Flush updated dictionaries
773277
public function flush()
    {
        if (!count($this->updated)) {
            // Not updated words
            return;
        }

        foreach ($this->updated as $lang => $true) {
            // Grouping all words by language
            $words = array();

            foreach ($this->words as $word => $wordLanguages) {
                if (in_array($lang, $wordLanguages)) {
                    $words[] = $word;
                }
            }

            $file = $this->dictionaryDir . '/' . $lang . '.php';
            file_put_contents($file, '<?php return ' . var_export($words, 1) . ';');
        }
    }
696212
def flush(self):
        """"""
        if self._wbuf:
            buffer = ''.join(self._wbuf)
            self._wbuf = []
            self.write(buffer)
938126
def flush_synced(self, using=None, **kwargs):
        
        return self._get_connection(using).indices.flush_synced(index=self._name, **kwargs)
876086
def flush(self, parser):
        
        if self._verbose:
            show = self._verbose if isinstance(self._verbose, str) else None
            self.show(show)
        parser.parse(self._filter(self.clear(), parser))
661813
def _flush(self):
        """"""
        d = os.path.dirname(self.path)
        if not os.path.isdir(d):
            os.makedirs(d)
        with io.open(self.path, 'w', encoding='utf8') as f:
            yaml.safe_dump(self._data, f, default_flow_style=False, encoding=None)
1044000
def flush(self):
        """"""
        if self.flag[0] != 'r':
            with self.write_mutex:
                if hasattr(self.db, 'sync'):
                    self.db.sync()
                else:
                    # fall-back, close and re-open, needed for ndbm
                    flag = self.flag
                    if flag[0] == 'n':
                        flag = 'c' + flag[1:]  # don't clobber an existing database
                    self.db.close()
                    # noinspection PyArgumentList
                    self.db = self.open(self.path, flag, self.mode, **self.open_kwargs)
910375
def flush(self, batch_size=1000):
        
        keys = self.database.keys(self.namespace + ':*')
        for i in range(0, len(keys), batch_size):
            self.database.delete(*keys[i:i + batch_size])
814793
def merge_dicts(base, updates):
    
    if not base:
        base = dict()
    if not updates:
        updates = dict()
    z = base.copy()
    z.update(updates)
    return z
682023
def flush(self, save_index=False, save_model=False, clear_buffer=False):
        """"""
        if save_index:
            if self.fresh_index is not None:
                self.fresh_index.save(self.location('index_fresh'))
            if self.opt_index is not None:
                self.opt_index.save(self.location('index_opt'))
        if save_model:
            if self.model is not None:
                self.model.save(self.location('model'))
        self.payload.commit()
        if clear_buffer:
            if hasattr(self, 'fresh_docs'):
                try:
                    self.fresh_docs.terminate() # erase all buffered documents + file on disk
                except:
                    pass
            self.fresh_docs = SqliteDict(journal_mode=JOURNAL_MODE) # buffer defaults to a random location in temp
        self.fresh_docs.sync()
519021
def _nary_dict_update(dicts, **kwargs):
    
    copy = kwargs['copy']
    res = dicts[0].copy() if copy else dicts[0]
    if len(dicts) == 1:
        return res

    # decide what strategy to use when updating a dictionary
    # with the values from another: {(non)recursive} x {(non)overwriting}
    deep = kwargs['deep']
    overwrite = kwargs['overwrite']
    if deep:
        dict_update = curry(_recursive_dict_update, overwrite=overwrite)
    else:
        if overwrite:
            dict_update = res.__class__.update
        else:
            def dict_update(dict_, other):
                for k, v in iteritems(other):
                    dict_.setdefault(k, v)

    for d in dicts[1:]:
        dict_update(res, d)
    return res
1217101
def flush(self):
        
        for key in self.grouping_info.keys():
            if self._should_flush(key):
                self._write_current_buffer_for_group_key(key)
170438
def _update_dictionary(self):
        
        self._total_words = sum(self._dictionary.values())
        self._unique_words = len(self._dictionary.keys())
        self._letters = set()
        for key in self._dictionary:
            self._letters.update(key)
1090844
def flush(o)
      @hooks.keys.each do |type|
        next unless Splib.type_of?(o, type)
        @hooks[type].each_pair do |key, objects|
          if(key == :procs)
            objects.each do |pr|
              if(@serial)
                pr.call(o)
              else
                @pool.process{ pr.call(o) }
              end
            end
          else
            objects.each do |h|
              if(h[:req].call(o))
                if(@serial)
                  h[:object].send(h[:method], o)
                else
                  @pool.process{ h[:object].send(h[:method], o) }
                end
              end
            end
          end
        end
      end
      nil
    end
1269564
def scrub_dict(d):
    
    if type(d) is dict:
        return dict(
            (k, scrub_dict(v)) for k, v in d.iteritems() if v and scrub_dict(v)
        )
    elif type(d) is list:
        return [
            scrub_dict(v) for v in d if v and scrub_dict(v)
        ]
    else:
        return d
91943
def flush(self, objects=None, batch_size=None, **kwargs):
        ''' '''
        batch_size = batch_size or self.config.get('batch_size')
        # if we're flushing these from self.store, we'll want to
        # pop them later.
        if objects:
            from_store = False
        else:
            from_store = True
            objects = self.itervalues()
        # sort by _oid for grouping by _oid below
        objects = sorted(objects, key=lambda x: x['_oid'])
        batch, _ids = [], []
        # batch in groups with _oid, since upsert's delete
        # all _oid rows when autosnap=False!
        for key, group in groupby(objects, lambda x: x['_oid']):
            _grouped = list(group)
            if len(batch) + len(_grouped) > batch_size:
                logger.debug("Upserting %s objects" % len(batch))
                _ = self.upsert(objects=batch, **kwargs)
                logger.debug("... done upserting %s objects" % len(batch))
                _ids.extend(_)
                # start a new batch
                batch = _grouped
            else:
                # extend existing batch, since still will be < batch_size
                batch.extend(_grouped)
        else:
            if batch:
                # get the last batch too
                logger.debug("Upserting last batch of %s objects" % len(batch))
                _ = self.upsert(objects=batch, **kwargs)
                _ids.extend(_)
            logger.debug("... Finished upserting all objects!")

        if from_store:
            for _id in _ids:
                # try to pop the _id's flushed from store; warn / ignore
                # the KeyError if they're not there
                try:
                    self.store.pop(_id)
                except KeyError:
                    logger.warn(
                        "failed to pop {} from self.store!".format(_id))
        return sorted(_ids)
523158
def flush(self):
        """"""
        self.__flushLevel(0)
        if self.__lastImport is not None:
            self.imports.append(self.__lastImport)
353046
def _flush(self):
        """"""
        self._buffer.sort()
        self._replace_batch()
        self._buffer = []
        self._compress()