class_docstr: Base class for all step decorators.
  
  Example:
  
  @my_decorator
  @step
  def a(self):
      pass
  
  @my_decorator
  @step
  def b(self):
      pass
  
  To make the above work, define a subclass
  
  class MyDecorator(StepDecorator):
      name = "my_decorator"
  
  and include it in plugins.STEP_DECORATORS. Now both a() and b()
  get an instance of MyDecorator, so you can keep step-specific
  state easily.
  
  TODO (savin): Initialize the decorators with flow, graph,
                step.__name__ etc., so that we don't have to
                pass them around with every lifecycle call.
class_docstr_tok: ["Base","class","for","all","step","decorators",".","Example",":","@","my_decorator","@","step","def","a","(","self",")",":","pass","@","my_decorator","@","step","def","b","(","self",")",":","pass","To","make","the","above","work",",","define","a","subclass","class","MyDecorator","(","StepDecorator",")",":","name","=","``","my_decorator","''","and","include","it","in","plugins.STEP_DECORATORS",".","Now","both","a","(",")","and","b","(",")","get","an","instance","of","MyDecorator",",","so","you","can","keep","step-specific","state","easily",".","TODO","(","savin",")",":","Initialize","the","decorators","with","flow",",","graph",",","step.__name__","etc.",",","so","that","we","do","n't","have","to","pass","them","around","with","every","lifecycle","call","."]
docstr: Run after the task context has been finalized.
  
  is_task_ok is set to False if the user code raised an exception that
  was not handled by any decorator.
  
  Note that you can't create or modify data artifacts in this method
  since the task has been finalized by the time this method
  is called. Also note that the task may fail after this method has been
  called, so this method may get called multiple times for a task over
  multiple attempts, similar to all task_ methods.
code: def task_finished(
      self,
      step_name,
      flow,
      graph,
      is_task_ok,
      retry_count,
      max_user_code_retries,
  ):
      """
      Run after the task context has been finalized.
  
      is_task_ok is set to False if the user code raised an exception that
      was not handled by any decorator.
  
      Note that you can't create or modify data artifacts in this method
      since the task has been finalized by the time this method
      is called. Also note that the task may fail after this method has been
      called, so this method may get called multiple times for a task over
      multiple attempts, similar to all task_ methods.
      """
      pass
  
imports: from functools import partial
  import json
  import re
  import os
  import sys
  from .flowspec import FlowSpec
  from .exception import MetaflowInternalError, MetaflowException, InvalidDecoratorAttribute
  from metaflow._vendor import click
label_desc: Use image node_id 13 for calling the StepDecorator obj's underlying member method code with example usage: obj.task_finished(step_name, flow, graph, is_task_ok, retry_count, max_user_code_retries) without return types