code: def displayable(obj):
      
      if isinstance(obj, Overlay) and any(isinstance(o, (HoloMap, GridSpace))
                                          for o in obj):
          return False
      if isinstance(obj, HoloMap):
          return not (obj.type in [Layout, GridSpace, NdLayout, DynamicMap])
      if isinstance(obj, (GridSpace, Layout, NdLayout)):
          for el in obj.values():
              if not displayable(el):
                  return False
          return True
      return True
docs: Predicate that returns whether the object is displayable or not
      (i.e whether the object obeys the nesting hierarchy