Finds the service offering with the specified name.
182631
def get_service_offering(name)

      # TODO: use name parameter
      # listServiceOfferings in CloudStack 2.2 doesn't seem to work
      # when the name parameter is specified. When this is fixed,
      # the name parameter should be added to the request.
      params = {
          'command' => 'listServiceOfferings'
      }
      json = send_request(params)

      services = json['serviceoffering']
      return nil unless services

      services.each { |s|
        if name.is_uuid? then
          return s if s['id'] == name
        else
          return s if s['name'] == name
        end
      }
      nil
    end
262445
def get_disk_offering(name)
      params = {
          'command' => 'listDiskOfferings',
      }
      json = send_request(params)
      disks = json['diskoffering']

      return nil if !disks

      disks.each { |d|
        return d if d['name'] == name
      }
      nil
    end
754952
function getService(name) {
    if (name.indexOf('.') >= 0) {
        name = utils.getCamelCase(name);
    }

    if (!name.match(/^.*Service$/)) {
        name += 'Service';
    }

    return cook(name);
}
390097
def GetServices(self,filename):
        """"""
        objlist=[]
        for sobj in self.services:
            if sobj.KnowsFile(filename) :
                objlist.append(sobj)

        if len(objlist)==0:
            return None

        return objlist
568835
def get_service_plan_for_service(self, service_name):
        
        services = self.get_services()
        for service in services['resources']:
            if service['entity']['label'] == service_name:
                response = self.api.get(service['entity']['service_plans_url'])
                return response['resources']
930393
public boolean hasService(String serviceName) {
    return serviceName.equals(MORTAR_SERVICE) || findService(serviceName, false) != null;
  }
34817
public ArrayList<OvhLineOffer> billingAccount_service_serviceName_offerChanges_GET(String billingAccount, String serviceName) throws IOException {
		String qPath = "/telephony/{billingAccount}/service/{serviceName}/offerChanges";
		StringBuilder sb = path(qPath, billingAccount, serviceName);
		String resp = exec(qPath, "GET", sb.toString(), null);
		return convertTo(resp, t15);
	}
1261008
def get_services_supported(self):
        """"""
        if _debug: Application._debug("get_services_supported")

        services_supported = ServicesSupported()

        # look through the confirmed services
        for service_choice, service_request_class in confirmed_request_types.items():
            service_helper = "do_" + service_request_class.__name__
            if hasattr(self, service_helper):
                service_supported = ConfirmedServiceChoice._xlate_table[service_choice]
                services_supported[service_supported] = 1

        # look through the unconfirmed services
        for service_choice, service_request_class in unconfirmed_request_types.items():
            service_helper = "do_" + service_request_class.__name__
            if hasattr(self, service_helper):
                service_supported = UnconfirmedServiceChoice._xlate_table[service_choice]
                services_supported[service_supported] = 1

        # return the bit list
        return services_supported
817763
def get_instance(self, service_name):
        
        for resource in self.space._get_instances():
            if resource['entity']['name'] == service_name:
                return resource['entity']
162351
def get_service(self, service_type=None):
        """"""
        for service in self._services:
            if service.type == service_type and service_type:
                return service
        return None
269973
def get(self, service_name, **kwargs):
        """"""
        return self._send(requests.get, service_name, **kwargs)
800367
def get_service_by_name(self, service_name):
		""""""
		content = self._fetch("/service/search?name=%s" % service_name)
		return FastlyService(self, content)
974904
def service_available(service_name):
    """"""
    try:
        subprocess.check_output(
            ['service', service_name, 'status'],
            stderr=subprocess.STDOUT).decode('UTF-8')
    except subprocess.CalledProcessError as e:
        return b'unrecognized service' not in e.output
    else:
        return True
465997
def resolve_service_spec(self, name, lineno):
        """"""

        if name in self.service_specs:
            return self.service_specs[name].link(self)

        if '.' in name:
            include_name, component = name.split('.', 2)
            if include_name in self.included_scopes:
                return self.included_scopes[
                    include_name
                ].resolve_service_spec(component, lineno)

        raise ThriftCompilerError(
            'Unknown service "%s" referenced at line %d%s' % (
                name, lineno, self.__in_path()
            )
        )
659203
def filter_service_by_regex_name(regex):
    
    host_re = re.compile(regex)

    def inner_filter(items):
        """Inner filter for service. Accept if regex match service_description"""
        service = items["service"]
        if service is None:
            return False
        return host_re.match(service.service_description) is not None

    return inner_filter
376033
public <T> T getService(String serviceName) {
    T service = findService(serviceName, true);
    if (service == null) {
      throw new IllegalArgumentException(format("No service found named \"%s\"", serviceName));
    }

    return service;
  }
136992
public ServiceMethod getMethod(String name) {
        for (ServiceMethod serviceMethod : getMethods()) {
            if (serviceMethod.getName().equals(name)) {
                return serviceMethod;
            }
        }
        return null;
    }