<commit_before>"""
API for dealing with environment specifications.
"""

from .handle import Handle

def spec_for_name(name):
    """
    Find an environment specification for the given name.

    If the specification is not found, None is returned.
    """
    handle = Handle()
    return handle.checked_call('SpecForName', {'Name': name})['Spec']<commit_msg>cleanup handle after spec call<commit_after>"""
API for dealing with environment specifications.
"""

from .handle import Handle

def spec_for_name(name):
    """
    Find an environment specification for the given name.

    If the specification is not found, None is returned.
    """
    handle = Handle()
    try:
        return handle.checked_call('SpecForName', {'Name': name})['Spec']
    finally:
        handle.close()
{'fraction_non_alphanumeric': 0.11040609137055837, 'fraction_numerical': 0.0, 'mean_word_length': 3.6140350877192984, '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': '4491563', 'n_tokens_mistral': 215, 'n_tokens_neox': 207, 'n_words': 78}