code: def testEagerPyFuncPlacement(self):
      if not ops.executing_eagerly_outside_functions():
          return
  
      def f(x):
          return math_ops.square(x)
  
      with ops.device(
          "/job:%s/replica:0/task:1/device:CPU:0" % JOB_NAME
      ):
          const_op = constant_op.constant(3.0, dtype=dtypes.float32)
          # PyFuncOp should be placed on the localhost's address space.
          py_func_op = script_ops.eager_py_func(
              func=f, inp=[const_op], Tout=dtypes.float32
          )
          self.assertEqual(
              py_func_op.device,
              "/job:%s/replica:0/task:0/device:CPU:0" % JOB_NAME,
          )
          self.assertEqual(self.evaluate(py_func_op), 9.0)
  
imports: from absl.testing import parameterized
  import numpy
  from tensorflow.core.protobuf import cluster_pb2
  from tensorflow.core.protobuf import tensorflow_server_pb2
  from tensorflow.python import pywrap_tfe
  from tensorflow.python.eager import backprop
  from tensorflow.python.eager import context
  from tensorflow.python.eager import def_function
  from tensorflow.python.eager import remote
  from tensorflow.python.framework import constant_op
  from tensorflow.python.framework import dtypes
  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 math_ops
  from tensorflow.python.ops import resource_variable_ops
  from tensorflow.python.ops import script_ops
  from tensorflow.python.platform import test
  from tensorflow.python.training import server_lib
label_desc: Use image node_id 8 for calling the RemoteExecutionTest obj's underlying member method code with example usage: obj.testEagerPyFuncPlacement() and returns: math_ops