code: def almost_equal_to(expected):
      def _almost_equal(actual):
          sorted_expected = sorted(expected)
          sorted_actual = sorted(actual)
          if not np.allclose(sorted_expected, sorted_actual):
              raise util.BeamAssertException(
                  "Failed assert: {} is not almost equal to {}".format(
                      sorted_expected, sorted_actual
                  )
              )
  
      return _almost_equal
  
file_path: tfx/tfx/experimental/distributed_inference/graphdef_experiments/subgraph_partitioning/beam_pipeline_test.py
imports: import os
  import tempfile
  import apache_beam
  from apache_beam.testing import util
  import numpy
  import tensorflow
  from tfx.experimental.distributed_inference.graphdef_experiments.subgraph_partitioning import beam_pipeline
  from tfx.experimental.distributed_inference.graphdef_experiments.subgraph_partitioning import create_complex_graph
  from tfx.experimental.distributed_inference.graphdef_experiments.subgraph_partitioning import graph_partition
label_desc: Use image node_id 4 for calling a global function with example usage: almost_equal_to(expected) and returns: _almost_equal