input: Write a function to parse a JSON data structure and extract the name, age, and occupation fields from it. The JSON data is provided as a dictionary. If the data is not a dictionary or does not contain the required fields, the function should return None.
  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')
  assert parse_json({'name': 'Alice', 'age': 30})==None
  assert parse_json({'age': 22, 'occupation': 'Teacher'})==None
  assert parse_json({})==None
output: def parse_json(data):
      if isinstance(data, dict) and 'name' in data and 'age' in data and 'occupation' in data:
          return (data['name'], data['age'], data['occupation'])
      return None