code: def _run_at_batch_size_one(backend, function, args):
      """Executes the given function, checking in- and out-batch shape."""
      for arg in args:
          for type_ in instructions.pattern_traverse(
              ab_type_inference.type_of_pattern(arg, backend),
              leaf_type=instructions.TensorType,
          ):
              shape = type_.shape
              if len(shape) >= 1 and shape[0] != 1:
                  msg = "Expecting input batch dimension of size 1; got {} of shape {}."
                  raise ValueError(msg.format(arg, shape))
      result = function(*args)
      for item in instructions.pattern_traverse(result):
          for type_ in instructions.pattern_traverse(
              ab_type_inference.type_of_pattern(item, backend),
              leaf_type=instructions.TensorType,
          ):
              shape = type_.shape
              if len(shape) >= 1 and shape[0] != 1:
                  msg = "Expecting result batch dimension of size 1; got {} of shape {}."
                  raise ValueError(msg.format(item, shape))
      return result
  
imports: import contextlib
  import functools
  import gast
  import six
  import tensorflow.compat.v2
  from tensorflow_probability.python.experimental.auto_batching import allocation_strategy
  from tensorflow_probability.python.experimental.auto_batching import dsl
  from tensorflow_probability.python.experimental.auto_batching import gast_util
  from tensorflow_probability.python.experimental.auto_batching import instructions
  from tensorflow_probability.python.experimental.auto_batching import lowering
  from tensorflow_probability.python.experimental.auto_batching import stack_optimization
  from tensorflow_probability.python.experimental.auto_batching import stackless
  from tensorflow_probability.python.experimental.auto_batching import tf_backend
  from tensorflow_probability.python.experimental.auto_batching import type_inference
  from tensorflow_probability.python.experimental.auto_batching import virtual_machine
  from tensorflow.python.autograph.converters import break_statements
  from tensorflow.python.autograph.converters import continue_statements
  from tensorflow.python.autograph.converters import return_statements
  from tensorflow.python.autograph.core import converter
  from tensorflow.python.autograph.pyct import anno
  from tensorflow.python.autograph.pyct import inspect_utils
  from tensorflow.python.autograph.pyct import parser
  from tensorflow.python.autograph.pyct import qual_names
  from tensorflow.python.autograph.pyct import templates
  from tensorflow.python.autograph.pyct import transformer
  from tensorflow.python.autograph.pyct.common_transformers import anf
  from tensorflow.python.autograph.pyct.static_analysis import activity
label_desc: Use image node_id 3 for calling a global function with example usage: _run_at_batch_size_one(backend, function, args) and returns: result