code: def filter_baseline(
      sample,
      kernel,
      anchor,
      border,
      fill_value=None,
      mode="same",
      has_channels=False,
  ):
      assert mode in ("same", "valid"), f"{mode}"
  
      def baseline_call(plane):
          return scipy_baseline_plane(
              plane, kernel, anchor, border, fill_value, mode
          )
  
      ndim = len(sample.shape)
      if not has_channels:
          assert ndim in (2, 3)
          return baseline_call(sample)
      assert ndim in (3, 4)
  
      ndim = len(sample.shape)
      channel_dim = ndim - 1
      channel_first = sample.transpose(
          [channel_dim] + [i for i in range(channel_dim)]
      )
      out = np.stack(
          [baseline_call(plane) for plane in channel_first],
          axis=channel_dim,
      )
      return out
  
imports: import numpy
label_desc: Use image node_id 3 for calling a global function with example usage: filter_baseline(sample, kernel, anchor, border, fill_value, mode, has_channels) and returns: out, scipy_baseline_plane, baseline_call