def convert_filename(value):

    if NORMALIZE_FILENAME:
        chunks = value.split(os.extsep)
        normalized = []

        for v in chunks:
            v = unicodedata.normalize('NFKD', six.text_type(v)).encode('ascii', 'ignore').decode('ascii')
            v = re.sub(r'[^\w\s-]', '', v).strip()
            normalized.append(v)

        if len(normalized) > 1:
            value = '.'.join(normalized)
        else:
            value = normalized[0]

    if CONVERT_FILENAME:
        value = value.replace(" ", "_").lower()

    return value
Convert Filename.
dataset/ETHPy150Open stephenmcd/filebrowser-safe/filebrowser_safe/functions.py/convert_filename