#NEWLINE# def get_service( self , reactor , options ) : #NEWLINE# #INDENT# "\n        Create an ``AgentLoopService`` instance.\n\n        :param reactor: The reactor to give to the service so it can schedule\n            timed events and make network connections.\n\n        :param AgentOptions options: The command-line options to use to\n            configure the loop and the loop's deployer.\n\n        :param context_factory: TLS context factory to pass to service.\n\n        :param NodeCredential node_credential: The node credential.\n\n        :return: The ``AgentLoopService`` instance.\n        " #NEWLINE# configuration = get_configuration ( options ) #NEWLINE# host = configuration [ 'control-service' ] [ 'hostname' ] #NEWLINE# port = configuration [ 'control-service' ] [ 'port' ] #NEWLINE# ip = self . get_external_ip ( host , port ) #NEWLINE# tls_info = _context_factory_and_credential ( options [ 'agent-config' ] . parent ( ) , host , port ) #NEWLINE# return AgentLoopService ( reactor = reactor , deployer = self . deployer_factory ( node_uuid = tls_info . node_credential . uuid , hostname = ip , cluster_uuid = reactor . node_credential . cluster_uuid ) , host = host , port = port , context_factory = tls_info . context_factory , era = get_era ( ) )