code: def search(cls, element, pattern):
          
          if isinstance(element, Layout):
              return [el for cell in element for el in cls.search(cell, pattern)]
          if isinstance(element, (NdOverlay, Overlay)):
              return [el for el in element if el.matches(pattern)]
          elif isinstance(element, Element):
              return [element] if element.matches(pattern) else []
docs: Helper method that returns a list of elements that match the
          given path pattern of form {type}.{group}.{label}.
  
          The input may be a Layout, an Overlay type or a single
          Element.