<commit_before>from dusty.schemas.base_schema_class import DustySchema
from dusty.schemas.app_schema import app_schema
from dusty.schemas.lib_schema import lib_schema
from dusty.schemas.bundle_schema import bundle_schema

def get_app_dusty_schema(doc, name=None):
    if 'image' not in doc and 'build' not in doc:
        doc['image'] = ''
    if 'repo' not in doc:
        doc['repo'] = ''
    if 'mount' not in doc:
        doc['mount'] = ''
    return DustySchema(app_schema, doc, name, 'apps')

def get_lib_dusty_schema(doc, name=None):
    if 'mount' not in doc:
        doc['mount'] = ''
    if 'repo' not in doc:
        doc['repo'] = ''
    return DustySchema(lib_schema, doc, name, 'libs')

def get_bundle_dusty_schema(doc):
    return DustySchema(bundle_schema, doc)

def apply_required_keys(specs):
    for k, v in specs.get('apps', {}).iteritems():
        specs['apps'][k] = get_app_dusty_schema(v, k)
    for k, v in specs.get('libs', {}).iteritems():
        specs['libs'][k] = get_lib_dusty_schema(v, k)<commit_msg>Update test utils for new optional schema<commit_after>from dusty.schemas.base_schema_class import DustySchema
from dusty.schemas.app_schema import app_schema
from dusty.schemas.lib_schema import lib_schema
from dusty.schemas.bundle_schema import bundle_schema

def get_app_dusty_schema(doc, name=None):
    if 'image' not in doc and 'build' not in doc:
        doc['image'] = ''
    if 'repo' in doc and 'mount' not in doc:
        doc['mount'] = '/repo'
    if 'mount' in doc and 'repo' not in doc:
        doc['repo'] = '/repo'
    return DustySchema(app_schema, doc, name, 'apps')

def get_lib_dusty_schema(doc, name=None):
    if 'mount' not in doc:
        doc['mount'] = ''
    if 'repo' not in doc:
        doc['repo'] = ''
    return DustySchema(lib_schema, doc, name, 'libs')

def get_bundle_dusty_schema(doc):
    return DustySchema(bundle_schema, doc)

def apply_required_keys(specs):
    for k, v in specs.get('apps', {}).iteritems():
        specs['apps'][k] = get_app_dusty_schema(v, k)
    for k, v in specs.get('libs', {}).iteritems():
        specs['libs'][k] = get_lib_dusty_schema(v, k)
{'fraction_non_alphanumeric': 0.1357042583060365, 'fraction_numerical': 0.0, 'mean_word_length': 3.7829977628635345, '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': '3785061', 'n_tokens_mistral': 769, 'n_tokens_neox': 728, 'n_words': 199}