code: def test_no_error_triggered_when_df_contains_unseen_categories_and_unseen_is_encode(
      df_enc, df_enc_rare
  ):
      # dataset to be transformed contains categories not present in
      # training dataset (unseen categories).
  
      # check for no error and no warning when unseen equals 'encode'
      warnings.simplefilter("error")
      encoder = CountFrequencyEncoder(unseen="encode")
      encoder.fit(df_enc)
      with warnings.catch_warnings():
          encoder.transform(df_enc_rare)
  
imports: import warnings
  import numpy
  import pandas
  import pytest
  from numpy import nan
  from feature_engine.encoding import CountFrequencyEncoder
label_desc: Use image node_id 6 for calling a global function with example usage: test_no_error_triggered_when_df_contains_unseen_categories_and_unseen_is_encode(df_enc, df_enc_rare) without return types