def has_known_bases(klass, context=None):
try:<EOL><INDENT>return klass._all_bases_known<EOL><DEDENT>except AttributeError:<EOL><INDENT>pass<EOL><DEDENT>for base in klass.bases:<EOL><INDENT>result = safe_infer(base, context=context)<EOL>if (<EOL>not isinstance(result, scoped_nodes.ClassDef)<EOL>or result is klass<EOL>or not has_known_bases(result, context=context)<EOL>):<EOL><INDENT>klass._all_bases_known = False<EOL>return False<EOL><DEDENT><DEDENT>klass._all_bases_known = True<EOL>return True<EOL>
Return true if all base classes of a class could be inferred.