docstr: If args is empty, assertRaises/Warns is being used as a
  context manager, so check for a 'msg' kwarg and return self.
  If args is not empty, call a callable passing positional and keyword
  arguments.
docstr_tok: ["If","args","is","empty",",","assertRaises\/Warns","is","being","used","as","a","context","manager",",","so","check","for","a","'msg","'","kwarg","and","return","self",".","If","args","is","not","empty",",","call","a","callable","passing","positional","and","keyword","arguments","."]
code: def handle(self, name, args, kwargs):
      """
      If args is empty, assertRaises/Warns is being used as a
      context manager, so check for a 'msg' kwarg and return self.
      If args is not empty, call a callable passing positional and keyword
      arguments.
      """
      # pylint: disable=no-member, self-cls-assignment, not-context-manager
      try:
          if not _is_subtype(self.expected, self._base_type):
              raise TypeError(
                  "%s() arg 1 must be %s" % (name, self._base_type_str)
              )
          if not args:
              self.msg = kwargs.pop("msg", None)
              if kwargs:
                  raise TypeError(
                      "%r is an invalid keyword argument for "
                      "this function" % (next(iter(kwargs)),)
                  )
              return self
  
          callable_obj = args[0]
          args = args[1:]
  
          try:
              self.obj_name = callable_obj.__name__
          except AttributeError:
              self.obj_name = str(callable_obj)
          with self:
              callable_obj(*args, **kwargs)
      finally:
          # bpo-23890: manually break a reference cycle
          self = None
  
imports: from __future__ import print_function, division, absolute_import
  import random
  import copy
  import warnings
  import tempfile
  import shutil
  import re
  import sys
  import importlib
  import functools
  import numpy
  import six.moves
  import imgaug
  import imgaug.random
  import imgaug.parameters
  from imgaug.augmentables.kps import KeypointsOnImage
label_desc: Use image node_id 2 for calling the _AssertRaisesBaseContext obj's underlying member method code with example usage: obj.handle(name, args, kwargs) and returns: self