code: def find_in_list_by_name(haystack, target_name, target_package, nodetype):
      
      for model in haystack:
          name = model.get('unique_id')
          if id_matches(name, target_name, target_package, nodetype, model):
              return model
  
      return None
docs: Find an entry in the given list by name.