def index_of_layer_containing_tag(stack, tag):
    """
	return zero based index of layer with `tag` or None

	:param stack: Iterable[layer.Layer]
	:param tag: str
	:return: int | None
	"""
    for i, layer in enumerate(reversed(stack)):
        for t in layer.tags:
            if t.closing == tag:
                return len(stack) - i - 1
    return None
