code: def get_testing_print_function(
      calls: List[List[Union[str, Dict[str, Any]]]],
  ) -> Callable[..., Any]:
      def new_print(*args):
          data = []
          for arg in args:
              if isinstance(arg, BaseModel):
                  data.append(arg.model_dump())
              elif isinstance(arg, list):
                  new_list = []
                  for item in arg:
                      if isinstance(item, BaseModel):
                          new_list.append(item.model_dump())
                  data.append(new_list)
              else:
                  data.append(arg)
          calls.append(data)
  
      return new_print
  
file_path: sqlmodel/tests/conftest.py
imports: import shutil
  import subprocess
  import sys
  from pathlib import Path
  from typing import Any, Callable, Dict, List, Union
  import pytest
  from pydantic import BaseModel
  from sqlmodel import SQLModel
  from sqlmodel._compat import IS_PYDANTIC_V2
  from sqlmodel.main import default_registry
label_desc: Use image node_id 4 for calling a global function with example usage: get_testing_print_function(calls) and returns: new_print