def upath(path):
    if six.PY2 and not isinstance(path, six.text_type):
        return path.decode(fs_encoding)
    return path


# copied from django-cms (for compatibility with Django 1.4)
Split text into 1 to n gram terms
dataset/ETHPy150Open divio/django-filer/filer/utils/compatibility.py/upath--crossover with--dataset/ETHPy150Open victorlin/loso/loso/service.py/SegumentService.splitNgramTerms