<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def get_create_base_agent(self, agent):
 """Return BaseAgent from an Agent, creating it if needed. Parameters agent : indra.statements.Agent Returns ------- base_agent : indra.mechlinker.BaseAgent """

        try:
            base_agent = self.agents[agent.name]
        except KeyError:
            base_agent = BaseAgent(agent.name)
            self.agents[agent.name] = base_agent

        return base_agent