<commit_before>/*
 * Copyright (C) 2018 <NAME>
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *       http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.pyamsoft.padlock.model

object Excludes {

  private val PACKAGES: List<String> = listOf(
      // Android system stuff. You can really shoot yourself in the foot here, don't let user
      // touch these packages
      "android",
      "com.android.systemui"
  )

  private val CLASSES: List<String> = listOf(
      // Lock Screen, can't lock itself
      "com.pyamsoft.padlock.lock.lockscreenactivity",

      // Leak Canary
      "com.squareup.leakcanary.internal.displayleakactivity",
      "com.squareup.leakcanary.internal.requeststoragepermissionactivity"
  )

  @JvmStatic
  fun isPackageExcluded(name: String): Boolean = checkExclusion(PACKAGES, name)

  @JvmStatic
  fun isClassExcluded(name: String): Boolean = checkExclusion(CLASSES, name)

  @JvmStatic
  private fun checkExclusion(
      list: List<String>,
      name: String
  ): Boolean {
    val check = name.trim()
        .toLowerCase()
    return list.contains(check)
  }

  @JvmStatic
  fun isLockScreen(
      packageName: String,
      className: String
  ): Boolean {
    val packageCheck = packageName.trim()
        .toLowerCase()
    val classCheck = className.trim()
        .toLowerCase()
    return (packageCheck == "com.pyamsoft.padlock"
        && classCheck == "com.pyamsoft.padlock.lock.lockscreenactivity")
  }
}<commit_msg>clean up models<commit_after>/*
 * Copyright (C) 2018 <NAME>
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *       http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.pyamsoft.padlock.model

import android.support.annotation.CheckResult

object Excludes {

  private val PACKAGES: List<String> = listOf(
      // Android system stuff. You can really shoot yourself in the foot here, don't let user
      // touch these packages
      "android",
      "com.android.systemui"
  )

  private val CLASSES: List<String> = listOf(
      // Lock Screen, can't lock itself
      "com.pyamsoft.padlock.lock.lockscreenactivity",

      // Leak Canary
      "com.squareup.leakcanary.internal.displayleakactivity",
      "com.squareup.leakcanary.internal.requeststoragepermissionactivity"
  )

  @JvmStatic
  @CheckResult
  fun isPackageExcluded(name: String): Boolean = checkExclusion(PACKAGES, name)

  @JvmStatic
  @CheckResult
  fun isClassExcluded(name: String): Boolean = checkExclusion(CLASSES, name)

  @JvmStatic
  @CheckResult
  private fun checkExclusion(
      list: List<String>,
      name: String
  ): Boolean {
    val check = name.trim()
        .toLowerCase()
    return list.contains(check)
  }

  @JvmStatic
  @CheckResult
  fun isLockScreen(
      packageName: String,
      className: String
  ): Boolean {
    val packageCheck = packageName.trim()
        .toLowerCase()
    val classCheck = className.trim()
        .toLowerCase()
    return (packageCheck == "com.pyamsoft.padlock"
        && classCheck == "com.pyamsoft.padlock.lock.lockscreenactivity")
  }
}
{'fraction_non_alphanumeric': 0.09479507166205682, 'fraction_numerical': 0.004023133014835303, 'mean_word_length': 3.2454642475987194, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '7059633', 'n_tokens_mistral': 1168, 'n_tokens_neox': 1136, 'n_words': 362}