code: def reduce_fn(x):
      """
      Aggregation function to get the first non-zero value.
      """
      values = x.values if isinstance(x, pd.Series) else x
      for v in values:
          if not is_nan(v):
              return v
      return np.nan
  
imports: import itertools
  import numpy
  import pandas
  import param
  from ..core import Dataset
  from ..core.boundingregion import BoundingBox
  from ..core.data import PandasInterface, default_datatype
  from ..core.operation import Operation
  from ..core.sheetcoords import Slice
  from ..core.util import cartesian_product, datetime_types, is_cyclic, is_nan, one_to_one, sort_topologically
label_desc: Use image node_id 3 for calling a global function with example usage: reduce_fn(x) and returns: np, v