in tensorflow_gnn/graph/keras/layers/graph_ops.py [0:0]
def _check_location(self, location, tag, required=False):
"""Raises ValueError for bad location. May be None if not required."""
if tag is None: # Not set in init.
assert not required, "Internal error: required unexpected without tag"
# Nothing left to check.
elif tag == const.CONTEXT:
if required and not location:
raise ValueError(
f"The {self._layer_name} layer with tag CONTEXT ""requires "
"exactly one of edge_set_name and node_set_name")
else: # SOURCE or TARGET
assert tag in (const.SOURCE, const.TARGET), f"Internal error: tag={tag}"
if required and not location or "node_set_name" in location:
raise ValueError(
f"The {self._layer_name} layer with tag SOURCE or TARGET "
"requires edge_set_name but not node_set_name")