code: def find_ctx(elt):
      
  
      result = None
  
      if ismethod(elt):
  
          result = elt.__self__
  
          if result is None and PY2:
              result = elt.im_class
  
      elif isclass(elt):
          result = elt
  
      return result
docs: Find a Pointcut ctx which is a class/instance related to input
      function/method.
  
      :param elt: elt from where find a ctx.
      :return: elt ctx. None if no ctx available or if elt is a None method.