<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_controller_agent(self, arg):
 """Return a single or a complex controller agent."""

        controller_agent = None
        controller = arg.get('arg')
        # There is either a single controller here
        if controller is not None:
            controller_agent, coords = self._get_agent_from_entity(controller)
        # Or the controller is a complex
        elif arg['argument-type'] == 'complex':
            controllers = list(arg.get('args').values())
            controller_agent, coords = \
                self._get_agent_from_entity(controllers[0])
            bound_agents = [self._get_agent_from_entity(c)[0]
                            for c in controllers[1:]]
            bound_conditions = [BoundCondition(ba, True) for
                                ba in bound_agents]
            controller_agent.bound_conditions = bound_conditions
        return controller_agent, coords