# Path: indra/ontology/standardize.py
# def standardize_agent_name(agent, standardize_refs=True, ontology=None,
#                            ns_order=None):
#     """Standardize the name of an Agent based on grounding information.
# 
#     The priority of which namespace is used as the bases for the
#     standard name depends on
# 
#     Parameters
#     ----------
#     agent : indra.statements.Agent
#         An INDRA Agent whose name attribute should be standardized based
#         on grounding information.
#     standardize_refs : Optional[bool]
#         If True, this function assumes that the Agent's db_refs need to
#         be standardized, e.g., HGNC mapped to UP.
#         Default: True
#     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.
# 
#     Returns
#     -------
#     bool
#         True if a new name was set, False otherwise.
#     """
#     # If the Agent is None, we return immediately
#     if agent is None:
#         return False
#     # If we want to standardize the Agent's db_refs, we call this now
#     if standardize_refs:
#         agent.db_refs = standardize_db_refs(agent.db_refs, ontology=ontology)
#     # We next try to get a standard name based on the Agent's grounding
#     standard_name = get_standard_name(agent.db_refs, ontology=ontology,
#                                       ns_order=ns_order)
#     # If we got a proper standard name, we apply it
#     if standard_name:
#         agent.name = standard_name
#         return True
#     return False


import logging
from indra.statements.validate import validate_text_refs
from indra.ontology.standardize import standardize_agent_name
from indra.statements import modtype_to_modclass, Agent, Evidence, Complex, \
    get_statement_by_name as stmt_by_name, BoundCondition
                    activation = True if lr_entry['consensus_stimulation'] else \
                        False
                    ligrec_stmts.append(self._get_ligrec_regs(
                        lr_entry['source'], lr_entry['target'], evidence,
                        activation=activation))
                elif lr_entry['consensus_stimulation'] and \
                        lr_entry['consensus_inhibition']:
                    no_consensus += 1
            # All evidences were filtered out
            else:
                no_refs += 1

        if no_refs:
            logger.warning(f'{no_refs} entries without references were '
                           f'skipped')
        if bad_pmid:
            logger.warning(f'{bad_pmid} references with bad pmids were '
                           f'skipped')
        if no_consensus:
            logger.warning(f'{no_consensus} entries with conflicting '
                           f'regulation were skipped')

        return ligrec_stmts

    @staticmethod
    def _agent_from_up_id(up_id):
        """Build an Agent object from a Uniprot ID. Adds db_refs for both
        Uniprot and HGNC where available."""
        db_refs = {'UP': up_id}
        ag = Agent(up_id, db_refs=db_refs)

# Path: indra/ontology/standardize.py
# def standardize_agent_name(agent, standardize_refs=True, ontology=None,
#                            ns_order=None):
#     """Standardize the name of an Agent based on grounding information.
# 
#     The priority of which namespace is used as the bases for the
#     standard name depends on
# 
#     Parameters
#     ----------
#     agent : indra.statements.Agent
#         An INDRA Agent whose name attribute should be standardized based
#         on grounding information.
#     standardize_refs : Optional[bool]
#         If True, this function assumes that the Agent's db_refs need to
#         be standardized, e.g., HGNC mapped to UP.
#         Default: True
#     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.
# 
#     Returns
#     -------
#     bool
#         True if a new name was set, False otherwise.
#     """
#     # If the Agent is None, we return immediately
#     if agent is None:
#         return False
#     # If we want to standardize the Agent's db_refs, we call this now
#     if standardize_refs:
#         agent.db_refs = standardize_db_refs(agent.db_refs, ontology=ontology)
#     # We next try to get a standard name based on the Agent's grounding
#     standard_name = get_standard_name(agent.db_refs, ontology=ontology,
#                                       ns_order=ns_order)
#     # If we got a proper standard name, we apply it
#     if standard_name:
#         agent.name = standard_name
#         return True
#     return False


# Path: indra/sources/omnipath/processor.py
import logging
from indra.statements.validate import validate_text_refs
from indra.ontology.standardize import standardize_agent_name
from indra.statements import modtype_to_modclass, Agent, Evidence, Complex, \
    get_statement_by_name as stmt_by_name, BoundCondition

                    activation = True if lr_entry['consensus_stimulation'] else \
                        False
                    ligrec_stmts.append(self._get_ligrec_regs(
                        lr_entry['source'], lr_entry['target'], evidence,
                        activation=activation))
                elif lr_entry['consensus_stimulation'] and \
                        lr_entry['consensus_inhibition']:
                    no_consensus += 1
            # All evidences were filtered out
            else:
                no_refs += 1

        if no_refs:
            logger.warning(f'{no_refs} entries without references were '
                           f'skipped')
        if bad_pmid:
            logger.warning(f'{bad_pmid} references with bad pmids were '
                           f'skipped')
        if no_consensus:
            logger.warning(f'{no_consensus} entries with conflicting '
                           f'regulation were skipped')

        return ligrec_stmts

    @staticmethod
    def _agent_from_up_id(up_id):
        """Build an Agent object from a Uniprot ID. Adds db_refs for both
        Uniprot and HGNC where available."""
        db_refs = {'UP': up_id}
        ag = Agent(up_id, db_refs=db_refs)

        standardize_agent_name(ag)