tries to drop any duplicates from db
433145
function(channel, next) {
    var filter = {
        channel_id : channel.id
      },
      modelName = this.getDataSourceName('dup');

    this._dao.removeFilter(modelName, filter, next);
  }
157250
def _drop(self, table, existing_tables=None):
        """"""
        # Retrieve list of existing tables for comparison
        existing_tables = existing_tables if existing_tables else self.tables

        # Only drop table if it exists
        if table in existing_tables:
            # Set to avoid foreign key errorrs
            self.execute('SET FOREIGN_KEY_CHECKS = 0')

            query = 'DROP TABLE {0}'.format(wrap(table))
            self.execute(query)

            # Set again
            self.execute('SET FOREIGN_KEY_CHECKS = 1')
            self._printer('\tDropped table {0}'.format(table))
470500
def delete_duplicates(seq):
    
    seen = set()
    seen_add = seen.add
    return [x for x in seq if not (x in seen or seen_add(x))]
926576
def _only_if_file_not_exist(func_, *args, **kwargs):
    
    obj_dict = args[1]
    conn = args[-1]
    try:
        RBF.get(obj_dict[PRIMARY_FIELD]).pluck(PRIMARY_FIELD).run(conn)
        err_str = "Duplicate primary key `Name`: {}".format(obj_dict[PRIMARY_FIELD])
        err_dict = {'errors': 1,
                    'first_error':  err_str}
        return err_dict
    except r.errors.ReqlNonExistenceError:
        return func_(*args, **kwargs)
849012
def _duplicate_queries(self, output):
        """"""
        if QC_SETTINGS['DISPLAY_DUPLICATES']:
            for query, count in self.queries.most_common(QC_SETTINGS['DISPLAY_DUPLICATES']):
                lines = ['\nRepeated {0} times.'.format(count)]
                lines += wrap(query)
                lines = "\n".join(lines) + "\n"
                output += self._colorize(lines, count)
        return output
1022942
@SuppressFBWarnings("RV_RETURN_VALUE_IGNORED_NO_SIDE_EFFECT")
    public static void dropIndex(final ODatabaseObject db, final String indexName) {
        // Separated to overcome findbugs false positive "RV_RETURN_VALUE_IGNORED_NO_SIDE_EFFECT" for dropIndex method.
        db.getMetadata().getIndexManager().dropIndex(indexName);
    }
248782
function someCollections(db, collections, next) {

  var last = ~~collections.length, counter = 0;
  if (last === 0) { // empty set
    return next(null);
  }

  collections.forEach(function(collection) {

    db.collection(collection, function(err, collection) {

      logger('select collection ' + collection.collectionName);
      if (err) {
        return last === ++counter ? next(err) : error(err);
      }
      collection.drop(function(err) {

        if (err) {
          error(err); // log if missing
        }
        return last === ++counter ? next(null) : null;
      });
    });
  });
}
593583
def remove_duplicates(lst):
    
    dset = set()
    return [l for l in lst if l not in dset and not dset.add(l)]
418348
def remove_dbs(self, double):
        
        one = []
        for dup in double:
            if dup not in one:
                one.append(dup)
        return one
757766
public function drop()
    {
        $conn = $this->connection->getConnection();
        $db = r\db($this->connection->getDatabaseName());
        $db->tableDrop($this->table)->run($conn);
    }
627167
def drop_constraints(quiet=True, stdout=None):
    

    results, meta = db.cypher_query("CALL db.constraints()")
    pattern = re.compile(':(.*) \).*\.(\w*)')
    for constraint in results:
        db.cypher_query('DROP ' + constraint[0])
        match = pattern.search(constraint[0])
        stdout.write(''' - Droping unique constraint and index on label {0} with property {1}.\n'''.format(
            match.group(1), match.group(2)))
    stdout.write("\n")
705370
def df_drop_duplicates(df, ignore_key_pattern="time"):
    

    keys_to_remove = list_contains(df.keys(), ignore_key_pattern)
    #key_tf = [key.find(noinfo_key_pattern) != -1 for key in df.keys()]
    # keys_to_remove
    # remove duplicates
    ks = copy.copy(list(df.keys()))
    for key in keys_to_remove:
        ks.remove(key)

    df = df.drop_duplicates(ks)
    return df
129842
function (cb) {
          if (opts.dropCollection) {
            db.listCollections({name: collectionName})
              .toArray(function (err, items) {
                if (err) return cb(err)
                if (items.length) return coll.drop(cb)
                cb()
              })
          } else cb()
        }
1288484
private void dropAllEntities() {

        for (final MappedEntity mappedEntity : ImmutableList.copyOf(entities.values())) {
            try {
                dropEntity(mappedEntity.getEntity());
            } catch (final DatabaseEngineException ex) {
                logger.debug(String.format("Failed to drop entity '%s'", mappedEntity.getEntity().getName()), ex);
            }
        }
    }
1123722
def flush(self):
    """"""
    self.puts.flush()
    self.deletes.flush()
    self.ndb_puts.flush()
    self.ndb_deletes.flush()
606619
function removeThis()
    {
        $itemOptionList = eZProductCollectionItemOption::fetchList( $this->attribute( 'id' ) );

        $db = eZDB::instance();
        $db->begin();
        foreach( $itemOptionList as $itemOption )
        {
            $itemOption->remove();
        }
        $this->remove();
        $db->commit();
    }
707390
def remove_duplicates_from_list(array):
    ""
    output = []
    unique = set()
    for a in array:
        if a not in unique:
            unique.add(a)
            output.append(a)
    return output