input: Write a function to parse a JSON data structure and return the name, age, and occupation. If the input data is not in JSON format or does not contain the required keys, the function should raise a ValueError.
  def parse_json(data):
   data = json.loads(data)
   if not all(key in data for key in ('name', 'age', 'occupation')):
    raise ValueError("Missing required keys in JSON data")
   return data['name'], data['age'], data['occupation']
  
  assert parse_json('{"name": "John", "age": 18, "occupation": "Software Engineer"}') == ("John", 18, "Software Engineer")
  assert parse_json('{"name": "Jane", "age": 25, "occupation": "Data Scientist"}') == ("Jane", 25, "Data Scientist")
  try:
   parse_json('{"name": "Alice", "age": 30}')
  except ValueError:
   pass
  else:
   raise AssertionError("Expected ValueError for missing keys")
  try:
   parse_json('{"name": "Bob", "age": "ten", "occupation": "Student"}')
  except ValueError:
   pass
  else:
   raise AssertionError("Expected ValueError for non-integer age")
output: def parse_json(data):
      data = json.loads(data)
      if not all(key in data for key in ('name', 'age', 'occupation')):
          raise ValueError("Missing required keys in JSON data")
      return data['name'], data['age'], data['occupation']