def _dynamic_mul(self, dimensions, other, keys):
        """
        Implements dynamic version of overlaying operation overlaying
        DynamicMaps and HoloMaps where the key dimensions of one is
        a strict superset of the other.
        """
        # If either is a HoloMap compute Dimension values
        if not isinstance(self, DynamicMap) or not isinstance(other, DynamicMap):
            keys = sorted((d, v) for k in keys for d, v in k)
            grouped =  dict([(g, [v for _, v in group])
                             for g, group in groupby(keys, lambda x: x[0])])
            dimensions = [d(values=grouped[d.name]) for d in dimensions]
            mode = 'bounded'
            map_obj = None
        elif (isinstance(self, DynamicMap) and (other, DynamicMap) and
            self.mode != other.mode):
            raise ValueEror("Cannot overlay DynamicMaps with mismatching mode.")
        else:
            map_obj = self if isinstance(self, DynamicMap) else other
            mode = map_obj.mode

        def dynamic_mul(*key):
            key = key[0] if mode == 'open' else key
            layers = []
            try:
                if isinstance(self, DynamicMap):
                    _, self_el = util.get_dynamic_item(self, dimensions, key)
                    if self_el is not None:
                        layers.append(self_el)
                else:
                    layers.append(self[key])
            except __HOLE__:
                pass
            try:
                if isinstance(other, DynamicMap):
                    _, other_el = util.get_dynamic_item(other, dimensions, key)
                    if other_el is not None:
                        layers.append(other_el)
                else:
                    layers.append(other[key])
            except KeyError:
                pass
            return Overlay(layers)
        if map_obj:
            return map_obj.clone(callback=dynamic_mul, shared_data=False,
                                 kdims=dimensions)
        else:
            return DynamicMap(callback=dynamic_mul, kdims=dimensions)
dataset/ETHPy150Open ioam/holoviews/holoviews/core/spaces.py/HoloMap._dynamic_mul