/*
options.action
options.path
542291
function sysctl(options, cb) {
  if (typeof arguments[0] != 'object'
    && typeof arguments[1] != 'function') {

    throw new Error('Invalid arguments. Signature: (object, callback)');
  }

  /*
   * Build cmd to execute.
   */
  var cmd = ['sysctl'];
  var args = [];

  switch (options.action) {
    case 'enable':
      args = args.concat('-w', options.path + '=1'); // It can not be --write since is not supported in older kernels.

      break;
    case 'disable':
      args = args.concat('-w', options.path + '=0'); // It can not be --write since is not supported in older kernels.

      break;
    case 'status':
      args = args.concat('--values', options.path);

      break;
    default:
      break;
  }

  /*
   * Execute command.
   */
  exec(cmd.concat(args).join(' '), function (error, stdout, stderror) {
    if (error) {
      cb(stderror.replace(/\n/g, '') + '. Executed command line: ' + cmd.concat(args).join(' '));
    }
    else {
      var result = null;
      if (options.action == 'status') {
        result = stdout;
      }

      cb(null, result);
    }
  });
}
758747
function lookup (action, options) {
  options = options || {}
  const cli = new CliDispatch(action, options.actions || 'actions', options.base || callersDir())

  return cli.lookup()
}
250775
public function generatePath($action, $id = null)
    {
        if (!is_null($id)) {
            return sprintf('%s/%s/%s/%s', self::VERSION, static::PATH, $action, $id);
        }

        return sprintf('%s/%s/%s', self::VERSION, static::PATH, $action);
    }
1360929
function (path, options) {

  options = options || {};
  this.debug = !!options.debug;
  this.userAgent = options.userAgent || "redwrap";

  this.ee = new EventEmitter();
  this.path = path || '/';
  this.filter = '';
  this.url = {
    protocol: 'http',
    host: 'www.reddit.com',
    pathname: path + '.json',
    query: options.query || {}
  };

}
465999
function getPath( req, res, next ) {

	var path = req.path.replace( /\..*$/, '' ).replace( /\//g, '.' ).replace( /^\.conf/, '' ).replace( /\.$/, '' ).trim();

	if ( path.length < 1 ) {
		path = null;
	}

	var outputFilter = req.path.trim().match( /\.(.*)$/ );
	if ( outputFilter ) {
		outputFilter = outputFilter[1].trim();
	}

	if ( typeof outputFilter !== 'string' || outputFilter.length < 1 ) {
		outputFilter = 'json';
	}

	req.confPath = path;
	req.outputFilter = outputFilter;

	return next();

}
236499
public static OptionalThing<ActionExecute> findActionExecute(String actionName, String paramPath) {
        return findActionMapping(actionName).map(mapping -> mapping.findActionExecute(paramPath));
    }
238107
function getConfiguredPath (path) {
    if (options.useBasePath && context.api && context.api.basePath) {
      return context.api.basePath + path;
    }
    else {
      return path;
    }
  }
990449
function outputPath(options, source) {
    var DEBUG = false;
    if (DEBUG)
        console.log('sourceFolder: ' + options.sourceFolder);
    var globBase = options.sourceFolder.replace(/\*.*/, '');
    if (globBase.endsWith('.sol')) // single file
        globBase = path.join(globBase, '../');
    if (DEBUG)
        console.log('globBase: ' + globBase);
    var optDestination = options.destinationFolder ? options.destinationFolder : globBase;
    if (DEBUG)
        console.log('optDestination: ' + optDestination);
    var destinationFolder = path.join(globBase, optDestination);
    if (optDestination === globBase)
        destinationFolder = globBase;
    if (DEBUG)
        console.log('destinationFolder: ' + destinationFolder);
    // destination-folder is absolut
    if (options.destinationFolder && options.destinationFolder.startsWith('/'))
        destinationFolder = path.join(options.destinationFolder, './');
    var fileNameRelative = source.filename.replace(globBase, '');
    if (DEBUG)
        console.log('fileNameRelative: ' + fileNameRelative);
    var goalPath = path.join(destinationFolder, fileNameRelative);
    return goalPath;
}
1085669
function route($path = '/', array $actions = [], $method = Router::ANY_METHOD, $name = '')
    {
        $this->path($path);
        $this->actions[$method] = $actions;
        $this->name = $name;

        return $this;
    }
821056
private Map<String, String> resourceForPath(Path path) {
        return AuthorizationUtil.resource(STORAGE_PATH_AUTH_RES_TYPE, authResForPath(path));
    }
832234
@Override
    public String fromActionNameToPath(final String actionName) {
        if (!actionName.endsWith(actionSuffix)) {
            throw new IllegalArgumentException(actionName);
        }
        String name = actionName.substring(0, actionName.length() - actionSuffix.length());
        return adjustViewRootPath() + "/" + name.replace(PACKAGE_SEPARATOR, '/') + viewExtension;
    }
546264
function(path) {
            var parts = [];
            qq.each(path.split("/"), function(idx, item) {
                parts.push(qq.s3.util.uriEscape(item));
            });
            return parts.join("/");
        }
64862
function resolvePath (path) {
  if (path) {
    // <rootDir>
    if (path.indexOf('<rootDir>') === 0) {
      return `"${path.replace('<rootDir>', root).replace(/\\/g, '\\\\')}"`
    } else {
      return `"${resolve(path).replace(/\\/g, '\\\\')}"`
    }
  } else {
    return ''
  }
}
570740
function resolve(path, options, callback) {
        resolvePath(path, options, function (err, path) {
            if (err) return callback(err);
            callback(null, { path: path });
        });
    }
1258872
function setPath(uri) {
  if (uri.path || (uri.pathname === undefined && uri.search === undefined)) return;

  uri.path = '';
  if (uri.pathname) uri.path += uri.pathname;
  if (uri.search) uri.path += uri.search;
}
1297090
private Action buildAction(String path) {
    Action action = (Action) ActionContext.getContext().getContextMap().get("dispatch_action");
    if (null == action) {
      action = new Action();
      String newPath = path;
      if (path.startsWith("?")) {
        newPath = getServletPath(ServletActionContext.getRequest()) + path;
      }
      action.path(newPath);
    } else {
      if (null != action.getClazz()) {
        Action newAction = actionBuilder.build(action.getClazz());
        action.name(newAction.getName()).namespace(newAction.getNamespace());
      }
      if (isBlank(action.getName())) {
        action.path(getServletPath(ServletActionContext.getRequest()));
      }
    }
    return action;
  }
623134
public void redirectToApplicationPath(String path) {
        if ("".equals(applicationPath)) {
            // application path is the root
            redirect(path);
        } else {
            redirect(applicationPath + StringUtils.addStart(path, "/"));
        }
    }