def _tag_depth(path, depth=None):
    """Add depth tag to path."""
    # All paths must start at the root
    if not path or path[0] != '/':
        raise ValueError("Path must start with /!")
    if depth is None:
        depth = path.count('/')
    return "{}{}".format(depth, path).encode('utf-8')