Construct a StreamVariantsRequest for the Contig using a prototype using a prototype request.

@param prototype A partially filled in request object.
@return the request object
555804
public StreamVariantsRequest getStreamVariantsRequest(StreamVariantsRequest prototype) {
    return StreamVariantsRequest.newBuilder(prototype)
        .setReferenceName(referenceName)
        .setStart(start)
        .setEnd(end)
        .build();
  }
712902
public RendererBuilder<T> withPrototypes(Collection<? extends Renderer<? extends T>> prototypes) {
    if (prototypes == null) {
      throw new NeedsPrototypesException(
          "RendererBuilder has to be created with a non null collection of"
              + "Collection<Renderer<T> to provide new or recycled Renderer instances");
    }
    this.prototypes.addAll(prototypes);
    return this;
  }
725381
public static <T> Stream<T> parallelConcat(final Collection<? extends Stream<? extends T>> c) {
        return parallelConcat(c, DEFAULT_READING_THREAD_NUM);
    }
1241057
@Deprecated
  public StreamVariantsRequest getStreamVariantsRequest(String variantSetId) {
    return StreamVariantsRequest.newBuilder()
        .setVariantSetId(variantSetId)
        .setReferenceName(referenceName)
        .setStart(start)
        .setEnd(end)
        .build();
  }
430626
protected CommonToken createToken(CommonToken prototype, String text, 
			Integer charPosInLine, Integer channel, Integer start, Integer stop, Integer type) {
		if (prototype == null)
			throw new IllegalArgumentException("Prototype may not be null.");
		CommonToken result = new CommonToken(prototype);
		if (text != null)
			result.setText(text);
		if (charPosInLine != null)
			result.setCharPositionInLine(charPosInLine.intValue());
		if (channel != null)
			result.setChannel(channel.intValue());
		if (start != null)
			result.setStartIndex(start.intValue());
		if (stop != null)
			result.setStopIndex(stop.intValue());
		if (type != null)
			result.setType(type.intValue());
		return result;
	}
1003774
@ExperimentalApi("https://github.com/grpc/grpc-java/issues/2861")
  public CallOptions withStreamTracerFactory(ClientStreamTracer.Factory factory) {
    CallOptions newOptions = new CallOptions(this);
    ArrayList<ClientStreamTracer.Factory> newList =
        new ArrayList<>(streamTracerFactories.size() + 1);
    newList.addAll(streamTracerFactories);
    newList.add(factory);
    newOptions.streamTracerFactories = Collections.unmodifiableList(newList);
    return newOptions;
  }
1106435
private static <ReqT, RespT> ServerCallHandler<ReqT, RespT> asyncStreamingRequestCall(
      StreamingRequestMethod<ReqT, RespT> method) {
    return new StreamingServerCallHandler<>(method);
  }
1000310
public <R> Stream<R> invokeAnd(Function<C, R> invoker) {
			Function<C, InvocationResult<R>> mapper = (callbackInstance) -> invoke(
					callbackInstance, () -> invoker.apply(callbackInstance));
			return this.callbackInstances.stream().map(mapper)
					.filter(InvocationResult::hasResult).map(InvocationResult::get);
		}
189523
private void copyRequestHeaders(HttpServletRequest servletRequest, HttpRequest proxyRequest)
            throws URISyntaxException {
        // Get an Enumeration of all of the header names sent by the client
        Enumeration<?> enumerationOfHeaderNames = servletRequest.getHeaderNames();
        while (enumerationOfHeaderNames.hasMoreElements()) {
            String headerName = (String) enumerationOfHeaderNames.nextElement();
            //Instead the content-length is effectively set via InputStreamEntity
            if (!headerName.equalsIgnoreCase(CONTENT_LENGTH) && !hopByHopHeaders.containsHeader(headerName)) {
                Enumeration<?> headers = servletRequest.getHeaders(headerName);
                while (headers.hasMoreElements()) {//sometimes more than one value
                    String headerValue = (String) headers.nextElement();
                    // In case the proxy host is running multiple virtual servers,
                    // rewrite the Host header to ensure that we get content from
                    // the correct virtual server
                    if (headerName.equalsIgnoreCase(HOST)) {
                        HttpHost host = URIUtils.extractHost(new URI(prerenderConfig.getPrerenderServiceUrl()));
                        headerValue = host.getHostName();
                        if (host.getPort() != -1) {
                            headerValue += ":" + host.getPort();
                        }
                    }
                    proxyRequest.addHeader(headerName, headerValue);
                }
            }
        }
    }
231622
function streamFactory( options ) {
		if ( !arguments.length ) {
			options = {};
		}
		options = copyOptions( options );
		/**
		* FUNCTION: createStream( value )
		*	Creates a stream.
		*
		* @param {*} value - value to be appended
		* @returns {Stream} Transform stream
		*/
		return function createStream( value ) {
			return new Stream( value, options );
		};
	}
989007
public static <T> Stream<T> buildConcatStream(List<T> sample1,
            List<T> sample2) {
        return Stream.concat(sample1.stream(), sample2.stream());
    }
897141
public final static <T, R> Stream<R> concatMapterable(final Stream<T> stream, final Function<? super T, ? extends Iterable<? extends R>> fn) {
        return stream.flatMap(fn.andThen(c -> stream(c)));

    }
537146
public static Builder copyOf(final Link prototype) {
        return new Builder(prototype.rel, prototype.href)
                .withType(prototype.type)
                .withProfile(prototype.profile)
                .withTitle(prototype.title)
                .withName(prototype.name)
                .withDeprecation(prototype.deprecation)
                .withHrefLang(prototype.hreflang);
    }
382520
function(extnds) {
      var prototype = this.findBasePrototype(extnds);
      if (!prototype) {
        // create a prototype based on tag-name extension
        var prototype = HTMLElement.getPrototypeForTag(extnds);
        // insert base api in inheritance chain (if needed)
        prototype = this.ensureBaseApi(prototype);
        // memoize this base
        memoizedBases[extnds] = prototype;
      }
      return prototype;
    }
1177456
@SuppressWarnings("WeakerAccess")
  public CreateInstanceRequest setType(@Nonnull Instance.Type type) {
    Preconditions.checkNotNull(type);
    Preconditions.checkArgument(type != Instance.Type.UNRECOGNIZED, "Type is unrecognized");
    builder.getInstanceBuilder().setType(type.toProto());
    return this;
  }
616587
function concatStream(list) {
  list = list.map(toStream);
  const transform = transformWithCancel(async function(reason) {
    await Promise.all(transforms.map(stream => cancel(stream, reason)));
  });
  let prev = Promise.resolve();
  const transforms = list.map((stream, i) => transformPair(stream, (readable, writable) => {
    prev = prev.then(() => pipe(readable, transform.writable, {
      preventClose: i !== list.length - 1
    }));
    return prev;
  }));
  return transform.readable;
}
192138
@Nullable
    private Request makeRequest(List<MobileEventJson> batch) throws IOException {
        if (batch.isEmpty()) {
            return null;
        }

        Sift.Config config = configProvider.getConfig();

        if (config == null) {
            Log.d(TAG, "Missing Sift.Config object");
            return null;
        }

        if (config.accountId == null || config.beaconKey == null || config.serverUrlFormat == null) {
            Log.d(TAG, "Missing account ID, beacon key, and/or server URL format");
            return null;
        }

        if (batch.isEmpty()) {
            Log.d(TAG, "Batch is null or empty");
            return null;
        }

        URL url = new URL(String.format(config.serverUrlFormat, config.accountId));

        final String encodedBeaconKey = Base64.encodeToString(
                config.beaconKey.getBytes(US_ASCII), Base64.NO_WRAP);

        Map<String, String> headers = new HashMap<String, String>();
        headers.put("Authorization", "Basic " + encodedBeaconKey);
        headers.put("Accept", "application/json");
        headers.put("Content-Encoding", "gzip");
        headers.put("Content-Type", "application/json");

        ListRequestJson request = new ListRequestJson()
                .withData(Collections.<Object>unmodifiableList(batch));

        ByteArrayOutputStream os = new ByteArrayOutputStream();
        OutputStream gzip = new GZIPOutputStream(os);
        Writer writer = new OutputStreamWriter(gzip, UTF8);
        Sift.GSON.toJson(request, writer);
        writer.close();

        Log.d(TAG, String.format("Built HTTP request for batch of size %d", batch.size()));

        return new Request.Builder()
                .withMethod("PUT")
                .withUrl(url)
                .withHeaders(headers)
                .withBody(os.toByteArray())
                .build();
    }