<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def checkFinite(value, name='value'):
 """Check that value is a finite number. If it is, return it. If not, raise GraphError describing the problem, using name in the error message. """

        if math.isnan(value):
            raise GraphError('Encountered NaN %s' % (name,))
        elif math.isinf(value):
            raise GraphError('Encountered infinite %s' % (name,))
        return value