<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def normalize_nucleotide_string( nucleotides, allow_extended_nucleotides=False, empty_chars=".-", treat_nan_as_empty=True):
 """ Normalizes a nucleotide string by converting various ways of encoding empty strings into "", making all letters upper case, and checking to make sure all letters in the string are actually nucleotides. Parameters nucleotides : str Sequence of nucleotides, e.g. "ACCTG" extended_nucleotides : bool Allow non-canonical nucleotide characters like 'X' for unknown base empty_chars : str Characters which encode empty strings, such as "." used in VCF format or "-" used in MAF format treat_nan_as_empty : bool Some MAF files represent deletions/insertions with NaN ref/alt values """

    if nucleotides in empty_chars:
        return ""
    elif treat_nan_as_empty and isinstance(nucleotides, float) and np.isnan(nucleotides):
        return ""

    require_string(nucleotides, name="nucleotide string")

    nucleotides = nucleotides.upper()

    if allow_extended_nucleotides:
        valid_nucleotides = EXTENDED_NUCLEOTIDES
    else:
        valid_nucleotides = STANDARD_NUCLEOTIDES

    if not set(nucleotides) <= valid_nucleotides:
        raise ValueError(
            "Invalid character(s) in nucleotide string: %s" % (
                ",".join(set(nucleotides) - valid_nucleotides),))

    return nucleotides