'Performs the teleport'

def func(self):

    caller = self.caller
    args = self.args
    (lhs, rhs) = (self.lhs, self.rhs)
    switches = self.switches
    tel_quietly = ('quiet' in switches)
    to_none = ('tonone' in switches)
    if to_none:
        if (not args):
            obj_to_teleport = caller
        else:
            obj_to_teleport = caller.search(lhs, global_search=True)
            if (not obj_to_teleport):
                caller.msg('Did    not    find    object    to    teleport.')
                return
        if obj_to_teleport.has_player:
            caller.msg(('Cannot    teleport    a    puppeted    object    (%s,    puppeted    by    %s)    to    a    None-location.' % (obj_to_teleport.key, obj_to_teleport.player)))
            return
        caller.msg(('Teleported    %s    ->    None-location.' % obj_to_teleport))
        if (obj_to_teleport.location and (not tel_quietly)):
            obj_to_teleport.location.msg_contents(('%s    teleported    %s    into    nothingness.' % (caller, obj_to_teleport)), exclude=caller)
        obj_to_teleport.location = None
        return
    if ((not args) and (not to_none)):
        caller.msg('Usage:    teleport[/switches]    [<obj>    =]    <target_loc>|home')
        return
    if rhs:
        obj_to_teleport = caller.search(lhs, global_search=True)
        destination = caller.search(rhs, global_search=True)
    else:
        obj_to_teleport = caller
        destination = caller.search(lhs, global_search=True)
    if (not obj_to_teleport):
        caller.msg('Did    not    find    object    to    teleport.')
        return
    if (not destination):
        caller.msg('Destination    not    found.')
        return
    if (obj_to_teleport == destination):
        caller.msg("You    can't    teleport    an    object    inside    of    itself!")
        return
    if (obj_to_teleport == destination.location):
        caller.msg("You    can't    teleport    an    object    inside    something    it    holds!")
        return
    if (obj_to_teleport.location and (obj_to_teleport.location == destination)):
        caller.msg(('%s    is    already    at    %s.' % (obj_to_teleport, destination)))
        return
    use_destination = True
    if ('intoexit' in self.switches):
        use_destination = False
    if obj_to_teleport.move_to(destination, quiet=tel_quietly, emit_to_obj=caller, use_destination=use_destination):
        if (obj_to_teleport == caller):
            caller.msg(('Teleported    to    %s.' % destination))
        else:
            caller.msg(('Teleported    %s    ->    %s.' % (obj_to_teleport, destination)))
