def canRun(self, command):
        # check if this rendernode has made too much errors in its last commands
        cpt = 0
        for i in self.history:
            if i == CMD_ERROR:
                cpt += 1
        if cpt == singletonconfig.get('CORE', 'RN_NB_ERRORS_TOLERANCE'):
            LOGGER.warning("RenderNode %s had only errors in its commands history, excluding..." % self.name)
            self.excluded = True
            return False
        if self.excluded:
            return False
        for (requirement, value) in command.task.requirements.items():
            if requirement.lower() == "softs":  # todo
                for soft in value:
                    if not soft in self.caracteristics['softs']:
                        return False
            else:
                if not requirement in self.caracteristics:
                    return False
                else:
                    caracteristic = self.caracteristics[requirement]
                    if type(caracteristic) != type(value) and not isinstance(value, list):
                        return False
                    if isinstance(value, list) and len(value) == 2:
                        a, b = value
                        if type(a) != type(b) or type(a) != type(caracteristic):
                            return False
                        try:
                            if not (a < caracteristic < b):
                                return False
                        except ValueError:
                            return False
                    else:
                        if isinstance(caracteristic, bool) and caracteristic != value:
                            return False
                        if isinstance(caracteristic, basestring) and caracteristic != value:
                            return False
                        if isinstance(caracteristic, int) and caracteristic < value:
                            return False

        if command.task.minNbCores:
            if self.freeCoresNumber < command.task.minNbCores:
                return False
        else:
            if self.freeCoresNumber != self.coresNumber:
                return False

        #
        # RAM requirement: we check task requirement with the amount of free RAM reported at last ping (systemFreeRam)
        #
        if command.task.ramUse != 0:
            if self.systemFreeRam < command.task.ramUse:
                LOGGER.info("Not enough ram on %s for command %d. %d needed, %d avail." % (self.name, command.id, int(command.task.ramUse), self.systemFreeRam))
                return False

        #
        # timer requirements: a timer is on the task and is the same for all commands
        #
        if command.task.timer is not None:
            # LOGGER.debug("Current command %r has a timer : %s" % (command.id, datetime.datetime.fromtimestamp(command.task.timer) ) )
            if time.time() < command.task.timer:
                LOGGER.info("Prevented execution of command %d because of timer present (%s)" % (command.id, datetime.datetime.fromtimestamp(command.task.timer)))
                return False

        return True
dataset/ETHPy150Open mikrosimage/OpenRenderManagement/src/octopus/dispatcher/model/rendernode.py/RenderNode.canRun/original