code: def test_warning_rc_file(caplog):
      """Test invalid lines and duplicated keys log warnings and bad value raises error."""
      path = os.path.dirname(os.path.abspath(__file__))
      read_rcfile(os.path.join(path, "../test.rcparams"))
      records = caplog.records
      assert len(records) == 1
      assert records[0].levelname == "WARNING"
      assert "Duplicate key" in caplog.text
  
imports: import os
  import numpy
  import pytest
  from xarray.core.indexing import MemoryCachedArray
  from ...data import datasets, load_arviz_data
  from ...rcparams import _make_validate_choice, _make_validate_choice_regex, _validate_float_or_none, _validate_positive_int_or_none, _validate_probability, make_iterable_validator, rc_context, rc_params, rcParams, read_rcfile
  from ...stats import compare
  from ..helpers import models
label_desc: Use image node_id 4 for calling a global function with example usage: test_warning_rc_file(caplog) without return types