code: def settings_directory():
      
  
      system = platform.system()
  
      basedir = None
  
      if system == 'Windows':
          if 'APPDATA' in os.environ:
              basedir = os.environ['APPDATA']
  
      # If we're not on Windows assume we're on some
      # kind of posix system or Mac, where the appropriate place would be
      # ~/.config
      if basedir is None:
          basedir = os.path.expanduser('~')
          basedir = os.path.join(basedir, '.config')
  
      settings_dir = os.path.abspath(os.path.join(basedir, 'IOTile-Core'))
      return settings_dir
docs: Find a per user settings directory that is appropriate for each
      type of system that we are installed on.