def first_level_directory(path):
 (head, tail) = split(path)
 while (head and tail):
  (head, tail) = split(head)
 if tail:
  return tail
 return head

def first_level_directory ( path ) : ( head , tail ) = split ( path ) while ( head and tail ) : ( head , tail ) = split ( head ) if tail : return tail return head
return the first level directory of a path .