<commit_before>import inspect

from .Project import Project
from .Study import Study
from .Subject import Subject
from .Visit import Visit
from .Sample import Sample
from .WgsDnaPrep import WgsDnaPrep
from .SixteenSDnaPrep import SixteenSDnaPrep
from .SixteenSRawSeqSet import SixteenSRawSeqSet

# currently used in Base.children()
# __name__ attribute used to ensure that if the class or method name
# changes, the maintainer is forced to update it here, too.
dependency_methods = {
              Project.__name__ : Project.studies.__name__,
                Study.__name__ : Study.subjects.__name__,
              Subject.__name__ : Subject.visits.__name__,
                Visit.__name__ : Visit.samples.__name__,
               Sample.__name__ : Sample.dnaPreps.__name__,
           WgsDnaPrep.__name__ : WgsDnaPrep.raw_seq_sets.__name__,
      SixteenSDnaPrep.__name__ : SixteenSDnaPrep.raw_seq_sets.__name__,
    SixteenSRawSeqSet.__name__ : SixteenSRawSeqSet.trimmed_seq_sets.__name__,
}

def generator_flatten(gen):
    for item in gen:
        if inspect.isgenerator(item) or type(item) in (list, tuple):
            for value in generator_flatten(item):
                yield value
        else:
            yield item<commit_msg>Added support for children() call on HostAssayPrep.<commit_after>import inspect

from .Project import Project
from .Study import Study
from .Subject import Subject
from .Visit import Visit
from .Sample import Sample
from .WgsDnaPrep import WgsDnaPrep
from .SixteenSDnaPrep import SixteenSDnaPrep
from .SixteenSRawSeqSet import SixteenSRawSeqSet
from .HostAssayPrep import HostAssayPrep

# currently used in Base.children()
# __name__ attribute used to ensure that if the class or method name
# changes, the maintainer is forced to update it here, too.
dependency_methods = {
              Project.__name__ : Project.studies.__name__,
                Study.__name__ : Study.subjects.__name__,
              Subject.__name__ : Subject.visits.__name__,
                Visit.__name__ : Visit.samples.__name__,
               Sample.__name__ : Sample.dnaPreps.__name__,
           WgsDnaPrep.__name__ : WgsDnaPrep.raw_seq_sets.__name__,
      SixteenSDnaPrep.__name__ : SixteenSDnaPrep.raw_seq_sets.__name__,
    SixteenSRawSeqSet.__name__ : SixteenSRawSeqSet.trimmed_seq_sets.__name__,
        HostAssayPrep.__name__ : HostAssayPrep.cytokines.__name__
}

def generator_flatten(gen):
    for item in gen:
        if inspect.isgenerator(item) or type(item) in (list, tuple):
            for value in generator_flatten(item):
                yield value
        else:
            yield item
{'fraction_non_alphanumeric': 0.06404879908501715, 'fraction_numerical': 0.0, 'mean_word_length': 3.10641627543036, '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': '4586525', 'n_tokens_mistral': 773, 'n_tokens_neox': 735, 'n_words': 209}