def getRects(self, view_clip=None, exclude=None):
        if not self.is_visible: return []

        # figure my rect
        r = util.Rect(self._x, self._y, self._width, self._height)
        if view_clip is not None:
            r = r.intersect(view_clip)
        if r is None: return []

        x, y, z = self._x, self._y, self._z

        # translate the view clip into this element's coordinate space
        clipped = self.rect
        clipped.x -= x
        clipped.y -= y
        if view_clip:
            view_clip = view_clip.copy()
            view_clip.x -= x
            view_clip.y -= y
            clipped = clipped.intersect(view_clip)
            if not clipped:
                return []

        rects = []
        if not self.is_transparent:
            rects.append((self, (x, y, z, clipped)))
        if not self.children:
            return rects

        # shift child elements and view clip for left & bottom padding 
        pad = self._padding
        x += pad
        y += pad
        if view_clip is not None:
            view_clip = view_clip.copy()
            view_clip.x -= pad
            view_clip.y -= pad

        # clip by this element's view clip
        if self.view_clip is not None:
            if view_clip is not None:
                view_clip = view_clip.intersect(self.view_clip)
            else:
                view_clip = self.view_clip

        if not view_clip: return rects

        for child in self.children:
            if exclude is child: continue
            for obj, (ox, oy, oz, c) in child.getRects(view_clip,
                    exclude):
                rects.append((obj, (ox+x, oy+y, oz+z, c)))
        return rects
>>> get_value_by_keypath([1, 2, 3], '[0]')
dataset/ETHPy150Open ardekantur/pyglet/contrib/wydget/wydget/element.py/Element.getRects--crossover with--dataset/ETHPy150Open sodastsai/taskr/taskr/contrib/collections.py/get_value_by_keypath