'Main puppet method'

def func(self):

    player = self.player
    session = self.session
    new_character = None
    if (not self.args):
        new_character = player.db._last_puppet
        if (not new_character):
            self.msg('Usage:    @ic    <character>')
            return
    if (not new_character):
        new_character = [char for char in search.object_search(self.args) if char.access(player, 'puppet')]
        if (not new_character):
            self.msg('That    is    not    a    valid    character    choice.')
            return
        if (len(new_character) > 1):
            self.msg(('Multiple    targets    with    the    same    name:\n    %s' % ',    '.join((('%s(#%s)' % (obj.key, obj.id)) for obj in new_character))))
            return
        else:
            new_character = new_character[0]
    try:
        player.puppet_object(session, new_character)
        player.db._last_puppet = new_character
    except RuntimeError as exc:
        self.msg(('|rYou    cannot    become    |C%s|n:    %s' % (new_character.name, exc)))
