class_docstr: Defines the status of a :class:`~TimeStep` within a sequence.
  
  Note that the last :class:`~TimeStep` in a sequence can either be
  :attribute:`StepType.TERMINAL` or :attribute:`StepType.TIMEOUT`.
  
  Suppose max_episode_length = 5:
  * A success sequence terminated at step 4 will look like:
      FIRST, MID, MID, TERMINAL
  * A success sequence terminated at step 5 will look like:
      FIRST, MID, MID, MID, TERMINAL
  * An unsuccessful sequence truncated by time limit will look like:
      FIRST, MID, MID, MID, TIMEOUT
class_docstr_tok: ["Defines","the","status","of","a",":","class",":","`","~TimeStep","`","within","a","sequence",".","Note","that","the","last",":","class",":","`","~TimeStep","`","in","a","sequence","can","either","be",":","attribute",":","`","StepType.TERMINAL","`","or",":","attribute",":","`","StepType.TIMEOUT","`",".","Suppose","max_episode_length","=","5",":","*","A","success","sequence","terminated","at","step","4","will","look","like",":","FIRST",",","MID",",","MID",",","TERMINAL","*","A","success","sequence","terminated","at","step","5","will","look","like",":","FIRST",",","MID",",","MID",",","MID",",","TERMINAL","*","An","unsuccessful","sequence","truncated","by","time","limit","will","look","like",":","FIRST",",","MID",",","MID",",","MID",",","TIMEOUT"]
docstr: Determines the step type based on step cnt and done signal.
  
  Args:
      step_cnt (int): current step cnt of the environment.
      max_episode_length (int): maximum episode length.
      done (bool): the done signal returned by Environment.
  
  Returns:
      StepType: the step type.
  
  Raises:
      ValueError: if step_cnt is < 1. In this case a environment's
      `reset()` is likely not called yet and the step_cnt is None.
docstr_tok: ["Determines","the","step","type","based","on","step","cnt","and","done","signal",".","Args",":","step_cnt","(","int",")",":","current","step","cnt","of","the","environment",".","max_episode_length","(","int",")",":","maximum","episode","length",".","done","(","bool",")",":","the","done","signal","returned","by","Environment",".","Returns",":","StepType",":","the","step","type",".","Raises",":","ValueError",":","if","step_cnt","is","<","1",".","In","this","case","a","environment's","`","reset","(",")","`","is","likely","not","called","yet","and","the","step_cnt","is","None","."]
code: def get_step_type(cls, step_cnt, max_episode_length, done):
      """Determines the step type based on step cnt and done signal.
  
      Args:
          step_cnt (int): current step cnt of the environment.
          max_episode_length (int): maximum episode length.
          done (bool): the done signal returned by Environment.
  
      Returns:
          StepType: the step type.
  
      Raises:
          ValueError: if step_cnt is < 1. In this case a environment's
          `reset()` is likely not called yet and the step_cnt is None.
      """
      if (
          max_episode_length is not None
          and step_cnt >= max_episode_length
      ):
          return StepType.TIMEOUT
      elif done:
          return StepType.TERMINAL
      elif step_cnt == 1:
          return StepType.FIRST
      elif step_cnt < 1:
          raise ValueError(
              "Expect step_cnt to be >= 1, but got {} "
              "instead. Did you forget to call `reset("
              ")`?".format(step_cnt)
          )
      else:
          return StepType.MID
  
imports: from dataclasses import dataclass
  import enum
  from typing import Dict, List
  import warnings
  import numpy
  from garage.np import concat_tensor_dict_list, pad_batch_array, slice_nested_dict, stack_tensor_dict_list
label_desc: Use image node_id 1 for calling the StepType obj's underlying member method code with example usage: obj.get_step_type(cls, step_cnt, max_episode_length, done) and returns: StepType, StepType, StepType, StepType