Return the function for the specified subcommand.

    Args:
        name: The name of a subcommand.

    Returns:
        The loadable object from the entry point represented by the subcommand.
5165
def _get_subcommand(name):
    # type: (str) -> config.RcliEntryPoint
    
    _LOGGER.debug('Accessing subcommand "%s".', name)
    if name not in settings.subcommands:
        raise ValueError(
            '"{subcommand}" is not a {command} command. \'{command} help -a\' '
            'lists all available subcommands.'.format(
                command=settings.command, subcommand=name)
        )
    return settings.subcommands[name]
452773
def main(args=None):
    
    if args is None:
        args = sys.argv[1:]

    if not args:
        args = ['-h']

    namespace = parser.parse_args(args)
    entry_function = namespace.func
    del namespace.func
    kwargs = namespace.__dict__
    return entry_function(**kwargs)
9815
def getx(self, name, *args):
        
        return lib.zargs_getx(self._as_parameter_, name, *args)
1090847
def get_subparser(self, name, dest="subcommand", **kwargs):
        """"""
        if name not in self.children:
            # Create the subparser.
            subparsers = self._get_subparsers(dest)
            parser = subparsers.add_parser(name, **kwargs)
            self.children[name] = NamedParser(name, parser)
        return self.children[name]
971460
def command(name, mode):
    
    def decorator(fn):
        commands[name] = fn.__name__
        _Client._addMethod(fn.__name__, name, mode)
        return fn
    return decorator
257862
def __get_subscript_delete(self, name):
    

    return ast.Delete(targets=[self.__get_subscript(name, ast.Del())])
375452
def map_subcommands(self, func):
        

        def crawl(cmd):
            for sc in cmd.subcommands.values():
                yield from crawl(sc)
            yield cmd
        return map(func, crawl(self.root_command))
237733
def __get_subscript(self, name, ctx=None):
    

    assert isinstance(name, string_types), name
    return ast.Subscript(
      value=ast.Name(id=self.data_var, ctx=ast.Load()),
      slice=ast.Index(value=ast.Str(s=name)),
      ctx=ctx)
816241
def get_parser(self, prog_name, subcommand):
        
        parser = OptionParser(
            prog=prog_name,
            usage=self.usage(subcommand),
            version=self.get_version(),
            option_list=sorted(self.get_option_list()))
        return parser
523010
function getCommand(commandName) {
    return _.find(commands, function (command) {
      return _.includes(command.aliases, commandName);
    });
  }
656713
def _function_lookup(name, module):
    
    try:
        return _registered_functions[name]
    except KeyError:  # force function registering
        __import__(module)
        mod = sys.modules[module]
        getattr(mod, name)

        return _registered_functions[name]
1098447
def subprocess(cls, cmd, **kwargs):
    
    def call(args):
      return subprocess.call(cmd + args, **kwargs)
    return cls(call)
1150684
def name_to_system_object(self, name):
        
        if isinstance(name, str):
            if self.allow_name_referencing:
                name = name
            else:
                raise NameError('System.allow_name_referencing is set to False, cannot convert string to name')
        elif isinstance(name, Object):
            name = str(name)
        return self.namespace.get(name, None)
820788
def subcommand(self, name, help):
    
    if self._subcommands is None:
      self._subcommands = self.add_subparsers(help='commands')
    return self._subcommands.add_parser(name, description=help, help=help)
151481
def get_function(self, name: str) -> AbiFunction or None:
        
        for func in self.functions:
            if func['name'] == name:
                return AbiFunction(func['name'], func['parameters'], func.get('returntype', ''))
        return None
993486
def get_command(self, ctx, name):
        """"""
        plugin = os.path.basename(self.folder)
        try:
            command = importlib.import_module("honeycomb.commands.{}.{}".format(plugin, name))
        except ImportError:
            raise click.UsageError("No such command {} {}\n\n{}".format(plugin, name, self.get_help(ctx)))
        return getattr(command, name)
1129645
def getVariable(self, name):
        
        return lock_and_call(
            lambda: Variable(self._impl.getVariable(name)),
            self._lock
        )