code: def mkdirs(filename, mode=0o777):
      
      dirname = os.path.dirname(filename)
      if not dirname:
          return
      _compat.makedirs(dirname, mode=mode, exist_ok=True)
docs: Recursively create directories up to the path of ``filename`` as needed.