def get_memory_banks_per_run(coreAssignment, cgroups):
    try:
        # read list of available memory banks
        allMems = set(cgroups.read_allowed_memory_banks())

        result = []
        for cores in coreAssignment:
            mems = set()
            for core in cores:
                coreDir = '/sys/devices/system/cpu/cpu{0}/'.format(core)
                mems.update(_get_memory_banks_listed_in_dir(coreDir))
            allowedMems = sorted(mems.intersection(allMems))
            logging.debug("Memory banks for cores %s are %s, of which we can use %s.", cores, list(mems), allowedMems)

            result.append(allowedMems)

        assert len(result) == len(coreAssignment)

        if any(result) and os.path.isdir('/sys/devices/system/node/'):
            return result
        else:
            # All runs get the empty list of memory regions
            # because this system has no NUMA support
            return None
    except ValueError as e:
        sys.exit("Could not read memory information from kernel: {0}".format(e))
Test if VTK classes are renamed correctly.
dataset/ETHPy150Open sosy-lab/benchexec/benchexec/resources.py/get_memory_banks_per_run--crossover with--dataset/ETHPy150Open enthought/mayavi/tvtk/tests/test_indenter.py/TestVTKDocMassager.test_rename_class