def METHOD_NAME(element_id, ids_to_refs, complex_members):
    """Get an agent for a MINERVA element.
    Parameters
    ----------
    element_id : str
        ID of an element used in MINERVA API and raw SIF files.
    ids_to_refs : dict
        A dictionary mapping element IDs to MINERVA provided references. Note
        that this mapping is unique per model (same IDs can be mapped to
        different refs in different models).
    complex_members : dict
        A dictionary mapping element ID of a complex element to element IDs of
        its members.
    Returns
    -------
    agent : indra.statements.agent.Agent
        INDRA agent created from given refs.
    """
    # Get references from MINERVA and filter to accepted namespaces
    exclude_ns = {'WIKIPATHWAYS', 'PUBMED', 'HGNC_SYMBOL', 'INTACT', 'PDB',
                  'DOI'}
    refs = ids_to_refs.get(element_id)
    db_refs = indra_db_refs_from_minerva_refs(refs)
    filtered_refs = {db_ns: db_id for (db_ns, db_id) in db_refs.items()
                     if db_ns not in exclude_ns}
    # If it's a complex and doesn't have complex level grounding
    if element_id in complex_members and len(filtered_refs) == 1:
        # Sort to always have the same main agent
        member_ids = complex_members[element_id]
        agents = [METHOD_NAME(member_id, ids_to_refs, complex_members)
                  for member_id in member_ids]
        agents = sorted(agents, key=lambda ag: ag.name)
        # Try to get a FamPlex family
        fam = get_family(agents)
        if fam:
            # Combine TEXT from MINERVA and found FPLX ID
            filtered_refs['FPLX'] = fam
            return get_agent_from_refs(filtered_refs)
        # Otherwise treat a list of agents as an agent with bound conditions
        else:
            main_agent = agents[0]
            if len(agents) > 1:
                for ag in agents[1:]:
                    main_agent.bound_conditions.append(BoundCondition(ag))
            return main_agent
    # Now we have either individual agents or complexes with complex level
    # grounding (e.g. from GO, MESH, UNIPROT)
    else:
        return get_agent_from_refs(filtered_refs)