input: Write a function to generate a Python function to parse a JSON data structure. The generated function should take a JSON string as input, parse it, and return the name, age, and occupation fields.
  assert parse_json('{"name": "John", "age": 18, "occupation": "Software Engineer"}')==("John", 18, "Software Engineer")
  assert parse_json('{"name": "Alice", "age": 23, "occupation": "Teacher"}')==("Alice", 23, "Teacher")
  assert parse_json('{"name": "Bob", "age": 45, "occupation": "Doctor"}')==("Bob", 45, "Doctor")
  assert parse_json('{"name": "Charlie", "age": 30, "occupation": "Engineer"}')==("Charlie", 30, "Engineer")
  assert parse_json('{"name": "Dave", "age": 50, "occupation": "Artist"}')==("Dave", 50, "Artist")
output: def parse_json(json_str):
      data = json.loads(json_str)
      return data['name'], data['age'], data['occupation']