def coerce_float(value):
    try:
        num = float(value)
    except ValueError:
        return None
    if num == num:  # is NaN?
        return num
    return None
dataset/ETHPy150Open graphql-python/graphql-core/graphql/core/type/scalars.py/coerce_float/original