<commit_before>"""
Some things to get information about the media
"""

import PyFBA
import argparse



def list_media():
    for m in PyFBA.Biochemistry.media:
        print(m)

<commit_msg>Add a function to list compounds in media<commit_after>"""
Some things to get information about the media
"""

import PyFBA
import argparse



def list_media():
    for m in PyFBA.Biochemistry.media:
        print(m)


def compounds_in_media(m, model_data=None, verbose=False):
    """
    Print the compounds in the media
    :param m: the media
    :param model_data: a model data object (not necessary)
    :param verbose: more output
    """

    if not model_data:
        model_data = PyFBA.parse.model_seed.parse_model_seed_data(verbose=verbose)

    media = PyFBA.parse.read_media.find_media_file(m, model_data, verbose)
    for c in media:
        print(c)
{'fraction_non_alphanumeric': 0.08654970760233918, 'fraction_numerical': 0.0, 'mean_word_length': 3.4583333333333335, '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': '6466252', 'n_tokens_mistral': 285, 'n_tokens_neox': 267, 'n_words': 87}