<commit_before>module RethinkDB
  # A database stored on the cluster.  Usually created with the <b>+r+</b>
  # shortcut, like:
  #   r.db('Welcome-db')
  class Database
    @@default_datacenter='Welcome-dc'
    # Refer to the database named <b>+name+</b>.  Usually you would
    # use the <b>+r+</b> shortcut instead:
    #   r.db(name)
    def initialize(name); @db_name = name; end

    # Access the table <b>+name+</b> in this database.  May also use the table
    # name as a member function for convenience.  The following are equivalent:
    #   r.db('Welcome-db').table('tbl')
    #   r.db('Welcome-db').tbl
    def table(name); Table.new(@db_name, name); end

    # Create a new table in this database.  You should specify the
    # datacenter it should reside in and the primary key as well
    # (almost always "id").  When run, either returns <b>+nil+</b> or
    # throws on error.
    def create_table(name, datacenter=@@default_datacenter,  primary_key="id")
      Meta_Query.new [:create_table, datacenter, [@db_name, name], primary_key]
    end

    # Drop the table <b>+name+</b> from this database.  When run,
    # either returns <b>+nil+</b> or throws on error.
    def drop_table(name)
      Meta_Query.new [:drop_table, @db_name, name]
    end

    # List all the tables in this database.  When run, either returns
    # <b>+nil+</b> or throws on error.
    def list_tables
      Meta_Query.new [:list_tables, @db_name]
    end

    # The following are equivalent:
    #   r.db('a').table('b')
    #   r.db('a').b
    def method_missing(m, *a, &b)
      self.table(m.to_s, *a, &b)
    end
  end

  # A table in a particular RethinkDB database.  If you call a
  # function from Sequence on it, it will be treated as a
  # Stream_Expression reading from the table.
  class Table
    # A table named <b>+name+</b> residing in database <b>+db_name+</b>.<commit_msg>Removed the dumb table referencing syntax (cf. Issue #1031).<commit_after>module RethinkDB
  # A database stored on the cluster.  Usually created with the <b>+r+</b>
  # shortcut, like:
  #   r.db('Welcome-db')
  class Database
    @@default_datacenter='Welcome-dc'
    # Refer to the database named <b>+name+</b>.  Usually you would
    # use the <b>+r+</b> shortcut instead:
    #   r.db(name)
    def initialize(name); @db_name = name; end

    # Access the table <b>+name+</b> in this database.  May also use the table
    # name as a member function for convenience.  The following are equivalent:
    #   r.db('Welcome-db').table('tbl')
    #   r.db('Welcome-db').tbl
    def table(name); Table.new(@db_name, name); end

    # Create a new table in this database.  You should specify the
    # datacenter it should reside in and the primary key as well
    # (almost always "id").  When run, either returns <b>+nil+</b> or
    # throws on error.
    def create_table(name, datacenter=@@default_datacenter,  primary_key="id")
      Meta_Query.new [:create_table, datacenter, [@db_name, name], primary_key]
    end

    # Drop the table <b>+name+</b> from this database.  When run,
    # either returns <b>+nil+</b> or throws on error.
    def drop_table(name)
      Meta_Query.new [:drop_table, @db_name, name]
    end

    # List all the tables in this database.  When run, either returns
    # <b>+nil+</b> or throws on error.
    def list_tables
      Meta_Query.new [:list_tables, @db_name]
    end
  end

  # A table in a particular RethinkDB database.  If you call a
  # function from Sequence on it, it will be treated as a
  # Stream_Expression reading from the table.
  class Table
    # A table named <b>+name+</b> residing in database <b>+db_name+</b>.
{'fraction_non_alphanumeric': 0.12301369863013699, 'fraction_numerical': 0.001095890410958904, 'mean_word_length': 3.0702341137123748, 'pattern_counts': {'":': 0, '<': 43, '<?xml version=': 0, '>': 43, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6865587', 'n_tokens_mistral': 1248, 'n_tokens_neox': 1211, 'n_words': 415}