import pickle


def getCategory(id):
    """Finds the clinical group a given participant belongs to.

    Parameters
    ----------
    id : int
        ID of the participant.
    
    Returns
    -------
    str
        Clinical group that the participant with the given
        ID belongs to.

    """


    file = open("data/"+str(id)+"/os.obj",'rb')
    collection = pickle.load(file)
    file.close()

    categories = ["borderline", "healthy", "bipolar"]

    return categories[collection[0].diagnosis]