Defines a CLI function that should be routed by this API
323569
def cli(self, *args, **kwargs):
        """"""
        kwargs['api'] = self.api
        return cli(*args, **kwargs)
1248573
def cli(self):
        
        if self._cli is None:
            self._cli = self.create_interface()
        return self._cli
929386
def map_run(path=None, opts=None, **kwargs):
    '''
    
    '''
    client = _get_client()
    if isinstance(opts, dict):
        client.opts.update(opts)
    info = client.map_run(path, **salt.utils.args.clean_kwargs(**kwargs))
    return info
1008278
def cli():
    """"""
    parser = argparse.ArgumentParser()
    parser.add_argument('api', help="""
        API to call.
        One one of 'article', 'frontpage', 'product', 'image', 'analyze', or
        'discussion'.
    """)
    parser.add_argument('url', help="""
        URL to pass as the 'url' parameter.
    """)
    parser.add_argument('token', help="""
        API key (token).
        Get one at https://www.diffbot.com/.
    """)
    parser.add_argument('-a', '--all', help="""
        Request all fields.
    """, action='store_true')
    parser.add_argument('-f', '--file', help="""
        File to read data from.
        Use '-' to read from STDIN.
    """)
    fields = text = html = None
    _args = parser.parse_args()
    if _args.all:
        fields = '*'
    if _args.file == '-':
        text = sys.stdin.read()
    elif _args.file:
        with open(_args.file, 'rb') as src:
            if os.path.splitext(_args.file)[1] in ('.html', '.htm'):
                html = src.read().decode(ENCODING)
            else:
                text = src.read().decode(ENCODING)
    print(json.dumps((api(_args.api, _args.url, _args.token,
                          html=html or None,
                          text=text or None,
                          fields=fields)),
                     sort_keys=True,
                     indent=2))
96813
def route(self, path_regex, methods=['GET'], doc=True):
        
        def register_func(func):
            """
            Decorator implementation
            """
            if doc:
                self.env['doc'].append({'url': path_regex, 'methods': ', '.join(methods), 'doc': func.__doc__})
            for method in methods:
                self._handlers[method].append((re.compile(path_regex), func))
            return func # Return the original function
        return register_func
156651
def cli(ctx, all, top, nostyle, nowarn, warn, project_dir):
    """"""

    exit_code = SCons(project_dir).lint({
        'all': all,
        'top': top,
        'nostyle': nostyle,
        'nowarn': nowarn,
        'warn': warn
    })
    ctx.exit(exit_code)
81902
def action(route, template='', methods=['GET']):
    """"""
    def real_decorator(function):
        function.pi_api_action = True
        function.pi_api_route = route
        function.pi_api_template = template
        function.pi_api_methods = methods

        if hasattr(function, 'pi_api_crossdomain'):
            if not function.pi_api_crossdomain_data['methods']:
                function.pi_api_crossdomain_data['methods'] = methods

            if 'OPTIONS' not in function.pi_api_methods:
                function.pi_api_methods += ['OPTIONS']

        return function
    return real_decorator
42889
def cli(ctx, file, quote):
    ''''''
    ctx.obj = {}
    ctx.obj['FILE'] = file
    ctx.obj['QUOTE'] = quote
674587
function generate_routes(dir_name, controller, routes) {
	let route_def = cli.cat(dir_name + '/config/routes.js');
	let lines = [], line;
	let method, path, action;

	routes.forEach((route) => {
		// set parameters
		method = route.method; path = route.path;
		controller = route.controller; action = route.action;
		// create and add line
		line = `		this.${method}('${path}', '${controller}#${action}');`;
		lines.push(line);
	});
	// add lines to config file
	route_def = route_def.replace(/use\s?\(\)\s?{/, `use() {
${lines.join('\n')}${route_def.match(/use\s?\(\)\s?{\s*}/) ? '' : '\n'}`);
	fs.writeFileSync(dir_name + '/config/routes.js', route_def);
}
222871
function buildRoutes(app, api, graphqlEndpoint) {
  return function (done) {
    api.forEachOperation(function (path, method, operation) {
      buildRoute(app, path, method, operation, graphqlEndpoint);
    });
    done(null, api);
  }
}
1065322
def cli(env):
    """"""
    manager = PlacementManager(env.client)

    routers = manager.get_routers()
    env.fout(get_router_table(routers))

    rules = manager.get_all_rules()
    env.fout(get_rule_table(rules))
95931
function (arg1, arg2, arg3) {
    if (arguments.length < 2 || arguments.length > 3) throw 'Invalid number of arguments for get function.';
    if (typeof arg1 !== 'string') throw 'First argument of get function must be a route string.';
    if (typeof arg2 !== 'function') throw 'Second argument of get function must be a function.';
    
    _gets.push({
      path: arg1,
      handler: arg2,
      priority: arg3 ? arg3 : 0
    });
  }
237071
function defineRoute (server, opts) {

    server.route({
        method: 'GET',
        path: '/' + opts.plural,
        handler: handler,
        config: {
            jsonp: 'callback',
            validate: {
                query: {},
                payload: false
            }
        }
    });

    function handler (req) {
        var res = {};
        res[opts.plural] = opts.things;
        req.reply(res);
    }

}
699225
function Cli(hydro, argv) {
  if (!(this instanceof Cli)) {
    return new Cli(hydro, argv);
  }

  this.hydro = hydro;
  this.argv = argv;
  this.options = {};
  this.conf = [];
  this.commands = [ 'help', 'version' ];
  this.arrayParams = { plugins: true };
}
198580
function dispatch() {
  var commands = [].slice.call(arguments);

  return function fn() {
    var args = [].slice.call(arguments);
    var result;

    for (var i = 0; i < commands.length; i++) {
      result = commands[i].apply(undefined, args);

      if (result !== undefined) {
        break;
      }
    }

    return result;
  };
}
842724
function go(path, title, shouldReplace) {
  // Server-side usage: directly execute handlers for the path
  if (!hist) return central[TRIGGER]('emit', getPathFromBase(path))

  path = route._.base + normalize(path)
  title = title || doc.title
  // browsers ignores the second parameter `title`
  shouldReplace
    ? hist.replaceState(null, title, path)
    : hist.pushState(null, title, path)
  // so we need to set it manually
  doc.title = title
  routeFound = false
  emit()
  return routeFound
}
714517
def run_cli(self, cli, args=None, node_paths=None):
    """"""
    cli_args = [cli]
    if args:
      cli_args.append('--')
      cli_args.extend(args)
    return self.run_command(args=cli_args, node_paths=node_paths)