parameters: (p)
return_statement: return d + head, tail
docstring: Split a pathname.
  
      Return tuple (head, tail) where tail is everything after the final slash.
      Either part may be empty.
docstring_summary: Split a pathname.
docstring_tokens: Split a pathname .
function: def split(p):
      """Split a pathname.
  
      Return tuple (head, tail) where tail is everything after the final slash.
      Either part may be empty."""
  
      d, p = splitdrive(p)
      # set i to index beyond p's last slash
      i = len(p)
      while i and p[i-1] not in '/\\':
          i = i - 1
      head, tail = p[:i], p[i:]  # now tail has no slashes
      # remove trailing slashes from head, unless it's all slashes
      head2 = head
      while head2 and head2[-1] in '/\\':
          head2 = head2[:-1]
      head = head2 or head
      return d + head, tail
function_tokens: def split ( p ) : d , p = splitdrive ( p ) # set i to index beyond p's last slash i = len ( p ) while i and p [ i - 1 ] not in '/\\' : i = i - 1 head , tail = p [ : i ] , p [ i : ] # now tail has no slashes # remove trailing slashes from head, unless it's all slashes head2 = head while head2 and head2 [ - 1 ] in '/\\' : head2 = head2 [ : - 1 ] head = head2 or head return d + head , tail