class_docstr: Specifies a timeout for your step.
  
  This decorator is useful if this step may hang indefinitely.
  
  This can be used in conjunction with the `@retry` decorator as well as the `@catch` decorator.
  A timeout is considered to be an exception thrown by the step. It will cause the step to be
  retried if needed and the exception will be caught by the `@catch` decorator, if present.
  
  Note that all the values specified in parameters are added together so if you specify
  60 seconds and 1 hour, the decorator will have an effective timeout of 1 hour and 1 minute.
  
  Parameters
  ----------
  seconds : int, default: 0
      Number of seconds to wait prior to timing out.
  minutes : int, default: 0
      Number of minutes to wait prior to timing out.
  hours : int, default: 0
      Number of hours to wait prior to timing out.
class_docstr_tok: ["Specifies","a","timeout","for","your","step",".","This","decorator","is","useful","if","this","step","may","hang","indefinitely",".","This","can","be","used","in","conjunction","with","the","`","@","retry","`","decorator","as","well","as","the","`","@","catch","`","decorator",".","A","timeout","is","considered","to","be","an","exception","thrown","by","the","step",".","It","will","cause","the","step","to","be","retried","if","needed","and","the","exception","will","be","caught","by","the","`","@","catch","`","decorator",",","if","present",".","Note","that","all","the","values","specified","in","parameters","are","added","together","so","if","you","specify","60","seconds","and","1","hour",",","the","decorator","will","have","an","effective","timeout","of","1","hour","and","1","minute",".","Parameters","--","--","--","--","--","seconds",":","int",",","default",":","0","Number","of","seconds","to","wait","prior","to","timing","out",".","minutes",":","int",",","default",":","0","Number","of","minutes","to","wait","prior","to","timing","out",".","hours",":","int",",","default",":","0","Number","of","hours","to","wait","prior","to","timing","out","."]
code: def __init__(self, *args, **kwargs):
      super(TimeoutDecorator, self).__init__(*args, **kwargs)
      # Initialize secs in __init__ so other decorators could safely use this
      # value without worrying about decorator order.
      # Convert values in attributes to type:int since they can be type:str
      # when passed using the CLI option --with.
      self.secs = (
          int(self.attributes["hours"]) * 3600
          + int(self.attributes["minutes"]) * 60
          + int(self.attributes["seconds"])
      )
  
file_path: metaflow/metaflow/plugins/timeout_decorator.py
imports: import signal
  import traceback
  from metaflow.exception import MetaflowException
  from metaflow.decorators import StepDecorator
  from metaflow.unbounded_foreach import UBF_CONTROL
label_desc: Use image node_id 1 to create a new TimeoutDecorator object from inherited base classes: StepDecorator with example: obj = TimeoutDecorator()