def _get_immediate_cls_attr(cls, attrname, strict=False):
 if (not issubclass(cls, object)):
  return None
 for base in cls.__mro__:
  _is_declarative_inherits = hasattr(base, '_decl_class_registry')
  if ((attrname in base.__dict__) and ((base is cls) or (((base in cls.__bases__) if strict else True) and (not _is_declarative_inherits)))):
   return getattr(base, attrname)
 else:
  return None

def _get_immediate_cls_attr ( cls , attrname , strict = False ) : if ( not issubclass ( cls , object ) ) : return None for base in cls . __mro__ : _is_declarative_inherits = hasattr ( base , '_decl_class_registry' ) if ( ( attrname in base . __dict__ ) and ( ( base is cls ) or ( ( ( base in cls . __bases__ ) if strict else True ) and ( not _is_declarative_inherits ) ) ) ) : return getattr ( base , attrname ) else : return None
return an attribute of the class that is either present directly on the class .