def _get_frame(self, key):
        """
        Creates a clone of the Layout with the nth-frame for each
        Element.
        """
        layout_frame = self.layout.clone(shared_data=False)
        keyisint = isinstance(key, int)
        if not isinstance(key, tuple): key = (key,)
        nthkey_fn = lambda x: zip(tuple(x.name for x in x.kdims),
                                  list(x.data.keys())[min([key[0], len(x)-1])])
        if key == self.current_key:
            return self.current_frame
        else:
            self.current_key = key

        for path, item in self.layout.items():
            if self.dynamic == 'open':
                if keyisint:
                    counts = item.traverse(lambda x: x.counter, (DynamicMap,))
                    if key[0] >= counts[0]:
                        item.traverse(lambda x: next(x), (DynamicMap,))
                    dim_keys = item.traverse(nthkey_fn, (DynamicMap,))[0]
                else:
                    dim_keys = zip([d.name for d in self.dimensions
                                    if d in item.dimensions('key')], key)
                self.current_key = tuple(k[1] for k in dim_keys)
            elif self.uniform:
                dim_keys = zip([d.name for d in self.dimensions
                                if d in item.dimensions('key')], key)
            else:
                dim_keys = item.traverse(nthkey_fn, (HoloMap,))[0]
            if dim_keys:
                obj = item.select((HoloMap,), **dict(dim_keys))
                if isinstance(obj, HoloMap) and len(obj) == 0:
                    continue
                else:
                    layout_frame[path] = obj
            else:
                layout_frame[path] = item

        self.current_frame = layout_frame
        return layout_frame
dataset/ETHPy150Open ioam/holoviews/holoviews/plotting/plot.py/GenericCompositePlot._get_frame/original