def _clean_extracted_series_name(seriesname):
    # type: (str) -> str
    """Cleans up series name by removing any . and _
    characters, along with any trailing hyphens.

    Is basically equivalent to replacing all _ and . with a
    space, but handles decimal numbers in string, for example:

    >>> _clean_extracted_series_name("an.example.1.0.test")
    'an example 1.0 test'
    >>> _clean_extracted_series_name("an_example_1.0_test")
    'an example 1.0 test'
    """
    # TODO: Could this be made to clean "Hawaii.Five-0.2010" into "Hawaii Five-0 2010"?
    seriesname = re.sub(r"(\D)[.](\D)", "\\1 \\2", seriesname)
    seriesname = re.sub(r"(\D)[.]", "\\1 ", seriesname)
    seriesname = re.sub(r"[.](\D)", " \\1", seriesname)
    seriesname = seriesname.replace("_", " ")
    seriesname = re.sub("-$", "", seriesname)
    return seriesname.strip()
Cleans up series name by removing any . and _
    characters, along with any trailing hyphens.

    Is basically equivalent to replacing all _ and . with a
    space, but handles decimal numbers in string, for example:

    >>> _clean_extracted_series_name("an.example.1.0.test")
    'an example 1.0 test'
    >>> _clean_extracted_series_name("an_example_1.0_test")
    'an example 1.0 test'
    
tvnamer/files.py