code: def test_dataframe_replace(df, to_replace, value):
      gdf = df
      pdf = gdf.to_pandas()
  
      pd_value = value
      if isinstance(value, pd.Series):
          gd_value = cudf.from_pandas(value)
      else:
          gd_value = value
  
      pd_to_replace = to_replace
      if isinstance(to_replace, pd.Series):
          gd_to_replace = cudf.from_pandas(to_replace)
      else:
          gd_to_replace = to_replace
  
      if pd_value is None:
          expected = pdf.replace(to_replace=pd_to_replace)
      else:
          expected = pdf.replace(
              to_replace=pd_to_replace, value=pd_value
          )
      actual = gdf.replace(to_replace=gd_to_replace, value=gd_value)
  
      expected_sorted = expected.sort_values(
          by=list(expected.columns), axis=0
      )
      actual_sorted = actual.sort_values(
          by=list(actual.columns), axis=0
      )
  
      assert_eq(expected_sorted, actual_sorted)
  
imports: import re
  from decimal import Decimal
  import numpy
  import pandas
  import pytest
  import cudf
  from cudf.core._compat import PANDAS_GE_134, PANDAS_GE_150
  from cudf.core.dtypes import Decimal32Dtype, Decimal64Dtype, Decimal128Dtype
  from cudf.testing._utils import INTEGER_TYPES, NUMERIC_TYPES, assert_eq, assert_exceptions_equal
label_desc: Use image node_id 4 for calling a global function with example usage: test_dataframe_replace(df, to_replace, value) without return types