<commit_before>class Pacparser < Formula
  desc "Library to parse proxy auto-config (PAC) files"
  homepage "https://github.com/pacparser/pacparser"
  url "https://github.com/pacparser/pacparser/archive/1.3.7.tar.gz"
  sha256 "575c5d8096b4c842b2af852bbb8bcfde96170b28b49f33249dbe2057a8beea13"
  head "https://github.com/pacparser/pacparser.git"

  bottle do
    cellar :any
    sha256 "2edae05d7acea79c4a395cb9052244101cb78f15c92bbcf7235eacbcd6d09d53" => :high_sierra
    sha256 "38db6b19b4cec0c237b6c9e11b67db9514b58e12e5dad0edc97e9919e57f71b3" => :sierra
    sha256 "7cd235305c7701181eb78c7b35683e88bb9fb14172f4c1ff7028b3fd5b480cf9" => :el_capitan
    sha256 "3d2092ad71629a2c71d5b88138d0ea7443247d7cd89414ef46a9cab7898b250c" => :yosemite
  end

  depends_on "python" => :optional

  def install
    # Disable parallel build due to upstream concurrency issue.
    # https://github.com/pacparser/pacparser/issues/27
    ENV.deparallelize
    ENV["VERSION"] = version
    Dir.chdir "src"
    system "make", "install",
           "PREFIX=#{prefix}"
    if build.with? "python"
      system "make", "install-pymod",
             "EXTRA_ARGS=\"--prefix=#{prefix}\""
    end
  end

  test do
    # example pacfile taken from upstream sources
    (testpath/"test.pac").write <<~'EOS'
      function FindProxyForURL(url, host) {

        if ((isPlainHostName(host) ||
            dnsDomainIs(host, ".manugarg.com")) &&
            !localHostOrDomainIs(host, "www.manugarg.com"))
          return "plainhost/.manugarg.com";

        // Return externaldomain if host matches .*\.externaldomain\.example
        if (/.*\.externaldomain\.example/.test(host))
          return "externaldomain";

        // Test if DNS resolving is working as intended
        if (dnsDomainIs(host, ".google.com") &&<commit_msg>pacparser: rename python@2 optional dependency<commit_after>class Pacparser < Formula
  desc "Library to parse proxy auto-config (PAC) files"
  homepage "https://github.com/pacparser/pacparser"
  url "https://github.com/pacparser/pacparser/archive/1.3.7.tar.gz"
  sha256 "575c5d8096b4c842b2af852bbb8bcfde96170b28b49f33249dbe2057a8beea13"
  head "https://github.com/pacparser/pacparser.git"

  bottle do
    cellar :any
    sha256 "2edae05d7acea79c4a395cb9052244101cb78f15c92bbcf7235eacbcd6d09d53" => :high_sierra
    sha256 "38db6b19b4cec0c237b6c9e11b67db9514b58e12e5dad0edc97e9919e57f71b3" => :sierra
    sha256 "7cd235305c7701181eb78c7b35683e88bb9fb14172f4c1ff7028b3fd5b480cf9" => :el_capitan
    sha256 "3d2092ad71629a2c71d5b88138d0ea7443247d7cd89414ef46a9cab7898b250c" => :yosemite
  end

  deprecated_option "with-python" => "with-python@2"

  depends_on "python@2" => :optional

  def install
    # Disable parallel build due to upstream concurrency issue.
    # https://github.com/pacparser/pacparser/issues/27
    ENV.deparallelize
    ENV["VERSION"] = version
    Dir.chdir "src"
    system "make", "install",
           "PREFIX=#{prefix}"
    if build.with? "python@2"
      system "make", "install-pymod",
             "EXTRA_ARGS=\"--prefix=#{prefix}\""
    end
  end

  test do
    # example pacfile taken from upstream sources
    (testpath/"test.pac").write <<~'EOS'
      function FindProxyForURL(url, host) {

        if ((isPlainHostName(host) ||
            dnsDomainIs(host, ".manugarg.com")) &&
            !localHostOrDomainIs(host, "www.manugarg.com"))
          return "plainhost/.manugarg.com";

        // Return externaldomain if host matches .*\.externaldomain\.example
        if (/.*\.externaldomain\.example/.test(host))
          return "externaldomain";

        // Test if DNS resolving is working as intended
        if (dnsDomainIs(host, ".google.com") &&
{'fraction_non_alphanumeric': 0.11622866431861284, 'fraction_numerical': 0.1175833107558927, 'mean_word_length': 3.513447432762836, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 14, 'https://': 8, 'lorem ipsum': 0, 'www.': 2, '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': '616514', 'n_tokens_mistral': 1607, 'n_tokens_neox': 1351, 'n_words': 227}