code: def get_sampled(self, data):
      from pyspark.pandas import DataFrame, Series
  
      fraction = get_option("plotting.sample_ratio")
      if fraction is None:
          fraction = 1 / (len(data) / get_option("plotting.max_rows"))
          fraction = min(1.0, fraction)
      self.fraction = fraction
  
      if isinstance(data, (DataFrame, Series)):
          if isinstance(data, Series):
              data = data.to_frame()
          sampled = data._internal.resolved_copy.spark_frame.sample(
              fraction=self.fraction
          )
          return DataFrame(
              data._internal.with_new_sdf(sampled)
          )._to_pandas()
      else:
          raise TypeError(
              "Only DataFrame and Series are supported for plotting."
          )
  
imports: import importlib
  import pandas
  import numpy
  from pandas.core.base import PandasObject
  from pandas.core.dtypes.inference import is_integer
  from pyspark.ml.feature import Bucketizer
  from pyspark.mllib.stat import KernelDensity
  from pyspark.sql import functions
  from pyspark.pandas.missing import unsupported_function
  from pyspark.pandas.config import get_option
  from pyspark.pandas.utils import name_like_string
label_desc: Use image node_id 1 for calling the SampledPlotBase obj's underlying member method code with example usage: obj.get_sampled(data) and returns: DataFrame