Extends ZNPClient to provice the ZCL layer, without understanding any of the underlying hardware.
973310
function ZCLClient(config) {
  ZNPClient.call(this, config);

  // handle zcl messages
  this.on('incoming-message', this._handleIncomingMessage.bind(this));

  // handle attribute reports
  this.on('zcl-command:ReportAttributes', this._handleReportAttributes.bind(this));

  // XXX: This really should be pulled out and handled by the user, or at least put into a IASZone mixin
  this.on('zcl-command:IAS Zone.Zone Enroll Request', this._handleZoneEnrollRequest.bind(this));
}
775656
def from_global_driver(self):
        """"""
        address, _ = _read_driver()

        if address is None:
            raise DriverNotRunningError("No driver currently running")

        security = Security.from_default()
        return Client(address=address, security=security)
923161
private boolean skipInterface(NetworkInterface ni) throws SocketException {
        boolean skipInterface = !ni.isUp() || ni.isVirtual() || ni.isLoopback();
        if (skipInterface && logger.isFineEnabled()) {
            logger.fine("Skipping NetworkInterface '" + ni.getName() + "': isUp=" + ni.isUp() + ", isVirtual=" + ni.isVirtual()
                    + ", isLoopback=" + ni.isLoopback());
        }
        return skipInterface;
    }
529548
def extend(self, other: Operation) -> None:
        """"""
        if isinstance(other, Circuit):
            self.elements.extend(other.elements)
        else:
            self.elements.extend([other])
146241
function (smd) {
                // zyp format by default.
                var ret = new ZypSMDReader(smd, this.config.resolver);
                if (!smd.SMDVersion) {
                    //not zyp then fail.
                    throw new Error("Argument is not an SMD.");
                }
                return ret;
            }
27335
def create_pipe(backend_p):
        
        return Zsock(lib.zsys_create_pipe(byref(zsock_p.from_param(backend_p))), False)
162047
public static IProcessingInstructionProcessor unwrap(final IProcessingInstructionProcessor processor) {
        if (processor == null) {
            return null;
        }
        if (processor instanceof AbstractProcessorWrapper) {
            return (IProcessingInstructionProcessor)((AbstractProcessorWrapper) processor).unwrap();
        }
        return processor;
    }
334676
@SuppressWarnings("unchecked")
    public <C extends Client> Optional<C> findClient(final Class<C> clazz) {
        CommonHelper.assertNotNull("clazz", clazz);
        init();
        if (clazz != null) {
            for (final Client client : getClients()) {
                if (clazz.isAssignableFrom(client.getClass())) {
                    return Optional.of((C) client);
                }
            }
        }
        LOGGER.debug("No client found for class: {}", clazz);
        return Optional.empty();
    }
703244
def indirect(self, interface):
        
        if interface is IBoxReceiver:
            router = Router()
            connector = self.connectorFactory(router)
            router.bindRoute(connector, None).connectTo(None)
            return router
        raise NotImplementedError()
1083688
@Override
	public <K extends TServiceClient> K getClient(String serviceName, Class<K> clazz) {
		if (thriftConnection != null) {
			return thriftConnection.getClient(serviceName, clazz);
		}
		throw new IllegalStateException("连接代理类没有绑定的原始连接信息");
	}
301385
View build() throws IOException {
        final Class<? extends T> proxyClass = generateProxyClass();
        if (proxyClass == null) {
            return null;
        }

        final Constructor<? extends T> constructor = getProxyClassConstructor(proxyClass);

        final View result;
        try {
            result = constructor.newInstance(CONSTRUCTOR_ARG_VALUES);
        } catch (InstantiationException e) {
            // Should not be thrown, generated class is not abstract.
            throw new AssertionError(e);
        } catch (IllegalAccessException e) {
            // Should not be thrown, the generated constructor is accessible.
            throw new AssertionError(e);
        } catch (InvocationTargetException e) {
            // Thrown when the base class constructor throws an exception.
            throw launderCause(e);
        }

        ((ViewProxy) result).setInterceptor(mInterceptor);
        return result;
    }
847019
public static <T> ExtensionLoader<T> getExtensionLoader(Class<T> clazz, ExtensionLoaderListener<T> listener) {
        ExtensionLoader<T> loader = LOADER_MAP.get(clazz);
        if (loader == null) {
            synchronized (ExtensionLoaderFactory.class) {
                loader = LOADER_MAP.get(clazz);
                if (loader == null) {
                    loader = new ExtensionLoader<T>(clazz, listener);
                    LOADER_MAP.put(clazz, loader);
                }
            }
        }
        return loader;
    }
394020
def extend(path=None, cache=None):
    """"""
    if path is None:
        path = config.PATH
    try:
        path = path.split(':')
    except:
        pass

    sys.path.extend([library.to_path(p, cache) for p in path])
165457
public static Zxid fromProtoZxid(ZabMessage.Zxid zxid) {
    return new Zxid(zxid.getEpoch(), zxid.getXid());
  }
154406
def extender(path=None, cache=None):
    """"""
    old_path = sys.path[:]
    extend(path, cache=None)

    try:
        yield
    finally:
        sys.path = old_path
662856
def Introspect(self, object_path, connection):
        '''
        '''
        # temporarily add our dynamic methods
        cls = self.__class__.__module__ + '.' + self.__class__.__name__
        orig_interfaces = self._dbus_class_table[cls]

        mock_interfaces = orig_interfaces.copy()
        for interface, methods in self.methods.items():
            for method in methods:
                mock_interfaces.setdefault(interface, {})[method] = self.methods[interface][method][3]
        self._dbus_class_table[cls] = mock_interfaces

        xml = dbus.service.Object.Introspect(self, object_path, connection)

        tree = ElementTree.fromstring(xml)

        for name in self.props:
            # We might have properties for new interfaces we don't know about
            # yet. Try to find an existing <interface> node named after our
            # interface to append to, and create one if we can't.
            interface = tree.find(".//interface[@name='%s']" % name)
            if interface is None:
                interface = ElementTree.Element("interface", {"name": name})
                tree.append(interface)

            for prop, val in self.props[name].items():
                if val is None:
                    # can't guess type from None, skip
                    continue
                elem = ElementTree.Element("property", {
                    "name": prop,
                    # We don't store the signature anywhere, so guess it.
                    "type": dbus.lowlevel.Message.guess_signature(val),
                    "access": "readwrite"})

                interface.append(elem)

        xml = ElementTree.tostring(tree, encoding='utf8', method='xml').decode('utf8')

        # restore original class table
        self._dbus_class_table[cls] = orig_interfaces

        return xml
94175
public static void runHelloReefWithoutClient(final Configuration runtimeConf) throws InjectionException {
    final REEF reef = Tang.Factory.getTang().newInjector(runtimeConf).getInstance(REEF.class);
    final Configuration driverConf = getDriverConfiguration();
    reef.submit(driverConf);
  }