side effect: modifies the list
177283
private static void addDescriptorsToList(final List<FeatureDescriptor> descriptorList,
                                             final Map<String, Object> scopeMap)
    {
        for (Object name : scopeMap.keySet())
        {
            String strName = (String)name;
            Class<?> runtimeType = scopeMap.get(strName).getClass();
            descriptorList.add(makeDescriptor(strName, runtimeType));
        }
    }
1011707
static void overrideBlackList(List<String> originList, String overrideStr) {
        List<String> adds = new ArrayList<String>();
        String[] overrideItems = StringUtils.splitWithCommaOrSemicolon(overrideStr);
        for (String overrideItem : overrideItems) {
            if (StringUtils.isNotBlank(overrideItem)) {
                if (overrideItem.startsWith("!") || overrideItem.startsWith("-")) {
                    overrideItem = overrideItem.substring(1);
                    if ("*".equals(overrideItem) || "default".equals(overrideItem)) {
                        originList.clear();
                    } else {
                        originList.remove(overrideItem);
                    }
                } else {
                    if (!originList.contains(overrideItem)) {
                        adds.add(overrideItem);
                    }
                }
            }
        }
        if (adds.size() > 0) {
            originList.addAll(adds);
        }
    }
233305
def do_rmpostfix(self, arg):
        """"""
        altered = False
        if arg in self.curargs["functions"]:
            del self.curargs["functions"][arg]
            altered = True
        elif arg == "*":
            for varname in list(self.curargs["functions"].keys()):
                del self.curargs["functions"][varname]
            altered = True
        if altered:
            self.do_postfix("list")
552519
function edit(inst, list, index, argv, event, fin) {
    return function editCallback(err, data) {
        if (err) return fin(err);
        list[index] = data;
        return fin(null, list);
    };
}
936544
function removeFromList(imageIdIndex) {
    const index = stackPrefetch.indicesToRequest.indexOf(imageIdIndex);

    if (index > -1) {
      // Don't remove last element if imageIdIndex not found
      stackPrefetch.indicesToRequest.splice(index, 1);
    }
  }
778438
def uniquify_list(L):
    """"""
    return [e for i, e in enumerate(L) if L.index(e) == i]
248771
def _adjust_object_lists(obj):
    '''
    
    '''
    for subcomp in TEMPLATE_COMPONENT_DEF:
        if subcomp in obj and TEMPLATE_COMPONENT_DEF[subcomp]['adjust']:
            obj[subcomp] = [item[TEMPLATE_COMPONENT_DEF[subcomp]['qidname']] for item in obj[subcomp]]
606572
protected function updateListifyPositions()
    {
        $newPosition = $this->getListifyPosition();

        // check for duplicate positions and resolve them if required
        if (null === $newPosition) return;

        $count = $this->listifyScopedQuery()
            ->where($this->positionColumn(), $newPosition)
            ->count();

        if ($count < 2) return;

        $oldPosition = Arr::get($this->getOriginal(), $this->positionColumn(), false);

        if (false === $oldPosition) return;

        // reorder positions while excluding the current model
        $this->reorderPositionsOnItemsBetween($oldPosition, $newPosition, $this->id);
    }
253014
def execute_deferred_effects(self, pos):
        
        costs = 0
        to_delete = []
        for entry in self.__dict__['deferred_effects']:
            effect_pos, effect = entry
            if pos.startswith(effect_pos):
                costs += effect(self)
                to_delete.append(entry)
        # we delete afterwards, because Python cannot delete from a list that
        # is being iterated over without screwing up the iteration.
        for entry in to_delete:
            self.__dict__['deferred_effects'].remove(entry)
        return costs
599651
private <T> boolean addToListInternal(Collection<T> list, T value) {
        if (!list.contains(value)) {
            list.add(value);
            isModified = true;
            return true;
        } else {
            return false;
        }
    }
78555
protected void removeDuplicates ()
    {
        if (_size > 1) {
            int last = _values[0];
            for (int ii = 1; ii < _size; ) {
                if (_values[ii] == last) { // shift everything down 1
                    _size--;
                    System.arraycopy(_values, ii + 1, _values, ii, _size - ii);
                } else {
                    last = _values[ii++];
                }
            }
        }
    }
1087954
def makebunches_alter(data, commdct, theidf):
    """"""
    bunchdt = {}
    dt, dtls = data.dt, data.dtls
    for obj_i, key in enumerate(dtls):
        key = key.upper()
        objs = dt[key]
        list1 = []
        for obj in objs:
            bobj = makeabunch(commdct, obj, obj_i)
            list1.append(bobj)
        bunchdt[key] = Idf_MSequence(list1, objs, theidf)
    return bunchdt
251328
def trim(self, restriction_list):
        
        replacement = []
        for reference in restriction_list:
            replacement.append(self.get_attribute(reference))

        if self.has_duplicates(replacement):
            raise AttributeReferenceError('Duplicate attribute reference.')
        self._contents = replacement
143112
def _update_id_list(self):
        """"""
        self.id_list = [id(self.editor.tabs.widget(_i))
                        for _i in range(self.editor.tabs.count())]
718460
protected void appendDirtySprite (DirtyItemList list, Sprite sprite)
    {
        MisoUtil.screenToTile(_metrics, sprite.getX(), sprite.getY(), _tcoords);
        list.appendDirtySprite(sprite, _tcoords.x, _tcoords.y);
    }
778825
def fix_deplist(deps):
    
    deps = [
        ((dep.lower(),)
         if not isinstance(dep, (list, tuple))
         else tuple([dep_entry.lower()
                     for dep_entry in dep
                    ]))
        for dep in deps
    ]
    return deps
995760
def add_effect(effect_id, *args, **kwargs):
    ''''''
    effect = fiber.get_stack_var(SIDE_EFFECT_TAG)
    if effect is None:
        return False
    effect.add_effect(effect_id, *args, **kwargs)
    return True