code: def pre(
      self, in_data
  ):  # noqa: W0221  # pylint: disable=arguments-differ
      xdf = cudf if self.is_gpu() else pd
      if isinstance(in_data, xdf.Series):
          unique_values = in_data.drop_duplicates()
          return xdf.Series(unique_values, name=in_data.name)
      else:
          if self._axis == 0:
              data = dict()
              for d, v in in_data.iteritems():
                  if not self._use_arrow_dtype or xdf is cudf:
                      data[d] = [v.drop_duplicates().to_list()]
                  else:
                      data[d] = self._drop_duplicates_to_arrow(v)
              df = xdf.DataFrame(data)
          else:
              df = xdf.DataFrame(columns=[0])
              for d, v in in_data.iterrows():
                  if not self._use_arrow_dtype or xdf is cudf:
                      df.loc[d] = [v.drop_duplicates().to_list()]
                  else:
                      df.loc[d] = self._drop_duplicates_to_arrow(v)
          return df
  
imports: import pandas
  from ...None import opcodes
  from ...core import OutputType
  from ...config import options
  from ...serialization.serializables import BoolField
  from ...utils import lazy_import
  from ..arrays import ArrowListArray, ArrowListDtype
  from .core import DataFrameReductionOperand, DataFrameReductionMixin, CustomReduction
label_desc: Use image node_id 3 for calling the NuniqueReduction obj's underlying member method code with example usage: obj.pre(in_data) and returns: xdf, df