Insert many items at once into a temporary table.
773392
def insert_many(self, items):
    
    return SessionContext.session.execute(
        self.insert(values=[
            to_dict(item, self.c)
            for item in items
        ]),
    ).rowcount
466371
def add(self, item):
        """"""
        if item in self._set:
            self._fifo.remove(item)
        elif len(self._set) == self.max_items:
            self._set.remove(self._fifo.pop(0))
        self._fifo.append(item)
        self._set.add(item)
649003
def insert(self, key, value, data={}):
        
        if value < self.min_value or value > self.max_value:
            raise BoundsError('item value out of bounds')

        item = self.Item(key, value, data)
        index = self.get_bin_index(value)

        self.bins[index].append(item)
748391
def _flush_puts(self, items, options):
    """"""
    datastore.Put(items, config=self._create_config(options))
100357
function (items) {
        var self = this, parent = self.parent();

        if (parent) {
          parent.insert(items, parent.items().indexOf(self), true);
        }

        return self;
      }
1220247
def _add_temporary_ngrams(self, ngrams):
        """"""
        # Remove duplicate n-grams, empty n-grams, and non-string n-grams.
        ngrams = [ngram for ngram in ngrams if ngram and
                  isinstance(ngram, str)]
        # Deduplicate while preserving order (useful for testing).
        seen = {}
        ngrams = [seen.setdefault(x, x) for x in ngrams if x not in seen]
        self._conn.execute(constants.DROP_TEMPORARY_NGRAMS_TABLE_SQL)
        self._conn.execute(constants.CREATE_TEMPORARY_NGRAMS_TABLE_SQL)
        self._conn.executemany(constants.INSERT_TEMPORARY_NGRAM_SQL,
                               [(ngram,) for ngram in ngrams])
1295495
def insert(self, item, safe=None): # pragma: nocover
		''' '''
		warnings.warn('Insert will be deprecated soon and removed in 1.0. Please use insert',
					  PendingDeprecationWarning)
		self.add(item, safe=safe)
885092
def insert(self, index, item):
        # type: (int, Any) -> None
        
        return list.insert(self, index, self.ref(item))
357841
def insert(collection_name, docs, check_keys,
           safe, last_error_args, continue_on_error, opts, ctx=None):
    """"""
    if ctx:
        return _insert_compressed(
            collection_name, docs, check_keys, continue_on_error, opts, ctx)
    return _insert_uncompressed(collection_name, docs, check_keys, safe,
                                last_error_args, continue_on_error, opts)
336294
def insert(
            self, M_c, T, X_L_list, X_D_list, new_rows=None, N_GRID=31,
            CT_KERNEL=0):
        """"""
        if new_rows is None:
            raise ValueError("new_row must exist")

        if not isinstance(new_rows, list):
            raise TypeError('new_rows must be list of lists')
            if not isinstance(new_rows[0], list):
                raise TypeError('new_rows must be list of lists')

        X_L_list, X_D_list, was_multistate = su.ensure_multistate(
            X_L_list, X_D_list)

        # get insert arg tuples
        arg_tuples = self.get_insert_arg_tuples(
            M_c, T, X_L_list, X_D_list, new_rows, N_GRID, CT_KERNEL)

        chain_tuples = self.mapper(self.do_insert, arg_tuples)
        X_L_list, X_D_list = zip(*chain_tuples)

        if not was_multistate:
            X_L_list, X_D_list = X_L_list[0], X_D_list[0]

        T.extend(new_rows)
        ret_tuple = X_L_list, X_D_list, T
        return ret_tuple
498059
def insert(self, i, item_weight):
        
        item, weight = item_weight
        self._seq.insert(i, item)
        self.weight += weight
461307
def putcolslice(self, value, blc, trc, inc=[], startrow=0, nrow=-1, rowincr=1):
        """"""
        return self._table.putcolslice(self._column, value, blc, trc, inc, startrow, nrow, rowincr)
945266
def _insert(self, name, value, timestamp, intervals, **kwargs):
    '''
    
    '''
    # TODO: confirm that this is in fact using the indices correctly.
    for interval,config in self._intervals.items():
      timestamps = self._normalize_timestamps(timestamp, intervals, config)
      for tstamp in timestamps:
        self._insert_data(name, value, tstamp, interval, config, **kwargs)
1221959
def _batch_insert(self, inserts, intervals, **kwargs):
    '''
    
    '''
    updates = {}
    # TODO support flush interval
    for interval,config in self._intervals.items():
      for timestamp,names in inserts.iteritems():
        timestamps = self._normalize_timestamps(timestamp, intervals, config)
        for name,values in names.iteritems():
          for value in values:
            for tstamp in timestamps:
              query,insert = self._insert_data(
                name, value, tstamp, interval, config, dry_run=True)

              batch_key = self._batch_key(query)
              updates.setdefault(batch_key, {'query':query, 'interval':interval})
              new_insert = self._batch(insert, updates[batch_key].get('insert'))
              updates[batch_key]['insert'] = new_insert

    # now that we've collected a bunch of updates, flush them out
    for spec in updates.values():
      self._client[ spec['interval'] ].update(
        spec['query'], spec['insert'], upsert=True, check_keys=False )
933191
def insert_data(self, node, data, start, end):
        """"""
        for item in data:
            self.recursive_insert(node, [item[0], item[1]], item[-1], start, end)
934023
def insert_many(cls, documents):
        """"""
        from mongoframes.queries import to_refs

        # Ensure all documents have been converted to frames
        frames = cls._ensure_frames(documents)

        # Send insert signal
        signal('insert').send(cls, frames=frames)

        # Prepare the documents to be inserted
        documents = [to_refs(f._document) for f in frames]

        # Bulk insert
        ids = cls.get_collection().insert_many(documents).inserted_ids

        # Apply the Ids to the frames
        for i, id in enumerate(ids):
            frames[i]._id = id

        # Send inserted signal
        signal('inserted').send(cls, frames=frames)

        return frames
1211892
def _insert(self, namespace, stream, events, configuration):
    
    max_items = configuration['max_items']
    for _id, event in events:
      while len(self.db[namespace][stream]) >= max_items:
        self.db[namespace][stream].pop(0)
      bisect.insort(self.db[namespace][stream], Event(_id, event))