code: def set_precision(self, precision, persist=False):
          
          if not 9 <= precision <= 12:
              raise ValueError(
                  "The given sensor precision '{0}' is out of range (9-12)".format(
                      precision
                  )
              )
  
          exitcode = subprocess.call(
              "echo {0} > {1}".format(precision, self.sensorpath), shell=True
          )
          if exitcode != 0:
              raise W1ThermSensorError(
                  "Failed to change resolution to {0} bit. "
                  "You might have to be root to change the precision".format(precision)
              )
  
          if persist:
              exitcode = subprocess.call(
                  "echo 0 > {0}".format(self.sensorpath), shell=True
              )
              if exitcode != 0:
                  raise W1ThermSensorError(
                      "Failed to write precision configuration to sensor EEPROM"
                  )
  
          return True
docs: Set the precision of the sensor for the next readings.
  
              If the ``persist`` argument is set to ``False`` this value
              is "only" stored in the volatile SRAM, so it is reset when
              the sensor gets power-cycled.
  
              If the ``persist`` argument is set to ``True`` the current set
              precision is stored into the EEPROM. Since the EEPROM has a limited
              amount of writes (>50k), this command should be used wisely.
  
              Note: root permissions are required to change the sensors precision.
  
              Note: This function is supported since kernel 4.7.
  
              :param int precision: the sensor precision in bits.
                                    Valid values are between 9 and 12
              :param bool persist: if the sensor precision should be written
                                   to the EEPROM.
  
              :returns: if the sensor precision could be set or not.
              :rtype: bool