code: def ensure_dir(path):
      
      os.makedirs(os.path.abspath(os.path.dirname(path)), exist_ok=True)
docs: Create all parent directories of path if they don't exist.
  
      Args:
          path. Path-like object. Create parent dirs to this path.
  
      Return:
          None.