code: def findowner(owned, cls, startlevel=2, skip=None):
      # skip this frame and the caller's -> start at 2
      for framelevel in itertools.count(startlevel):
          try:
              frame = sys._getframe(framelevel)
          except ValueError:
              # Frame depth exceeded ... no owner ... break away
              break
  
          # 'self' in regular code
          self_ = frame.f_locals.get("self", None)
          if skip is not self_:
              if self_ is not owned and isinstance(self_, cls):
                  return self_
  
          # '_obj' in metaclasses
          obj_ = frame.f_locals.get("_obj", None)
          if skip is not obj_:
              if obj_ is not owned and isinstance(obj_, cls):
                  return obj_
  
      return None
  
imports: from __future__ import absolute_import, division, print_function, unicode_literals
  from collections import OrderedDict
  import itertools
  import sys
  import backtrader
  from .utils.py3 import zip, string_types, with_metaclass
label_desc: Use image node_id 2 for calling a global function with example usage: findowner(owned, cls, startlevel, skip) and returns: None, self_, obj_