import yaml
import random


def get_random_subject(species='human'):
    """
    Function to get a random data config file and subject for a given species.

    Note: only human data are configured at the moment

    Parameters
    ----------
    species: str
        'human', 'rodent', or 'nhp'

    Returns
    -------
    data_config_file: str

    participant_ndx: int
    """
    if species == 'human':
        data_config_file = (
            'CPAC/resources/configs/test_configs/'
            'data-test_4-projects_5-subjects.yml'
        )
    else:
        raise NotImplementedError(
            f'Data configurations not yet set for random test of {species}'
        )
    with open(data_config_file, 'r') as data_config:
        subject_list = yaml.safe_load(data_config)
    return (data_config_file, random.randrange(len(subject_list)))