# Buggy code
def make_class(
    self, node, name_var, bases, class_dict_var, cls_var, new_class_var=None
):
    """Create a class with the name, bases and methods given.

    Args:
      node: The current CFG node.
      name_var: Class name.
      bases: Base classes.
      class_dict_var: Members of the class, as a Variable containing an
          abstract.Dict value.
      cls_var: The class's metaclass, if any.
      new_class_var: If not None, make_class() will return new_class_var with
          the newly constructed class added as a binding. Otherwise, a new
          variable if returned.

    Returns:
      A node and an instance of Class.
    """
    name = abstract_utils.get_atomic_python_constant(name_var)
    log.info("Declaring class %s", name)
    try:
        class_dict = abstract_utils.get_atomic_value(class_dict_var)
    except abstract_utils.ConversionError:
        log.error("Error initializing class %r", name)
        return self.convert.create_new_unknown(node)
    # Handle six.with_metaclass.
    metacls, bases = self._filter_out_metaclasses(bases)
    if metacls:
        cls_var = metacls
    # Flatten Unions in the bases
    bases = [self._process_base_class(node, base) for base in bases]
    if not bases:
        # Old style class.
        bases = [self.convert.oldstyleclass_type.to_variable(self.root_cfg_node)]
    if isinstance(class_dict, abstract.Unsolvable) or not isinstance(
        class_dict, mixin.PythonConstant
    ):
        # An unsolvable appears here if the vm hit maximum depth and gave up on
        # analyzing the class we're now building. Otherwise, if class_dict isn't
        # a constant, then it's an abstract dictionary, and we don't have enough
        # information to continue building the class.
        var = self.new_unsolvable(node)
    else:
        if cls_var is None:
            cls_var = class_dict.members.get("__metaclass__")
            if cls_var and self.PY3:
                # This way of declaring metaclasses no longer works in Python 3.
                self.errorlog.ignored_metaclass(
                    self.frames,
                    name,
                    cls_var.data[0].full_name if cls_var.bindings else "Any",
                )
        if cls_var and all(
            v.data.full_name == "__builtin__.type" for v in cls_var.bindings
        ):
            cls_var = None
        # pylint: disable=g-long-ternary
        cls = (
            abstract_utils.get_atomic_value(cls_var, default=self.convert.unsolvable)
            if cls_var
            else None
        )
        try:
            val = abstract.InterpreterClass(name, bases, class_dict.pyval, cls, self)
            if class_dict.late_annotations:
                val.late_annotations = class_dict.late_annotations
                self.classes_with_late_annotations.append(val)
        except mro.MROError as e:
            self.errorlog.mro_error(self.frames, name, e.mro_seqs)
            var = self.new_unsolvable(node)
        except abstract_utils.GenericTypeError as e:
            self.errorlog.invalid_annotation(self.frames, e.annot, e.error)
            var = self.new_unsolvable(node)
        else:
            if new_class_var:
                var = new_class_var
            else:
                var = self.program.NewVariable()
            var.AddBinding(val, class_dict_var.bindings, node)
            node = val.call_metaclass_init(node)
            if not val.is_abstract:
                # Since a class decorator could have made the class inherit from
                # ABCMeta, we have to mark concrete classes now and check for
                # abstract methods at postprocessing time.
                self.concrete_classes.append((val, self.simple_stack()))
    self.trace_opcode(None, name, var)
    return node, var


# Traceback (AttributeError)
from typing import Any
def __getattr__(name: Any) -> Any: ...
# Caught error in pytype: 'LateAnnotation' object has no attribute 'Bindings'
# Traceback (most recent call last):
#   File "/Users/name/.pyenv/versions/3.7.3/envs/venv/lib/python3.7/site-packages/pytype/io.py", line 131, in check_or_generate_pyi
#     input_filename=options.input, options=options, loader=loader)
#   File "/Users/name/.pyenv/versions/3.7.3/envs/venv/lib/python3.7/site-packages/pytype/io.py", line 89, in generate_pyi
#     analyze.infer_types, input_filename, options, loader)
#   File "/Users/name/.pyenv/versions/3.7.3/envs/venv/lib/python3.7/site-packages/pytype/io.py", line 62, in _call
#     deep=deep)
#   File "/Users/name/.pyenv/versions/3.7.3/envs/venv/lib/python3.7/site-packages/pytype/analyze.py", line 668, in infer_types
#     tracer.exitpoint = tracer.analyze(loc, defs, maximum_depth)
#   File "/Users/name/.pyenv/versions/3.7.3/envs/venv/lib/python3.7/site-packages/pytype/analyze.py", line 407, in analyze
#     return self.analyze_toplevel(node, defs)
#   File "/Users/name/.pyenv/versions/3.7.3/envs/venv/lib/python3.7/site-packages/pytype/analyze.py", line 370, in analyze_toplevel
#     new_node = self.analyze_class(node, value)
#   File "/Users/name/.pyenv/versions/3.7.3/envs/venv/lib/python3.7/site-packages/pytype/analyze.py", line 352, in analyze_class
#     node = self.analyze_method_var(node, name, b)
#   File "/Users/name/.pyenv/versions/3.7.3/envs/venv/lib/python3.7/site-packages/pytype/analyze.py", line 202, in analyze_method_var
#     node2 = self.maybe_analyze_method(node1, val)
#   File "/Users/name/.pyenv/versions/3.7.3/envs/venv/lib/python3.7/site-packages/pytype/analyze.py", line 157, in maybe_analyze_method
#     node, _ = self.call_function_with_args(node, val, args)
#   File "/Users/name/.pyenv/versions/3.7.3/envs/venv/lib/python3.7/site-packages/pytype/analyze.py", line 121, in call_function_with_args
#     new_node, ret = self.call_function_in_frame(node, fvar, *args)
#   File "/Users/name/.pyenv/versions/3.7.3/envs/venv/lib/python3.7/site-packages/pytype/analyze.py", line 132, in call_function_in_frame
#     state, var, args, kwargs, starargs, starstarargs)
#   File "/Users/name/.pyenv/versions/3.7.3/envs/venv/lib/python3.7/site-packages/pytype/vm.py", line 917, in call_function_with_state
#     starstarargs=starstarargs), fallback_to_unsolvable, allow_noreturn=True)
#   File "/Users/name/.pyenv/versions/3.7.3/envs/venv/lib/python3.7/site-packages/pytype/vm.py", line 953, in call_function
#     new_node, one_result = func.call(node, funcv, args)
#   File "/Users/name/.pyenv/versions/3.7.3/envs/venv/lib/python3.7/site-packages/pytype/abstract.py", line 3247, in call
#     alias_map=self.alias_map)
#   File "/Users/name/.pyenv/versions/3.7.3/envs/venv/lib/python3.7/site-packages/pytype/abstract.py", line 3051, in call
#     node2, ret = self.vm.run_frame(frame, node)
#   File "/Users/name/.pyenv/versions/3.7.3/envs/venv/lib/python3.7/site-packages/pytype/vm.py", line 292, in run_frame
#     state = self.run_instruction(op, state)
#   File "/Users/name/.pyenv/versions/3.7.3/envs/venv/lib/python3.7/site-packages/pytype/vm.py", line 253, in run_instruction
#     state = bytecode_fn(state, op)
#   File "/Users/name/.pyenv/versions/3.7.3/envs/venv/lib/python3.7/site-packages/pytype/vm.py", line 1980, in byte_LOAD_ATTR
#     state, val = self.load_attr(state, obj, name)
#   File "/Users/name/.pyenv/versions/3.7.3/envs/venv/lib/python3.7/site-packages/pytype/vm.py", line 1224, in load_attr
#     node, result, errors = self._retrieve_attr(state.node, obj, attr)
#   File "/Users/name/.pyenv/versions/3.7.3/envs/venv/lib/python3.7/site-packages/pytype/vm.py", line 1195, in _retrieve_attr
#     node, val.data, attr, val)
#   File "/Users/name/.pyenv/versions/3.7.3/envs/venv/lib/python3.7/site-packages/pytype/attribute.py", line 65, in get_attribute
#     return self._get_instance_attribute(node, obj, name, valself)
#   File "/Users/name/.pyenv/versions/3.7.3/envs/venv/lib/python3.7/site-packages/pytype/attribute.py", line 234, in _get_instance_attribute
#     return self._get_attribute(node, obj, obj.cls, name, valself)
#   File "/Users/name/.pyenv/versions/3.7.3/envs/venv/lib/python3.7/site-packages/pytype/attribute.py", line 270, in _get_attribute
#     node, attr = self.get_attribute(node, cls, name, valself)
#   File "/Users/name/.pyenv/versions/3.7.3/envs/venv/lib/python3.7/site-packages/pytype/attribute.py", line 58, in get_attribute
#     return self._get_class_attribute(node, obj, name, valself)
#   File "/Users/name/.pyenv/versions/3.7.3/envs/venv/lib/python3.7/site-packages/pytype/attribute.py", line 229, in _get_class_attribute
#     return self._get_attribute(node, cls, meta, name, valself)
#   File "/Users/name/.pyenv/versions/3.7.3/envs/venv/lib/python3.7/site-packages/pytype/attribute.py", line 284, in _get_attribute
#     attr = self._filter_var(node, attr)
#   File "/Users/name/.pyenv/versions/3.7.3/envs/venv/lib/python3.7/site-packages/pytype/attribute.py", line 426, in _filter_var
#     bindings = var.Bindings(node, strict=False)
# AttributeError: 'LateAnnotation' object has no attribute 'Bindings'

# Fixed code
def make_class(
    self, node, name_var, bases, class_dict_var, cls_var, new_class_var=None
):
    """Create a class with the name, bases and methods given.

    Args:
      node: The current CFG node.
      name_var: Class name.
      bases: Base classes.
      class_dict_var: Members of the class, as a Variable containing an
          abstract.Dict value.
      cls_var: The class's metaclass, if any.
      new_class_var: If not None, make_class() will return new_class_var with
          the newly constructed class added as a binding. Otherwise, a new
          variable if returned.

    Returns:
      A node and an instance of Class.
    """
    name = abstract_utils.get_atomic_python_constant(name_var)
    log.info("Declaring class %s", name)
    try:
        class_dict = abstract_utils.get_atomic_value(class_dict_var)
    except abstract_utils.ConversionError:
        log.error("Error initializing class %r", name)
        return self.convert.create_new_unknown(node)
    # Handle six.with_metaclass.
    metacls, bases = self._filter_out_metaclasses(bases)
    if metacls:
        cls_var = metacls
    # Flatten Unions in the bases
    bases = [self._process_base_class(node, base) for base in bases]
    if not bases:
        # Old style class.
        bases = [self.convert.oldstyleclass_type.to_variable(self.root_cfg_node)]
    if isinstance(class_dict, abstract.Unsolvable) or not isinstance(
        class_dict, mixin.PythonConstant
    ):
        # An unsolvable appears here if the vm hit maximum depth and gave up on
        # analyzing the class we're now building. Otherwise, if class_dict isn't
        # a constant, then it's an abstract dictionary, and we don't have enough
        # information to continue building the class.
        var = self.new_unsolvable(node)
    else:
        if cls_var is None:
            cls_var = class_dict.members.get("__metaclass__")
            if cls_var and self.PY3:
                # This way of declaring metaclasses no longer works in Python 3.
                self.errorlog.ignored_metaclass(
                    self.frames,
                    name,
                    cls_var.data[0].full_name if cls_var.bindings else "Any",
                )
        if cls_var and all(
            v.data.full_name == "__builtin__.type" for v in cls_var.bindings
        ):
            cls_var = None
        # pylint: disable=g-long-ternary
        cls = (
            abstract_utils.get_atomic_value(cls_var, default=self.convert.unsolvable)
            if cls_var
            else None
        )
        try:
            val = abstract.InterpreterClass(name, bases, class_dict.pyval, cls, self)
        except mro.MROError as e:
            self.errorlog.mro_error(self.frames, name, e.mro_seqs)
            var = self.new_unsolvable(node)
        except abstract_utils.GenericTypeError as e:
            self.errorlog.invalid_annotation(self.frames, e.annot, e.error)
            var = self.new_unsolvable(node)
        else:
            if new_class_var:
                var = new_class_var
            else:
                var = self.program.NewVariable()
            var.AddBinding(val, class_dict_var.bindings, node)
            node = val.call_metaclass_init(node)
            if not val.is_abstract:
                # Since a class decorator could have made the class inherit from
                # ABCMeta, we have to mark concrete classes now and check for
                # abstract methods at postprocessing time.
                self.concrete_classes.append((val, self.simple_stack()))
    self.trace_opcode(None, name, var)
    return node, var