Given a few parameters from the Connection constructor,
    select and create a subclass of _AbstractTransport.
763935
def create_transport(host, connect_timeout, ssl=False):
    """"""
    if ssl:
        return SSLTransport(host, connect_timeout, ssl)
    else:
        return TCPTransport(host, connect_timeout)
557728
private function initTransports()
    {
        $this->transports = array();

        foreach ($this->loadTransports() as $transport) {
            if (!$transport instanceof TransportInterface) {
                throw new \InvalidArgumentException(sprintf('Transport %s should implements TransportInterface', get_class($transport)));
            }

            $this->transports[$transport->getName()] = $transport;
        }
    }
65700
static <T1, T2> Flowable<Notification<Tuple2<T1, T2>>> createWithTwoOutParameters(Single<Connection> connection,
            String sql, Flowable<List<Object>> parameterGroups, List<ParameterPlaceholder> parameterPlaceholders,
            Class<T1> cls1, Class<T2> cls2) {
        return connection.toFlowable().flatMap(con -> createWithParameters(con, sql, parameterGroups,
                parameterPlaceholders,
                (stmt, parameters) -> createWithTwoParameters(stmt, parameters, parameterPlaceholders, cls1, cls2)));
    }
1274958
def from_connection(cls, connection):
        
        facade_name = cls.__name__
        if not facade_name.endswith('Facade'):
           raise TypeError('Unexpected class name: {}'.format(facade_name))
        facade_name = facade_name[:-len('Facade')]
        version = connection.facades.get(facade_name)
        if version is None:
            raise Exception('No facade {} in facades {}'.format(facade_name,
                                                                connection.facades))

        c = lookup_facade(cls.__name__, version)
        c = c()
        c.connect(connection)

        return c
1951
private void batchImport() {
        m_jdbcTemplate.batchUpdate(createInsertQuery(),
                                   new BatchPreparedStatementSetter() {
                                       public void setValues(
                                               PreparedStatement ps, int i)
                                               throws SQLException {
                                           int j = 1;
                                           for (String property : m_propertyNames) {
                                               Map params = (Map) m_batch.get(
                                                       i);
                                               ps.setObject(j++, params.get(
                                                       property));
                                           }
                                       }

                                       public int getBatchSize() {
                                           return m_batch.size();
                                       }
                                   });
    }
1149199
def create_port(self, port):
        """"""
        instance_type = self.get_instance_type(port)
        if not instance_type:
            return
        port_type = instance_type + a_const.PORT_SUFFIX
        p_res = MechResource(port['id'], port_type, a_const.CREATE)
        self.provision_queue.put(p_res)
1015021
static <T1, T2, T3, T4> Flowable<Notification<Tuple4<T1, T2, T3, T4>>> createWithFourOutParameters(
            Single<Connection> connection, String sql, Flowable<List<Object>> parameterGroups,
            List<ParameterPlaceholder> parameterPlaceholders, Class<T1> cls1, Class<T2> cls2, Class<T3> cls3,
            Class<T4> cls4) {
        return connection.toFlowable()
                .flatMap(con -> createWithParameters(con, sql, parameterGroups, parameterPlaceholders,
                        (stmt, parameters) -> createWithFourParameters(stmt, parameters, parameterPlaceholders, cls1,
                                cls2, cls3, cls4)));
    }
522007
public Client<? extends Options, ? extends OptionsBuilder, ? extends RequestBuilder> newClient() {
        if (clientClassName == null) {
            return new DefaultClient();
        } else {
            try {
                return (Client) Thread.currentThread().getContextClassLoader().loadClass(clientClassName).newInstance();
            } catch (Exception e) {
                throw new RuntimeException(e);
            }
        }
    }
586337
def from_connections(cls, caption, connections):
        """"""

        root = ET.Element('datasource', caption=caption, version='10.0', inline='true')
        outer_connection = ET.SubElement(root, 'connection')
        outer_connection.set('class', 'federated')
        named_conns = ET.SubElement(outer_connection, 'named-connections')
        for conn in connections:
            nc = ET.SubElement(named_conns,
                               'named-connection',
                               name=_make_unique_name(conn.dbclass),
                               caption=conn.server)
            nc.append(conn._connectionXML)
        return cls(root)
189909
def connection_factory(self, endpoint, *args, **kwargs):
        
        kwargs = self._make_connection_kwargs(endpoint, kwargs)
        return self.connection_class.factory(endpoint, self.connect_timeout, *args, **kwargs)
768262
function instantiateImports(
  n: Module,
  allocator: Allocator,
  externalElements: Object,
  internals: Object,
  moduleInstance: ModuleInstance
) {
  function getExternalElementOrThrow(key: string, key2: string): any {
    if (
      typeof externalElements[key] === "undefined" ||
      typeof externalElements[key][key2] === "undefined"
    ) {
      throw new CompileError(`Unknown import ${key}.${key2}`);
    }

    return externalElements[key][key2];
  }

  function handleFuncImport(node: ModuleImport, descr: FuncImportDescr) {
    const element = getExternalElementOrThrow(node.module, node.name);

    const params = descr.signature.params != null ? descr.signature.params : [];
    const results =
      descr.signature.results != null ? descr.signature.results : [];

    const externFuncinstance = externvalue.createFuncInstance(
      element,
      // $FlowIgnore
      params,
      results
    );

    const externFuncinstanceAddr = allocator.malloc(
      1 /* sizeof externFuncinstance */
    );
    allocator.set(externFuncinstanceAddr, externFuncinstance);

    moduleInstance.funcaddrs.push(externFuncinstanceAddr);
  }

  function handleGlobalImport(node: ModuleImport, descr: GlobalType) {
    const element = getExternalElementOrThrow(node.module, node.name);

    const externglobalinstance = externvalue.createGlobalInstance(
      new i32(element),
      descr.valtype,
      descr.mutability
    );

    const addr = allocator.malloc(1 /* size of the globalinstance struct */);
    allocator.set(addr, externglobalinstance);

    moduleInstance.globaladdrs.push(addr);
  }

  function handleMemoryImport(node: ModuleImport) {
    const memoryinstance = getExternalElementOrThrow(node.module, node.name);

    const addr = allocator.malloc(1 /* size of the memoryinstance struct */);
    allocator.set(addr, memoryinstance);

    moduleInstance.memaddrs.push(addr);
  }

  function handleTableImport(node: ModuleImport) {
    const tableinstance = getExternalElementOrThrow(node.module, node.name);

    const addr = allocator.malloc(1 /* size of the tableinstance struct */);
    allocator.set(addr, tableinstance);

    moduleInstance.tableaddrs.push(addr);
  }

  traverse(n, {
    ModuleImport({ node }: NodePath<ModuleImport>) {
      switch (node.descr.type) {
        case "FuncImportDescr":
          return handleFuncImport(node, node.descr);
        case "GlobalType":
          return handleGlobalImport(node, node.descr);
        case "Memory":
          return handleMemoryImport(node);
        case "Table":
          return handleTableImport(node);
        default:
          throw new Error("Unsupported import of type: " + node.descr.type);
      }
    }
  });
}
127366
private static <T> Flowable<Notification<T>> createWithParameters(Connection con, String sql,
            Flowable<List<Object>> parameterGroups, List<ParameterPlaceholder> parameterPlaceholders,
            BiFunction<NamedCallableStatement, List<Object>, Single<T>> single) {
        Callable<NamedCallableStatement> resourceFactory = () -> Util.prepareCall(con, sql, parameterPlaceholders);
        final Function<NamedCallableStatement, Flowable<Notification<T>>> flowableFactory = //
                stmt -> parameterGroups //
                        .flatMap(parameters -> single.apply(stmt, parameters).toFlowable()) //
                        .materialize() //
                        .doOnComplete(() -> Util.commit(stmt.stmt)) //
                        .doOnError(e -> Util.rollback(stmt.stmt));
        Consumer<NamedCallableStatement> disposer = Util::closeCallableStatementAndConnection;
        return Flowable.using(resourceFactory, flowableFactory, disposer, true);
    }
1038598
@SuppressWarnings("unchecked")
	public void registerTransport(String transportClazz) {
		if(transportClazz == null){
			return;
		}
		try {
			registerTransport((Class<Transport>)Class.forName(transportClazz));
		} catch (ClassNotFoundException e) {
			return;
		} catch(ClassCastException cce){
			throw new ApiTransportException(cce);
		}
	}
689241
static SQLTransform getNetTransform(TypeName typeName) {
		if (URL.class.getName().equals(typeName.toString())) {
			return new UrlSQLTransform();
		}

		return null;
	}
1125938
public void createControlAdapter()
  {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.entry(tc, "createControlAdapter");

    // The type of control adapter created depends on the type of destination
    // that we're working with
    if(!destinationHandler.isLink())
    {
      XmitPoint rqm =
        (XmitPoint) destinationHandler.getRemoteQueuePointControl(getLocalizingMEUuid(), true);
      controlAdapter = new XmitPointControl(rqm,
                                            this,                                        
                                            destinationHandler); 
    }
    else
    { 
      // Use the StreamSet's Control Adapter for the "link remote queue points"
      controlAdapter = 
        new LinkRemoteQueuePoint(destinationHandler, this);
    }                                          
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.exit(tc, "createControlAdapter", controlAdapter);
  }
1331709
def _instantiate(cls, params):
    
    sig_params = inspect.signature(cls.__init__).parameters
    valid_params = dict()
    for key, value in params.items():
        if key in sig_params:
            valid_params[key] = value
        else:
            logger.debug('Type %s does not support parameter \'%s\'' % (cls.__name__, key))
    return cls(**valid_params)
1276348
def inherited(subclass)
      subclass._arguments = []
      subclass._description = ''
      subclass._abstract = false
      subclass._skip_options = false
      subclass._exe_name = @_exe_name
      subclass._default_priority = @_default_priority.to_f / 2
      subclass._priority = 0
      super
    end