input: Write a function to parse a json-formatted string into a dictionary. If the input string is empty, return an empty dictionary.
  import json
  
  def parse_json_to_dict(json_str):
      if not json_str:
          return {}
      return json.loads(json_str)
  
  assert parse_json_to_dict('{"name": "John","age": 30,"address": {"city": "New York","state": "NY"}}')=={'name': 'John', 'age': 30, 'address': {'city': 'New York', 'state': 'NY'}}
  assert parse_json_to_dict('{}')=={}
  assert parse_json_to_dict('')=={}
  assert parse_json_to_dict('{"key": "value"}')=={'key': 'value'}
  assert parse_json_to_dict(None)=={}
output: 
  def parse_json_to_dict(json_str):
      if not json_str:
          return {}
      return json.loads(json_str)
  