def addToHeap(self, uuid, type):
        # lookup if type is in the service_mapping, if it is
        # then rewrite type to the proper resource
        if not uuid in self.unscheduled_items:
            if self.service_mapping and type is self.service_mapping:
                LOGGER.info('Remapping resource %s to %s'
                    % (type, self.service_mapping[type]))
                type = self.service_mapping[type]
            try:
                # Make sure the uuid is in bytes
                uuid_bytes = UUID(uuid).bytes
            except ValueError:
                LOGGER.error('Cound not turn UUID into byes using string %s'
                    % uuid)
                return
            if type in self.functions and 'interval' in self.functions[type]:
                interval = int(self.functions[type]['interval'])
            else:
                LOGGER.error('Could not find interval for type %s' % type)
                return
            enqueue_time = int(time.time() + interval)
            # Add a UUID to the heap.
            LOGGER.debug('Adding %s to heap with time %s and interval of %s'
                % (uuid, enqueue_time, interval))
            heappush(self.heap, (enqueue_time, (uuid_bytes, interval)))
        else:
            LOGGER.info('Unscheduling %s' % uuid)
            self.unscheduled_items.remove(uuid)
dataset/ETHPy150Open wehriam/awspider/awspider/servers2/scheduler.py/SchedulerServer.addToHeap/operator `in` -> `is`