docstr: Tests export and importing a graph across scopes.
  
  Args:
    graph_fn: A closure that creates a graph on the current scope.
    use_resource: A bool indicating whether or not to use ResourceVariables.
docstr_tok: ["Tests","export","and","importing","a","graph","across","scopes",".","Args",":","graph_fn",":","A","closure","that","creates","a","graph","on","the","current","scope",".","use_resource",":","A","bool","indicating","whether","or","not","to","use","ResourceVariables","."]
code: def _testExportImportAcrossScopes(self, graph_fn, use_resource):
      """Tests export and importing a graph across scopes.
  
      Args:
        graph_fn: A closure that creates a graph on the current scope.
        use_resource: A bool indicating whether or not to use ResourceVariables.
      """
      with ops.Graph().as_default() as original_graph:
          with variable_scope.variable_scope("dropA/dropB/keepA"):
              graph_fn(use_resource=use_resource)
      exported_meta_graph_def = meta_graph.export_scoped_meta_graph(
          graph=original_graph, export_scope="dropA/dropB"
      )[0]
  
      with ops.Graph().as_default() as imported_graph:
          meta_graph.import_scoped_meta_graph(
              exported_meta_graph_def, import_scope="importA"
          )
  
      with ops.Graph().as_default() as expected_graph:
          with variable_scope.variable_scope("importA/keepA"):
              graph_fn(use_resource=use_resource)
  
      result = meta_graph.export_scoped_meta_graph(
          graph=imported_graph
      )[0]
      expected = meta_graph.export_scoped_meta_graph(
          graph=expected_graph
      )[0]
  
      if use_resource:
          # Clear all shared_name and debug_name attributes before comparing, since
          # they are orthogonal to scopes and are not updated on export/import.
          for meta_graph_def in [result, expected]:
              for node in meta_graph_def.graph_def.node:
                  for attr_to_remove in ["shared_name", "debug_name"]:
                      attr_value = node.attr.get(attr_to_remove, None)
                      if attr_value and attr_value.HasField("s"):
                          if attr_value.s:
                              node.attr[attr_to_remove].s = b""
  
      test_util.assert_meta_graph_protos_equal(self, expected, result)
  
imports: import math
  import os.path
  import random
  import shutil
  from tensorflow.core.framework import graph_pb2
  from tensorflow.core.protobuf import meta_graph_pb2
  from tensorflow.python.client import session
  from tensorflow.python.framework import constant_op
  from tensorflow.python.framework import dtypes
  from tensorflow.python.framework import function
  from tensorflow.python.framework import meta_graph
  from tensorflow.python.framework import ops
  from tensorflow.python.framework import test_util
  from tensorflow.python.ops import array_ops
  from tensorflow.python.ops import cond
  from tensorflow.python.ops import data_flow_ops
  from tensorflow.python.ops import gradients_impl
  from tensorflow.python.ops import math_ops
  from tensorflow.python.ops import metrics
  from tensorflow.python.ops import nn_ops
  from tensorflow.python.ops import partitioned_variables
  from tensorflow.python.ops import random_ops
  from tensorflow.python.ops import resource_variable_ops
  from tensorflow.python.ops import variable_scope
  from tensorflow.python.ops import variables
  from tensorflow.python.ops import while_loop
  from tensorflow.python.platform import gfile
  from tensorflow.python.platform import test
  from tensorflow.python.training import queue_runner_impl
label_desc: Use image node_id 2 for calling the ExportImportAcrossScopesTest obj's underlying member method code with example usage: obj._testExportImportAcrossScopes(graph_fn, use_resource) without return types