<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def isfinite(data):
 """Performs an element-wise check to determine if the NDArray contains an infinite element or not. Parameters input : NDArray An N-D NDArray. Returns ------- output: NDArray The output NDarray, with same shape as input, where 1 indicates the array element is finite i.e. not equal to positive or negative infinity and 0 in places where it is positive or negative infinity. Examples -------- [0. 0. 0. 1.] <NDArray 4 @cpu(0)> """

    is_data_not_nan = data == data
    is_data_not_infinite = data.abs() != np.inf
    return ndarray.logical_and(is_data_not_infinite, is_data_not_nan)