code: def populate_scoped_cols(self, scoped_tbls):
          
          columns = []
          meta = self.dbmetadata
  
          for tbl in scoped_tbls:
              # A fully qualified schema.relname reference or default_schema
              # DO NOT escape schema names.
              schema = tbl[0] or self.dbname
              relname = tbl[1]
              escaped_relname = self.escape_name(tbl[1])
  
              # We don't know if schema.relname is a table or view. Since
              # tables and views cannot share the same name, we can check one
              # at a time
              try:
                  columns.extend(meta['tables'][schema][relname])
  
                  # Table exists, so don't bother checking for a view
                  continue
              except KeyError:
                  try:
                      columns.extend(meta['tables'][schema][escaped_relname])
                      # Table exists, so don't bother checking for a view
                      continue
                  except KeyError:
                      pass
  
              try:
                  columns.extend(meta['views'][schema][relname])
              except KeyError:
                  pass
  
          return columns
docs: Find all columns in a set of scoped_tables
          :param scoped_tbls: list of (schema, table, alias) tuples
          :return: list of column names