def normalize_extension(extension):
    """Normalise a file name extension."""
    extension = decode_path(extension)
    if extension is None:
        return
    if extension.startswith('.'):
        extension = extension[1:]
    if '.' in extension:
        _, extension = os.path.splitext(extension)
    extension = slugify(extension, sep='')
    if extension is None:
        return
    if len(extension):
        return extension
def normalize_extension ( extension ) : extension = decode_path ( extension ) if extension is None : return if extension . startswith ( '.' ) : extension = extension [ 1 : ] if '.' in extension : _ , extension = os . path . splitext ( extension ) extension = slugify ( extension , sep = '' ) if extension is None : return if len ( extension ) : return extension
Normalise a file name extension.