code: def _call_dtensor_op(
      op,
      seed,
      shape,
      dtype,
      key,
      counter,
      alg,
      minval,
      maxval,
      op_version,
      mesh,
  ):
      if op_version == "V1":
          return op(shape=shape, seed=seed, dtype=dtype)
  
      shape = numpy_util.pack_numpy(
          constant_op.constant(shape), Layout.replicated(mesh, 1)
      )
      key = numpy_util.pack_numpy(key, Layout.replicated(mesh, 1))
      counter = numpy_util.pack_numpy(
          counter, Layout.replicated(mesh, 1)
      )
  
      if op_version == "V2":
          return op(
              shape=shape,
              key=key,
              counter=counter,
              alg=alg,
              dtype=dtype,
          )
      elif op_version == "V2_RANGE":
          return op(
              shape=shape,
              key=key,
              counter=counter,
              alg=alg,
              minval=minval,
              maxval=maxval,
          )
      else:
          raise ValueError("op_version argument was invalid.")
  
imports: from absl.testing import parameterized
  from tensorflow.dtensor.python import api
  from tensorflow.dtensor.python import d_variable
  from tensorflow.dtensor.python import layout
  from tensorflow.dtensor.python import numpy_util
  from tensorflow.dtensor.python.tests import test_util
  from tensorflow.dtensor.python.tests import test_util_ops
  from tensorflow.python.distribute import tpu_strategy
  from tensorflow.python.distribute.cluster_resolver.tpu import tpu_cluster_resolver
  from tensorflow.python.eager import remote
  from tensorflow.python.eager.polymorphic_function import polymorphic_function
  from tensorflow.python.framework import constant_op
  from tensorflow.python.framework import dtypes
  from tensorflow.python.framework import ops
  from tensorflow.python.ops import gen_bitwise_ops
  from tensorflow.python.ops import gen_stateful_random_ops
  from tensorflow.python.ops import gen_stateless_random_ops_v2
  from tensorflow.python.ops import math_ops
  from tensorflow.python.ops import variables
  from tensorflow.python.platform import test
  from tensorflow.python.tpu import device_assignment
label_desc: Use image node_id 2 for calling a global function with example usage: _call_dtensor_op(op, seed, shape, dtype, key, counter, alg, minval, maxval, op_version, mesh) and returns: op, op, op