code: def _base_class_object_build(node, member, basenames, name=None, localname=None):
      
      klass = build_class(
          name or getattr(member, "__name__", None) or localname,
          basenames,
          member.__doc__,
      )
      klass._newstyle = isinstance(member, type)
      node.add_local_node(klass, localname)
      try:
          # limit the instantiation trick since it's too dangerous
          # (such as infinite test execution...)
          # this at least resolves common case such as Exception.args,
          # OSError.errno
          if issubclass(member, Exception):
              instdict = member().__dict__
          else:
              raise TypeError
      except TypeError:
          pass
      else:
          for item_name, obj in instdict.items():
              valnode = nodes.EmptyNode()
              valnode.object = obj
              valnode.parent = klass
              valnode.lineno = 1
              klass.instance_attrs[item_name] = [valnode]
      return klass
docs: create astroid for a living class object, with a given set of base names
      (e.g. ancestors)