code: def test_warn_and_drop_long_samples():
      df = pd.DataFrame(
          {
              "prompt": ["a" * 12000, "a" * 9000, "a"],
              "completion": ["b" * 12000, "b" * 2000, "b"],
          }
      )
  
      expected_df = pd.DataFrame({"prompt": ["a"], "completion": ["b"]})
      message = f"""TODO: There are {2} / {3} 
          samples that have its prompt and completion too long 
          (over {10000} chars), which have been dropped."""
  
      assert expected_df.equals(
          warn_and_drop_long_samples(df, 10000)[0]
      )
      assert warn_and_drop_long_samples(df, 10000)[1] == message
  
      df_short = pd.DataFrame(
          {"prompt": ["a"] * 2, "completion": ["b"] * 2}
      )
  
      assert warn_and_drop_long_samples(df_short, 10000) == (
          df_short,
          None,
      )
  
imports: import pandas
  import pytest
  from ..customization_dataset_preparation import convert_into_prompt_completion_only, convert_into_template, drop_duplicated_rows, drop_unrequired_fields, get_common_suffix, get_prepared_filename, parse_template, recommend_hyperparameters, show_first_example_in_df, split_into_train_validation, template_mapper, validate_template, warn_and_drop_long_samples, warn_completion_is_not_empty, warn_duplicated_rows, warn_imbalanced_completion, warn_low_n_samples, warn_missing_suffix
label_desc: Use image node_id 15 for calling a global function with example usage: test_warn_and_drop_long_samples() without return types