code: def test_xml_sampling_ratio(self):
      rdd = self.spark.sparkContext.range(0, 100, 1, 1).map(
          lambda x: "<p><a>0.1</a></p>"
          if x == 1
          else "<p><a>%s</a></p>" % str(x)
      )
      schema = (
          self.spark.read.option("samplingRatio", 0.5).xml(rdd).schema
      )
      self.assertEqual(
          schema, StructType([StructField("a", LongType(), True)])
      )
  
imports: import shutil
  import tempfile
  import uuid
  import os
  from pyspark.sql import Row
  from pyspark.sql.types import IntegerType, StructField, StructType, LongType, StringType
  from pyspark.testing.sqlutils import ReusedSQLTestCase
label_desc: Use image node_id 8 for calling the DataSourcesTestsMixin obj's underlying member method code with example usage: obj.test_xml_sampling_ratio() without return types