class_docstr: 1-dimensional grid-world implementation with 3 possible movement actions ("LEFT", "STAY", "RIGHT")
code: def set_init_state(self, init_state=None):
      if init_state != None:
          if init_state > (self.n_states - 1) or init_state < 0:
              raise ValueError(
                  "`init_state` is greater than number of states"
              )
          if not isinstance(init_state, (int, float)):
              raise ValueError("`init_state` must be [int/float]")
          self.init_state = int(init_state)
      else:
          self.init_state = np.random.randint(0, self.n_states)
      self.state = self.init_state
  
imports: import numpy
  import matplotlib.pyplot
  import seaborn
  from pymdp.envs import Env
label_desc: Use image node_id 6 for calling the DGridWorldEnv obj's underlying member method code with example usage: obj.set_init_state(init_state) without return types