parameters: (self, path, recursive=False, maxdepth=None)
docstring: Delete files.
  
          Parameters
          ----------
          path: str or list of str
              File(s) to delete.
          recursive: bool
              If file(s) are directories, recursively delete contents and then
              also remove the directory
          maxdepth: int or None
              Depth to pass to walk for finding files to delete, if recursive.
              If None, there will be no limit and infinite recursion may be
              possible.
docstring_summary: Delete files.
docstring_tokens: Delete files .
function: def rm(self, path, recursive=False, maxdepth=None):
          """Delete files.
  
          Parameters
          ----------
          path: str or list of str
              File(s) to delete.
          recursive: bool
              If file(s) are directories, recursively delete contents and then
              also remove the directory
          maxdepth: int or None
              Depth to pass to walk for finding files to delete, if recursive.
              If None, there will be no limit and infinite recursion may be
              possible.
          """
          # prefer some bulk method, if possible
          if not isinstance(path, list):
              path = [path]
          for p in path:
              if recursive:
                  out = self.walk(p, maxdepth=maxdepth)
                  for pa_, _, files in reversed(list(out)):
                      for name in files:
                          fn = "/".join([pa_, name]) if pa_ else name
                          self.rm(fn)
                      self.rmdir(pa_)
              else:
                  self._rm(p)
function_tokens: def rm ( self , path , recursive = False , maxdepth = None ) : # prefer some bulk method, if possible if not isinstance ( path , list ) : path = [ path ] for p in path : if recursive : out = self . walk ( p , maxdepth = maxdepth ) for pa_ , _ , files in reversed ( list ( out ) ) : for name in files : fn = "/" . join ( [ pa_ , name ] ) if pa_ else name self . rm ( fn ) self . rmdir ( pa_ ) else : self . _rm ( p )