<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def spawn(self, cls, kwargs={}, nowait=False):
 """Spawn a new actor on a celery worker by sending a remote command to the worker. :param cls: the name of the :class:`~.cell.actors.Actor` class or its derivative. :keyword kwargs: The keyword arguments to pass on to actor __init__ (a :class:`dict`) :keyword nowait: If set to True (default) the call waits for the result of spawning the actor. if False, the spawning is asynchronous. :returns :class:`~.cell.actors.ActorProxy`:, holding the id of the spawned actor. """


        actor_id = uuid()

        if str(qualname(cls)) == '__builtin__.unicode':
            name = cls
        else:
            name = qualname(cls)

        res = self.call('spawn', {'cls': name, 'id': actor_id,
                                  'kwargs': kwargs},
                        type=ACTOR_TYPE.RR, nowait=nowait)
        return ActorProxy(name, actor_id, res, agent=self,
                          connection=self.connection, **kwargs)