code: def __init__(
      self,
      pathspec_query,
      resolved_from,
      run_id=None,
  ):
      message = "Cannot resolve task to find card."
      if resolved_from == "task_pathspec":
          message = "Task pathspec %s not found." % pathspec_query
      elif resolved_from == "step_pathspec":
          message = "Step pathspec %s not found." % pathspec_query
      elif resolved_from == "stepname":
          message = "Step %s not found" % pathspec_query
          if run_id is not None:
              message = "Step %s not found for Run('%s')." % (
                  pathspec_query,
                  run_id,
              )
      super().__init__(msg=message, lineno=None)
  
imports: from metaflow.exception import MetaflowException
  import traceback
  import re
label_desc: Use image node_id 1 to create a new TaskNotFoundException object from inherited base classes: MetaflowException with example: obj = TaskNotFoundException(pathspec_query, resolved_from, run_id)