

def get_full_path(path, language, bookmark=''):
    ' Utility function to build a valid path based on an initial\n    :param path: the initial path\n    :param language: language component\n    :param bookmark: bookmark, if any\n    :return: a valid path string\n    '
    if (not path.startswith('/')):
        path = ('/' + path)
    if (not path.endswith('/')):
        path += '/'
    path += bookmark
    if (language and settings.I18N_URLS):
        path = (('/' + language) + path)
    return path

dataset/ETHPy150Open Wtower/django-ninecms/ninecms/utils/nodes.py get_full_path/original