regardless of its future position in the list from other modifications
510343
public Node<E> append(E value, int maxSize)
    {
        Node<E> newTail = new Node<>(randomLevel(), value);

        lock.writeLock().lock();
        try
        {
            if (size >= maxSize)
                return null;
            size++;

            Node<E> tail = head;
            for (int i = maxHeight - 1 ; i >= newTail.height() ; i--)
            {
                Node<E> next;
                while ((next = tail.next(i)) != null)
                    tail = next;
                tail.size[i]++;
            }

            for (int i = newTail.height() - 1 ; i >= 0 ; i--)
            {
                Node<E> next;
                while ((next = tail.next(i)) != null)
                    tail = next;
                tail.setNext(i, newTail);
                newTail.setPrev(i, tail);
            }

            return newTail;
        }
        finally
        {
            lock.writeLock().unlock();
        }
    }
161683
def unique_list(seq):
    
    seen = set()
    seen_add = seen.add
    return [x for x in seq if not (x in seen or seen_add(x))]
956958
private <T> List<T> immutableAdd(List<T> list, T element) {
      List<T> result = new ArrayList<T>(list);
      result.add(element);
      return Collections.unmodifiableList(result);
   }
361437
function positionInNodeList(element, nodeList) {
  for (var i = 0; i < nodeList.length; i++) {
    if (element === nodeList[i]) {
      return i;
    }
  }
  return -1;
}
791799
def fixed(self):
        
        decision = False
        for record in self.history:
            # Completely ignore older changes
            if record["when"] < self.options.since.date:
                continue
            # Look for status change to MODIFIED (unless already found)
            if not decision and record["when"] < self.options.until.date:
                for change in record["changes"]:
                    if (change["field_name"] == "status"
                            and change["added"] == "MODIFIED"
                            and change["removed"] != "CLOSED"):
                        decision = True
            # Make sure that the bug has not been later moved to ASSIGNED.
            # (This would mean the issue has not been fixed properly.)
            else:
                for change in record["changes"]:
                    if (change["field_name"] == "status"
                            and change["added"] == "ASSIGNED"):
                        decision = False
        return decision
1232537
function listNext(node, pred) {
  pred = pred || func.fail;

  const nodes = [];
  while (node) {
    if (pred(node)) { break; }
    nodes.push(node);
    node = node.nextSibling;
  }
  return nodes;
}
403624
def _update_inplace(self, result, verify_is_copy=True):
        
        # NOTE: This does *not* call __finalize__ and that's an explicit
        # decision that we may revisit in the future.

        self._reset_cache()
        self._clear_item_cache()
        self._data = getattr(result, '_data', result)
        self._maybe_update_cacher(verify_is_copy=verify_is_copy)
532717
function (list, e, item) {
			this.options.todos.push(item);
			// Reset the filter so that you always see your new todo
			this.options.state.attr('filter', '');
		}
1322059
def update_list(self, list_id, revision, title=None, public=None):
        '''  '''
        return lists_endpoint.update_list(self, list_id, revision, title=title, public=public)
797324
def symmetric_difference_update(self, that):
        
        _set = self._set
        _list = self._list
        _set.symmetric_difference_update(that)
        _list.clear()
        _list.update(_set)
        return self
1068056
def p_always(self, p):
        ''
        p[0] = Always(p[2], p[3], lineno=p.lineno(1))
        p.set_lineno(0, p.lineno(1))
581919
def position_result_list(change_list):
    
    result = result_list(change_list)
    # Remove sortable attributes
    for x in range(0, len(result['result_headers'])):
        result['result_headers'][x]['sorted'] = False
        if result['result_headers'][x]['sortable']:
            result['result_headers'][x]['class_attrib'] = mark_safe(
                ' class="sortable"')
    # Append position <th> element
    result['result_headers'].append({
        'url_remove': '?o=',
        'sort_priority': 1,
        'sortable': True,
        'class_attrib': mark_safe(' class="sortable sorted ascending"'),
        'sorted': True,
        'text': 'position',
        'ascending': True,
        'url_primary': '?o=-1',
        'url_toggle': '?o=-1',
    })
    # Append the editable field to every result item
    for x in range(0, len(result['results'])):
        obj = change_list.result_list[x]
        # Get position object
        c_type = ContentType.objects.get_for_model(obj)
        try:
            object_position = ObjectPosition.objects.get(
                content_type__pk=c_type.id, object_id=obj.id)
        except ObjectPosition.DoesNotExist:
            object_position = ObjectPosition.objects.create(content_object=obj)
        # Add the <td>
        html = ('<td><input class="vTextField" id="id_position-{0}"'
                ' maxlength="10" name="position-{0}" type="text"'
                ' value="{1}" /></td>').format(object_position.id,
                                               object_position.position)
        result['results'][x].append(mark_safe(html))
    return result
53522
def append(self, future):
        
        future.prev = self.tail
        if self.tail is None:
            assert self.head is None
            self.head = future
        else:
            self.tail.next = future
        self.tail = future
        # Once done, it will be removed from the list.
        future.add_done_callback(self.remove)
144786
def modifyInPlace(self, *, sort=None, purge=False, done=None):
        """"""
        self.data = self.modify(sort=sort, purge=purge, done=done)
1193190
function _in_list(in_item, list, comparator){

	var retval = false;
	for(var li = 0; li < list.length; li++ ){
	    var list_item = list[li];

	    if( comparator ){
		var comp_op = comparator(in_item, list_item);
		if( comp_op && comp_op == true ){
		    retval = true;
		}
	    }else{
		if( in_item == list_item ){
		    retval = true;
		}
	    }
	}

	return retval;
    }
82324
public function updateList(&$list){
		if($this->modelIsMultiSitesAware()){
			$site = $this->getActiveSite();
			if ($site) {
				$list = $list->filter('SiteID', $site->ID);
			}
		}
	}
845419
private boolean isUnidirestionalList(RelationshipList list) {
        if (list.size() > 0) {
            try {
                if (((AsymmetricRelationship) list.get(0)).getCommonParentIndex() == 0) {
                    return true;
                }
            } catch (java.lang.IndexOutOfBoundsException ex) {
                return true;
            }
        }
        return false;
    }