Returns server to perform request

@return Server
517241
public function getServer(): Server
    {
        if ($this->serverHostname instanceof \Closure) {
            $server = call_user_func($this->serverHostname);
        } else {
            if ($this->isOnCluster()) {
                /*
                 * If no server provided, will take random server from cluster
                 */
                if (is_null($this->serverHostname)) {
                    $server = $this->serverProvider->getRandomServerFromCluster($this->getClusterName());
                    $this->serverHostname = $server->getHost();
                } else {
                    $server = $this->serverProvider->getServerFromCluster(
                        $this->getClusterName(),
                        $this->serverHostname
                    );
                }
            } else {
                /*
                 * If no server provided, will take random server from cluster
                 */
                if (is_null($this->serverHostname)) {
                    $server = $this->serverProvider->getRandomServer();
                    $this->serverHostname = $server->getHost();
                } else {
                    $server = $this->serverProvider->getServer($this->serverHostname);
                }
            }
        }
        
        return $server;
    }
635827
public function server($name = null)
    {
        if (empty($name)) {
            $name = $this->getDefaultServerName();
        }

        if (!isset($this->servers[$name])) {
            $this->servers[$name] = $this->makeServer($name);
        }

        return $this->servers[$name];
    }
681220
public function server($key = NULL)
    {
        if ( !$key ) {
            return $this->server->all();
        }

        return $this->server->get($key);
    }
1282112
public static function getServerIP()
	{
		static $serverIP = null;
	
		if ($serverIP !== null) {
			return $serverIP;
		}
	
		if (isset($_SERVER)) {
			if (isset($_SERVER['SERVER_ADDR'])) {
				$serverIP = $_SERVER['SERVER_ADDR'];
			} else {
				$serverIP = '0.0.0.0';
			}
		} else {
			$serverIP = getenv('SERVER_ADDR');
		}
	
		return $serverIP;
	}
743117
protected function getClient() {
		if(!$this->client) {
			$this->client = new Client([
				RequestOptions::VERIFY  => self::$VERIFY_SSL,
				RequestOptions::TIMEOUT => $this->timeout,
			]);
		}
		return $this->client;
	}
196957
public function getClient() {
		if ( $this->client === null ) {
			$this->client = $this->newClient();
		}
		return $this->client;
	}
419056
public function server()
    {
        if (is_null($this->server)) {
            $this->server = app(Server::class);
        }

        return $this->server;
    }
539898
public function createServer(ServerRequestInterface $request): Server
    {
        if ($this->server === null) {
            $this->server = Server::createServerFromRequest(
                $this->config('middleware'),
                $request
            );
        } else {
            $this->server->setRequest($request);
        }

        $this->setRequest($request);

        return $this->server;
    }
120256
private function getFromRemoteHostServer()
    {
        if (empty($remoteHost = $this->request->server('REMOTE_HOST')))
            return null;

        $remoteHost = explode('.', $remoteHost);
        $locale     = strtolower(end($remoteHost));

        return $this->isSupported($locale) ? $locale : null;
    }
225182
public function getHost()
    {
        $host = $this->headers->get('HTTP_HOST');
        if ($host) {
            if (strpos($host, ':') !== false) {
                $hostParts = explode(':', $host);

                return $hostParts[0];
            }

            return $host;
        }

        return $this->env->get('SERVER_NAME');
    }
1268169
public function getServer(string $name = null)
    {
        if (is_null($name)) {
            return $this->get('server');
        }

        return $this->get('server', $name);
    }
228887
protected function getRequest()
    {
        $request = new Request();

        $request->setUrl($this->getUrl())
            ->setHeaders($this->getHeaders())
            ->setParams($this->getRequestParams())
            ->setBody($this->getRequestBody())
            ->setUserIp($this->getUserIp());
      
        if (isset($_SERVER)) {
            $request->setMethod(isset($_SERVER['REQUEST_METHOD']) ? $_SERVER['REQUEST_METHOD'] : null)
                ->setQueryString(isset($_SERVER['QUERY_STRING']) ? $_SERVER['QUERY_STRING'] : null);
        }
      
        if (isset($_GET)) {
            $request->setGet($_GET);
        }
        if (isset($_POST)) {
            $request->setPost($_POST);
        }
        
        if ($request->getMethod() === 'PUT') {
            $postData = array();
            parse_str($request->getBody(), $postData);
            $request->setPost($postData);
        }
        
        $extras = $this->getRequestExtras();
        if (!$extras) {
            $extras = array();
        }

        $request->setExtras($extras);
        
        if (isset($_SESSION) && is_array($_SESSION) && count($_SESSION) > 0) {
            $request->setSession($_SESSION);
        }
        return $request;
    }
114718
public function getRequest()
	{
	    $name = 'web.request';
	    if (!Ioc::has($name)) {
	        Ioc::setShared($name, function(){
	            return Request::createFromGlobals($_SERVER);
	        });
	    }
	    
	    return Ioc::get($name);
	}
1028156
public function getServer()
    {
        $server = new Server(
            $this->getSource(),
            $this->getCache(),
            $this->getApi()
        );

        $server->setSourcePathPrefix($this->getSourcePathPrefix());
        $server->setCachePathPrefix($this->getCachePathPrefix());
        $server->setGroupCacheInFolders($this->getGroupCacheInFolders());
        $server->setCacheWithFileExtensions($this->getCacheWithFileExtensions());
        $server->setDefaults($this->getDefaults());
        $server->setPresets($this->getPresets());
        $server->setBaseUrl($this->getBaseUrl());
        $server->setResponseFactory($this->getResponseFactory());

        return $server;
    }
778962
protected function getRequest()
    {
        if (null === $this->request) {
            $this->request = $this->getParser()->getRequest();
        }

        return $this->request;
    }
283553
public function getServer()
    {
        $servers = $this->getSortedServersArray();

        foreach ($servers as $server) {
            if ($this->isServerAvailable($server)) {
                return $server;
            }
        }

        throw new LdapConnectionException('No LDAP server is available.');
    }
1325261
def server(self):
        """"""

        conn = self.connection_class(self)
        with self.mutex:
            self.connections.append(conn)
        return conn