<commit_before>import os
import os.path as p
from xml.dom import minidom
from ..extensions.database import db
from utils import auto_generate_hash

# EXPERIMENT_ACCESS_LEVELS = (
#     'read',
#     'delete'
# )


class ExperimentShare(db.Model):
    recipient_user_id = db.Column(db.Integer, db.ForeignKey('user.id'),
                                  primary_key=True)
    donor_user_id = db.Column(db.Integer, db.ForeignKey('user.id'),
                              primary_key=True)
    experiment_id = db.Column(db.Integer, db.ForeignKey('experiment.id'),
                              primary_key=True)
    experiment = db.relationship('Experiment', uselist=False)
    # access_level = db.Column(db.Enum(*EXPERIMENT_ACCESS_LEVELS,
    #                                  name='access_level'))


@auto_generate_hash
class Experiment(db.Model):
    id = db.Column(db.Integer, primary_key=True)
    hash = db.Column(db.String(20))
    name = db.Column(db.String(120), index=True)
    location = db.Column(db.String(600))
    description = db.Column(db.Text)
<commit_msg>Automatically generate experiment dir<commit_after>import os
import os.path as p
from xml.dom import minidom
from ..extensions.database import db
from utils import auto_generate_hash, auto_create_directory

# EXPERIMENT_ACCESS_LEVELS = (
#     'read',
#     'delete'
# )


class ExperimentShare(db.Model):
    recipient_user_id = db.Column(db.Integer, db.ForeignKey('user.id'),
                                  primary_key=True)
    donor_user_id = db.Column(db.Integer, db.ForeignKey('user.id'),
                              primary_key=True)
    experiment_id = db.Column(db.Integer, db.ForeignKey('experiment.id'),
                              primary_key=True)
    experiment = db.relationship('Experiment', uselist=False)
    # access_level = db.Column(db.Enum(*EXPERIMENT_ACCESS_LEVELS,
    #                                  name='access_level'))


@auto_create_directory(lambda e: e.location)
@auto_generate_hash
class Experiment(db.Model):
    id = db.Column(db.Integer, primary_key=True)
    hash = db.Column(db.String(20))
    name = db.Column(db.String(120), index=True)
    location = db.Column(db.String(600))
    description = db.Column(db.Text)

{'fraction_non_alphanumeric': 0.11717352415026834, 'fraction_numerical': 0.007155635062611807, 'mean_word_length': 2.785109983079526, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7560489', 'n_tokens_mistral': 710, 'n_tokens_neox': 693, 'n_words': 119}