nodes: 0, module; 1, function_definition; 2, function_name:union; 3, parameters; 4, block; 5, identifier:self; 6, identifier:rdds; 7, expression_statement; 8, expression_statement; 9, if_statement; 10, expression_statement; 11, expression_statement; 12, for_statement; 13, return_statement; 14, comment:"""
          Build the union of a list of RDDs.
  
          This supports unions() of RDDs with different serialized formats,
          although this forces them to be reserialized using the default
          serializer:
  
          >>> path = os.path.join(tempdir, "union-text.txt")
          >>> with open(path, "w") as testFile:
          ...    _ = testFile.write("Hello")
          >>> textFile = sc.textFile(path)
          >>> textFile.collect()
          [u'Hello']
          >>> parallelized = sc.parallelize(["World!"])
          >>> sorted(sc.union([textFile, parallelized]).collect())
          [u'Hello', 'World!']
          """; 15, assignment; 16, call; 17, block; 18, assignment; 19, assignment; 20, identifier:i; 21, call; 22, block; 23, call; 24, identifier:first_jrdd_deserializer; 25, attribute; 26, identifier:any; 27, generator_expression; 28, expression_statement; 29, identifier:cls; 30, attribute; 31, identifier:jrdds; 32, call; 33, identifier:range; 34, argument_list; 35, expression_statement; 36, identifier:RDD; 37, argument_list; 38, subscript; 39, identifier:_jrdd_deserializer; 40, comparison_operator:x._jrdd_deserializer != first_jrdd_deserializer; 41, for_in_clause; 42, assignment; 43, attribute; 44, identifier:JavaRDD; 45, attribute; 46, argument_list; 47, integer:0; 48, call; 49, assignment; 50, call; 51, identifier:self; 52, attribute; 53, identifier:rdds; 54, integer:0; 55, attribute; 56, identifier:first_jrdd_deserializer; 57, identifier:x; 58, identifier:rdds; 59, identifier:rdds; 60, list_comprehension; 61, attribute; 62, identifier:java; 63, attribute; 64, identifier:new_array; 65, identifier:cls; 66, call; 67, identifier:len; 68, argument_list; 69, subscript; 70, attribute; 71, attribute; 72, argument_list; 73, subscript; 74, identifier:_jrdd_deserializer; 75, identifier:x; 76, identifier:_jrdd_deserializer; 77, call; 78, for_in_clause; 79, attribute; 80, identifier:api; 81, identifier:SparkContext; 82, identifier:_gateway; 83, identifier:len; 84, argument_list; 85, identifier:rdds; 86, identifier:jrdds; 87, identifier:i; 88, subscript; 89, identifier:_jrdd; 90, attribute; 91, identifier:union; 92, identifier:jrdds; 93, identifier:rdds; 94, integer:0; 95, attribute; 96, argument_list; 97, identifier:x; 98, identifier:rdds; 99, attribute; 100, identifier:spark; 101, identifier:rdds; 102, identifier:rdds; 103, identifier:i; 104, identifier:self; 105, identifier:_jsc; 106, identifier:x; 107, identifier:_reserialize; 108, attribute; 109, identifier:apache; 110, attribute; 111, identifier:org; 112, identifier:SparkContext; 113, identifier:_jvm
code: def union(self, rdds):
          """
          Build the union of a list of RDDs.
  
          This supports unions() of RDDs with different serialized formats,
          although this forces them to be reserialized using the default
          serializer:
  
          >>> path = os.path.join(tempdir, "union-text.txt")
          >>> with open(path, "w") as testFile:
          ...    _ = testFile.write("Hello")
          >>> textFile = sc.textFile(path)
          >>> textFile.collect()
          [u'Hello']
          >>> parallelized = sc.parallelize(["World!"])
          >>> sorted(sc.union([textFile, parallelized]).collect())
          [u'Hello', 'World!']
          """
          first_jrdd_deserializer = rdds[0]._jrdd_deserializer
          if any(x._jrdd_deserializer != first_jrdd_deserializer for x in rdds):
              rdds = [x._reserialize() for x in rdds]
          cls = SparkContext._jvm.org.apache.spark.api.java.JavaRDD
          jrdds = SparkContext._gateway.new_array(cls, len(rdds))
          for i in range(0, len(rdds)):
              jrdds[i] = rdds[i]._jrdd
          return RDD(self._jsc.union(jrdds), self, rdds[0]._jrdd_deserializer)