code: def test_roc_curves_from_test_statistics_vis_api(csv_filename):
      """Ensure pdf and png figures can be saved via visualization API call.
  
      :param csv_filename: csv fixture from tests.fixtures.filenames.csv_filename
      :return: None
      """
      input_features = [binary_feature(), bag_feature()]
      output_features = [binary_feature()]
  
      with TemporaryDirectory() as tmpvizdir:
          # Generate test data
          data_csv = generate_data(
              input_features,
              output_features,
              os.path.join(tmpvizdir, csv_filename),
          )
          output_feature_name = output_features[0]["name"]
  
          model = run_api_experiment(input_features, output_features)
          data_df = read_csv(data_csv)
          _, _, output_dir = model.train(
              dataset=data_df,
              output_directory=os.path.join(tmpvizdir, "results"),
          )
          # extract test metrics
          test_stats, _, _ = model.evaluate(
              dataset=data_df,
              collect_overall_stats=True,
              output_directory=output_dir,
          )
          test_stats = test_stats
          viz_outputs = ("pdf", "png")
          for viz_output in viz_outputs:
              vis_output_pattern_pdf = os.path.join(
                  output_dir, f"*.{viz_output}"
              )
              visualize.roc_curves_from_test_statistics(
                  [test_stats, test_stats],
                  output_feature_name,
                  model_names=["Model1", "Model2"],
                  output_directory=output_dir,
                  file_format=viz_output,
              )
              figure_cnt = glob.glob(vis_output_pattern_pdf)
              assert 1 == len(figure_cnt)
  
imports: import glob
  import logging
  import os
  from tempfile import TemporaryDirectory
  import numpy
  import pytest
  from ludwig import visualize
  from ludwig.api import LudwigModel, TrainingStats
  from ludwig.constants import BATCH_SIZE, ENCODER, NAME, PREDICTIONS, PROBABILITIES, PROBABILITY, TRAINER, TYPE
  from ludwig.data.split import get_splitter
  from ludwig.globals import HYPEROPT_STATISTICS_FILE_NAME
  from ludwig.utils.data_utils import read_csv
  from tests.integration_tests.utils import bag_feature, binary_feature, category_feature, generate_data, LocalTestBackend, number_feature, sequence_feature, set_feature, text_feature
label_desc: Use image node_id 23 for calling a global function with example usage: test_roc_curves_from_test_statistics_vis_api(csv_filename) without return types