import yaml
import json


def load_data(file_path, use_yaml=True):
    """Load data from a given YAML file into a Python dictionary.

    :param file_path: path to your YAML file.
    :param use_yaml: use yaml or json
    :return: contents of the file as Python dict.
    """
    with open(file_path, "r") as f:
        if use_yaml:
            data = yaml.safe_load(f)
        else:
            data = json.load(f)
    return data