def createStorage(storage_type, storage_parm=None):
    num_idx = storage_parm.get('num_idx', 0) if storage_parm else 0

    if storage_type == 'mem':
        # create inverted file storage
        if num_idx > 0:
            return [MemStorage() for i in xrange(num_idx)]
        # create normal storage
        else:
            return MemStorage()
    elif storage_type == 'lmdb':
        path = storage_parm['path']
        clear = storage_parm.get('clear', False)

        # create inverted file storage
        if num_idx > 0:
            env = lmdb.open(path, map_size=2**30, sync=False, max_dbs=num_idx)
            return [LMDBStorage(env, clear, i) for i in xrange(num_idx)]
        # create normal storage
        else:
            env = lmdb.open(path, map_size=2**30, sync=False, max_dbs=1)
            return LMDBStorage(env, clear)
    else:
        raise Exception(storage_type % 'Wroing storage type: %s')
dataset/ETHPy150Open hdidx/hdidx/hdidx/storage/__init__.py/createStorage/swapped operands of `%`