code: def map_agent(self, agent, do_rename):
          
  
          agent_text = agent.db_refs.get('TEXT')
          mapped_to_agent_json = self.agent_map.get(agent_text)
          if mapped_to_agent_json:
              mapped_to_agent = \
                  Agent._from_json(mapped_to_agent_json['agent'])
              return mapped_to_agent, False
          # Look this string up in the grounding map
          # If not in the map, leave agent alone and continue
          if agent_text in self.gm.keys():
              map_db_refs = self.gm[agent_text]
          else:
              return agent, False
  
          # If it's in the map but it maps to None, then filter out
          # this statement by skipping it
          if map_db_refs is None:
              # Increase counter if this statement has not already
              # been skipped via another agent
              logger.debug("Skipping %s" % agent_text)
              return None, True
          # If it has a value that's not None, map it and add it
          else:
              # Otherwise, update the agent's db_refs field
              self.update_agent_db_refs(agent, agent_text, do_rename)
          return agent, False
docs: Return the given Agent with its grounding mapped.
  
          This function grounds a single agent. It returns the new Agent object
          (which might be a different object if we load a new agent state
          from json) or the same object otherwise.
  
          Parameters
          ----------
          agent : :py:class:`indra.statements.Agent`
              The Agent to map.
          do_rename: bool
              If True, the Agent name is updated based on the mapped grounding.
              If do_rename is True the priority for setting the name is
              FamPlex ID, HGNC symbol, then the gene name
              from Uniprot.
  
          Returns
          -------
          grounded_agent : :py:class:`indra.statements.Agent`
              The grounded Agent.
          maps_to_none : bool
              True if the Agent is in the grounding map and maps to None.