Checks for the existence of a record by a single field (typically a
        PK).
966098
def does_row_exist(self, table: str, field: str, value: Any) -> bool:
        """"""
        sql = ("SELECT COUNT(*) FROM " + self.delimit(table) +
               " WHERE " + self.delimit(field) + "=?")
        row = self.fetchone(sql, value)
        return True if row[0] >= 1 else False
712719
private boolean isInRecord(String[] strClassNames, int iClassIndex, String strRecordClass)
    {
        boolean bIsInRecord = false;
        for (int i = 0; i <= iClassIndex; i++)
        {
            if (strClassNames[i].equalsIgnoreCase(strRecordClass))
                bIsInRecord = true;   // True, it IS in the record
        }
        return bIsInRecord;    // It is in the record?
    }
416514
def hexists(self):
        
        try:
            key = self.key
        except DoesNotExist:
            """
            If the object doesn't exists anymore, its PK is deleted, so the
            "self.key" call will raise a DoesNotExist exception. We catch it
            to return False, as the field doesn't exists too.
            """
            return False
        else:
            return self.connection.hexists(key, self.name)
524108
def has_field_item?(method_name)
      field_items.any? { |field_item| field_item.field.name.parameterize(separator: '_') == method_name.to_s }
    end
732081
def check_uniqueness(self, *args, **kwargs):
        

        if not self.field.unique:
            return

        try:
            pk = self.instance.pk.get()
        except AttributeError:
            pk = None

        key = self.get_storage_key(*args)
        value = list(args)[-1]
        pks = self.get_pks_for_filter(key, 'eq', self.normalize_value(value))

        self.assert_pks_uniqueness(pks, pk, value)
1331227
def does_field_exist(self,collection,field_name):
        '''
        
        '''
        schema = self.get_schema_fields(collection)
        logging.info(schema)
        return True if field_name in [field['name'] for field in schema['fields']] else False
878622
def exists(self, record_key):
        
        ''' 
            
        '''
        
        title = '%s.exists' % self.__class__.__name__
    
    # validate inputs
        input_fields = {
            'record_key': record_key
        }
        for key, value in input_fields.items():
            object_title = '%s(%s=%s)' % (title, key, str(value))
            self.fields.validate(value, '.%s' % key, object_title)
    
    # send get metadata request
        file_path = '/%s' % record_key
        try:
            self.dropbox.files_get_metadata(file_path)
        except Exception as err:
            if str(err).find("LookupError('not_found'") > -1:
                return False
            else:
                raise DropboxConnectionError(title)

        return True
1248941
def find_record(relation = nil)
      if locate_id.nil? || (locate_id.is_a?(::Numeric) && locate_id == 0) || (locate_id.to_s == '')
        return -1
      end

      dataset = load_records(relation, false)
      return -1 if dataset.blank?

      first_item = dataset.first
      klass = first_item.class

      id_field = klass.respond_to?('primary_key')       ? klass.primary_key   : nil
      id_field ||= first_item.respond_to?('id')         ? 'id'                : nil

      return -1 unless id_field
      if locate_id.is_a?(::Numeric)
        dataset.index{|item| item.send(id_field) == locate_id} || -1
      else
        loc_id = locate_id.to_s.downcase
        dataset.index{|item| item.send(id_field).to_s.downcase == loc_id} || -1
      end

    end
1259406
def obtain_record(check = nil, type = nil)
      
      return check if check.is_a?(ActiveRecord::Base)

      if check.blank? 
        return nil if @content.blank? || !@content[0].blank?
        @content
      else
        records = Post.where( 'post_title = :p OR post_slug = :p2 OR id = :p3', { p: check.to_s, p2: check.to_s, p3: check.to_i} )
        if !type.blank?
          records = records.where("post_type = :p4", {p4: type})
        end
        records.first
      end

    end
938929
def exists(self, model_class, ID):
        ''''''

        assert hasattr(model_class, '_fields'), 'Not a valid model class'
        res = self.get(model_class, id=ID, fetchOne=True)
        if res:
            return True
        return False
712083
def has_key(self, key):
        """"""
        k = self._lowerOrReturn(key)
        return k in self.data
900991
public boolean isSet(_Fields field) {
    if (field == null) {
      throw new IllegalArgumentException();
    }

    switch (field) {
    case RECORDS:
      return isSetRecords();
    }
    throw new IllegalStateException();
  }
207485
def exists(self):
        
        try:
            key = self.key
        except DoesNotExist:
            """
            If the object doesn't exists anymore, its PK is deleted, so the
            "self.key" call will raise a DoesNotExist exception. We catch it
            to return False, as the field doesn't exists too.
            """
            return False
        else:
            return self.connection.exists(key)
1013484
def field_exists(app_name, model_name, field_name):
    
    model = apps.get_model(app_name, model_name)
    table_name = model._meta.db_table
    cursor = connection.cursor()
    field_info = connection.introspection.get_table_description(cursor, table_name)
    field_names = [f.name for f in field_info]
    return field_name in field_names
1362144
public function valueExists($field, $value = null)
    {
        $record = new static($this->table, $this->keys, $this->mapper);

        if ($value === null) {
            $value = $this->$field;
        }

        try {
            $record->load([$field => $value]);
        } catch (NoResultException $e) {
            return false;
        }

        if ($record->$field != $value) {
            return false;
        }

        // check record keys same as self
        $same = [];

        foreach ($this->keys as $key) {
            $same[] = ($record->$key == $this->$key);
        }

        // Key not same, means same value exists in other record.
        if (in_array(false, $same, true)) {
            return true;
        }

        return false;
    }
1004302
def isRecord(self, db=None):
        
        if db is not None:
            same_db = db == self.context().db

        if db is None or same_db:
            col = self.schema().idColumn()
            with ReadLocker(self.__dataLock):
                return (col in self.__loaded) and (self.__values[col.name()][0] is not None)
        else:
            return None
780252
public boolean isSet(_Fields field) {
    if (field == null) {
      throw new IllegalArgumentException();
    }

    switch (field) {
    case KEYSPACE:
      return isSetKeyspace();
    case NAME:
      return isSetName();
    case COLUMN_TYPE:
      return isSetColumn_type();
    case COMPARATOR_TYPE:
      return isSetComparator_type();
    case SUBCOMPARATOR_TYPE:
      return isSetSubcomparator_type();
    case COMMENT:
      return isSetComment();
    case READ_REPAIR_CHANCE:
      return isSetRead_repair_chance();
    case COLUMN_METADATA:
      return isSetColumn_metadata();
    case GC_GRACE_SECONDS:
      return isSetGc_grace_seconds();
    case DEFAULT_VALIDATION_CLASS:
      return isSetDefault_validation_class();
    case ID:
      return isSetId();
    case MIN_COMPACTION_THRESHOLD:
      return isSetMin_compaction_threshold();
    case MAX_COMPACTION_THRESHOLD:
      return isSetMax_compaction_threshold();
    case KEY_VALIDATION_CLASS:
      return isSetKey_validation_class();
    case KEY_ALIAS:
      return isSetKey_alias();
    case COMPACTION_STRATEGY:
      return isSetCompaction_strategy();
    case COMPACTION_STRATEGY_OPTIONS:
      return isSetCompaction_strategy_options();
    case COMPRESSION_OPTIONS:
      return isSetCompression_options();
    case BLOOM_FILTER_FP_CHANCE:
      return isSetBloom_filter_fp_chance();
    case CACHING:
      return isSetCaching();
    case DCLOCAL_READ_REPAIR_CHANCE:
      return isSetDclocal_read_repair_chance();
    case MEMTABLE_FLUSH_PERIOD_IN_MS:
      return isSetMemtable_flush_period_in_ms();
    case DEFAULT_TIME_TO_LIVE:
      return isSetDefault_time_to_live();
    case SPECULATIVE_RETRY:
      return isSetSpeculative_retry();
    case TRIGGERS:
      return isSetTriggers();
    case CELLS_PER_ROW_TO_CACHE:
      return isSetCells_per_row_to_cache();
    case MIN_INDEX_INTERVAL:
      return isSetMin_index_interval();
    case MAX_INDEX_INTERVAL:
      return isSetMax_index_interval();
    case ROW_CACHE_SIZE:
      return isSetRow_cache_size();
    case KEY_CACHE_SIZE:
      return isSetKey_cache_size();
    case ROW_CACHE_SAVE_PERIOD_IN_SECONDS:
      return isSetRow_cache_save_period_in_seconds();
    case KEY_CACHE_SAVE_PERIOD_IN_SECONDS:
      return isSetKey_cache_save_period_in_seconds();
    case MEMTABLE_FLUSH_AFTER_MINS:
      return isSetMemtable_flush_after_mins();
    case MEMTABLE_THROUGHPUT_IN_MB:
      return isSetMemtable_throughput_in_mb();
    case MEMTABLE_OPERATIONS_IN_MILLIONS:
      return isSetMemtable_operations_in_millions();
    case REPLICATE_ON_WRITE:
      return isSetReplicate_on_write();
    case MERGE_SHARDS_CHANCE:
      return isSetMerge_shards_chance();
    case ROW_CACHE_PROVIDER:
      return isSetRow_cache_provider();
    case ROW_CACHE_KEYS_TO_SAVE:
      return isSetRow_cache_keys_to_save();
    case POPULATE_IO_CACHE_ON_FLUSH:
      return isSetPopulate_io_cache_on_flush();
    case INDEX_INTERVAL:
      return isSetIndex_interval();
    }
    throw new IllegalStateException();
  }