(path)
return file_name
Normalize a path by ensuring it is a string.

    If the resulting string contains path separators, an exception is raised.
Normalize a path by ensuring it is a string.
Normalize a path by ensuring it is a string .
def normalize_path(path):
    # type: (Any) -> str
    """Normalize a path by ensuring it is a string.

    If the resulting string contains path separators, an exception is raised.
    """
    str_path = str(path)
    parent, file_name = os.path.split(str_path)
    if parent:
        raise ValueError(f'{path!r} must be only a file name')
    return file_name
def normalize_path ( path ) : # type: (Any) -> str str_path = str ( path ) parent , file_name = os . path . split ( str_path ) if parent : raise ValueError ( f'{path!r} must be only a file name' ) return file_name