'Implements the spawner'

def func(self):

    def _show_prototypes(prototypes):
        'Helper    to    show    a    list    of    available    prototypes'
        prots = ',    '.join(sorted(prototypes.keys()))
        return ('\nAvailable    prototypes    (case    sensistive):    %s' % (('\n' + utils.fill(prots)) if prots else 'None'))
    prototypes = spawn(return_prototypes=True)
    if (not self.args):
        string = 'Usage:    @spawn    {key:value,    key,    value,    ...    }'
        self.caller.msg((string + _show_prototypes(prototypes)))
        return
    try:
        prototype = _convert_from_string(self, self.args)
    except SyntaxError:
        string = '|RCritical    Python    syntax    error    in    argument.    '
        string += 'Only    primitive    Python    structures    are    allowed.    '
        string += '\nYou    also    need    to    use    correct    Python    syntax.    '
        string += 'Remember    especially    to    put    quotes    around    all    '
        string += 'strings    inside    lists    and    dicts.|n'
        self.caller.msg(string)
        return
    if isinstance(prototype, basestring):
        keystr = prototype
        prototype = prototypes.get(prototype, None)
        if (not prototype):
            string = ("No    prototype    named    '%s'." % keystr)
            self.caller.msg((string + _show_prototypes(prototypes)))
            return
    elif isinstance(prototype, dict):
        if (('exec' in prototype) and (not self.caller.check_permstring('Immortals'))):
            self.caller.msg("Spawn    aborted:    You    don't    have    access    to    use    the    'exec'    prototype    key.")
            return
    else:
        self.caller.msg('The    prototype    must    be    a    prototype    key    or    a    Python    dictionary.')
        return
    if ((not ('noloc' in self.switches)) and (not ('location' in prototype))):
        prototype['location'] = self.caller.location
    for obj in spawn(prototype):
        self.caller.msg(('Spawned    %s.' % obj.get_display_name(self.caller)))
