code: def test_choose_param_value():
      original_params = {
          "local_listen_port": 1234,
          "port": 2222,
          "metric": "auc",
          "num_trees": 81,
          "n_iter": 13,
      }
  
      # should resolve duplicate aliases, and prefer the main parameter
      params = lgb.basic._choose_param_value(
          main_param_name="local_listen_port",
          params=original_params,
          default_value=5555,
      )
      assert params["local_listen_port"] == 1234
      assert "port" not in params
  
      # should choose the highest priority alias and set that value on main param
      # if only aliases are used
      params = lgb.basic._choose_param_value(
          main_param_name="num_iterations",
          params=params,
          default_value=17,
      )
      assert params["num_iterations"] == 13
      assert "num_trees" not in params
      assert "n_iter" not in params
  
      # should use the default if main param and aliases are missing
      params = lgb.basic._choose_param_value(
          main_param_name="learning_rate",
          params=params,
          default_value=0.789,
      )
      assert params["learning_rate"] == 0.789
  
      # all changes should be made on copies and not modify the original
      expected_params = {
          "local_listen_port": 1234,
          "port": 2222,
          "metric": "auc",
          "num_trees": 81,
          "n_iter": 13,
      }
      assert original_params == expected_params
  
imports: import filecmp
  import numbers
  import re
  from copy import deepcopy
  from os import getenv
  from pathlib import Path
  import numpy
  import pytest
  from scipy import sparse
  from sklearn.datasets import dump_svmlight_file, load_svmlight_file
  from sklearn.model_selection import train_test_split
  import lightgbm
  from lightgbm.compat import PANDAS_INSTALLED, pd_DataFrame, pd_Series
  from .utils import dummy_obj, load_breast_cancer, mse_obj, np_assert_array_equal
label_desc: Use image node_id 19 for calling a global function with example usage: test_choose_param_value() without return types