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/py2/IPython/testing/decorators.py
imports: import sys
  import os
  import tempfile
  import unittest
  import warnings
  from decorator import decorator
  from .ipunittest import ipdoctest, ipdocstring
  from IPython.external.decorators import *
  from IPython.utils.py3compat import string_types, which, PY2, PY3, PYPY
label_desc: Use image node_id 1 for calling a global function with example usage: as_unittest(func) and returns: Tester