def get_instance(dataset_id):
    """ Break dataset_id from ESGF search in dictionary of instance attributes """
    bits = dataset_id.split('.')
    if '|esgfcog' in bits[8]:
        return {'model': bits[3], 'experiment': bits[4], 'realm': bits[6],
            'ensemble': bits[7], 'version': bits[8].split('|')[0]}
    return {'model': bits[3], 'experiment': bits[4], 'realm': bits[6],
        'mip': bits[7], 'ensemble': bits[8], 'version': bits[9].split('|')[0]}
