check if the summary table exists
320063
def dfsummary_made(self):
        """"""
        try:
            empty = self.dfsummary.empty
        except AttributeError:
            empty = True
        return not empty
5489
def _check_exists(database: Database, table: LdapObjectClass, key: str, value: str):
    
    try:
        get_one(table, Q(**{key: value}), database=database)
        return True
    except ObjectDoesNotExist:
        return False
143371
def check_table_exists(dbcon, tablename):
    
    dbcur = dbcon.cursor()
    dbcur.execute("SELECT name FROM sqlite_master WHERE type='table' AND name='%s';" % tablename)
    result = dbcur.fetchone()
    dbcur.close()
    if result is None:
        return False
    else:
        try:
            return result[0] == tablename
        except IndexError as e:
            return check_table_exists(dbcon, tablename)
1159206
private boolean storeExists(String tableName) {
        KeyspaceMetadata ksMetadata = m_cluster.getMetadata().getKeyspace(m_keyspace);
        return (ksMetadata != null) && (ksMetadata.getTable(tableName) != null);
    }
550996
function checkTable(count) {
      // Make sure we don't go into an infinite loop
      if (++count > 1000) return cb(new Error('Wait limit exceeded'))

      self.describeTable(function(err, data) {
        if (err) return cb(err)
        if (data.TableStatus !== 'ACTIVE' || (data.GlobalSecondaryIndexes &&
            !data.GlobalSecondaryIndexes.every(function (idx) {return idx.IndexStatus === 'ACTIVE'}))) {
          return setTimeout(checkTable, 1000, count)
        }

        // If the table is ACTIVE then return
        cb(null, data)
      })
    }
1185681
def is_simpletable(table):
    """"""
    tds = table('td')
    for td in tds:
        if td.contents != []:
            td = tdbr2EOL(td)
            if len(td.contents) == 1:
                thecontents = td.contents[0]
                if not isinstance(thecontents, NavigableString):
                    return False
            else:
                return False
    return True
408006
private function check_tables() {
		$tab = new AdminStoreTables();
		$tab::init($this);
		$force = $this->force_create_table;
		if ($tab::exists($force)) {
			if (!$force)
				$tab::upgrade();
			$tab::deinit();
			return;
		}
		$tab::install($this->expiration);
		$tab::deinit();
	}
958754
def exists(c_table_cd: str, tables: I2B2Tables) -> int:
        
        conn = tables.ont_connection
        table = tables.schemes
        return bool(list(conn.execute(table.select().where(table.c.c_table_cd == c_table_cd))))
188684
function pg_table_exists(self, name) {
	return do_query(self, 'SELECT * FROM information_schema.tables WHERE table_name = $1 LIMIT 1', [name]).then(function(rows) {
		if(!rows) { throw new TypeError("Unexpected result from query: " + util.inspect(rows)); }
		return rows.length !== 0;
	});
}
944117
def is_table(self):
        
        if self.type_counts["text"] < 6 or "figure" in self.type_counts:
            return False
        for e in self.elems:
            # Characters written as curve are usually small, discard diagrams here
            if elem_type(e) == "curve" and e.height * e.width > 100:
                return False
        # import re
        # space_re = '\\s+'
        # ws_arr = []
        # whitespace_aligned = False
        # for elem in self.elems:
        #     elem_ws = []
        #     for m in re.finditer(space_re, elem.get_text()):
        #         elem_ws.append(m.start())
        #     # print elem, elem_ws
        #     if(len(elem_ws)>0):
        #         ws_arr.append(elem_ws)
        # # print ws_arr
        # if(len(ws_arr)>0):
        #     count_arr = max([ws_arr.count(i) for i in ws_arr])
        #     if(float(count_arr)/len(ws_arr) > 0.75):
        #         return True
        if (
            self.sum_elem_bbox / (self.height * self.width)
        ) > self.table_area_threshold:
            return False
        has_many_x_align = False
        has_many_y_align = False
        for k, v in six.iteritems(self.feat_counts):
            font_key = k[0]
            if (
                v >= 2 and "-" in font_key
            ):  # Text row or column with more than 2 elements
                if font_key[-2] == "x":
                    has_many_x_align = True
                if font_key[-2] == "y":
                    has_many_y_align = True
        return has_many_x_align and has_many_y_align
53680
def table_or_view_exists(engine: Engine, table_or_view_name: str) -> bool:
    
    tables_and_views = get_table_names(engine) + get_view_names(engine)
    return table_or_view_name in tables_and_views
1322939
def db_check(name,
             table=None,
             **connection_args):
    '''
    
    '''
    ret = []
    if table is None:
        # we need to check all tables
        tables = db_tables(name, **connection_args)
        for table in tables:
            log.info('Checking table \'%s\' in db \'%s\'..', name, table)
            ret.append(__check_table(name, table, **connection_args))
    else:
        log.info('Checking table \'%s\' in db \'%s\'..', name, table)
        ret = __check_table(name, table, **connection_args)
    return ret
1329415
def check_table(table=None, family='ipv4'):
    '''
    
    '''
    ret = {'comment': '',
           'result': False}

    if not table:
        ret['comment'] = 'Table needs to be specified'
        return ret

    nft_family = _NFTABLES_FAMILIES[family]
    cmd = '{0} list tables {1}' . format(_nftables_cmd(), nft_family)
    out = __salt__['cmd.run'](cmd, python_shell=False).find('table {0} {1}'.format(nft_family, table))

    if out == -1:
        ret['comment'] = 'Table {0} in family {1} does not exist'.\
                         format(table, family)
    else:
        ret['comment'] = 'Table {0} in family {1} exists'.\
                         format(table, family)
        ret['result'] = True
    return ret
661085
private function _tableExists() {

        // Try a select statement against the table
        // Run it in try/catch in case PDO is in ERRMODE_EXCEPTION.
        try {
            $result = mysqli_query($this->link,"SELECT 1 FROM $this->table_name LIMIT 1");
        } catch (\Exception $e) {
            // We got an exception == table not found
            return FALSE;
        }

        // Result is either boolean FALSE (no table found) or PDOStatement Object (table found)
        return $result !== FALSE;
    }
357366
def column_exists(self, tablename: str, column: str) -> bool:
        """"""
        sql = """
            SELECT COUNT(*)
            FROM information_schema.columns
            WHERE table_name=?
            AND column_name=?
            AND table_schema={}
        """.format(self.get_current_schema_expr())
        row = self.fetchone(sql, tablename, column)
        return True if row[0] >= 1 else False
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
263005
public boolean existsTable(String keyspace, String table, boolean showLog) {
        this.metadata = this.cluster.getMetadata();

        if (!(this.metadata.getKeyspace(keyspace).getTables().isEmpty())) {
            for (TableMetadata t : this.metadata.getKeyspace(keyspace).getTables()) {
                if (t.getName().equals(table)) {
                    return true;
                }
            }
        }
        return false;
    }