docstr: Execute decorated callable, but if `OSError` is raised, call :func:`make_dirs` on the
  directory specified by the exception, then recall the decorated callable again
  
  Examples
  --------
  >>> from tempfile import TemporaryDirectory
  >>> with TemporaryDirectory(dir="") as d:  # doctest: +ELLIPSIS
  ...     def f_0():
  ...         os.mkdir(f"{d}/nonexistent_dir/subdir")
  ...     f_0()
  Traceback (most recent call last):
      File "file_utils.py", line ?, in f_0
  FileNotFoundError: [Errno 2] No such file or directory...
  >>> with TemporaryDirectory(dir="") as d:
  ...     @RetryMakeDirs()
  ...     def f_1():
  ...         os.mkdir(f"{d}/nonexistent_dir/subdir")
  ...     f_1()
docstr_tok: ["Execute","decorated","callable",",","but","if","`","OSError","`","is","raised",",","call",":","func",":","`","make_dirs","`","on","the","directory","specified","by","the","exception",",","then","recall","the","decorated","callable","again","Examples","--","--","--","--",">",">",">","from","tempfile","import","TemporaryDirectory",">",">",">","with","TemporaryDirectory","(","dir=","''","''",")","as","d",":","#","doctest",":","+ELLIPSIS","...","def","f_0","(",")",":","...","os.mkdir","(","f","''","{","d","}","\/nonexistent_dir\/subdir","''",")","...","f_0","(",")","Traceback","(","most","recent","call","last",")",":","File","``","file_utils.py","''",",","line","?",",","in","f_0","FileNotFoundError",":","[","Errno","2","]","No","such","file","or","directory","...",">",">",">","with","TemporaryDirectory","(","dir=","''","''",")","as","d",":","...","@","RetryMakeDirs","(",")","...","def","f_1","(",")",":","...","os.mkdir","(","f","''","{","d","}","\/nonexistent_dir\/subdir","''",")","...","f_1","(",")"]
code: def __init__(self):
      """Execute decorated callable, but if `OSError` is raised, call :func:`make_dirs` on the
      directory specified by the exception, then recall the decorated callable again
  
      Examples
      --------
      >>> from tempfile import TemporaryDirectory
      >>> with TemporaryDirectory(dir="") as d:  # doctest: +ELLIPSIS
      ...     def f_0():
      ...         os.mkdir(f"{d}/nonexistent_dir/subdir")
      ...     f_0()
      Traceback (most recent call last):
          File "file_utils.py", line ?, in f_0
      FileNotFoundError: [Errno 2] No such file or directory...
      >>> with TemporaryDirectory(dir="") as d:
      ...     @RetryMakeDirs()
      ...     def f_1():
      ...         os.mkdir(f"{d}/nonexistent_dir/subdir")
      ...     f_1()
      """
  
imports: from hyperparameter_hunter.settings import G
  from contextlib import suppress
  from inspect import signature
  import numpy
  import os
  import os.path
  import pandas
  import simplejson
  from typing import Union
  import wrapt
label_desc: Use image node_id 1 to create a new RetryMakeDirs object from inherited base classes: object with example: obj = RetryMakeDirs()