remove list items that are restricted to some user or user group.
496418
public function RemoveRestrictedItems()
    {
        // since this is a tcmsrecord list, we need to collect all valid ids, and the reload the list with them
        $aValidIds = array();
        $this->GoToStart();
        while ($oItem = &$this->Next()) {
            if ($oItem->IsPublic()) {
                $aValidIds[] = MySqlLegacySupport::getInstance()->real_escape_string($oItem->id);
            }
        }

        $query = 'SELECT `shop_shipping_type`.*
                  FROM `shop_shipping_type`
                 WHERE ';
        if (count($aValidIds) > 0) {
            $query .= " `shop_shipping_type`.`id` IN ('".implode("','", $aValidIds)."') ";
        } else {
            $query .= ' 1 = 0 ';
        }
        $query .= ' ORDER BY `shop_shipping_type`.`position`';
        $this->Load($query);
    }
518575
def remove_each(text, items, count=None, strip=False):
    '''
    
    '''
    for item in items:
        text = remove(text, item, count=count, strip=strip)
    return text
836227
def remove(self, items):
        """"""
        with _presub_lock:
            self.load_from_cloud()
            for entry in utils.ensure_listable(items):
                # remove all matching entries
                while entry in self.current:
                    self.current.remove(entry)
            self.save_to_cloud()
1132735
def filter(self, table, users, filter_string):
        """"""
        q = filter_string.lower()
        return [user for user in users
                if (q in user.name.lower() or
                    q in (getattr(user, 'email', None) or '').lower())]
1108825
def limit(self, keys):
        ''' 
        '''
        if not isinstance(keys, list) and not isinstance(keys, tuple):
            keys = [keys]
        remove_keys = [k for k in self.keys() if k not in keys]
        for k in remove_keys:
            self.pop(k)
454926
def remove(config, username, filename, force):
        """"""
        client = Client()
        client.prepare_connection()
        user_api = UserApi(client)
        key_api = API(client)
        key_api.remove(username, user_api, filename, force)
1077571
def remove_selected_classification(self):
        """"""
        removed_classes = self.hazard_class_form.selectedItems()
        current_item = self.hazard_class_form.currentItem()
        removed_index = self.hazard_class_form.indexFromItem(current_item)
        del self.classification[removed_index.row()]
        for item in removed_classes:
            self.hazard_class_form.takeItem(
                self.hazard_class_form.row(item))
375334
public void pruneZeroCounts() {
        int i = 0;
        while (i < rankedItems.size()) {
            if (rankedItems.get(i).getCount() == 0) {
                rankedItems.remove(i);
            } else {
                i++;
            }
        }
    }
987479
def purgeAutoSelected(self):
        """"""
        params = self._autoParams.allData()
        for p in params:
            comps_to_remove = []
            for comp in p['selection']:
                if self.indexByComponent(comp) is None:
                    comps_to_remove.append(comp)
            for orphaned in comps_to_remove:
                p['selection'].remove(orphaned)
88930
def delete_users(user_list)
      raise ArgumentError unless user_list.is_a?(Array)
      validate_user_list(user_list)
      api.post('deleteUsers', user_list, 'application/json')
    end
113424
def remove_historical_group_permissions(group=None, allowed_permissions=None):
    
    allowed_permissions = allowed_permissions or ["view"]

    for action in allowed_permissions:
        for permission in group.permissions.filter(
            codename__contains="historical"
        ).exclude(codename__startswith=action):
            group.permissions.remove(permission)
122719
def cleanup(self):
        """"""
        for item in self.server_map:
            self.member_del(item, reconfig=False)
        self.server_map.clear()
832874
def remove(self, toRemove):
        '''
            
        '''
        list.remove(self, toRemove)
        self.uids.remove(toRemove.uid)
644593
def remove(self, item):
        
        self.real_list.remove(item)
        self._items.remove(item)
425301
def delete_attribute_group_items(attributegroupitems, **kwargs):

    


    user_id=kwargs.get('user_id')

    log.info("Deleting %s attribute group items", len(attributegroupitems))

    #if there area attributegroupitems from different networks, keep track of those
    #networks to ensure the user actually has permission to remove the items.
    network_lookup = {}

    if not isinstance(attributegroupitems, list):
        raise HydraError("Cannpt add attribute group items. Attributegroupitems must be a list")

    #'agi' = shorthand for 'attribute group item'
    for agi in attributegroupitems:

        network_i = network_lookup.get(agi.network_id)

        if network_i is None:
            network_i = _get_network(agi.network_id)
            network_lookup[agi.network_id] = network_i

        network_i.check_write_permission(user_id)

        agi_i = db.DBSession.query(AttrGroupItem).filter(AttrGroupItem.network_id == agi.network_id,
                                                 AttrGroupItem.group_id == agi.group_id,
                                                 AttrGroupItem.attr_id  == agi.attr_id).first()

        if agi_i is not None:
            db.DBSession.delete(agi_i)

    db.DBSession.flush()

    log.info("Attribute group items deleted")

    return 'OK'
1185166
def remove_groups_from_user(id, group_list = [])
      wf_user_id?(id)
      validate_usergroup_list(group_list)
      api.post([id, 'removeUserGroups'].uri_concat, group_list,
               'application/json')
    end
949135
function removeDuplicates(items) {
    var temp = {}, result = [], x, i = items.length;
    while (i--) {
      x = getData(items[i], 'id', true);
      if (!temp.hasOwnProperty(x)) {
        temp[x] = 1;
        result.push(items[i]);
      }
    }
    return result;
  }