Returns a transport that satisfies the requirements of this and the specified other
transport.
334374
public Transport combine (Transport other)
    {
        // if the channels are different, we fall back to the default channel
        return getInstance(
            _type.combine(other._type),
            (_channel == other._channel) ? _channel : 0);
    }
1011172
function queryTransport(transport, next) {
        if (options.query) {
            options.query = transport.formatQuery(query);
        }

        transport.query(options, function (err, results) {
            if (err) {
                return next(err);
            }

            next(null, transport.formatResults(results, options.format));
        });
    }
1236082
def busses():
    """
    return (Bus(g) for k, g in groupby(
            sorted(core.find(find_all=True), key=lambda d: d.bus),
            lambda d: d.bus))
806746
public T orElseSupplier(final Supplier<T> other) {
        checkNotNull(other, "orElse requires a non null supplier");
        if (isPresent()) {
            return get();
        }
        return other.get();
    }
174101
def get_one_required(self, locator):
        
        components = self.find(locator, True)
        return components[0] if len(components) > 0 else None
1039178
@Pure
	public Iterable<BusStop> busStops() {
		final MultiCollection<BusStop> col = new MultiCollection<>();
		col.addCollection(this.validBusStops);
		col.addCollection(this.invalidBusStops);
		return Iterables.unmodifiableIterable(col);
	}
83400
public void registerTransport(Class<Transport> transportClazz) {
		if(transportClazz == null){
			return;
		}
		
		HashSet<Class<Transport>> set = new HashSet<Class<Transport>>(availableTransports); 
		set.add(transportClazz);
		
		availableTransports = new LinkedList<Class<Transport>>(set);
	}
1137001
def get_missing_requirements(func, requires, d):
    
    if not requires:
        return None
    if any(i in d for i in IGNORE.get(func, [])):
        raise SkipComponent()
    req_all, req_any = split_requirements(requires)
    d = set(d.keys())
    req_all = [r for r in req_all if r not in d]
    req_any = [r for r in req_any if set(r).isdisjoint(d)]
    if req_all or req_any:
        return req_all, req_any
    else:
        return None
1142031
def needed(name, required):
    
    return [
        relative_field(r, name) if r and startswith_field(r, name) else None
        for r in required
    ]
1190430
def get_transport(name):
    '''
    
    '''
    try:
        log.debug('Using %s as transport', name)
        return TRANSPORT_LOOKUP[name]
    except KeyError:
        msg = 'Transport {} is not available. Are the dependencies installed?'.format(name)
        log.error(msg, exc_info=True)
        raise InvalidTransportException(msg)
984077
def matches(self, requirement):
    """"""
    try:
      requirement = self.parse_requirement(requirement, self._interpreter)
    except ValueError as e:
      raise self.UnknownRequirement(str(e))
    return self.distribution in requirement
1122185
public Stream<Module> requiresTransitive(Module m) {
        // find requires transitive
        return m.descriptor()
                .requires().stream()
                .filter(req -> req.modifiers().contains(TRANSITIVE))
                .map(ModuleDescriptor.Requires::name)
                .map(config::findModule)
                .flatMap(Optional::stream);
    }
261911
def doesnt_require(self, requirements, **overrides):
        """"""
        return self.where(requires=tuple(set(self.route.get('requires', ())).difference(requirements if
                                                            type(requirements) in (list, tuple) else (requirements, ))))
25056
def using_transport(self, transport=None, path=None, logs=True):
        
        if not transport:
            return self

        if self.transport == transport and self.path == path:
            return self

        path_required = [SkopeoTransport.DIRECTORY,
                         SkopeoTransport.DOCKER_ARCHIVE,
                         SkopeoTransport.OCI]

        if transport in path_required:
            if not path and logs:
                logging.debug("path not provided, temporary path was used")
            self.path = self.mount(path).mount_point
        elif transport == SkopeoTransport.OSTREE:
            if path and not os.path.isabs(path):
                raise ConuException("Path '", path, "' for OSTree transport is not absolute")
            if not path and logs:
                logging.debug("path not provided, default /ostree/repo path was used")
            self.path = path
        else:
            if path and logs:
                logging.warning("path %s was ignored!", path)
            self.path = None

        self.transport = transport
        return self
713241
def get(self, service_type, source_id=None, target_id=None, goods_value=None):
        ''''''
        request = TOPRequest('taobao.logistics.partners.get')
        request['service_type'] = service_type
        if source_id!=None: request['source_id'] = source_id
        if target_id!=None: request['target_id'] = target_id
        if goods_value!=None: request['goods_value'] = goods_value
        self.create(self.execute(request))
        return self.logistics_partners
897195
private Transport createTransport(final String profile) {
        if (getCaCapabilities(profile).isPostSupported()) {
            return transportFactory.forMethod(Method.POST, url);
        } else {
            return transportFactory.forMethod(Method.GET, url);
        }
    }
1306858
public com.google.protobuf.Any getTransportOptions() {
    return transportOptions_ == null ? com.google.protobuf.Any.getDefaultInstance() : transportOptions_;
  }