code: def has_known_bases(klass, context=None):
      
      try:
          return klass._all_bases_known
      except AttributeError:
          pass
      for base in klass.bases:
          result = safe_infer(base, context=context)
          # TODO: check for A->B->A->B pattern in class structure too?
          if (
              not isinstance(result, scoped_nodes.ClassDef)
              or result is klass
              or not has_known_bases(result, context=context)
          ):
              klass._all_bases_known = False
              return False
      klass._all_bases_known = True
      return True
docs: Return true if all base classes of a class could be inferred.