<commit_before>from neomodel import IntegerProperty, StructuredNode, StringProperty, db, DateProperty, RelationshipFrom, \
    RelationshipTo, StructuredRel, Relationship

EDITABLE_PROPERTIES = {
    # labels: {property-name, ...},

    # Nodes
    ':Company': ['name'],
    ':Note': ['text', 'date'],
    ':Person': ['name'],
    ':Project': ['name', 'description'],
    ':Role': ['name', 'description'],
    ':Topic': ['name', 'description'],

    # Relationships
    '(:Person)-[:PERFORMED]->(:Role)': ['start_date', 'end_date'],
    '(:Person)-[:CONTRIBUTED_TO]->(:Project)': ['start_date', 'end_date'],
}


def get_node_by_id(cls, id):
    labels = ''.join(label_string(cls.inherited_labels()))
    results = db.cypher_query(
        'MATCH (n{}) WHERE ID(n)={{id}} RETURN n'.format(labels),
        dict(id=id)
    )
    if len(results[0]) == 0:
        raise cls.DoesNotExist('No node found with given ID')
    return cls.inflate(results[0][0]['n'])


def label_string(labels):
    return ''.join(':' + label for label in labels)


def editable_params(params, label):
    return {
        k: v<commit_msg>Alphabetize<commit_after>from neomodel import IntegerProperty, StructuredNode, StringProperty, db, DateProperty, RelationshipFrom, \
    RelationshipTo, StructuredRel, Relationship

EDITABLE_PROPERTIES = {
    # labels: {property-name, ...},

    # Nodes
    ':Company': ['name'],
    ':Note': ['text', 'date'],
    ':Person': ['name'],
    ':Project': ['name', 'description'],
    ':Role': ['name', 'description'],
    ':Topic': ['name', 'description'],

    # Relationships
    '(:Person)-[:CONTRIBUTED_TO]->(:Project)': ['start_date', 'end_date'],
    '(:Person)-[:PERFORMED]->(:Role)': ['start_date', 'end_date'],
}


def get_node_by_id(cls, id):
    labels = ''.join(label_string(cls.inherited_labels()))
    results = db.cypher_query(
        'MATCH (n{}) WHERE ID(n)={{id}} RETURN n'.format(labels),
        dict(id=id)
    )
    if len(results[0]) == 0:
        raise cls.DoesNotExist('No node found with given ID')
    return cls.inflate(results[0][0]['n'])


def label_string(labels):
    return ''.join(':' + label for label in labels)


def editable_params(params, label):
    return {
        k: v
{'fraction_non_alphanumeric': 0.19711971197119713, 'fraction_numerical': 0.0036003600360036, 'mean_word_length': 3.9072847682119205, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '3068743', 'n_tokens_mistral': 757, 'n_tokens_neox': 722, 'n_words': 159}