code: def sanitise(self, pathName: str) -> str:
          
  
          assert isinstance(pathName, str)
          assert '..' not in pathName
          assert not pathName.endswith(os.sep)
  
          while pathName.startswith(os.sep):
              pathName = pathName[1:]
  
          return pathName
docs: Sanitise
  
          Clean unwanted characters from the pathName string.
  
          @param pathName: Path name variable.
          @type pathName: String
          @return: Path name as string.