'This performs the actual command.'

def func(self):

    if (not is_in_combat(self.caller)):
        self.caller.msg('You    can    only    do    that    in    combat.    (see:    help    fight)')
        return
    if (not is_turn(self.caller)):
        self.caller.msg('You    can    only    do    that    on    your    turn.')
        return
    self.caller.location.msg_contents(('%s    disengages,    ready    to    stop    fighting.' % self.caller))
    spend_action(self.caller, 'all', action_name='disengage')
    '\n                                The    action_name    kwarg    sets    the    character\'s    last    action    to    "disengage",    which    is    checked    by\n                                the    turn    handler    script    to    see    if    all    fighters    have    disengaged.\n                                '
