docs: def is_defined_in_xxx(xxx, cls):
          """
          Small helper method that checks whether the class `cls` is defined
          under `::xxx` namespace
          """
          if not cls.parent:
              return False
  
          if not isinstance(cls.parent, namespace.namespace_t):
              return False
  
          if xxx != cls.parent.name:
              return False
  
          xxx_ns = cls.parent
          if not xxx_ns.parent:
              return False
  
          if not isinstance(xxx_ns.parent, namespace.namespace_t):
              return False
  
          if xxx_ns.parent.name != '::':
              return False
  
          global_ns = xxx_ns.parent
          return None is global_ns.parent