code: def test_relevel_by_freq_weights():
      fr = H2OFrame([[1, "a"], [2, "b"], [3, "c"]])
      fr["C2"] = fr["C2"].asfactor()
      assert fr.levels() == [[], ["a", "b", "c"]]
  
      fr_releveled = fr.relevel_by_frequency(weights_column="C1")
  
      assert_frame_equal(
          fr_releveled.as_data_frame(), fr.as_data_frame()
      )
      assert fr_releveled.levels() == [[], ["c", "b", "a"]]
  
imports: import sys
  from tests import pyunit_utils
  from pandas.testing import assert_frame_equal
  from h2o.frame import H2OFrame
label_desc: Use image node_id 1 for calling a global function with example usage: test_relevel_by_freq_weights() without return types