def ancestor_types(self, x):
    """Find all types frame x belongs to (explicitly or implicitly)."""
    types = set()
    for key, val in x:
      if isinstance(key, sling.Frame) and key.id == INSTANCE_OF_ID:
        types.add(val)
    return self.transitively_close(types, SUBCLASS_OF_ID)
Find all types frame x belongs to (explicitly or implicitly).
language/templama/sling2facts.py