'Checks if a task is either queued or running in this executor
:param task_instance: TaskInstance
:return: True if the task is known to this executor'

def has_task(self, task_instance):

    if ((task_instance.key in self.queued_tasks) or (task_instance.key in self.running)):
        return True
