import json


def get_dataset_metadata(dataset_path: str):
    """
    Many datasets outputted by the sklearn bot have a first comment line with
    important meta-data
    """
    with open(dataset_path) as fp:
        first_line = fp.readline()
        if first_line[0] != '%':
            raise ValueError('arff data file should start with comment for meta-data')
    meta_data = json.loads(first_line[1:])
    return meta_data