Return the item with the lowest priority and remove it.

        Raises IndexError if the object is empty.
341695
def pop_smallest(self):
        

        heap = self._heap
        v, k = heappop(heap)
        while k not in self or self[k] != v:
            v, k = heappop(heap)
        del self[k]
        return k
1152731
def popitem(self):
        """"""
        try:
            key = self.__choice(list(self))
        except IndexError:
            raise KeyError('%s is empty' % self.__class__.__name__)
        else:
            return (key, self.pop(key))
213752
def sort_item(iterable, number, reverse=False):
    """"""
    return sorted(iterable, key=itemgetter(number), reverse=reverse)
321963
def _poplast(self):
        """"""

        try:
            tup = self.data.pop()
        except IndexError as ex:
            ex.args = ('DEPQ is already empty',)
            raise

        self_items = self.items

        try:
            self_items[tup[0]] -= 1
            if self_items[tup[0]] == 0:
                del self_items[tup[0]]
        except TypeError:
            r = repr(tup[0])
            self_items[r] -= 1
            if self_items[r] == 0:
                del self_items[r]

        return tup
510246
def get(self, key, default=None):
        
        try:
            return self.items[key]
        except IndexError:
            return value(default)
978517
def addfirst(self, item, new_priority=None):
        """"""

        with self.lock:

            self_data = self.data

            try:
                priority = self_data[0][1]
                if new_priority is not None:
                    if new_priority < priority:
                        raise ValueError('Priority must be >= '
                                         'highest priority.')
                    else:
                        priority = new_priority
            except IndexError:
                priority = 0 if new_priority is None else new_priority

            self_data.appendleft((item, priority))
            self_items = self.items
            maxlen = self._maxlen

            try:
                self_items[item] += 1
            except TypeError:
                self_items[repr(item)] += 1

            if maxlen is not None and maxlen < len(self_data):
                self._poplast()
891414
def pop_min(self):
        

        if self.root is NULL:
            raise KeyError("pop from an empty blackjack")

        self.root, value = self.root.delete_min()
        self._len -= 1
        return value
143682
def first(self, callback=None, default=None):
        
        if callback is not None:
            for val in self.items:
                if callback(val):
                    return val

            return value(default)

        if len(self.items) > 0:
            return self.items[0]
        else:
            return default
245498
def get(self, item, default=None):
        
        if hasattr(self, item):
            return getattr(self, item)
        try:
            return self.__getitem__(item)

        except KeyError:
            return default
1173153
def min(self):
        
        if(self._clean.isDict()):
            return self._wrap(list())
        return self._wrap(min(self.obj))
1142417
function remove (arr, item) {
  if (arr.length) {
    var index = arr.indexOf(item);
    if (index > -1) {
      return arr.splice(index, 1)
    }
  }
}
49611
def remove(self, item):
        """"""
        for entry in self:
            if item.lower() == entry.lower():
                list.remove(self, entry)
                return
        raise ValueError(': list.remove(x): x not in list')
728173
def _priority(s):
    """"""
    if type(s) in (list, tuple, set, frozenset):
        return ITERABLE
    if type(s) is dict:
        return DICT
    if issubclass(type(s), type):
        return TYPE
    if hasattr(s, "validate"):
        return VALIDATOR
    if callable(s):
        return CALLABLE
    else:
        return COMPARABLE
774957
def remove(self, index):
        ''''''
        newtree = LookupTree()
        newtree.root = _remove_down(self.root, index, 0)
        return newtree
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
1159704
def popitem(self):
        """"""
        try:
            (key, _), = self.__counter.most_common(1)
        except ValueError:
            raise KeyError('%s is empty' % self.__class__.__name__)
        else:
            return (key, self.pop(key))
408932
def process_item(self, item, spider):  # pylint: disable=unused-argument
        ""
        url = URLObject(item["url"])
        if url.path.startswith("/api/"):
            raise DropItem(u"Dropping DRF url {url}".format(url=url))
        else:
            return item