<commit_before>(function($) {
  $(function() {
    $('a[data-obfu]').each(function() {
      var self = $(this)
        , obfu = self.data('obfu')
        , text = ''
        , rand
        , i;

      rand = parseInt(obfu.substr(0, 2), 16);
      
      for (i = 1; i < obfu.length / 2; ++i) {
        text += String.fromCharCode(parseInt(obfu.substr(i * 2, 2), 16) ^ rand);
      }
      self.attr('href', text);
    });
  });

  $(function() {
    var $win = $(window)
      , $body = $('body')
      , $navbar = $('#navbar')
      , $navbarContainer = $('#navbar .container')
      , $navbarCollapse = $('#navbar .navbar-collapse')
      , navHeight = $('#navbar').height()
      , navTop = $('#navbar').length && $('#navbar').offset().top
      , marginTop = parseInt($body.css('margin-top'), 10);

    $win.ready(processScroll);
    $win.scroll(processScroll);
    $win.resize(processScroll);
    $win.ready(fixNavTop);
    $win.resize(fixNavTop);

    function processScroll() {
      if ($body.width() < 750) {
        return;
      }

      var scrollTop = $win.scrollTop()
        , navTop = $('#banner').height() + $('#banner').offset().top
        , navHeight = $('#navbar').height();

      if (scrollTop >= navTop) {
        $navbar.addClass('navbar-fixed-top');
        $navbarContainer.removeClass('navbar-container-style');
        $body.css('margin-top', marginTop + navHeight + 'px');

      } else if (scrollTop <= navTop){
        $navbar.removeClass('navbar-fixed-top');
        $navbarContainer.addClass('navbar-container-style');
        $body.css('margin-top', marginTop + 'px');
      }
    }

    function fixNavTop() {
      if ($body.width() < 750) {
        $navbar.removeClass('navbar-fixed-top');
      }

      if ($body.width() < 768) {
        $navbarCollapse.removeClass('navbar-collapse-style');
      }

      if ($body.width() > 750) {
        $navbarCollapse.addClass('navbar-collapse-style');
      }
    }
  });

  $(function() {
    var MIN_WIDTH = 768;
    $('.navbar-search-form input').click(function() {
      var width = $('body').width();
      if (width >= MIN_WIDTH) {
        $(this).parent().parent().addClass('open');
      }
    });

    $('.navbar-search-form input').blur(function() {
      var width = $('body').width();
      if (width >= MIN_WIDTH && !trim($(this).val())) {
        $(this).val('');
        $(this).parent().parent().removeClass('open');
      }
    });

    function trim(str) {
      return str.replace(/(^\s*)|(\s*$)/g, '');
    }
  });

  $(function() {
    var $win = $(window)<commit_msg>Improved navigation bar display experience<commit_after>(function($) {
  $(function() {
    $('a[data-obfu]').each(function() {
      var self = $(this)
        , obfu = self.data('obfu')
        , text = ''
        , rand
        , i;

      rand = parseInt(obfu.substr(0, 2), 16);
      
      for (i = 1; i < obfu.length / 2; ++i) {
        text += String.fromCharCode(parseInt(obfu.substr(i * 2, 2), 16) ^ rand);
      }
      self.attr('href', text);
    });
  });

  $(function() {
    var $win = $(window)
      , $body = $('body')
      , $navbar = $('#navbar')
      , $navbarContainer = $('#navbar .container')
      , $navbarCollapse = $('#navbar .navbar-collapse')
      , navHeight = $('#navbar').height()
      , navTop = $('#navbar').length && $('#navbar').offset().top
      , marginTop = parseInt($body.css('margin-top'), 10);

    $win.ready(processScroll);
    $win.scroll(processScroll);
    $win.resize(processScroll);
    $win.ready(fixNavTop);
    $win.resize(fixNavTop);

    function processScroll() {
      var scrollTop = $win.scrollTop()
        , navTop = $('#banner').height() + $('#banner').offset().top
        , navHeight = $('#navbar').height();

      if (scrollTop >= navTop) {
        $navbar.addClass('navbar-fixed-top');
        $navbarContainer.removeClass('navbar-container-style');
        $body.css('margin-top', marginTop + navHeight + 'px');

      } else if (scrollTop <= navTop){
        $navbar.removeClass('navbar-fixed-top');
        $navbarContainer.addClass('navbar-container-style');
        $body.css('margin-top', marginTop + 'px');
      }
    }

    function fixNavTop() {
      if ($body.width() < 768) {
        $navbarCollapse.removeClass('navbar-collapse-style');
      }

      if ($body.width() > 750) {
        $navbarCollapse.addClass('navbar-collapse-style');
      }
    }
  });

  $(function() {
    var MIN_WIDTH = 768;
    $('.navbar-search-form input').click(function() {
      var width = $('body').width();
        $(this).parent().parent().addClass('open');
    });

    $('.navbar-search-form input').blur(function() {
      var width = $('body').width();
      if (!trim($(this).val())) {
        $(this).val('');
        $(this).parent().parent().removeClass('open');
      }
    });

    function trim(str) {
      return str.replace(/(^\s*)|(\s*$)/g, '');
    }
  });

  $(function() {
    var $win = $(window)
{'fraction_non_alphanumeric': 0.21653225806451612, 'fraction_numerical': 0.00967741935483871, 'mean_word_length': 2.4119669876203575, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 9, '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': '1315236', 'n_tokens_mistral': 1671, 'n_tokens_neox': 1551, 'n_words': 260}