code: def _get_dict_from_list(dict_key, list_of_dicts):
      
      the_dict = [cur_dict for cur_dict in list_of_dicts
                  if cur_dict.get(dict_key)]
      if not the_dict:
          raise ValueError('Could not find a dict with key %s' % dict_key)
      return the_dict[0][dict_key]
docs: Retrieve a specific dict from a list of dicts.
  
      Parameters
      ----------
      dict_key : str
          The (single) key of the dict to be retrieved from the list.
      list_of_dicts : list
          The list of dicts to search for the specific dict.
  
      Returns
      -------
      dict value
          The value associated with the dict_key (e.g., a list of nodes or
          edges).