code: def build_custom_reduction_result(
      df, custom_reduction_obj, method=None
  ):
      use_inf_as_na = options.dataframe.mode.use_inf_as_na
      output_type = (
          OutputType.series if df.ndim == 2 else OutputType.scalar
      )
      op = DataFrameCustomReduction(
          custom_reduction=custom_reduction_obj,
          output_types=[output_type],
          use_inf_as_na=use_inf_as_na,
          method=method,
      )
      return op(df)
  
file_path: mars/mars/dataframe/reduction/custom_reduction.py
imports: from ...None import opcodes
  from ...config import options
  from ...core import OutputType
  from ...serialization.serializables import AnyField
  from .core import DataFrameReductionOperand, DataFrameReductionMixin
label_desc: Use image node_id 1 for calling a global function with example usage: build_custom_reduction_result(df, custom_reduction_obj, method) and returns: op