code: def test_imbalance_local(balance):
      config = {
          "input_features": [
              {"name": "Index", "column": "Index", "type": "number"},
              {
                  "name": "random_1",
                  "column": "random_1",
                  "type": "number",
              },
              {
                  "name": "random_2",
                  "column": "random_2",
                  "type": "category",
              },
          ],
          "output_features": [
              {"name": "Label", "column": "Label", "type": "binary"}
          ],
          "trainer": {"epochs": 2, "batch_size": 8},
          "preprocessing": {},
      }
      df = pd.DataFrame(
          {
              "Index": np.arange(0, 200, 1),
              "random_1": np.random.randint(0, 50, 200),
              "random_2": np.random.choice(
                  ["Type A", "Type B", "Type C", "Type D"], 200
              ),
              "Label": np.concatenate((np.zeros(180), np.ones(20))),
          }
      )
  
      config["preprocessing"][balance] = 0.5
      run_test_imbalance_local(df, config, balance)
  
file_path: ludwig/tests/integration_tests/test_class_imbalance_feature.py
imports: import contextlib
  import os
  import shutil
  import numpy
  import pandas
  import pytest
  from ludwig.api import LudwigModel
  from ludwig.backend import LocalBackend
  from tests.integration_tests.utils import create_data_set_to_use, RAY_BACKEND_CONFIG, spawn
label_desc: Use image node_id 5 for calling a global function with example usage: test_imbalance_local(balance) without return types