code: def map_agents_for_stmt(self, stmt, do_rename=True):
          mapped_stmt = deepcopy(stmt)
          agent_list = mapped_stmt.agent_list()
          for idx, agent in enumerate(agent_list):
              if agent is None:
                  continue
              agent_txt = agent.db_refs.get('TEXT')
              if agent_txt is None:
                  continue
              new_agent, maps_to_none = self.map_agent(agent, do_rename)
              if self.use_deft and agent_txt in deft_disambiguators:
                  try:
                      run_deft_disambiguation(mapped_stmt, agent_list, idx,
                                              new_agent, agent_txt)
                  except Exception as e:
                      logger.error('There was an error during Deft'
                                   ' disambiguation.')
                      logger.error(e)
              if maps_to_none:
                  return None
              if new_agent is not None and len(new_agent.bound_conditions) == 0:
                  new_agent.bound_conditions = agent.bound_conditions
              agent_list[idx] = new_agent
          mapped_stmt.set_agent_list(agent_list)
          for agent in agent_list:
              if agent is not None:
                  for bc in agent.bound_conditions:
                      bc.agent, maps_to_none = self.map_agent(bc.agent,
                                                              do_rename)
                      if maps_to_none:
                          return None
          return mapped_stmt