<commit_before>part of osx;

class Common {
  static Future<bool> areHiddenFilesShown() => Defaults.get(Domains.FINDER, "AppleShowAllFiles");
  static Future setHiddenFilesShown(bool shown) => Defaults.set(Domains.FINDER, "AppleShowAllFiles", shown);
}

class Domains {
  static const String FINDER = "com.apple.finder";
}

class Volume {
  static int getVolume() {
    return int.parse(runAppleScriptSync("output volume of (get volume settings)"));
  }

  static bool isMuted() {
    return runAppleScriptSync("output of muted of (get volume settings)") == "true";
  }

  static void setVolume(int volume) {
    runAppleScriptSync("set volume output volume ${volume}");
  }

  static void setMuted(bool muted) {
    runAppleScriptSync("set volume ${muted ? 'with' : 'without'} output muted");
  }

  static void mute() => setMuted(true);
  static void unmute() => setMuted(false);
  static void toggleMuted() => setMuted(!isMuted());
}

class SystemInformation {
  static Map<String, dynamic> _info = parseAppleScriptRecord(runAppleScriptSync("system info"));

  static String getVersion() => runAppleScriptSync('system version of (system info)');
  static String getUser() => runAppleScriptSync('short user name of (system info)');
  static String getUserName() => runAppleScriptSync('long user name of (system info)');
  static String getComputerName() => runAppleScriptSync('computer name of (system info)');
  static String getHostName() => runAppleScriptSync('host name of (system info)');
  static String getUserLocale() => runAppleScriptSync('user locale of (system info)');
  static int getCpuSpeed() => int.parse(runAppleScriptSync('CPU speed of (system info)'));
  static int getPhysicalMemory() => int.parse(runAppleScriptSync('physical memory of (system info)'));
}

class System {
  static void beep() {
    runAppleScriptSync("beep");
  }
}

class Battery {
  static num getLevel() {
    var info = _info();
    info = info.replaceAll("\t", "; ");
    var x = info.split("; ")[1];
    x = x.substring(0, x.indexOf("%"));
    return num.parse(x);
  }

  static bool isCharging() {
    return _info().contains("charging;");
  }

  static bool isPluggedIn() {
    var info = _info();
    return info.contains("charging;") || info.contains("charged;");
  }

  static String _info() {
    return Process.runSync("pmset", ["-g", "batt"]).stdout.split("\n")[1].trim();
  }
}<commit_msg>Bug Fix<commit_after>part of osx;

class Common {
  static bool areHiddenFilesShown() => Defaults.get(Domains.FINDER, "AppleShowAllFiles");
  static void setHiddenFilesShown(bool shown) => Defaults.set(Domains.FINDER, "AppleShowAllFiles", shown);
}

class Domains {
  static const String FINDER = "com.apple.finder";
}

class Volume {
  static int getVolume() {
    return int.parse(runAppleScriptSync("output volume of (get volume settings)"));
  }

  static bool isMuted() {
    return runAppleScriptSync("output of muted of (get volume settings)") == "true";
  }

  static void setVolume(int volume) {
    runAppleScriptSync("set volume output volume ${volume}");
  }

  static void setMuted(bool muted) {
    runAppleScriptSync("set volume ${muted ? 'with' : 'without'} output muted");
  }

  static void mute() => setMuted(true);
  static void unmute() => setMuted(false);
  static void toggleMuted() => setMuted(!isMuted());
}

class SystemInformation {
  static Map<String, dynamic> _info = parseAppleScriptRecord(runAppleScriptSync("system info"));

  static String getVersion() => runAppleScriptSync('system version of (system info)');
  static String getUser() => runAppleScriptSync('short user name of (system info)');
  static String getUserName() => runAppleScriptSync('long user name of (system info)');
  static String getComputerName() => runAppleScriptSync('computer name of (system info)');
  static String getHostName() => runAppleScriptSync('host name of (system info)');
  static String getUserLocale() => runAppleScriptSync('user locale of (system info)');
  static int getCpuSpeed() => int.parse(runAppleScriptSync('CPU speed of (system info)'));
  static int getPhysicalMemory() => int.parse(runAppleScriptSync('physical memory of (system info)'));
}

class System {
  static void beep() {
    runAppleScriptSync("beep");
  }

  static String runShell(String command) {
    return runAppleScriptSync('do shell script "${command}"');
  }

  static String runAdminShell(String command) {
    return runAppleScriptSync('do shell script "${command}" with administrator privileges');
  }
}

class Battery {
  static num getLevel() {
    var info = _info();
    info = info.replaceAll("\t", "; ");
    var x = info.split("; ")[1];
    x = x.substring(0, x.indexOf("%"));
    return num.parse(x);
  }

  static bool isCharging() {
    return _info().contains("charging;");
  }

  static bool isPluggedIn() {
    var info = _info();
    return info.contains("charging;") || info.contains("charged;");
  }

  static String _info() {
    return Process.runSync("pmset", ["-g", "batt"]).stdout.split("\n")[1].trim();
  }
}
{'fraction_non_alphanumeric': 0.14794193676675282, 'fraction_numerical': 0.0011930801352157488, 'mean_word_length': 4.748571428571428, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 32, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '190815', 'n_tokens_mistral': 1588, 'n_tokens_neox': 1515, 'n_words': 422}