def __init__(self, tags, rlimits, config):

        self.cpu_model = None
        self.memory   = None
        self.cpu_cores = None

        for requireTag in tags:

            cpu_model = requireTag.get('cpuModel', None)
            if cpu_model:
                if self.cpu_model is None:
                    self.cpu_model = cpu_model
                else:
                    raise Exception('Double specification of required CPU model.')

            cpu_cores = requireTag.get('cpuCores', None)
            if cpu_cores:
                if self.cpu_cores is None:
                    if cpu_cores is not None:
                        self.cpu_cores = int(cpu_cores)
                else:
                    raise Exception('Double specification of required CPU cores.')

            memory = requireTag.get('memory',   None)
            if memory:
                if self.memory is None:
                    if memory is not None:
                        try:
                            self.memory = int(memory) * _BYTE_FACTOR * _BYTE_FACTOR
                            logging.warning(
                                'Value "%s" for memory requirement interpreted as MB for backwards compatibility, '
                                'specify a unit to make this unambiguous.',
                                memory)
                        except __HOLE__:
                            self.memory = util.parse_memory_value(memory)
                else:
                    raise Exception('Double specification of required memory.')

        # TODO check, if we have enough requirements to reach the limits
        # TODO is this really enough? we need some overhead!
        if self.cpu_cores is None:
            self.cpu_cores = rlimits.get(CORELIMIT, None)

        if self.memory is None:
            self.memory = rlimits.get(MEMLIMIT, None)

        if hasattr(config, 'cpu_model') and config.cpu_model is not None:
            # user-given model -> override value
            self.cpu_model = config.cpu_model

        if self.cpu_cores is not None and self.cpu_cores <= 0:
            raise Exception('Invalid value {} for required CPU cores.'.format(self.cpu_cores))

        if self.memory is not None and self.memory <= 0:
            raise Exception('Invalid value {} for required memory.'.format(self.memory))
dataset/ETHPy150Open sosy-lab/benchexec/benchexec/model.py/Requirements.__init__