Returns the requested service
@param {string} serviceName The name of the service to retrieve.
@returns {!Object} An object if the service is found or null if not.
@private
962104
function getService(serviceName) {
		var serviceData = services[serviceName];

		if (serviceData) {
			if (!serviceData.instance) {
				serviceData.instance = serviceData.creator(application);
			}

			return serviceData.instance;
		}

		return null;
	}
388337
@VisibleForTesting
  static ServiceInfo getServiceInfo(String serviceName) {
    return ServiceInfo.newBuilder().setName(serviceName).build();
  }
48493
public SMethod findMethod(String methodName) {
		for (SService sService : servicesByName.values()) {
			SMethod method = sService.getSMethod(methodName);
			if (method != null) {
				return method;
			}
		}
		return null;
	}
1197425
public Service getServiceObjectFromId(String id) {
        log.fine("Return service object for " + id);
        Service service = null;
        for (Service s : services.getServices()) {
            if (id.equals(s.getId())) {
                return s;
            }
        }
        return service;
    }
398414
final protected function api($serviceName = null)
    {
        if ($serviceName !== null) {
            return $this->api->service($serviceName);
        }

        return $this->api;
    }
1179399
public function getServiceMethod($methodName)
    {
        return $this->getService($this->getServiceName($methodName)) instanceof Service ? $this->getService($this->getServiceName($methodName))->getMethod($methodName) : null;
    }
606938
public static <T> ServiceController<T> findService(ServiceRegistry registry, ServiceName name) {
        return (ServiceController<T>) registry.getService(name);
    }
1088117
function getService(serviceName) {

		var serviceData = services[serviceName];

		if (serviceData) {

			if (!serviceData.instance) {
				// check for circular dependencies
				if (isServiceBeingInstantiated(serviceName)) {
					error(new ReferenceError('Circular service dependency: ' + serviceStack.join(' -> ') + ' -> ' + serviceName));
					return null;
				}

				// flag that this service is being initialized just in case there's a circular dependency issue
				serviceStack.push(serviceName);

				serviceData.instance = serviceData.creator(application);

				// no error was thrown for circular dependencies, so we're done
				serviceStack.pop();
			}

			return serviceData.instance;
		} else {
			error(new Error('Service "' + serviceName + '" not found'));
		}

		return null;
	}
930393
public boolean hasService(String serviceName) {
    return serviceName.equals(MORTAR_SERVICE) || findService(serviceName, false) != null;
  }
1302009
def get(cls, name, service=Service()):
        ''''''
        path = pathjoin(cls.path, name)
        response = service.send(SRequest('GET', path))
        return cls.from_response(response, service=service)
877428
public static <T> T findValue(ServiceRegistry registry, ServiceName name) {
        ServiceController<T> service = findService(registry, name);
        return ((service != null) && (service.getState() == State.UP)) ? service.getValue() : null;
    }
1191683
public String[] getServices(String servicename, String instname) throws DevFailed {
		return databaseDAO.getServices(this, servicename, instname);
	}
488287
public ModelService lookupService(String serviceName){
        HttpResponse result = invoker.invoke("/service/" + serviceName , null, HttpMethod.GET);

        if (result.getHttpCode() != HTTP_OK) {
            throw new ServiceException(ErrorCode.REMOTE_DIRECTORY_SERVER_ERROR,
                    "HTTP Code is not OK, code=%s", result.getHttpCode());
        }

        ModelService service = _deserialize(result.getRetBody(), ModelService.class);
        return service;
    }
524508
public static gslbservice get(nitro_service service, String servicename) throws Exception{
		gslbservice obj = new gslbservice();
		obj.set_servicename(servicename);
		gslbservice response = (gslbservice) obj.get_resource(service);
		return response;
	}
973864
public function get($serviceName)
    {
        if ($this->registry->has($serviceName)) {
            $service = $this->registry->getStrict($serviceName);
        }
        elseif ($this->parameterContainer->has($serviceName)) {
            $service = $this->parameterContainer->get($serviceName);
        }
        else {
            $service = $this->resolveService($serviceName);
        }

        return $service;
    }
850014
@Override
  public Service get() {
    String serviceName = this.environment.getVariable(SERVICE_NAME_KEY);
    if (Strings.isNullOrEmpty(serviceName)) {
      String errorMessage =
          String.format("Environment variable '%s' is not set", SERVICE_NAME_KEY);
      throw new IllegalArgumentException(errorMessage);
    }
    String serviceVersion = this.environment.getVariable(SERVICE_VERSION_KEY);

    return fetch(serviceName, serviceVersion);
  }
256186
public static service get(nitro_service service, String name) throws Exception{
		service obj = new service();
		obj.set_name(name);
		service response = (service) obj.get_resource(service);
		return response;
	}