<commit_before>jQuery(document).ready(function ($) {
  var $menu = $('#mainmenu')
  var $menuBar = $('#mainmenu > ul')

  // Add menu icon
  $menu.prepend('<div id="mainmenu-icon">&#9776;</div>')
  var $menuIcon = $('#mainmenu-icon')

  // Click on menu icon, toggle menu
  $menuIcon.on('click', function () {
    $menuBar.slideToggle({
      complete: function () {
        $menuIcon.toggleClass('active')
      }
    })
  })

  // Click outside menu, close it
  $(document).click(function (mouseEvent) {
    if ($menuIcon.is(':visible') && $menuBar.is(':visible') && isOutsideMenu(mouseEvent)) {
      $menuBar.slideUp({
        complete: function () {
          $menuIcon.removeClass('active')
        }
      })
    }
  })

  function isOutsideMenu(mouseEvent) {
    var offsetMenuBar = $menuBar.offset()
    var insideMenuBar = mouseEvent.pageX > offsetMenuBar.left &&
      mouseEvent.pageX < offsetMenuBar.left + $menuBar.outerWidth() &&
      mouseEvent.pageY > offsetMenuBar.top &&
      mouseEvent.pageY < offsetMenuBar.top + $menuBar.outerHeight()

    var offsetMenuIcon = $menuIcon.offset()
    var insideMenuIcon = mouseEvent.pageX > offsetMenuIcon.left &&
      mouseEvent.pageX < offsetMenuIcon.left + $menuIcon.outerWidth() &&
      mouseEvent.pageY > offsetMenuIcon.top &&
      mouseEvent.pageY < offsetMenuIcon.top + $menuIcon.outerHeight()

    return !insideMenuBar && !insideMenuIcon
  }
})<commit_msg>Refine variable names<commit_after>jQuery(document).ready(function ($) {
  var $mainmenu = $('#mainmenu')
  var $menu = $('#mainmenu > ul')

  // Add menu icon
  $mainmenu.prepend('<div id="mainmenu-icon">&#9776;</div>')
  var $menuIcon = $('#mainmenu-icon')

  // Click on menu icon, toggle menu
  $menuIcon.on('click', function () {
    $menu.slideToggle({
      complete: function () {
        $menuIcon.toggleClass('active')
      }
    })
  })

  // Click outside menu, close it
  $(document).click(function (mouseEvent) {
    if ($menuIcon.is(':visible') && $menu.is(':visible') && isOutsideMenu(mouseEvent)) {
      $menu.slideUp({
        complete: function () {
          $menuIcon.removeClass('active')
        }
      })
    }
  })

  function isOutsideMenu(mouseEvent) {
    var offsetMenuBar = $menu.offset()
    var insideMenuBar = mouseEvent.pageX > offsetMenuBar.left &&
      mouseEvent.pageX < offsetMenuBar.left + $menu.outerWidth() &&
      mouseEvent.pageY > offsetMenuBar.top &&
      mouseEvent.pageY < offsetMenuBar.top + $menu.outerHeight()

    var offsetMenuIcon = $menuIcon.offset()
    var insideMenuIcon = mouseEvent.pageX > offsetMenuIcon.left &&
      mouseEvent.pageX < offsetMenuIcon.left + $menuIcon.outerWidth() &&
      mouseEvent.pageY > offsetMenuIcon.top &&
      mouseEvent.pageY < offsetMenuIcon.top + $menuIcon.outerHeight()

    return !insideMenuBar && !insideMenuIcon
  }
})
{'fraction_non_alphanumeric': 0.1546572934973638, 'fraction_numerical': 0.00281195079086116, 'mean_word_length': 3.266866566716642, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 17, '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': '3635233', 'n_tokens_mistral': 901, 'n_tokens_neox': 878, 'n_words': 158}