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-genutils/py3/ipython_genutils/testing/decorators.py
imports: import sys
  import os
  import tempfile
  import unittest
  from ..py3compat import string_types, which
label_desc: Use image node_id 1 for calling a global function with example usage: as_unittest(func) and returns: Tester