def load_training_sets(file, image=None):
    """
    Loads a list of TrainingSet objects from a file.  This function assumes
    that all the sets in the list refer to the same image and mask array.
    If that is not the case, this function should not be used.
    """
    from .algorithms.algorithms import TrainingClassSet
    ts = TrainingClassSet()
    ts.load(file, image)
    return ts
