parameters: (original_item, item)
docstring: Fail if the 2 items are from different graphs.
  
    Args:
      original_item: Original item to check against.
      item: Item to check.
  
    Raises:
      ValueError: if graphs do not match.
docstring_summary: Fail if the 2 items are from different graphs.
docstring_tokens: Fail if the 2 items are from different graphs .
function: def _assert_same_graph(original_item, item):
    """Fail if the 2 items are from different graphs.
  
    Args:
      original_item: Original item to check against.
      item: Item to check.
  
    Raises:
      ValueError: if graphs do not match.
    """
    original_graph = getattr(original_item, "graph", None)
    graph = getattr(item, "graph", None)
    if original_graph and graph and original_graph is not graph:
      raise ValueError(
          "%s must be from the same graph as %s (graphs are %s and %s)." %
          (item, original_item, graph, original_graph))
function_tokens: def _assert_same_graph ( original_item , item ) : original_graph = getattr ( original_item , "graph" , None ) graph = getattr ( item , "graph" , None ) if original_graph and graph and original_graph is not graph : raise ValueError ( "%s must be from the same graph as %s (graphs are %s and %s)." % ( item , original_item , graph , original_graph ) )