<commit_before>let hasWindowListener = false
let lastScrollDirection = null
let lastScrollY = null
let ticking = false
const scrollObjects = []
const scrollTargetObjects = []

// SHARED METHODS
// -------------------------------------

function callMethod(component, method, scrollProperties) {
  if (component[method]) {
    component[method](scrollProperties)
  }
}

function getScrollDirection(scrollY) {
  if (Math.abs(lastScrollY - scrollY) >= 5) {
    return (scrollY > lastScrollY) ? 'down' : 'up'
  }
  return lastScrollDirection
}

// This is handy, but we're not using it anywhere at the moment
function getScrollPercent(bottom, top, val) {
  let bottomRange = bottom
  let topRange = top
  let valueInRange = val
  topRange += -bottomRange
  valueInRange += -bottomRange
  bottomRange += -bottomRange
  return Math.round(((valueInRange / (topRange - bottomRange)) * 100))<commit_msg>Decrease sensitivity on a scroll direction change<commit_after>let hasWindowListener = false
let lastScrollDirection = null
let lastScrollY = null
let ticking = false
const scrollObjects = []
const scrollTargetObjects = []

// SHARED METHODS
// -------------------------------------

function callMethod(component, method, scrollProperties) {
  if (component[method]) {
    component[method](scrollProperties)
  }
}

function getScrollDirection(scrollY) {
  if (Math.abs(lastScrollY - scrollY) >= 20) {
    return (scrollY > lastScrollY) ? 'down' : 'up'
  }
  return lastScrollDirection
}

// This is handy, but we're not using it anywhere at the moment
function getScrollPercent(bottom, top, val) {
  let bottomRange = bottom
  let topRange = top
  let valueInRange = val
  topRange += -bottomRange
  valueInRange += -bottomRange
  bottomRange += -bottomRange
  return Math.round(((valueInRange / (topRange - bottomRange)) * 100))
{'fraction_non_alphanumeric': 0.13808219178082193, 'fraction_numerical': 0.004931506849315068, 'mean_word_length': 3.5994962216624686, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '813091', 'n_tokens_mistral': 530, 'n_tokens_neox': 512, 'n_words': 153}