def prepareShapesModel(datasetDirectory, regexp=".*"):

    import glob
    import os.path
    import re

    shapes = {}

    nameFilter = re.compile(regexp)
    
    datasets = glob.glob(datasetDirectory + '/*.dat')

    for dataset in datasets:
        if dataset not in "params":
            name = os.path.splitext(os.path.basename(dataset))[0]

            if nameFilter.match(name):
                shapeModeler = ShapeModeler(init_filename = dataset, num_principle_components = 5)
                shapes[name] = shapeModeler

    return shapes
dataset/ETHPy150Open chili-epfl/shape_learning/scripts/visualize_dataset.py/prepareShapesModel/swapped operands of `not in`