input: Write a function to parse a json-formatted string into a dictionary. The function should accept a json-formatted string as input and return the parsed dictionary. Import the json module at the beginning of the code to use the **json.loads()** function.
  assert parse_json('{"name": "John","age": 30,"address": {"city": "New York","state": "NY"}}')=={"name": "John","age": 30,"address": {"city": "New York","state": "NY"}}
  assert parse_json('{"fruit": "Apple","color": "Red"}')=={"fruit": "Apple","color": "Red"}
  assert parse_json('{"item": "Laptop","price": 1200}')=={"item": "Laptop","price": 1200}
  assert parse_json('')=={}
  assert parse_json('{"name": "Alice"}')=={"name": "Alice"}
output: import json
  
  def parse_json(json_str):
      if not json_str:
          return {}
      return json.loads(json_str)