def get_non_nan_unary_red_code(
    kind: str, unary_red_code: UnaryRedCode
) -> UnaryRedCode:
    """
    Return the equivalent non-nan reduction op codes if the datatype
    of the array isn't floating-point. Raise an error if the datatype
    is disallowed, which is currently complex64 and complex128.
    """

    assert unary_red_code in _EQUIVALENT_NON_NAN_OPS

    # complex datatype is not supported
    if kind == "c":
        raise NotImplementedError(
            "operation is not supported for complex64 and complex128 types"
        )

    # use NaN API if the datatype is floating point type otherwise
    # use equivalent non-NaN API
    if kind == "f":
        return unary_red_code

    return _EQUIVALENT_NON_NAN_OPS[unary_red_code]

    Return the equivalent non-nan reduction op codes if the datatype
    of the array isn't floating-point. Raise an error if the datatype
    is disallowed, which is currently complex64 and complex128.
    
cupynumeric/_module/_unary_red_utils.py