Remove all the IN_ADVANCE items for which we have no invoice items
559385
private void build() {
        // nextRecurringDate are computed based on *proposed* items, and not missing items (= proposed - existing). So
        // we need to filter out the dates for which there is no item left otherwsie we may end up in creating too many notification dates
        // and in particular that could lead to an infinite loop.
        for (final UUID subscriptionId : perSubscriptionFutureNotificationDates.keySet()) {
            final SubscriptionFutureNotificationDates tmp = perSubscriptionFutureNotificationDates.get(subscriptionId);
            if (tmp.getRecurringBillingMode() == BillingMode.IN_ADVANCE && !hasItemsForSubscription(subscriptionId, InvoiceItemType.RECURRING)) {
                tmp.resetNextRecurringDate();
            }
        }
        if (invoice != null && invoice.getInvoiceItems().isEmpty()) {
            invoice = null;
        }
    }
150337
def clear_info(self):
        """"""
        self._version_text = None
        self._inventory_text = None
        self._users_text = None
        self.os_version = None
        self.os_type = None
        self.family = None
        self.platform = None
        self.udi = None
        # self.is_console = None
        self.prompt = None
        self.prompt_re = None
137970
def drop_unused_terms(self):
		'''
		
		'''
		self.term_doc_mat = self.term_doc_mat.remove_terms(
			set(self.term_doc_mat.get_terms()) - set(self.priors.index)
		)
		self._reindex_priors()
		return self
1113576
private function DeleteOldLogItems()
    {
        $days = SettingsProxy::Singleton()->Settings()->GetLogLifetime();
        $deleteBefore = Date::Now();
        $deleteBefore->AddDays(-$days);
        $tblLogItem = LogItem::Schema()->Table();
        $sql = Access::SqlBuilder();
        $where = $sql->LT($tblLogItem->Field('Changed'), $sql->Value($deleteBefore));
        LogItem::Schema()->Delete($where);
    }
266842
def trim(self):
        ''''''
        now_time = time.time()

        while self._seq and self._seq[0].expire_time < now_time:
            item = self._seq.popleft()
            del self._map[item.key]

        if self._max_items:
            while self._seq and len(self._seq) > self._max_items:
                item = self._seq.popleft()
                del self._map[item.key]
36488
protected function filterEmpty()
    {
        $vars = $this->toArray();
        foreach ($vars as $name => $value) {
            if (!strlen($value)) {
                unset($this->{$name});
            }
        }
    }
1048041
function (invoiceitem, cb) {

		Invoiceitem.destroy(invoiceitem.id)
	    .exec(function (err, destroyedInvoiceitems){
	      if (err) return cb(err);
	      if (!destroyedInvoiceitems) return cb(null, null);
	      Invoiceitem.afterStripeInvoiceitemDeleted(destroyedInvoiceitems[0], function(err, invoiceitem){
	      	cb(err, invoiceitem);
	      });
	    });
	}
1343410
def get_without_invoice(self):
        
        qs = Transaction.objects.filter(
            children__isnull=True, invoice__isnull=True)
        return qs
511548
def clear(self, omit_item_evicted=False):
        """"""
        if not omit_item_evicted:
            items = self._dict.items()
            for key, value in items:
                self._evict_item(key, value)
        self._dict.clear()
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()
1193846
def clear(self):
        
        self._filters = []
        self._order_by = OrderedDict()
        self._selects = set()
        self._negation = False
        self._attribute = None
        self._chain = None
        self._search = None

        return self
871683
function removeDuplicates(collection) {
  return collection.filter(function(e, i, arr) {
    return isValue(e) && arr.lastIndexOf(e) === i;
  });
}
413976
def _not_none(items):
    """"""
    if not isinstance(items, (tuple, list)):
        items = (items,)
    return all(item is not _none for item in items)
972935
def remove_redundant_items(items):
    # type: (List[AbstractType]) -> List[AbstractType]
    """"""
    result = []
    for item in items:
        for other in items:
            if item is not other and is_redundant_union_item(item, other):
                break
        else:
            result.append(item)
    return result
383039
def remove_defaults(self, *args):
        '''
        
        '''
        for arg in args:
            if arg not in self.defaults:
                raise KeyError('{0}'.format(arg))
        return self.discard_defaults(*args)
490373
def _skip_remove(self):
        
        if "--checklist" not in self.extra:
            self.msg.template(78)
            print("| Insert packages to exception remove:")
            self.msg.template(78)
            try:
                self.skip = raw_input(" > ").split()
            except EOFError:
                print("")
                raise SystemExit()
        for s in self.skip:
            if s in self.removed:
                self.removed.remove(s)
1318046
protected function removeNotImportantRemainingActions()
    {
        // remove remaining 'move' actions
        if (!empty($this->actions[self::GROUP_ADD])) {
            foreach ($this->actions[self::GROUP_ADD] as $index => $action) {
                if ($action[0] === self::MOVE) {
                    unset($this->actions[self::GROUP_ADD][$index]);
                }
            }
        }
        // remove remaining 'remove' actions if there are no any 'add' actions
        if (!empty($this->actions[self::GROUP_REMOVE]) && empty($this->actions[self::GROUP_ADD])) {
            unset($this->actions[self::GROUP_REMOVE]);
        }
    }