docstr: Verify that local properties set on the driver are available in TaskContext.
docstr_tok: ["Verify","that","local","properties","set","on","the","driver","are","available","in","TaskContext","."]
code: def test_get_local_property(self):
      """Verify that local properties set on the driver are available in TaskContext."""
      key = "testkey"
      value = "testvalue"
      self.sc.setLocalProperty(key, value)
      try:
          rdd = self.sc.parallelize(range(1), 1)
          prop1 = rdd.map(
              lambda _: TaskContext.get().getLocalProperty(key)
          ).collect()[0]
          self.assertEqual(prop1, value)
          prop2 = rdd.map(
              lambda _: TaskContext.get().getLocalProperty("otherkey")
          ).collect()[0]
          self.assertTrue(prop2 is None)
      finally:
          self.sc.setLocalProperty(key, None)
  
imports: import os
  import random
  import stat
  import sys
  import tempfile
  import time
  import unittest
  from pyspark import SparkConf, SparkContext, TaskContext, BarrierTaskContext
  from pyspark.testing.utils import PySparkTestCase, SPARK_HOME, eventually
label_desc: Use image node_id 7 for calling the TaskContextTests obj's underlying member method code with example usage: obj.test_get_local_property() without return types