code: def test_dataframe_and_scalar(func_name, func_opts):
      if func_opts.func_name in ["__and__", "__or__", "__xor__"]:
          # bitwise logical operators doesn\'t support floating point scalars
          return
  
      data = pd.DataFrame(
          np.random.rand(10, 10),
          index=np.arange(10),
          columns=np.arange(3, 13),
      )
      df = from_pandas(data, chunk_size=5)
      # test operator with scalar
      result = func_opts.func(df, 1)
      result2 = getattr(df, func_opts.func_name)(1)
  
      # test reverse operator with scalar
      result3 = getattr(df, func_opts.rfunc_name)(1)
      result4 = func_opts.func(df, 1)
      result5 = func_opts.func(1, df)
  
      expected = func_opts.func(data, 2)
      pd.testing.assert_series_equal(result.dtypes, expected.dtypes)
  
      pd.testing.assert_index_equal(
          result.columns_value.to_pandas(), data.columns
      )
      assert isinstance(result.index_value.value, IndexValue.Int64Index)
  
      pd.testing.assert_index_equal(
          result2.columns_value.to_pandas(), data.columns
      )
      assert isinstance(
          result2.index_value.value, IndexValue.Int64Index
      )
  
      pd.testing.assert_index_equal(
          result3.columns_value.to_pandas(), data.columns
      )
      assert isinstance(
          result3.index_value.value, IndexValue.Int64Index
      )
  
      pd.testing.assert_index_equal(
          result4.columns_value.to_pandas(), data.columns
      )
      assert isinstance(
          result4.index_value.value, IndexValue.Int64Index
      )
  
      pd.testing.assert_index_equal(
          result5.columns_value.to_pandas(), data.columns
      )
      assert isinstance(
          result5.index_value.value, IndexValue.Int64Index
      )
  
      if "builtin_function_or_method" not in str(type(func_opts.func)):
          # skip NotImplemented test for comparison function
          return
  
      # test NotImplemented, use other's rfunc instead
      class TestRFunc:
          pass
  
      setattr(TestRFunc, f"__{func_opts.rfunc_name}__", lambda *_: 1)
      other = TestRFunc()
      ret = func_opts.func(df, other)
      assert ret == 1
  
imports: import datetime
  import itertools
  import operator
  from dataclasses import dataclass
  from typing import Callable
  import numpy
  import pandas
  import pytest
  from ....None import tensor
  from ....core import OutputType, OperandType, tile
  from ....core.operand import OperandStage
  from ....utils import dataslots
  from ...align import DataFrameIndexAlign, DataFrameShuffleProxy
  from ...core import IndexValue
  from ...datasource.dataframe import from_pandas, DataFrameDataSource
  from ...datasource.from_tensor import dataframe_from_tensor
  from ...datasource.series import from_pandas, SeriesDataSource
  from ...utils import hash_dtypes
  from ...utils import split_monotonic_index_min_max, build_split_idx_to_origin_idx, filter_index_value
  from ..None import DataFrameAbs, DataFrameAdd, DataFrameSubtract, DataFrameMul, DataFrameFloorDiv, DataFrameTrueDiv, DataFrameMod, DataFramePower, DataFrameEqual, DataFrameNotEqual, DataFrameGreater, DataFrameLess, DataFrameGreaterEqual, DataFrameLessEqual, DataFrameNot, DataFrameAnd, DataFrameOr, DataFrameXor
label_desc: Use image node_id 17 for calling a global function with example usage: test_dataframe_and_scalar(func_name, func_opts) without return types