<commit_before>require 'formula'

# Was a Framework build requested?
def build_framework?; ARGV.include? '--framework'; end

# Are we installed or installing as a Framework?
def as_framework?
  (self.installed? and File.exists? prefix+"Frameworks/Python.framework") or build_framework?
end

class Distribute < Formula
  url 'http://pypi.python.org/packages/source/d/distribute/distribute-0.6.24.tar.gz'
  md5 '17722b22141aba8235787f79800cc452'
end

class Python < Formula
  url 'http://www.python.org/ftp/python/2.7.2/Python-2.7.2.tar.bz2'
  homepage 'http://www.python.org/'
  md5 'ba7b2f11ffdbf195ee0d111b9455a5bd'

  depends_on 'readline' => :optional # Prefer over OS X's libedit
  depends_on 'sqlite'   => :optional # Prefer over OS X's older version
  depends_on 'gdbm'     => :optional

  def options
    [
      ["--framework", "Do a 'Framework' build instead of a UNIX-style build."],
      ["--universal", "Build for both 32 & 64 bit Intel."],
      ["--static", "Build static libraries."]
    ]
  end

  def patches
    # fix for recognizing gdbm 1.9.x databases
    # patch is already upstream: http://hg.python.org/cpython/rev/14cafb8d1480
    DATA
  end

  # Skip binaries so modules will load; skip lib because it is mostly Python files
  skip_clean ['bin', 'lib']

  def install
    if build_framework? and ARGV.include? "--static"
      onoe "Cannot specify both framework and static."
      exit 99
    end

    args = ["--prefix=#{prefix}"]

    if ARGV.build_universal?
      args << "--enable-universalsdk=/" << "--with-universal-archs=intel"
    end<commit_msg>Python requires -fwrapv for Decimal division<commit_after>require 'formula'

# Was a Framework build requested?
def build_framework?; ARGV.include? '--framework'; end

# Are we installed or installing as a Framework?
def as_framework?
  (self.installed? and File.exists? prefix+"Frameworks/Python.framework") or build_framework?
end

class Distribute < Formula
  url 'http://pypi.python.org/packages/source/d/distribute/distribute-0.6.24.tar.gz'
  md5 '17722b22141aba8235787f79800cc452'
end

class Python < Formula
  url 'http://www.python.org/ftp/python/2.7.2/Python-2.7.2.tar.bz2'
  homepage 'http://www.python.org/'
  md5 'ba7b2f11ffdbf195ee0d111b9455a5bd'

  depends_on 'readline' => :optional # Prefer over OS X's libedit
  depends_on 'sqlite'   => :optional # Prefer over OS X's older version
  depends_on 'gdbm'     => :optional

  def options
    [
      ["--framework", "Do a 'Framework' build instead of a UNIX-style build."],
      ["--universal", "Build for both 32 & 64 bit Intel."],
      ["--static", "Build static libraries."]
    ]
  end

  def patches
    # fix for recognizing gdbm 1.9.x databases
    # patch is already upstream: http://hg.python.org/cpython/rev/14cafb8d1480
    DATA
  end

  # Skip binaries so modules will load; skip lib because it is mostly Python files
  skip_clean ['bin', 'lib']

  def install
    # Python requires -fwrapv for proper Decimal division
    # See: http://stackoverflow.com/questions/7590137/dividing-decimals-yields-invalid-results-in-python-2-5-to-2-7
    ENV.append_to_cflags "-fwrapv"

    if build_framework? and ARGV.include? "--static"
      onoe "Cannot specify both framework and static."
      exit 99
    end

    args = ["--prefix=#{prefix}"]

    if ARGV.build_universal?
      args << "--enable-universalsdk=/" << "--with-universal-archs=intel"
    end
{'fraction_non_alphanumeric': 0.12533020252421484, 'fraction_numerical': 0.04373348987378926, 'mean_word_length': 3.3524904214559386, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 4, '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': '1499343', 'n_tokens_mistral': 1255, 'n_tokens_neox': 1133, 'n_words': 313}