code: def set_sample_probability(probability):
      
      global _sample_probability
  
      if not 0.0 <= probability <= 1.0:
          raise ValueError('Invalid probability value')
  
      LOGGER.debug('Setting sample probability to %.2f', probability)
      _sample_probability = float(probability)
docs: Set the probability that a batch will be submitted to the InfluxDB
      server. This should be a value that is greater than or equal to ``0`` and
      less than or equal to ``1.0``. A value of ``0.25`` would represent a
      probability of 25% that a batch would be written to InfluxDB.
  
      :param float probability: The value between 0 and 1.0 that represents the
          probability that a batch will be submitted to the InfluxDB server.