Apply a list to something else.
324452
def applyIndex(self, lst, right):
    """"""
    if len(right) != 1:
      raise exceptions.EvaluationError('%r can only be applied to one argument, got %r' % (self.left, self.right))
    right = right[0]

    if isinstance(right, int):
      return lst[right]

    raise exceptions.EvaluationError("Can't apply %r to argument (%r): integer expected, got %r" % (self.left, self.right, right))
1297509
function(_items) {
        var list = new List();
        if(_items) list.push.apply(list, _items);
        return list;
      }
794667
def apply(self, ax):
        
        for th in self.themeables.values():
            th.apply(ax)
1281270
def extend(self, sequence):
        """"""
        self.__field.validate(sequence)
        return list.extend(self, sequence)
310874
function addGroupToList(group, list) {
    if (!group) {
      return list;
    }

    if (group.length > 1) {
      list.push(group);
    } else {
      list = list.concat(group);
    }

    return list;
  }
264924
def unlist(list_thing, complain=True):
    """"""
    if complain and len(list_thing) > 1:
        raise ValueError("More than one element in {}".format(list_thing))
    elif len(list_thing) == 1:
        return list_thing[0]

    if complain:
        raise ValueError("Nothing in {}".format(list_thing))
    return None
1028450
def flat_list(input_list):
    

    """
    x = input_list
    if isinstance(x, list):
        return [a for i in x for a in flat_list(i)]
    else:
        return [x]
93390
private void addToList(List<Object> list, Object value) {
    if (value instanceof List) {
      list.addAll((List) value);
    } else {
      list.add(value);
    }
  }
159757
def _process_exlist(self, exc, raised):
        """"""
        if (not raised) or (raised and exc.endswith("*")):
            return exc[:-1] if exc.endswith("*") else exc
        return None
21033
private static List<String> addToList(List<String> list, String part, boolean isTrim, boolean ignoreEmpty){
		if(isTrim){
			part = StrUtil.trim(part);
		}
		if(false == ignoreEmpty || false == part.isEmpty()){
			list.add(part);
		}
		return list;
	}
1000122
public void apply(List items) {
        //If the list is empty avoid sorting and adding headers.
        int size = items.size();
        if (size > 0) {
            //sort beforehand
            if (comparator != null) {
                Collections.sort(items, comparator);
            }

            //we have to get the list size each time, as we will add the headers to it
            for (int i = -1; i < size; i++) {
                HeaderItem headerItem;
                if (i == -1) {
                    headerItem = groupingFunction.group(null, (Item) items.get(i + 1), i);
                } else if (i == size - 1) {
                    headerItem = groupingFunction.group((Item) items.get(i), null, i);
                } else {
                    headerItem = groupingFunction.group((Item) items.get(i), (Item) items.get(i + 1), i);
                }

                if (headerItem != null) {
                    items.add(i + 1, headerItem);
                    i = i + 1;
                    size = size + 1;
                }
            }
        }

        /**
         * set the sorted list to the modelAdapter if provided
         */
        if (modelAdapter != null) {
            modelAdapter.set(items);
        }
    }
15964
def do_list(self, arglist: List[str]) -> None:
        """"""
        if arglist:
            first = arglist[0]
            try:
                first = int(first)
            except ValueError:
                first = 1
        else:
            first = 1
        last = first + 10

        for x in range(first, last):
            self.poutput(str(x))
918636
def indent_list(inlist, level):
    """"""

    indent = ' '*level
    joinstr = '\n' + indent

    retval = joinstr.join(inlist)
    return indent + retval
624920
def cut(list_, index=0):
    """"""
    if isinstance(index, int):
        cut_ = lambda x: x[index]
    else:
        cut_ = lambda x: getattr(x, index)
    return list(map(cut_, list_))
489788
public void setList(List<?> list) {
		this.checkNull(list);
		this.list.add(list);
		this.type.add(List.class);
	}
1206295
def p_lconcatlist(self, p):
        ''
        p[0] = p[1] + (p[3],)
        p.set_lineno(0, p.lineno(1))
866910
def process_lists(self):
        """"""
        for l1_idx, obj1 in enumerate(self.l1):
            for l2_idx, obj2 in enumerate(self.l2):
                if self.equal(obj1, obj2):
                    self.matches.add((l1_idx, l2_idx))