class_docstr: Utility class that provides methods to save and load stateful attributes to disk.
docstr: Set the directory path to store state in, and create an empty directory if it doesn't already exist.
  
  Parameters
  ----------
  dirpath
      The directory to save state file inside.
docstr_tok: ["Set","the","directory","path","to","store","state","in",",","and","create","an","empty","directory","if","it","does","n't","already","exist",".","Parameters","--","--","--","--","--","dirpath","The","directory","to","save","state","file","inside","."]
code: def _set_state_dir(self, dirpath: Union[str, os.PathLike]):
      """
      Set the directory path to store state in, and create an empty directory if it doesn't already exist.
  
      Parameters
      ----------
      dirpath
          The directory to save state file inside.
      """
      self.state_dir = Path(dirpath)
      self.state_dir.mkdir(parents=True, exist_ok=True)
  
file_path: alibi-detect/alibi_detect/utils/state/state.py
imports: import os
  from pathlib import Path
  import logging
  from abc import ABC
  from typing import Union, Tuple
  import numpy
  from alibi_detect.utils.frameworks import Framework
  from alibi_detect.utils.state._pytorch import save_state_dict, load_state_dict
label_desc: Use image node_id 1 for calling the StateMixin obj's underlying member method code with example usage: obj._set_state_dir(dirpath) without return types