parameters: (p)
return_statement: return head
docstring: Returns the directory component of a pathname
docstring_summary: Returns the directory component of a pathname
docstring_tokens: Returns the directory component of a pathname
function: def dirname(p):
      """Returns the directory component of a pathname"""
      i = p.rfind('/') + 1
      head = p[:i]
      if head and head != '/'*len(head):
          head = head.rstrip('/')
      return head
function_tokens: def dirname ( p ) : i = p . rfind ( '/' ) + 1 head = p [ : i ] if head and head != '/' * len ( head ) : head = head . rstrip ( '/' ) return head