(rpath)
return rpath
u'''rpath is either list or empty string (if list, we need only first item);
    return either empty string or rpath[0] (or its parent), e.g.
        foo/bar/ → foo/bar/
        foo/bar  → foo/
u'''rpath is either list or empty string (if list, we need only first item);
    return either empty string or rpath[0] (or its parent), e.g.
        foo/bar/ → foo/bar/
        foo/bar  → foo/
u rpath is either list or empty string ( if list we need only first item ) ; return either empty string or rpath [ 0 ] ( or its parent ) e . g . foo / bar / → foo / bar / foo / bar → foo /
def relative_path(rpath):
    u'''rpath is either list or empty string (if list, we need only first item);
    return either empty string or rpath[0] (or its parent), e.g.
        foo/bar/ → foo/bar/
        foo/bar  → foo/
    '''
    if rpath:
        rpath = rpath[0]
        if rpath[~0] != os.sep:
            rpath = os.path.split(rpath)[0] + os.sep
        if rpath == os.sep:
            rpath = ''
    return rpath
def relative_path ( rpath ) : if rpath : rpath = rpath [ 0 ] if rpath [ ~ 0 ] != os . sep : rpath = os . path . split ( rpath ) [ 0 ] + os . sep if rpath == os . sep : rpath = '' return rpath