docstr: Test that temporary socket/port is released prior to invoking user map_fun.
docstr_tok: ["Test","that","temporary","socket\/port","is","released","prior","to","invoking","user","map_fun","."]
code: def test_port_released(self):
      """Test that temporary socket/port is released prior to invoking user map_fun."""
  
      def _map_fun(args, ctx):
          assert ctx.tmp_socket is None
  
      cluster = TFCluster.run(
          self.sc,
          _map_fun,
          tf_args={},
          num_executors=self.num_workers,
          num_ps=0,
          input_mode=TFCluster.InputMode.TENSORFLOW,
          master_node="chief",
      )
      cluster.shutdown()
  
file_path: TensorFlowOnSpark/tests/test_TFCluster.py
imports: import unittest
  import test
  import time
  from tensorflowonspark import TFCluster, TFNode
label_desc: Use image node_id 7 for calling the TFClusterTest obj's underlying member method code with example usage: obj.test_port_released() without return types