The arguments are not all optional. Either a path or hostname+port should
    be specified; you have to specify one.
438818
def run(hostname=None, port=None, path=None, loop=None):
    
    if path:
        log.debug("Starting Opentrons server application on {}".format(
            path))
        hostname, port = None, None
    else:
        log.debug("Starting Opentrons server application on {}:{}".format(
            hostname, port))
        path = None

    web.run_app(init(loop), host=hostname, port=port, path=path)
391785
static void setHost(String scheme, String host, int port) {
    BASE_URL = scheme + "://" + host + ":" + port + "/" + VERSION + "/";
  }
927147
public static void main(String[] args) throws Exception {
    boolean usage = false;
    int serverPort = 0;
    int driverPort = 0;
    for (String arg : args) {
      if (!arg.startsWith("--")) {
        System.err.println("All arguments must start with '--': " + arg);
        usage = true;
        break;
      }
      String[] parts = arg.substring(2).split("=", 2);
      String key = parts[0];
      if ("help".equals(key)) {
        usage = true;
        break;
      }
      if (parts.length != 2) {
        System.err.println("All arguments must be of the form --arg=value");
        usage = true;
        break;
      }
      String value = parts[1];
      if ("server_port".equals(key)) {
        serverPort = Integer.valueOf(value);
      } else if ("driver_port".equals(key)) {
        driverPort = Integer.valueOf(value);
      } else {
        System.err.println("Unknown argument: " + key);
        usage = true;
        break;
      }
    }
    if (usage || driverPort == 0) {
      System.err.println(
          "Usage: [ARGS...]"
              + "\n"
              + "\n  --driver_port=<port>"
              + "\n    Port to expose grpc.testing.WorkerService, used by driver to initiate work."
              + "\n  --server_port=<port>"
              + "\n    Port to start load servers on. Defaults to any available port");
      System.exit(1);
    }
    LoadWorker loadWorker = new LoadWorker(driverPort, serverPort);
    loadWorker.start();
    loadWorker.driverServer.awaitTermination();
    log.log(Level.INFO, "DriverServer has terminated.");

    // Allow enough time for quitWorker to deliver OK status to the driver.
    Thread.sleep(3000);
  }
281461
public void setHost(String host) throws IllegalStateException {
        if (host == null) {
            throw new IllegalArgumentException("host parameter is null");
        }
        assertNotOpen();
        hostName = host;
    }
474494
def add_export(exports='/etc/exports', path=None, hosts=None, options=None):
    '''
    
    '''
    if options is None:
        options = []
    if not isinstance(hosts, six.string_types):
        # Lists, etc would silently mangle /etc/exports
        raise TypeError('hosts argument must be a string')
    edict = list_exports(exports)
    if path not in edict:
        edict[path] = []
    new = {'hosts': hosts, 'options': options}
    edict[path].append(new)
    _write_exports(exports, edict)

    return new
648549
public static void main(String[] args) throws Exception {

        if (args.length < 2 || args.length == 4 || args.length > 5) {
            System.out.println("USAGE: HelloWorldClientTls host port [trustCertCollectionFilePath] " +
                    "[clientCertChainFilePath clientPrivateKeyFilePath]\n  Note: clientCertChainFilePath and " +
                    "clientPrivateKeyFilePath are only needed if mutual auth is desired.");
            System.exit(0);
        }

        HelloWorldClientTls client;
        switch (args.length) {
            case 2:
                client = new HelloWorldClientTls(args[0], Integer.parseInt(args[1]),
                        buildSslContext(null, null, null));
                break;
            case 3:
                client = new HelloWorldClientTls(args[0], Integer.parseInt(args[1]),
                        buildSslContext(args[2], null, null));
                break;
            default:
                client = new HelloWorldClientTls(args[0], Integer.parseInt(args[1]),
                        buildSslContext(args[2], args[3], args[4]));
        }

        try {
            /* Access a service running on the local machine on port 50051 */
            String user = "world";
            if (args.length > 0) {
                user = args[0]; /* Use the arg as the name to greet if provided */
            }
            client.greet(user);
        } finally {
            client.shutdown();
        }
    }
183715
private void vaildateHostPort(String host, String port)
    {
        if (host == null || !StringUtils.isNumeric(port) || port.isEmpty())
        {
            logger.error("Host or port should not be null / port should be numeric");
            throw new IllegalArgumentException("Host or port should not be null / port should be numeric");
        }
    }
537787
static PathMappingContext of(VirtualHost virtualHost, String hostname,
                                 String path, @Nullable String query,
                                 HttpHeaders headers, @Nullable MediaTypeSet producibleMediaTypes) {
        return of(virtualHost, hostname, path, query, headers, producibleMediaTypes, false);
    }
398500
function(path, options) {
      options = options || { };

      this.setOptions(options);

      if (!path) {
        throw Error('`path` argument is required');
      }

      var fromArray = _toString.call(path) === '[object Array]';

      this.path = fromArray
        ? path
        // one of commands (m,M,l,L,q,Q,c,C,etc.) followed by non-command characters (i.e. command values)
        : path.match && path.match(/[mzlhvcsqta][^mzlhvcsqta]*/gi);

      if (!this.path) return;

      if (!fromArray) {
        this._initializeFromString(options);
      }

      if (options.sourcePath) {
        this.setSourcePath(options.sourcePath);
      }
    }
643138
function startServer(argv, httpPort, httpsPort, certs) {
  console.log('Launching proxy server...');
  console.log('   http: ' + httpPort);
  console.log('  https: ' + httpsPort);

  // Injects a node stream by buffering all data, transforming it, and writing
  // it back out.
  // Module IDs are assigned on demand and rotate 0-126.
  var nextModuleId = 0;
  function injectStream(url, source, target) {
    var moduleId = nextModuleId++;
    if (nextModuleId >= 127) {
      nextModuleId = 0;
    }
    var sourceCode = '';
    source.on('data', function(chunk) {
      sourceCode += chunk;
    });
    source.on('end', function() {
      try {
        var targetCode = transformCode(moduleId, url, sourceCode, argv);
        target.end(targetCode);
      } catch (e) {
        console.log('Error during transformation, writing through.');
        console.log(e);
        target.end(sourceCode);
      }
    });
  };

  // Handles both HTTP and HTTPS requests.
  function handler(req, res) {
    // Support both the ?url= mode and the X-WTF-URL header.
    var targetUrl;
    if (req.headers['x-wtf-url']) {
      targetUrl = req.headers['x-wtf-url'];
    } else {
      var parsedUrl = url.parse(req.url, true);
      var query = parsedUrl.query;
      targetUrl = query.url;
    }
    if (!targetUrl || targetUrl.indexOf('http') != 0) {
      res.writeHead(404, ['Content-Type', 'text/plain']);
      res.end();
      return;
    }

    res.on('error', function(e) {
      console.log('ERROR (source): ' + e);
    });

    var targetModule = targetUrl.indexOf('https') == 0 ? https : http;
    targetModule.get(targetUrl, function(originalRes) {
      // Eat errors, otherwise the app will die.
      originalRes.on('error', function(e) {
        console.log('ERROR (target): ' + e);
      });

      // Pull out content type to see if we are interested in it.
      var supportedContentType = false;
      var contentType = originalRes.headers['content-type'];
      if (contentType && contentType.indexOf(';') != 0) {
        contentType = contentType.substr(0, contentType.indexOf(';'));
      }
      switch (contentType) {
        case 'text/javascript':
        case 'application/javascript':
          supportedContentType = true;
          break;
      }

      // Also parse the URL - some servers don't return content type for some
      // reason.
      var supportedPath = false;
      var contentUrl = url.parse(targetUrl);
      if (path.extname(contentUrl.pathname) == '.js') {
        supportedPath = true;
      }

      if (supportedContentType || supportedPath) {
        var headers = [];
        for (var key in originalRes.headers) {
          if (key == 'content-length') {
            continue;
          }
          headers.push([key, originalRes.headers[key]]);
        }
        res.writeHead(originalRes.statusCode, headers);
        injectStream(targetUrl, originalRes, res);
      } else {
        console.log('Pass-through: ' + targetUrl, contentType);
        res.writeHead(originalRes.statusCode, originalRes.headers);
        originalRes.pipe(res);
      }
    }).on('error', function(e) {
      console.log(e);
      res.writeHead(404, ['Content-Type', 'text/plain']);
      res.end(e.message);
    });
  };

  // HTTP server.
  var httpServer = http.createServer(handler);
  httpServer.listen(httpPort);

  // HTTPS server.
  var httpsServer = https.createServer({
    key: certs.privateKey,
    cert: certs.certificate
  }, handler);
  httpsServer.listen(httpsPort);

  console.log('Server ready, use ctrl-c to exit...');
  console.log('');
}
316298
public static URL buildPostUrl(String host, int port, String path) throws MalformedURLException {
        return buildPostUrl("http", host, port, path);
    }
34957
public static void main(String[] args) {
        System.setProperty("java.awt.headless", "true");
        try {
            // USAGE: fedora-export host:port user password pid|ftyps format econtext path protocol [context]
            if (args.length < 8 || args.length > 9) {
                Export.badArgs("Wrong number of arguments.");
            }
            String[] hp = args[0].split(":");
            if (hp.length != 2) {
                Export.badArgs("First arg must be of the form 'host:port'");
            }

            //SDP - HTTPS
            String protocol = args[7];
            if (!protocol.equals("http") && !protocol.equals("https")) {
                Export.badArgs("protocol arg must be 'http' or 'https'");
            }

            String context = Constants.FEDORA_DEFAULT_APP_CONTEXT;
            if (args.length == 9 && !args[8].isEmpty()) {
                context = args[8];
            }

            // ******************************************
            // NEW: use new client utility class
            String baseURL =
                    protocol + "://" + hp[0] + ":" + Integer.parseInt(hp[1])
                            + "/" + context;
            FedoraClient fc = new FedoraClient(baseURL, args[1], args[2]);
            FedoraAPIAMTOM sourceRepoAPIA = fc.getAPIAMTOM();
            FedoraAPIMMTOM sourceRepoAPIM = fc.getAPIMMTOM();
            fc.shutdown();
            //*******************************************

            String exportFormat = args[4];
            String exportContext = args[5];
            if (!exportFormat.equals(FOXML1_1.uri)
                    && !exportFormat.equals(FOXML1_0.uri)
                    && !exportFormat.equals(METS_EXT1_1.uri)
                    && !exportFormat.equals(METS_EXT1_0.uri)
                    && !exportFormat.equals(ATOM1_1.uri)
                    && !exportFormat.equals(ATOM_ZIP1_1.uri)
                    && !exportFormat.equals("default")) {
                Export.badArgs(exportFormat + " is not a valid export format.");
            }
            if (!exportContext.equals("public")
                    && !exportContext.equals("migrate")
                    && !exportContext.equals("archive")
                    && !exportContext.equals("default")) {
                Export
                        .badArgs("econtext arg must be 'public', 'migrate', 'archive', or 'default'");
            }

            RepositoryInfo repoinfo = sourceRepoAPIA.describeRepository();
            StringTokenizer stoken =
                    new StringTokenizer(repoinfo.getRepositoryVersion(), ".");
            int majorVersion = new Integer(stoken.nextToken()).intValue();
            if (majorVersion < 2 // pre-2.0 repo
                    && !exportFormat.equals(METS_EXT1_0.uri)
                    && !exportFormat.equals("default")) {
                Export.badArgs("format arg must be '" + METS_EXT1_0.uri
                        + "' or 'default' for pre-2.0 repository.");
            }

            if (exportFormat.equals("default")) {
                exportFormat = null;
            }
            if (exportContext.equals("default")) {
                exportContext = null;
            }
            if (args[3].indexOf(":") == -1) {
                // assume args[3] is FTYPS... so multi-export
                int count =
                        Export.multi(sourceRepoAPIA,
                                     sourceRepoAPIM,
                                     exportFormat,
                                     exportContext,
                                     //args[4], // format
                                     //args[5], // export context
                                     new File(args[6])); // path
                System.out.print("Exported " + count + " objects.");
            } else {
                // assume args[3] is a PID...they only want to export one object

                Export.one(sourceRepoAPIA, sourceRepoAPIM, args[3], // PID
                           exportFormat,
                           exportContext,
                           //args[4], // format
                           //args[5], // export context
                           new File(args[6])); // path
                System.out.println("Exported " + args[3]);
            }
        } catch (Exception e) {
            System.err.print("Error  : " + e);
            if (e.getMessage() == null) {
                e.printStackTrace();
            } else {
                System.err.print(e.getMessage());
            }
        }
    }
1031167
function _getHostAddress (uri, defaultHost, defaultPort) {
      const addr = {};

      if (uri === undefined) { // If no uri, use default
        addr.protocol = 'http://';
        addr.port = defaultPort;
        addr.host = defaultHost;
      } else { // Otherwise parse provided uri
        const uriSplit = uri.replace(/http:\/\/|https:\/\//, '').split(':', 2);

        addr.protocol = (uri.toLowerCase().indexOf('https') == 0 ? 'https://' : 'http://');

        if (uriSplit.length == 0) {
          throw new Error('Invalid webdriveruri specified:' + uri);
        } else if (uriSplit.length < 2) {
          addr.port = defaultPort;
        } else {
          addr.port = uriSplit[1];
        }
        addr.host = uriSplit[0];
      }
      return addr.protocol + addr.host + ':' + addr.port;
    }
587770
protected URL getApiUrl(Object... pathArgs) throws IOException {
        String url = appendPathArgs(this.hostUrl, pathArgs);
        return (new URL(url));
    }
48739
public static void main(String argv[]) throws Exception {   
    DnsMonitorSecurityManager.setTheManager();
    AvatarShell shell = null;
    try {
      shell = new AvatarShell();
    } catch (RPC.VersionMismatch v) {
      System.err.println("Version Mismatch between client and server"
          + "... command aborted.");
      System.exit(-1);
    } catch (IOException e) {
      System.err.println("Bad connection to AvatarNode. command aborted.");
      System.exit(-1);
    }

    int res;
    try {
      res = ToolRunner.run(shell, argv);
    } finally {
      shell.close();
    }
    System.exit(res);
  }
271150
function format() {
  var args = Array.prototype.slice.call(arguments);
  var pathname = [];
  var parsedUrl = {};
  var pathName = '';
  var options;

  // Looking for paths and options
  args.forEach(function (arg, key) {

    // Find a path
    if(_.isString(arg)) {

      // First may contains the host
      if(key === 0) {
        parsedUrl = url.parse(arg);

        if (parsedUrl.pathname[0] && parsedUrl.pathname[0][0] === '/') {
          pathName = '/';
        }

        pathname.push.apply(pathname, parsedUrl.pathname.split('/'));

        return;
      }

      pathname.push.apply(pathname, arg.split('/'));
    }

    // Find the option
    else if (_.isObject(arg)) {
      options = arg;
    }
  });

  options = options || {};

  // Path params
  options.param = options.param || {};

  pathname = pathname.map(function (path) {
    if(path.charAt(0) === ':' && options.param[path.substring(1)]) {
      return options.param[path.substring(1)];
    }

    return path;
  });

  pathName += path.join.apply(path, pathname);
  parsedUrl.pathname = pathName;

  // Merge with options
  parsedUrl = _.merge(parsedUrl, options);

  return url.format(parsedUrl);
}
293003
def _route(self, attr, args, kwargs, **fkwargs):
        
        return self.cluster.hosts.keys()