Return the server controller.
967796
def _controller(self):
        """"""
        def server_controller(cmd_id, cmd_body, _):
            """Server controler."""
            if not self.init_logginig:
                # the reason put the codes here is because we cannot get
                # kvstore.rank earlier
                head = '%(asctime)-15s Server[' + str(
                    self.kvstore.rank) + '] %(message)s'
                logging.basicConfig(level=logging.DEBUG, format=head)
                self.init_logginig = True

            if cmd_id == 0:
                try:
                    optimizer = pickle.loads(cmd_body)
                except:
                    raise
                self.kvstore.set_optimizer(optimizer)
            else:
                print("server %d, unknown command (%d, %s)" % (
                    self.kvstore.rank, cmd_id, cmd_body))
        return server_controller
845520
def get(self, url, controller):
        

        self.request_type = 'GET'
        controller_class, controller_method = self.__return_controller__(controller)

        self.controller = controller_class
        self.method = controller_method
        self.url_ = url

        self.url.append((url, controller_class, dict(method=controller_method, request_type=self.request_type, middleware=None)))
        return self
716742
public function controller()
    {
        if ($this->restful) {
            return filesystem()->exists(realpath(__DIR__.'/../../../../../app/controllers')) ?
                realpath(__DIR__.'/../Templates/controller/restful.stub') :
                realpath(__DIR__.'/../Templates/controller/restful.core.stub');
        }

        return filesystem()->exists(realpath(__DIR__.'/../../../../../app/controllers')) ?
            realpath(__DIR__.'/../Templates/controller/plain.stub') :
            realpath(__DIR__.'/../Templates/controller/core.stub');
    }
1054964
def _get_controller_help(self, controller):
        
        if hasattr(self._controllers[controller], 'HELP'):
            return self._controllers[controller].HELP
        return None
236412
public function getController(): ControllerInterface
    {
        $controllers = $this->getControllers();
        if ($controller = reset($controllers)) {
            return $controller;
        }

        throw new NotFoundException("Unable to find any controllers on the current network");
    }
496963
def controller
      unless params[:controller]
        raise ControllerExceptions::NotFound,
          "Route matched, but route did not specify a controller.\n" +
          "Did you forgot to add :controller => \"people\" or :controller " +
          "segment to route definition?\nHere is what's specified:\n" +
          route.inspect
      end
      path = [params[:namespace], params[:controller]].compact.join(Merb::Const::SLASH)
      controller = path.snake_case.to_const_string

      begin
        Object.full_const_get(controller)
      rescue NameError => e
        msg = "Controller class not found for controller `#{path}'"
        Merb.logger.warn!(msg)
        raise ControllerExceptions::NotFound, msg
      end
    end
688000
public static function getRequest()
    {
        if (self::$request) {
            return self::$request;
        }
        // Fall back to trying from the global state
        if (Controller::has_curr()) {
            return Controller::curr()->getRequest();
        }
    }
413086
protected function pullServer() {
		if (!is_array($this->serverVars)) {
			$this->serverVars = $this->request->getServerParams();
		}
		
		return $this->serverVars;
	}
998017
def create(controller_id, name):
        """"""
        def _decorator(cls):
            class _ControllerClass(cls, Controller):
                def __init__(self):
                    Controller.__init__(self, controller_id, name)
                    for key in cls.__dict__.keys():
                        prop = cls.__dict__[key]
                        if isinstance(prop, KerviValue):
                            if prop.is_input:
                                self.inputs._add_internal(key, prop)
                            else:
                                self.outputs._add_internal(key, prop)
                    cls.__init__(self)
            return _ControllerClass
        return _decorator
706545
function getServer(localPath) {
        var provider, server, i;

        for (i = 0; i < _serverProviders.length; i++) {
            provider = _serverProviders[i];
            server = provider.create();

            if (server.canServe(localPath)) {
                return server;
            }
        }

        return null;
    }
649244
async def controller(self):
        
        return await Connection.connect(
            self.endpoint,
            username=self.username,
            password=self.password,
            cacert=self.cacert,
            bakery_client=self.bakery_client,
            loop=self.loop,
            max_frame_size=self.max_frame_size,
        )
1217798
public String getController() {
        final StringBuilder controller = new StringBuilder();
        if (getProtocol() != null) {
            controller.append(getProtocol()).append("://");
        }
        if (getHost() != null) {
            controller.append(getHost());
        } else {
            controller.append("localhost");
        }
        if (getPort() > 0) {
            controller.append(':').append(getPort());
        }
        return controller.toString();
    }
497070
protected function controllerMiddleware()
	{
		list( $class, $method ) = explode( '@', $this->action['uses'] );

		$controller = UniversalBuilder::resolve( $class );

		return ( new ControllerDispatcher( $this->router ) )->getMiddleware( $controller, $method );
	}
1362077
def getSystemVariable(self, remote, name):
        """"""
        if self._server is not None:
            return self._server.getSystemVariable(remote, name)
442664
public function getController()
    {
        if (! ($this->_controller instanceof LibBaseControllerAbstract)) {

            //Make sure we have a controller identifier
            if (! ($this->_controller instanceof AnServiceIdentifier)) {
                $this->setController($this->_controller);
            }

            $config = array(
                'response' => $this->getResponse(),
                'request' => $this->_request,
                'dispatched' => true,
            );

            $this->_controller = $this->getService($this->_controller, $config);
        }

        return $this->_controller;
    }
1187933
protected function _getController()
    {
        if (!$this->_controller instanceof KControllerInterface) {
            $this->_controller = $this->getObject($this->_controller);
        }

        return $this->_controller;
    }
245467
def controller(self):
        

        if hasattr(self, 'controller_id'):
            if len(self.controller_info['controllers']) > 1:
                raise TypeError(
                    'Only one controller per account is supported.'
                )
            return self.controller_id
        raise AttributeError('No controllers assigned to this account.')