<commit_before>import json
import os
import re

# These will have to be updated manually over time, there's not an
# easy way to determine the latest version.
COMPILE_SDK_VERSION = 27
TARGET_SDK_VERSION = 27
BUILD_TOOLS_VERSION = '27.0.2'

COMPILE_SDK_RE = r'compileSdkVersion[\s][\w]+'
TARGET_SDK_RE = r'targetSdkVersion[\s][\w]+'
BUILD_TOOLS_RE = r'buildToolsVersion[\s][\'\"][\w\.]+[\'\"]'

GROUPS_ALLOWED_MAJOR_UPDATE = [
  'com.google.android.gms',
  'com.android.support'
]

# Depends on https://github.com/ben-manes/gradle-versions-plugin
#
# Must run this command:
# $ ./gradlew dependencyUpdates -Drevision=release -DoutputFormatter=json
INPUT_JSON = 'build/dependencyUpdates/report.json'

def find_gradle_files():
    """Finds all build.gradle files, recursively."""
    gradle_files = []
    for root, dirs, files in os.walk('.'):
        for filename in files:
            if filename.endswith('build.gradle'):
                gradle_files.append(os.path.join(root, filename))

    return gradle_files

def get_android_replacements():
    """Gets a dictionary of all android-specific replacements to be made."""
    replacements = {}

    compileSdk = 'compileSdkVersion {}'.format(COMPILE_SDK_VERSION)
    targetSdk = 'targetSdkVersion {}'.format(TARGET_SDK_VERSION)
    buildToolsVersion = 'buildToolsVersion \'{}\''.format(BUILD_TOOLS_VERSION)<commit_msg>Update major version whitelist<commit_after>import json
import os
import re

# These will have to be updated manually over time, there's not an
# easy way to determine the latest version.
COMPILE_SDK_VERSION = 27
TARGET_SDK_VERSION = 27
BUILD_TOOLS_VERSION = '27.0.2'

COMPILE_SDK_RE = r'compileSdkVersion[\s][\w]+'
TARGET_SDK_RE = r'targetSdkVersion[\s][\w]+'
BUILD_TOOLS_RE = r'buildToolsVersion[\s][\'\"][\w\.]+[\'\"]'

GROUPS_ALLOWED_MAJOR_UPDATE = [
  'com.google.android.gms',
  'com.google.firebase',
  'com.android.support',
  'com.android.support.test'
]

# Depends on https://github.com/ben-manes/gradle-versions-plugin
#
# Must run this command:
# $ ./gradlew dependencyUpdates -Drevision=release -DoutputFormatter=json
INPUT_JSON = 'build/dependencyUpdates/report.json'

def find_gradle_files():
    """Finds all build.gradle files, recursively."""
    gradle_files = []
    for root, dirs, files in os.walk('.'):
        for filename in files:
            if filename.endswith('build.gradle'):
                gradle_files.append(os.path.join(root, filename))

    return gradle_files

def get_android_replacements():
    """Gets a dictionary of all android-specific replacements to be made."""
    replacements = {}

    compileSdk = 'compileSdkVersion {}'.format(COMPILE_SDK_VERSION)
    targetSdk = 'targetSdkVersion {}'.format(TARGET_SDK_VERSION)
    buildToolsVersion = 'buildToolsVersion \'{}\''.format(BUILD_TOOLS_VERSION)
{'fraction_non_alphanumeric': 0.1326458036984353, 'fraction_numerical': 0.005689900426742532, 'mean_word_length': 4.317580340264651, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '4596633', 'n_tokens_mistral': 975, 'n_tokens_neox': 920, 'n_words': 202}