code: def traverse_data(obj, key_target):
      ''' will traverse nested list and dicts until key_target equals the current dict key '''
      if isinstance(obj, str) and '.json' in str(obj):
          obj = json.load(open(obj, 'r'))
      if isinstance(obj, list):
          queue = obj.copy()
      elif isinstance(obj, dict):
          queue = [obj.copy()]
      else:
          sys.exit('obj needs to be a list or dict')
      count = 0
      ''' BFS '''
      while not queue or count != 1000:
          count += 1
          curr_obj = queue.pop()
          if isinstance(curr_obj, dict):
              for key, value in curr_obj.items():
                  if key == key_target:
                      return curr_obj
                  else:
                      queue.append(curr_obj[key])
          elif isinstance(curr_obj, list):
              for co in curr_obj:
                  queue.append(co)
      if count == 1000:
          sys.exit('traverse_data needs to be updated...')
      return Falsf traverse_data(obj, key_target):
      ''' will traverse nested list and dicts until key_target equals the current dict key '''
      if isinstance(obj, str) and '.json' in str(obj):
          obj = json.load(open(obj, 'r'))
      if isinstance(obj, list):
          queue = obj.copy()
      elif isinstance(obj, dict):
          queue = [obj.copy()]
      else:
          sys.exit('obj needs to be a list or dict')
      count = 0
      ''' BFS '''
      while not queue or count != 1000:
          count += 1
          curr_obj = queue.pop()
          if isinstance(curr_obj, dict):
              for key, value in curr_obj.items():
                  if key == key_target:
                      return curr_obj
                  else:
                      queue.append(curr_obj[key])
          elif isinstance(curr_obj, list):
              for co in curr_obj:
                  queue.append(co)
      if count == 1000:
          sys.exit('traverse_data needs to be updated...')
      return False
docs: will traverse nested list and dicts until key_target equals the current dict key