code: def pyunit_apply_with_args():
      fr = h2o_frame_fixture()
      ref = fr.scale(center=False, scale=False).as_data_frame()
  
      # vars
      false = False
      args = (False, False)
      kwargs = dict(center=False, scale=False)
      partial_args = (False,)
      partial_kwargs = dict(scale=False)
  
      to_test = dict(
          scale_with_arg=lambda x: x.scale(False, False),
          scale_with_kwarg=lambda x: x.scale(center=False, scale=False),
          scale_with_argkwarg=lambda x: x.scale(False, scale=False),
          scale_with_global_arg=(lambda x: x.scale(false, scale=false)),
          scale_with_args=(lambda x: x.scale(*args)),
          scale_with_kwargs=(lambda x: x.scale(**kwargs)),
          scale_with_partial_args=(
              lambda x: x.scale(False, *partial_args)
          ),
          scale_with_partial_kwargs=(
              lambda x: x.scale(False, **partial_kwargs)
          ),
          scale_with_partial_kwargs2=(
              lambda x: x.scale(center=False, **partial_kwargs)
          ),
          scale_with_args_and_kwargs=(
              lambda x: x.scale(*partial_args, **partial_kwargs)
          ),
          scale_with_all_kind_args=(
              lambda x: x.scale(
                  False, *partial_args, scale=False, **partial_kwargs
              )
          ),  # surprisingly this works because our signature verification is not that strict, but it's fine... at least behaves as expected.
      )
      for test, lbd in to_test.items():
          if lbd:
              print(test)
              res = fr.apply(lbd)
              res_df = res.as_data_frame()
              assert_frame_equal(res_df, ref)
              h2o.remove(res)
  
file_path: h2o-3/h2o-py/tests/testdir_misc/pyunit_apply.py
imports: import sys
  import h2o
  from tests import pyunit_utils
  import pandas
  from pandas.util.testing import assert_frame_equal
  import numpy
  from functools import partial
label_desc: Use image node_id 9 for calling a global function with example usage: pyunit_apply_with_args() without return types