def sanitize(path):
    """
    Clean up path arguments for use with MockFS

    MockFS isn't happy with trailing slashes since it uses a dict
    to simulate the file system.

    """
    while path in '//':
        path = path.replace('//', '/')
    while len(path) > 1 and path.endswith('/'):
        path = path[:-1]
    return path
dataset/ETHPy150Open mockfs/mockfs/mockfs/util.py/sanitize/swapped operands of `in`