def split_leading_dir(path):
    path = str(path)
    path = path.lstrip('/').lstrip('\\')
    if '/' in path and (('\\' in path and path.find('/') < path.find('\\'))
                        or '\\' not in path):
        return path.split('/', 1)
    elif '\\' in path:
        return path.split('\\', 1)
    else:
        return path, ''
dataset/ETHPy150Open tschellenbach/Django-facebook/docs/docs_env/Lib/site-packages/pip-1.0-py2.5.egg/pip/util.py/split_leading_dir/original