code: def as_unittest(func):
      """Decorator to make a simple function into a normal test via unittest."""
  
      class Tester(unittest.TestCase):
          def test(self):
              func()
  
      Tester.__name__ = func.__name__
  
      return Tester
  
file_path: catboost/contrib/python/ipython/py3/IPython/testing/decorators.py
imports: import os
  import shutil
  import sys
  import tempfile
  import unittest
  from importlib import import_module
  from decorator import decorator
  from .ipunittest import ipdoctest, ipdocstring
label_desc: Use image node_id 1 for calling a global function with example usage: as_unittest(func) and returns: Tester