Returns unique records
775045
def _uniq_rec(fastafile, seq=False):
    
    seen = set()
    for rec in SeqIO.parse(fastafile, "fasta"):
        name = str(rec.seq) if seq else rec.id
        if name in seen:
            logging.debug("ignore {0}".format(rec.id))
            continue
        seen.add(name)
        yield rec
1258021
def unique_index(data, keys=None, fail_on_dup=True):
    
    o = UniqueIndex(listwrap(keys), fail_on_dup=fail_on_dup)

    for d in data:
        try:
            o.add(d)
        except Exception as e:
            o.add(d)
            Log.error(
                "index {{index}} is not unique {{key}} maps to both {{value1}} and {{value2}}",
                index=keys,
                key=select([d], keys)[0],
                value1=o[d],
                value2=d,
                cause=e,
            )
    return o
431065
def _model_unique(ins):
    
    unique = []
    for t in ins.tables:
        for c in t.constraints:
            if isinstance(c, UniqueConstraint):
                unique.append(tuple(col.key for col in c.columns))
    return unique
1329100
def query_unique(self, field):
        
        return set(self._convert_field(field, value)
                   for value in super(Reader, self).query_unique(field))
930287
def distinct(self):
        
        new_query_set = self.clone()
        new_query_set.query.distinct = True
        return new_query_set
550442
def get_record(self, name):
        

        return set().union(self.records.get(name, set()))
27912
public RecordList getUniqueRecordsBy(String fieldName) {
        Set<String> uniqueKeys = new HashSet<String>();
        final RecordListBuilder uniqueRecordListBuilder = new RecordListBuilder(schema);
        for (int rowIndex = 0; rowIndex < this.size(); rowIndex++) {
            final Record currentRecord = this.records.get(rowIndex);
            String uniqueKeyField = currentRecord.getValueByFieldName(fieldName);
            if(!uniqueKeys.contains(uniqueKeyField)){
                uniqueRecordListBuilder.add(currentRecord);
            }
            uniqueKeys.add(uniqueKeyField);
        }
        return uniqueRecordListBuilder.createRecordList(dataSourceHash);
    }
1371183
def _get_upserts_distinct(queryset, model_objs_updated, model_objs_created, unique_fields):
    

    # Keep track of the created models
    created_models = []

    # If we created new models query for them
    if model_objs_created:
        created_models.extend(
            queryset.extra(
                where=['({unique_fields_sql}) in %s'.format(
                    unique_fields_sql=', '.join(unique_fields)
                )],
                params=[
                    tuple([
                        tuple([
                            getattr(model_obj, field)
                            for field in unique_fields
                        ])
                        for model_obj in model_objs_created
                    ])
                ]
            )
        )

    # Return the models
    return model_objs_updated, created_models
1002842
def _unique_todict(session, cls, queryfunc, arg, kw):
    '''
    
    '''
    q = session.query(cls)
    q = queryfunc(q, *arg, **kw)
    obj = q.first()
    if not obj:
        obj = kw
        obj['__cls__'] = cls.__mapper__.class_.__name__
    return obj
90740
def get_records(self, sequence_id, gt=None, gte=None, lt=None, lte=None, limit=None,
                    query_ascending=True, results_ascending=True):
        
47006
def get_one_record(self, *args, **kwargs):
        

        records = self.call(*args, **kwargs)
        records = list(records)
        len_ = len(records)

        if len_ != 1:
            raise ValueError("We were told to only return one record, but "
                             "this did not match what was given: (%d)" % 
                             (len_,))

        return records[0]
856416
def get_unique_fields(self):
        """"""
        for unique_together in self._meta.unique_together:
            if 'sort_order' in unique_together:
                unique_fields = list(unique_together)
                unique_fields.remove('sort_order')
                return ['%s_id' % f for f in unique_fields]
        return []
196563
public static function get_records($filters = array(), $sort = '', $order = 'ASC', $skip = 0, $limit = 0) {
        global $DB;

        $orderby = '';
        if (!empty($sort)) {
            $orderby = $sort . ' ' . $order;
        }

        $records = $DB->get_records(static::TABLE, $filters, $orderby, '*', $skip, $limit);
        $instances = array();

        foreach ($records as $record) {
            $newrecord = new static(0, $record);
            array_push($instances, $newrecord);
        }
        return $instances;
    }
1175147
def records(self):
		''''''
		if self._records == None:
			self._records = self._get_records()
		return self._records
408534
def records(self):
        
        if self._records is None:
            self._records = RecordList(self._version, account_sid=self._solution['account_sid'], )
        return self._records
58014
def distinct(key)
      result = collection.database.command(
        distinct: collection.name,
        key: key.to_s,
        query: selector
      )
      result["values"]
    end
957901
def getAllRecordIDs( dbid )
      rids = []
      if dbid
         getSchema( dbid )
         next_record_id = getResponseElement( "table/original/next_record_id" )
         if next_record_id and next_record_id.has_text?
            next_record_id = next_record_id.text
            (1..next_record_id.to_i).each{ |rid|
               begin
                  _getRecordInfo( rid )
                  rids << rid.to_s if update_id
               rescue
               end
            }
         end
      end
      if block_given?
        rids.each { |id| yield id }
      else
        rids
      end
   end