def splitall(path):
head, tail = os.path.split(os.path.normpath(path))<EOL>components = []<EOL>while tail:<EOL><INDENT>components.insert(<NUM_LIT:0>, tail)<EOL>head, tail = os.path.split(head)<EOL><DEDENT>return components<EOL>
Splits path in its components:
foo/bar, /foo/bar and /foo/bar/ will all return
['foo', 'bar']