code: def test_malformed_RDD(self):
      basepath = self.tempdir.name
      # non-batch-serialized RDD[[(K, V)]] should be rejected
      data = [[(1, "a")], [(2, "aa")], [(3, "aaa")]]
      rdd = self.sc.parallelize(data, len(data))
      self.assertRaises(
          Exception,
          lambda: rdd.saveAsSequenceFile(
              basepath + "/malformed/sequence"
          ),
      )
  
imports: import os
  import shutil
  import tempfile
  import unittest
  from pyspark.testing.utils import ReusedPySparkTestCase, SPARK_HOME
label_desc: Use image node_id 9 for calling the OutputFormatTests obj's underlying member method code with example usage: obj.test_malformed_RDD() without return types