# Path: indra/databases/hgnc_client.py
# def get_hgnc_id(hgnc_name):
#     """Return the HGNC ID corresponding to the given HGNC symbol.
# 
#     Parameters
#     ----------
#     hgnc_name : str
#         The HGNC symbol to be converted. Example: BRAF
# 
#     Returns
#     -------
#     hgnc_id : str
#         The HGNC ID corresponding to the given HGNC symbol.
#     """
#     return hgnc_ids.get(hgnc_name)
# 
# Path: indra/ontology/standardize.py
# def get_standard_agent(name, db_refs, ontology=None, ns_order=None, **kwargs):
#     """Get a standard agent based on the name, db_refs, and a any other kwargs.
# 
#     name : str
#         The name of the agent that may not be standardized.
#     db_refs : dict
#         A dict of db refs that may not be standardized, i.e., may be
#         missing an available UP ID corresponding to an existing HGNC ID.
#     ontology : Optional[indra.ontology.IndraOntology]
#         An IndraOntology object, if not provided, the default BioOntology
#         is used.
#     ns_order : Optional[list]
#         A list of namespaces which are in order of priority with higher
#         priority namespaces appearing earlier in the list.
#     kwargs :
#         Keyword arguments to pass to :func:`Agent.__init__`.
# 
#     Returns
#     -------
#     Agent
#         A standard agent
#     """
#     standard_name, db_refs = standardize_name_db_refs(db_refs,
#                                                       ontology=ontology,
#                                                       ns_order=ns_order)
#     if standard_name:
#         name = standard_name
#     assert_valid_db_refs(db_refs)
#     return Agent(name, db_refs=db_refs, **kwargs)


from typing import Union
from indra.statements import *
from indra.ontology.bio import bio_ontology
from indra.databases.hgnc_client import get_hgnc_id
from indra.ontology.standardize import get_standard_agent

                    self.statements.append(stmt)

    def get_agent(self, acsn_agent: str) -> Union[Agent, None]:
        """Return an INDRA Agent corresponding to an ACSN agent.

        Parameters
        ----------
        acsn_agent :
            Agent extracted from the relations statement data frame

        Returns
        -------
        :
            Returns INDRA agent with HGNC or FamPlex ID in db_refs. If there
            are no groundings available, we return None.
        """
        mapping = self.correspondence_dict.get(acsn_agent)
        if not mapping:
            return None
        if len(mapping) == 1:
            hgnc_id = get_hgnc_id(mapping[0])
            if hgnc_id:
                db_refs = {'HGNC': hgnc_id}
                return get_standard_agent(mapping[0], db_refs=db_refs)
        else:
            fplx_rel = self.fplx_lookup.get(tuple(sorted(
                self.correspondence_dict[acsn_agent])))
            if fplx_rel:
                db_refs = {'FPLX': fplx_rel}

# Path: indra/databases/hgnc_client.py
# def get_hgnc_id(hgnc_name):
#     """Return the HGNC ID corresponding to the given HGNC symbol.
# 
#     Parameters
#     ----------
#     hgnc_name : str
#         The HGNC symbol to be converted. Example: BRAF
# 
#     Returns
#     -------
#     hgnc_id : str
#         The HGNC ID corresponding to the given HGNC symbol.
#     """
#     return hgnc_ids.get(hgnc_name)
# 
# Path: indra/ontology/standardize.py
# def get_standard_agent(name, db_refs, ontology=None, ns_order=None, **kwargs):
#     """Get a standard agent based on the name, db_refs, and a any other kwargs.
# 
#     name : str
#         The name of the agent that may not be standardized.
#     db_refs : dict
#         A dict of db refs that may not be standardized, i.e., may be
#         missing an available UP ID corresponding to an existing HGNC ID.
#     ontology : Optional[indra.ontology.IndraOntology]
#         An IndraOntology object, if not provided, the default BioOntology
#         is used.
#     ns_order : Optional[list]
#         A list of namespaces which are in order of priority with higher
#         priority namespaces appearing earlier in the list.
#     kwargs :
#         Keyword arguments to pass to :func:`Agent.__init__`.
# 
#     Returns
#     -------
#     Agent
#         A standard agent
#     """
#     standard_name, db_refs = standardize_name_db_refs(db_refs,
#                                                       ontology=ontology,
#                                                       ns_order=ns_order)
#     if standard_name:
#         name = standard_name
#     assert_valid_db_refs(db_refs)
#     return Agent(name, db_refs=db_refs, **kwargs)


# Path: indra/sources/acsn/processor.py
from typing import Union
from indra.statements import *
from indra.ontology.bio import bio_ontology
from indra.databases.hgnc_client import get_hgnc_id
from indra.ontology.standardize import get_standard_agent


                    self.statements.append(stmt)

    def get_agent(self, acsn_agent: str) -> Union[Agent, None]:
        """Return an INDRA Agent corresponding to an ACSN agent.

        Parameters
        ----------
        acsn_agent :
            Agent extracted from the relations statement data frame

        Returns
        -------
        :
            Returns INDRA agent with HGNC or FamPlex ID in db_refs. If there
            are no groundings available, we return None.
        """
        mapping = self.correspondence_dict.get(acsn_agent)
        if not mapping:
            return None
        if len(mapping) == 1:
            hgnc_id = get_hgnc_id(mapping[0])
            if hgnc_id:
                db_refs = {'HGNC': hgnc_id}
                return get_standard_agent(mapping[0], db_refs=db_refs)
        else:
            fplx_rel = self.fplx_lookup.get(tuple(sorted(
                self.correspondence_dict[acsn_agent])))
            if fplx_rel:
                db_refs = {'FPLX': fplx_rel}

                return get_standard_agent(fplx_rel, db_refs=db_refs)