def for_each_active_agents(self, func, *args, **kwargs):
        """
        This func is a function that take each object as the first argument and *arg and **kwargs as others.
        """
        assert len(self.active_agents) > 0, "Not enough objects exist!"
        ret = dict()
        for k, v in self.active_agents.items():
            ret[k] = func(v, *args, **kwargs)
        return ret

        This func is a function that take each object as the first argument and *arg and **kwargs as others.
        
metadrive/manager/base_manager.py