import random
import string


def generateMetadataDict(key_prefix, n_num, n_str, n_obj, n_arr, n_bool, n_null):
    """
    Generate a dictionary of metadata comprising data type counts according to the
    passed arguments.
    """

    meta_dict = {}
    for i_num in range(1, n_num + 1):
        meta_dict[key_prefix + "_num_" + str(i_num)] = random.randint(0, 100)
    for i_str in range(1, n_str + 1):
        meta_dict[key_prefix + "_str_" + str(i_str)] = "".join(
            random.choice(string.ascii_lowercase) for _ in range(10)
        )
    for i_obj in range(1, n_obj + 1):
        meta_dict[key_prefix + "_obj_" + str(i_obj)] = {
            "sub_key_{}_1".format(i_obj): 1,
            "sub_key_{}_2".format(i_obj): "value_2",
        }
    for i_arr in range(1, n_arr + 1):
        meta_dict[key_prefix + "_arr_" + str(i_arr)] = [1, 2, 3]
    for i_bool in range(1, n_bool + 1):
        meta_dict[key_prefix + "_bool_" + str(i_bool)] = random.choice([True, False])
    for i_null in range(1, n_null + 1):
        meta_dict[key_prefix + "_null_" + str(i_null)] = None

    return meta_dict