code: def pathsplit(pth, dropext=True):
      
  
      if dropext:
          pth = os.path.splitext(pth)[0]
      parts = os.path.split(pth)
      if parts[0] == '':
          return parts[1:]
      elif len(parts[0]) == 1:
          return parts
      else:
          return pathsplit(parts[0], dropext=False) + parts[1:]
docs: Split a path into a tuple of all of its components.