parameters: (self, name, context=None, **args)
return_statement: return fn(**args) or 0
docstring: Dispatch/run a command.
  
          Commands can use this to call other commands.
docstring_summary: Dispatch/run a command.
docstring_tokens: Dispatch / run a command .
function: def dispatch(self, name, context=None, **args):
          """Dispatch/run a command.
  
          Commands can use this to call other commands.
          """
  
          # TODO The logic in this function overlaps with code in
          # mach.main.Main._run() and should be consolidated.
          handler = self.command_handlers[name]
          cls = handler.cls
  
          if handler.pass_context and not context:
              raise Exception('mach command class requires context.')
  
          if handler.pass_context:
              instance = cls(context)
          else:
              instance = cls()
  
          fn = getattr(instance, handler.method)
  
          return fn(**args) or 0
function_tokens: def dispatch ( self , name , context = None , * * args ) : # TODO The logic in this function overlaps with code in # mach.main.Main._run() and should be consolidated. handler = self . command_handlers [ name ] cls = handler . cls if handler . pass_context and not context : raise Exception ( 'mach command class requires context.' ) if handler . pass_context : instance = cls ( context ) else : instance = cls ( ) fn = getattr ( instance , handler . method ) return fn ( * * args ) or 0