code: def _recursive_rm(path: Path):
      if path.is_file() or path.is_symlink():
          if path.exists():
              try:
                  path.unlink()
              except Exception:
                  pass
          return
      for sub_path in list(path.iterdir()):
          _recursive_rm(sub_path)
      path.rmdir()
  
file_path: fastNLP/fastNLP/envs/distributed.py
imports: import os
  from functools import wraps
  from pathlib import Path
  from typing import Callable, Any, Optional, Union
  from contextlib import contextmanager
  from fastNLP.envs.env import FASTNLP_GLOBAL_RANK, FASTNLP_NO_SYNC
label_desc: Use image node_id 7 for calling a global function with example usage: _recursive_rm(path) without return types