def METHOD_NAME(self, values, replace_scalar):
    for item in values:
        if isinstance(item, tuple):
            key, values = item
            yield replace_scalar(key), replace_scalar(values)
        else:
            for key, values in replace_scalar(item).items():
                yield key, values