<commit_before>module DockerCookbook
  module DockerHelpers
    module InstallationPackage
      def el6?
        return true if node['platform_family'] == 'rhel' && node['platform_version'].to_i == 6
        false
      end

      def el7?
        return true if node['platform_family'] == 'rhel' && node['platform_version'].to_i == 7
        false
      end

      def fedora?
        return true if node['platform'] == 'fedora'
        false
      end

      def debuntu?
        return true if node['platform'] == 'debian'
        return true if node['platform'] == 'ubuntu'
        false
      end

      def wheezy?
        return true if node['platform'] == 'debian' && node['platform_version'].to_i == 7
        false
      end

      def jessie?
        return true if node['platform'] == 'debian' && node['platform_version'].to_i == 8
        false
      end

      def precise?
        return true if node['platform'] == 'ubuntu' && node['platform_version'] == '12.04'
        false
      end

      def trusty?
        return true if node['platform'] == 'ubuntu' && node['platform_version'] == '14.04'
        false
      end

      def vivid?
        return true if node['platform'] == 'ubuntu' && node['platform_version'] == '15.04'
        false
      end

      def wily?
        return true if node['platform'] == 'ubuntu' && node['platform_version'] == '15.10'
        false
      end

      def xenial?
        return true if node['platform'] == 'ubuntu' && node['platform_version'] == '16.04'
        false
      end

      def zesty?
        return true if node['platform'] == 'ubuntu' && node['platform_version'] == '17.04'
        false
      end

      def amazon?
        return true if node['platform'] == 'amazon'
        false
      end

      # https://github.com/chef/chef/issues/4103
      def version_string(v)
        ubuntu_prefix = if Gem::Version.new(v) > Gem::Version.new('1.12.3')
                          'ubuntu'
                        else
                          ''
                        end

        debian_prefix = if Gem::Version.new(v) > Gem::Version.new('1.12.3')
                          'debian'
                        else
                          ''
                        end

        edition = if Gem::Version.new(v) > Gem::Version.new('17.03.0')
                    if debuntu?
                      '~ce'
                    elsif amazon?
                      'ce'
                    else
                      '.ce'
                    end
                  else
                    ''
                  end

        codename = if Gem::Version.new(v) < Gem::Version.new('17.06.0')
                     if wheezy?
                       '-wheezy'
                     elsif jessie?
                       '-jessie'
                     elsif precise?
                       '-precise'
                     elsif trusty?
                       '-trusty'
                     elsif vivid?
                       '-vivid'
                     elsif wily?
                       '-wily'
                     elsif xenial?
                       '-xenial'
                     elsif zesty?
                       '-zesty'
                     end
                   else
                     ''
                   end

        return "#{v}#{edition}-1.el6" if el6?
        return "#{v}#{edition}-1.el7.centos" if el7?
        return "#{v}#{edition}-1.50.amzn1" if amazon?
        return "#{v}#{edition}-1.fc#{node['platform_version'].to_i}" if fedora?
        return "#{v}#{edition}-0~#{debian_prefix}#{codename}" if node['platform'] == 'debian'
        return "#{v}#{edition}-0~#{ubuntu_prefix}#{codename}" if node['platform'] == 'ubuntu'
        v
      end

      def default_docker_version
        return '1.7.1' if el6?
        return '17.03.1' if amazon?
        return '17.04.0' if precise?<commit_msg>adding support for debian 9 (stretch)<commit_after>module DockerCookbook
  module DockerHelpers
    module InstallationPackage
      def el6?
        return true if node['platform_family'] == 'rhel' && node['platform_version'].to_i == 6
        false
      end

      def el7?
        return true if node['platform_family'] == 'rhel' && node['platform_version'].to_i == 7
        false
      end

      def fedora?
        return true if node['platform'] == 'fedora'
        false
      end

      def debuntu?
        return true if node['platform'] == 'debian'
        return true if node['platform'] == 'ubuntu'
        false
      end

      def wheezy?
        return true if node['platform'] == 'debian' && node['platform_version'].to_i == 7
        false
      end

      def jessie?
        return true if node['platform'] == 'debian' && node['platform_version'].to_i == 8
        false
      end

      def stretch?
        return true if node['platform'] == 'debian' && node['platform_version'].to_i == 9
        false
      end

      def precise?
        return true if node['platform'] == 'ubuntu' && node['platform_version'] == '12.04'
        false
      end

      def trusty?
        return true if node['platform'] == 'ubuntu' && node['platform_version'] == '14.04'
        false
      end

      def vivid?
        return true if node['platform'] == 'ubuntu' && node['platform_version'] == '15.04'
        false
      end

      def wily?
        return true if node['platform'] == 'ubuntu' && node['platform_version'] == '15.10'
        false
      end

      def xenial?
        return true if node['platform'] == 'ubuntu' && node['platform_version'] == '16.04'
        false
      end

      def zesty?
        return true if node['platform'] == 'ubuntu' && node['platform_version'] == '17.04'
        false
      end

      def amazon?
        return true if node['platform'] == 'amazon'
        false
      end

      # https://github.com/chef/chef/issues/4103
      def version_string(v)
        ubuntu_prefix = if Gem::Version.new(v) > Gem::Version.new('1.12.3')
                          'ubuntu'
                        else
                          ''
                        end

        debian_prefix = if Gem::Version.new(v) > Gem::Version.new('1.12.3')
                          'debian'
                        else
                          ''
                        end

        edition = if Gem::Version.new(v) > Gem::Version.new('17.03.0')
                    if debuntu?
                      '~ce'
                    elsif amazon?
                      'ce'
                    else
                      '.ce'
                    end
                  else
                    ''
                  end

        codename = if Gem::Version.new(v) < Gem::Version.new('17.06.0')
                     if wheezy?
                       '-wheezy'
                     elsif jessie?
                       '-jessie'
                     elsif stretch?
                       '-stretch'
                     elsif precise?
                       '-precise'
                     elsif trusty?
                       '-trusty'
                     elsif vivid?
                       '-vivid'
                     elsif wily?
                       '-wily'
                     elsif xenial?
                       '-xenial'
                     elsif zesty?
                       '-zesty'
                     end
                   else
                     ''
                   end

        return "#{v}#{edition}-1.el6" if el6?
        return "#{v}#{edition}-1.el7.centos" if el7?
        return "#{v}#{edition}-1.50.amzn1" if amazon?
        return "#{v}#{edition}-1.fc#{node['platform_version'].to_i}" if fedora?
        return "#{v}#{edition}-0~#{debian_prefix}#{codename}" if node['platform'] == 'debian'
        return "#{v}#{edition}-0~#{ubuntu_prefix}#{codename}" if node['platform'] == 'ubuntu'
        v
      end

      def default_docker_version
        return '1.7.1' if el6?
        return '17.03.1' if amazon?
        return '17.04.0' if precise?
{'fraction_non_alphanumeric': 0.12245922208281054, 'fraction_numerical': 0.020075282308657464, 'mean_word_length': 1.242824985931345, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 9, 'https://': 2, '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': '3300743', 'n_tokens_mistral': 2376, 'n_tokens_neox': 2157, 'n_words': 524}