code: def mkdirs(filename, mode: int = 0o777) -> None:
      """Recursively create directories up to the path of ``filename`` as needed."""
      dirname = os.path.dirname(filename)
      if not dirname:
          return
      os.makedirs(dirname, mode=mode, exist_ok=True)
  
imports: import os
  import typing
label_desc: Use image node_id 2 for calling a global function with example usage: mkdirs(filename, mode) without return types