code: def _get_output(
      algorithm,
      iport=0,
      iconnection=0,
      oport=0,
      active_scalars=None,
      active_scalars_field="point",
  ):
      """Get the algorithm's output and copy input's pyvista meta info."""
      ido = wrap(algorithm.GetInputDataObject(iport, iconnection))
      data = wrap(algorithm.GetOutputDataObject(oport))
      if not isinstance(data, pyvista.MultiBlock):
          data.copy_meta_from(ido, deep=True)
          if not data.field_data and ido.field_data:
              data.field_data.update(ido.field_data)
          if active_scalars is not None:
              data.set_active_scalars(
                  active_scalars, preference=active_scalars_field
              )
      # return a PointSet if input is a pointset
      if isinstance(ido, pyvista.PointSet):
          return data.cast_to_pointset()
      return data
  
file_path: pyvista/pyvista/core/filters/__init__.py
imports: import pyvista
  from pyvista.core.utilities.helpers import wrap
  from pyvista.core.utilities.observers import ProgressMonitor
  from .composite import CompositeFilters
  from .data_set import DataSetFilters
  from .image_data import ImageDataFilters
  from .poly_data import PolyDataFilters
  from .rectilinear_grid import RectilinearGridFilters
  from .structured_grid import StructuredGridFilters
  from .unstructured_grid import UnstructuredGridFilters
label_desc: Use image node_id 2 for calling a global function with example usage: _get_output(algorithm, iport, iconnection, oport, active_scalars, active_scalars_field) and returns: data, data