<commit_before>import os
import pymysql
from . import config, DataJointError
from .hash import long_hash
from .blob import pack, unpack
from .base_relation import BaseRelation


class ExternalTable(BaseRelation):
    """
    The table tracking externally stored objects
    """
    def __init__(self, arg, database=None):
        if isinstance(arg, ExternalTable):
            super().__init__(arg)
            # copy constructor
            self.database = arg.database
            self._connection = arg._connection
            self._definition = arg._definition
            self._user = arg._user
            return
        super().__init__()
        self.database = database
        self._connection = arg
        if not self.is_declared:
            self.declare()

    @property
    def definition(self):
        return """
        # external storage tracking 
        store   : char(8)    # the name of external store
        hash    : char(43)   # the hash of stored object
        ---
        count = 1 : int    # reference count
        size      : int       # size of object in bytes
        timestamp=CURRENT_TIMESTAMP  :timestamp   # automatic timestamp
        """

    @property
    def table_name(self):
        return '~external'

    def put(self, store, obj):<commit_msg>minor<commit_after>import os
import pymysql
from . import config, DataJointError
from .hash import long_hash
from .blob import pack, unpack
from .base_relation import BaseRelation


class ExternalTable(BaseRelation):
    """
    The table tracking externally stored objects
    """
    def __init__(self, arg, database=None):
        if isinstance(arg, ExternalTable):
            super().__init__(arg)
            # copy constructor
            self.database = arg.database
            self._connection = arg._connection
            self._definition = arg._definition
            self._user = arg._user
            return
        super().__init__()
        self.database = database
        self._connection = arg
        if not self.is_declared:
            self.declare()

    @property
    def definition(self):
        return """
        # external storage tracking 
        store :char(8)  # the name of external store
        hash  :char(43) # the hash of stored object
        ---
        count = 1 :int               # reference count
        size      :bigint unsigned   # size of object in bytes
        timestamp=CURRENT_TIMESTAMP  :timestamp   # automatic timestamp
        """

    @property
    def table_name(self):
        return '~external'

    def put(self, store, obj):
{'fraction_non_alphanumeric': 0.07910042652190771, 'fraction_numerical': 0.0031019775106630476, 'mean_word_length': 1.9965156794425087, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '4472720', 'n_tokens_mistral': 670, 'n_tokens_neox': 642, 'n_words': 206}