

def lowercase_ext(filename):
    '\n    This is a helper used by UploadSet.save to provide lowercase extensions for\n    all processed files, to compare with configured extensions in the same\n    case.\n\n    .. versionchanged:: 0.1.4\n       Filenames without extensions are no longer lowercased, only the\n       extension is returned in lowercase, if an extension exists.\n\n    :param filename: The filename to ensure has a lowercase extension.\n    '
    if ('.' in ext):
        (main, ext) = os.path.splitext(filename)
        return (main + ext.lower())
    return filename

dataset/ETHPy150Open jeffwidman/flask-uploads/flask_uploads.py lowercase_ext/VarMisuse@16/166 `filename`->`ext`