def extract_context():
 for frame in inspect.stack():
  arguments = frame[0].f_code.co_varnames
  if (not arguments):
   continue
  self_argument = arguments[0]
  if (not (self_argument in frame[0].f_locals)):
   continue
  instance = frame[0].f_locals[self_argument]
  if (hasattr(instance, 'context') and isinstance(instance.context, PluginContext)):
   return instance.context

def extract_context ( ) : for frame in inspect . stack ( ) : arguments = frame [ 0 ] . f_code . co_varnames if ( not arguments ) : continue self_argument = arguments [ 0 ] if ( not ( self_argument in frame [ 0 ] . f_locals ) ) : continue instance = frame [ 0 ] . f_locals [ self_argument ] if ( hasattr ( instance , 'context' ) and isinstance ( instance . context , PluginContext ) ) : return instance . context
given an xml element corresponding to the output of test_capa_system .