code: 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
      --------
      >>> data = mx.nd.array([np.inf, -np.inf, np.NINF, -1])
      >>> output = mx.nd.contrib.isfinite(data)
      >>> output
      [0. 0. 0. 1.]
      <NDArray 4 @cpu(0)>
      """
      is_data_not_nan = (
          data == data
      )  # pylint: disable=comparison-with-itself
      is_data_not_infinite = data.abs() != np.inf
      return ndarray.logical_and(is_data_not_infinite, is_data_not_nan)
  
imports: import math
  import numpy
  import mxnet
  from ..device import current_device
  from ..random import uniform
  from ..base import _as_list
  from .None import ndarray
label_desc: Use image node_id 9 for calling a global function with example usage: isfinite(data) and returns: ndarray