code: def splitpath(path):
      
  
      head, tail = os.path.split(path)
      if tail == '':
          return head,
      elif head == '':
          return tail,
      else:
          return splitpath(head) + (tail,)
docs: Recursively split a filepath into all directories and files.