def METHOD_NAME(self, task: tasks.Task, uid: str) -> None:
    """
    Before adding Tasks to a ProcessPool, check that the Task target does
    not come from __main__.
    """
    if isinstance(task, tasks.Task) and task.module == "__main__":
        raise ValueError("Cannot add Tasks from __main__ to ProcessPool")
    super(ProcessPool, self).METHOD_NAME(task, uid)