Get an instance of interface services facade.
322138
def create_interface(self):
        """"""
        return Interface(
            self.networkapi_url,
            self.user,
            self.password,
            self.user_ldap)
810530
def GetServiceObj(self,servicename):
        """"""
        for sobj in self.services:
            if sobj.GetName().lower()==servicename.lower():
                return sobj

        return None
38414
def get_interface(iface):
    '''
    
    '''
    _interfaces = get_interfaces_details()
    for _interface in _interfaces['interfaces']:
        if _interface['connectionid'] == iface:
            return _dict_to_string(_interface)
    return None
570801
public Object getService(String interfaceClassName, String serviceClassName, String versionRange, Dictionary<String,String> filter)
    {
        return ClassServiceUtility.getClassService().getClassFinder(context).getClassBundleService(interfaceClassName, serviceClassName, versionRange, filter, -1);
    }
1122423
private Class<?> retrieveRealServiceClass(Object service) {
        Class<?> serviceClass = service.getClass();
        Method realTypeMethod = null;
        try {
            realTypeMethod = serviceClass.getMethod("getRealUnproxiedType");
        } catch (NoSuchMethodException e) {
            // no problem this method does not have to exist
        }
        if (realTypeMethod != null) {
            try {
                serviceClass = (Class<?>) realTypeMethod.invoke(service);
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
        return serviceClass;
    }
16942
def _get_instance(project_id, instance_zone, name, service):
    '''
    
    '''
    return service.instances().get(project=project_id,
                                   zone=instance_zone,
                                   instance=name).execute()
1284517
def _get_network_interface(name, resource_group):
    '''
    
    '''
    public_ips = []
    private_ips = []
    netapi_versions = get_api_versions(kwargs={
        'resource_provider': 'Microsoft.Network',
        'resource_type': 'publicIPAddresses'
        }
    )
    netapi_version = netapi_versions[0]
    netconn = get_conn(client_type='network')
    netiface_query = netconn.network_interfaces.get(
        resource_group_name=resource_group,
        network_interface_name=name
    )

    netiface = netiface_query.as_dict()
    for index, ip_config in enumerate(netiface['ip_configurations']):
        if ip_config.get('private_ip_address') is not None:
            private_ips.append(ip_config['private_ip_address'])
        if 'id' in ip_config.get('public_ip_address', {}):
            public_ip_name = get_resource_by_id(
                ip_config['public_ip_address']['id'],
                netapi_version,
                'name'
            )
            public_ip = _get_public_ip(public_ip_name, resource_group)
            public_ips.append(public_ip['ip_address'])
            netiface['ip_configurations'][index]['public_ip_address'].update(public_ip)

    return netiface, public_ips, private_ips
612324
def get_instance(cls, dependencies=None):
        
        assert cls is not ContractBase, 'ContractBase is not meant to be used directly.'
        assert cls.CONTRACT_NAME, 'CONTRACT_NAME must be set to a valid keeper contract name.'
        return cls(cls.CONTRACT_NAME, dependencies)
339792
@Nullable
	public static <T> InterfaceDescriptor<T> findInterfaceDescriptor(final Class<T> cls) {
		if (!cls.isInterface()) {
			throw new IllegalArgumentException("Interface required, got " + cls);
		}

		Field field;
		try {
			field = cls.getField("DESCRIPTOR");
		} catch (NoSuchFieldException e) {
			throw new IllegalArgumentException("No DESCRIPTOR field in " + cls);
		}

		if (!InterfaceDescriptor.class.isAssignableFrom(field.getType())) {
			throw new IllegalArgumentException("Not an InterfaceDescriptor field, " + field);
		}

		try {
			// Get the static TYPE field.
			@SuppressWarnings("unchecked")
			InterfaceDescriptor<T> descriptor = (InterfaceDescriptor<T>) field.get(null);
			return descriptor;
		} catch (IllegalAccessException e) {
			throw new RuntimeException(e);
		}
	}
692678
public static <T> T getService(BundleContext bundleContext, Class<T> serviceClass) {
        T service = null;
        if (FrameworkState.isValid()) {
            ServiceReference<T> ref = bundleContext.getServiceReference(serviceClass);

            if (ref != null) {
                service = bundleContext.getService(ref);
            }
        }
        return service;
    }
1305349
public static String getServiceName(AbstractInterfaceConfig interfaceConfig) {
        String uniqueId = interfaceConfig.getUniqueId();
        return interfaceConfig.getInterfaceId() + (StringUtils.isEmpty(uniqueId) ? "" : ":" + uniqueId);
    }
717242
public static <T> List<T> getServices(Class<T> intf) {
        List<T> ret = new ArrayList<T>();

        for (T service : ServiceLoader.load(intf)) {
            if (!(service instanceof ServiceStatus) || ((ServiceStatus)service).isAvailable()) {
                if (service instanceof ServiceLifecycle) {
                    ((ServiceLifecycle)service).init();
                }

                ret.add(service);
            }
        }

        return ret;
    }
487241
@VisibleForTesting
  String getServiceName() {
    String simpleName = interfaceClass.getSimpleName();
    return simpleName.substring(0, simpleName.indexOf("Interface"));
  }
283971
def _getInterfaces(self):
        
        interfaces = {}

        interfacesPath = os.path.join("application", "interface")
        interfaceList = os.listdir(interfacesPath)

        for file in interfaceList:
            interfaceDirectoryPath = os.path.join(interfacesPath, file)
            if not os.path.isdir(interfaceDirectoryPath) or file.startswith("__") or file.startswith("."):
                continue

            interfaceName = ntpath.basename(interfaceDirectoryPath)
            interfacePath = os.path.join(interfaceDirectoryPath, interfaceName) + ".py"

            if not os.path.isfile(interfacePath):
                continue

            # importing interface
            interfaceSpec = importlib.util.spec_from_file_location(
                interfaceName,
                interfacePath
            )
            interface = importlib.util.module_from_spec(interfaceSpec)
            interfaceSpec.loader.exec_module(interface)

            # checking if there is an interface in the file
            if hasattr(interface, "Service"):
                # initializing interface
                interfaceInstance = interface.Service(self)
                interfaces[interfaceName] = interfaceInstance

        return interfaces
716305
public static Interface_stats[] get(nitro_service service) throws Exception{
		Interface_stats obj = new Interface_stats();
		Interface_stats[] response = (Interface_stats[])obj.stat_resources(service);
		return response;
	}
1249446
def create_api_interface_request(self):
        """"""

        return ApiInterfaceRequest(
            self.networkapi_url,
            self.user,
            self.password,
            self.user_ldap)
1156963
def _interface_to_service(iface):
    '''
    
    '''
    for _service in _get_services():
        service_info = pyconnman.ConnService(os.path.join(SERVICE_PATH, _service))
        if service_info.get_property('Ethernet')['Interface'] == iface:
            return _service
    return None