code: def print_as_warning(
      message: str, warning_class: Type[Warning] = UserWarning
  ) -> None:
      old_format = copy.copy(warnings.formatwarning)
      warnings.formatwarning = _custom_formatwarning
      warnings.warn(message, warning_class)
      warnings.formatwarning = old_format
  
imports: import copy
  import warnings
  from typing import Type, Union
label_desc: Use image node_id 2 for calling a global function with example usage: print_as_warning(message, warning_class) without return types