code: def clear_temp(wdir, rmdir=True):
      
      wdir = pathlib.Path(wdir)
      extensions = ["*.log", "*.dat", "*.txt"]
  
      for ext in extensions:
          for ff in wdir.glob(ext):
              ff.unlink()
  
      if rmdir:
          wdir.rmdir()
docs: Remove all files in wdir