Static factory method for creating an HList from the given head and tail.

@param head   the head element
@param tail   the tail HList
@param <Head> the head type
@param <Tail> the tail type
@return the newly created HList
553850
public static <Head, Tail extends HList> HCons<Head, Tail> cons(Head head, Tail tail) {
        return new HCons<>(head, tail);
    }
864111
def create_head(nf:int, nc:int, lin_ftrs:Optional[Collection[int]]=None, ps:Floats=0.5,
                concat_pool:bool=True, bn_final:bool=False):
    ""
    lin_ftrs = [nf, 512, nc] if lin_ftrs is None else [nf] + lin_ftrs + [nc]
    ps = listify(ps)
    if len(ps) == 1: ps = [ps[0]/2] * (len(lin_ftrs)-2) + ps
    actns = [nn.ReLU(inplace=True)] * (len(lin_ftrs)-2) + [None]
    pool = AdaptiveConcatPool2d() if concat_pool else nn.AdaptiveAvgPool2d(1)
    layers = [pool, Flatten()]
    for ni,no,p,actn in zip(lin_ftrs[:-1], lin_ftrs[1:], ps, actns):
        layers += bn_drop_lin(ni, no, True, p, actn)
    if bn_final: layers.append(nn.BatchNorm1d(lin_ftrs[-1], momentum=0.01))
    return nn.Sequential(*layers)
1105476
public RequestBuilder head(final String url) {

    checkNotNull(url, "url may not be null");
    final AsyncHttpClient.BoundRequestBuilder ningRequestBuilder = asyncHttpClient.prepareHead(url);
    return createNewRequestBuilder(url, ningRequestBuilder);
  }
481852
private static List<Argument> separate(List<RelatedArgument> heads, List<RelatedArgument> tails) {
        List<Argument> merge;

        merge = new ArrayList<Argument>();
        for (RelatedArgument head : heads) {
            merge.add(head.arg);
            tails.addAll(head.nexts);
        }
        return merge;
    }
671038
@SuppressWarnings("unchecked")
	public T head() {
		T ret;
		if (JcRelation.class.equals(type)) {
			ret = (T) new JcRelation(null, this, 
					new FunctionInstance(FUNCTION.Collection.HEAD, 1));
		} else if (JcNode.class.equals(type)) {
			ret = (T) new JcNode(null, this, 
					new FunctionInstance(FUNCTION.Collection.HEAD, 1));
		} else {
			ret = (T) new JcValue(null, this, 
					new FunctionInstance(FUNCTION.Collection.HEAD, 1));
		}
		QueryRecorder.recordInvocationConditional(this, "head", ret);
		return ret;
	}
354108
public Instruction createList(final Instruction _newTail) {
      Instruction childExprHead = null;
      if (_newTail == null) {
         childExprHead = head;
         tail = head = null;
      } else {
         childExprHead = _newTail.getNextExpr();
         tail = _newTail;
         _newTail.setNextExpr(null);
         if (childExprHead != null) {
            childExprHead.setPrevExpr(null);
         }

      }
      return (childExprHead);
   }
771941
public static <T> List<T> createWhenNull(final List<T> list) {
        if (list == null) {
            return new ArrayList<T>();
        } else {
            return list;
        }
    }
1033822
public static <Head, Tail extends HList> Lens.Simple<HCons<Head, ? extends Tail>, Tail> tail() {
        return simpleLens(HCons::tail, (hCons, newTail) -> cons(hCons.head(), newTail));
    }
637860
static Matcher head(Matcher matcher) {
    if (matcher instanceof SeqMatcher) {
      List<Matcher> ms = matcher.<SeqMatcher>as().matchers();
      return ms.get(0);
    } else {
      return matcher;
    }
  }
195132
function LinkedList( ... elements ) {
	this.head = null ;
	this.tail = null ;
	this.length = 0 ;

	if ( elements.length ) {
		this.push( ... elements ) ;
	}
}
2356
public List<Type> newInstances(List<Type> tvars) {
        List<Type> tvars1 = tvars.map(newInstanceFun);
        for (List<Type> l = tvars1; l.nonEmpty(); l = l.tail) {
            TypeVar tv = (TypeVar) l.head;
            tv.bound = subst(tv.bound, tvars, tvars1);
        }
        return tvars1;
    }
11073
public <T> List<T> cloneList(List<T> list) {
        return new ArrayList<T>(list);
    }
410315
public static <T> DecomposableMatchBuilder0<List<T>> headNil(MatchesExact<T> head) {
    List<Matcher<Object>> matchers = Lists.of(ArgumentMatchers.eq(head.t));
    return new DecomposableMatchBuilder0<List<T>>(matchers, new ListConsHeadFieldExtractor<>());
  }
817298
public static final <S, E> Functional<S> functionalList(List<E> list) {
		return new FunctionalList<S, E>(list); 
	}
257007
public T removeHead() {
		if( first == null )
			throw new IllegalArgumentException("Empty list");

		T ret = first.getObject();
		Element<T> e = first;
		available.push(first);

		if( first.next != null ) {
			first.next.previous = null;
			first = first.next;
		} else {
			// there's only one element in the list
			first = last = null;
		}
		e.clear();
		size--;
		return ret;
	}
576219
static <T> ListFactory<T> arrayListFactoryWithFirstElement(final T first) {
    return new ListFactory<T>() {
      @Override List<T> newList() {
        ArrayList<T> list = Lists.arrayList();
        list.add(first);
        return list;
      }
    };
  }
322956
public float[] subVector(float[] z, int head, int tail) {
    int size = tail - head + 1;
    float[] result = new float[size];

    System.arraycopy(z, head, result, head - head, tail + 1 - head);

    return result;
  }