<commit_before>module Pip
  def self.install(opts)
    # make sure our pip is recent enough to return 0 on empty .pip files.
    sh "pip install 'pip>=1.1'" do |ok, status|
      error("pip failed") unless ok
    end
    # actually run the command
    sh "pip install #{opts}" do |ok, status|
      error("pip failed") unless ok
    end
  end
end<commit_msg>Made both INDEX_URL and PYNEST_URL optional for pip tasks.<commit_after>module Pip
  def self.install(opts)
    # make sure our pip is recent enough to return 0 on empty .pip files.
    sh "pip install 'pip>=1.1'" do |ok, status|
      error("pip failed") unless ok
    end
    # actually run the command
    args = []
    if Project[:INDEX_URL] then
      args += ["--index-url", Project[:INDEX_URL]]
    end
    if Project[:PYNEST_URL] then
      args += ["--find-links", Project[:PYNEST_URL]]
    end

    argstr = args.join(" ")

    sh "pip install #{argstr} #{opts}" do |ok, status|
      error("pip failed") unless ok
    end
  end
end
{'fraction_non_alphanumeric': 0.117, 'fraction_numerical': 0.006, 'mean_word_length': 2.7773584905660376, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '4176049', 'n_tokens_mistral': 333, 'n_tokens_neox': 315, 'n_words': 121}