def action_space(self) -> gym.Space:
        """
        Return action spaces of active and controllable agents. Generally, it is defined in AgentManager. But you can
        still overwrite this function to define the action space for the environment.
        :return: Dict
        """
        ret = self.agent_manager.get_action_spaces()
        if not self.is_multi_agent:
            return next(iter(ret.values()))
        else:
            return gym.spaces.Dict(ret)

        Return action spaces of active and controllable agents. Generally, it is defined in AgentManager. But you can
        still overwrite this function to define the action space for the environment.
        :return: Dict
        
metadrive/envs/base_env.py