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