<commit_before>module SpecInfra
  module Command
    class Darwin < Base
      def check_file_md5checksum(file, expected)
        "openssl md5 #{escape(file)} | cut -d'=' -f2 | cut -c 2- | grep -E ^#{escape(expected)}$"
      end

      def check_file_sha256checksum(file, expected)
        "openssl sha256 #{escape(file)} | cut -d'=' -f2 | cut -c 2- | grep -E ^#{escape(expected)}$"
      end

      def check_link(link, target)
        "stat -f %Y #{escape(link)} | grep -- #{escape(target)}"<commit_msg>Support check service enabled and running in Darwin<commit_after>module SpecInfra
  module Command
    class Darwin < Base
      def check_enabled(service, level=nil)
        "launchctl list | grep #{escape(service)}"
      end

      def check_running(service)
        "launchctl list | grep #{escape(service)} | grep -E '^[0-9]+'"
      end

      def check_file_md5checksum(file, expected)
        "openssl md5 #{escape(file)} | cut -d'=' -f2 | cut -c 2- | grep -E ^#{escape(expected)}$"
      end

      def check_file_sha256checksum(file, expected)
        "openssl sha256 #{escape(file)} | cut -d'=' -f2 | cut -c 2- | grep -E ^#{escape(expected)}$"
      end

      def check_link(link, target)
        "stat -f %Y #{escape(link)} | grep -- #{escape(target)}"
{'fraction_non_alphanumeric': 0.15027537372147914, 'fraction_numerical': 0.020456333595594022, 'mean_word_length': 2.7970149253731345, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, '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': '5193325', 'n_tokens_mistral': 442, 'n_tokens_neox': 411, 'n_words': 120}