<commit_before>require 'tab'
require 'os/mac'
require 'extend/ARGV'
require 'bottle_version'

def bottle_filename options={}
  options = { :tag => bottle_tag }.merge(options)
  "#{options[:name]}-#{options[:version]}#{bottle_native_suffix(options)}"
end

def built_as_bottle? f
  return false unless f.installed?
  tab = Tab.for_keg(f.installed_prefix)
  tab.built_as_bottle
end

def bottle_file_outdated? f, file
  filename = file.basename.to_s
  return unless f.bottle && filename.match(bottle_regex)

  bottle_ext = filename[bottle_native_regex, 1]
  bottle_url_ext = f.bottle.url[bottle_native_regex, 1]

  bottle_ext && bottle_url_ext && bottle_ext != bottle_url_ext
end

def bottle_native_suffix options={}
  options = { :tag => bottle_tag }.merge(options)
  ".#{options[:tag]}#{bottle_suffix(options[:revision])}"
end

def bottle_suffix revision=nil
  revision = revision.to_i > 0 ? ".#{revision}" : ""
  ".bottle#{revision}.tar.gz"
end

def bottle_native_regex
  /(\.#{bottle_tag}\.bottle\.(\d+\.)?tar\.gz)$/o
end

def bottle_regex
  Pathname::BOTTLE_EXTNAME_RX
end

def bottle_url(root_url, filename_options={})
  "#{root_url}/#{bottle_filename(filename_options)}"<commit_msg>Inline method that just wraps a constant<commit_after>require 'tab'
require 'os/mac'
require 'extend/ARGV'
require 'bottle_version'

def bottle_filename options={}
  options = { :tag => bottle_tag }.merge(options)
  "#{options[:name]}-#{options[:version]}#{bottle_native_suffix(options)}"
end

def built_as_bottle? f
  return false unless f.installed?
  tab = Tab.for_keg(f.installed_prefix)
  tab.built_as_bottle
end

def bottle_file_outdated? f, file
  filename = file.basename.to_s
  return unless f.bottle && filename.match(Pathname::BOTTLE_EXTNAME_RX)

  bottle_ext = filename[bottle_native_regex, 1]
  bottle_url_ext = f.bottle.url[bottle_native_regex, 1]

  bottle_ext && bottle_url_ext && bottle_ext != bottle_url_ext
end

def bottle_native_suffix options={}
  options = { :tag => bottle_tag }.merge(options)
  ".#{options[:tag]}#{bottle_suffix(options[:revision])}"
end

def bottle_suffix revision=nil
  revision = revision.to_i > 0 ? ".#{revision}" : ""
  ".bottle#{revision}.tar.gz"
end

def bottle_native_regex
  /(\.#{bottle_tag}\.bottle\.(\d+\.)?tar\.gz)$/o
end

def bottle_url(root_url, filename_options={})
  "#{root_url}/#{bottle_filename(filename_options)}"
{'fraction_non_alphanumeric': 0.14745762711864407, 'fraction_numerical': 0.002542372881355932, 'mean_word_length': 5.707386363636363, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, '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': '3597178', 'n_tokens_mistral': 907, 'n_tokens_neox': 914, 'n_words': 159}