code: def load_kernel_modules():
      
      if not os.path.isdir(W1ThermSensor.BASE_DIRECTORY):
          os.system("modprobe w1-gpio >/dev/null 2>&1")
          os.system("modprobe w1-therm >/dev/null 2>&1")
  
      for _ in range(W1ThermSensor.RETRY_ATTEMPTS):
          if os.path.isdir(
              W1ThermSensor.BASE_DIRECTORY
          ):  # w1 therm modules loaded correctly
              break
          time.sleep(W1ThermSensor.RETRY_DELAY_SECONDS)
      else:
          raise KernelModuleLoadError()
docs: Load kernel modules needed by the temperature sensor
      if they are not already loaded.
      If the base directory then does not exist an exception is raised an the kernel module loading
      should be treated as failed.
  
      :raises KernelModuleLoadError: if the kernel module could not be loaded properly