code: def arduino_path():
      
  
      x = _ARDUINO_PATH
      if not x:
          x = os.environ.get('ARDUINO_HOME')
  
      if not x:
          x = arduino_default_path()
  
      assert x, str(x)
  
      x = path(x).expand().abspath()
  
      assert x.exists(), 'arduino path not found:' + str(x)
      return x
docs: expanded root path, ARDUINO_HOME env var or arduino_default_path()