<commit_before>$(() => {
  const caption = [
    "Curious grey kitten",
    "Cat licking off the last bits of his meal from its paw",
    "The cat stays still, keeping in mind not to startle its prey",
    "After destroying its toy, it looks for a new target",
    "The white furred cat stares into the camera lens, admiring its beautiful coloured green eyes"
  ];
  /*
   * handles the logic for clicking the buttons
   */
  function photocarouselButtonHandler(event) {
    console.log('first');

    const buttonType = event.target.name;
    const $catdivs = $('.cat-div');
    $imagecontainer = $('.image-container');
    const currentIndex = $imagecontainer.data('current-index');
    let nextIndex = currentIndex;

    //check which button is being pressed and determine the next index
    if (buttonType === "next") {
      if (nextIndex >= $catdivs.length - 1) {
        nextIndex = 0;
      } else {
        nextIndex += 1;
      }
    } else {
      if (nextIndex <= 0) {
        nextIndex = $catdivs.length - 1;
      } else {
        nextIndex -= 1;
      }
    }
    // alert(nextIndex);
    $imagecontainer.data('current-index', nextIndex);
    render(nextIndex, buttonType);
    return;
  }
  /*
   * Handles the logic of the next slide to be displayed
   */
  function render(nextIndex, buttonType = 'init') {
    const $catdivs = $('.cat-div');<commit_msg>tracing bug<commit_after>$(() => {
  const caption = [
    "Curious grey kitten",
    "Cat licking off the last bits of his meal from its paw",
    "The cat stays still, keeping in mind not to startle its prey",
    "After destroying its toy, it looks for a new target",
    "The white furred cat stares into the camera lens, admiring its beautiful coloured green eyes"
  ];
  /*
   * handles the logic for clicking the buttons
   */
  function photocarouselButtonHandler(event) {
    console.log('first');

    const buttonType = event.target.name;
    const $catdivs = $('.cat-div');
    $imagecontainer = $('.image-container');
    const currentIndex = $imagecontainer.data('current-index');
    let nextIndex = currentIndex;

    //check which button is being pressed and determine the next index
    if (buttonType === "next") {
      console.log("Next button pressed");
      if (nextIndex >= $catdivs.length - 1) {
        nextIndex = 0;
      } else {
        nextIndex += 1;
      }
    } else {
      console.log("Previous button pressed");
      if (nextIndex <= 0) {
        nextIndex = $catdivs.length - 1;
      } else {
        nextIndex -= 1;
      }
    }
    console.log('nextIndex = ' + nextIndex);
    // alert(nextIndex);
    $imagecontainer.data('current-index', nextIndex);
    render(nextIndex, buttonType);
    return;
  }
  /*
   * Handles the logic of the next slide to be displayed
   */
  function render(nextIndex, buttonType = 'init') {
    console.log("render");
    const $catdivs = $('.cat-div');
{'fraction_non_alphanumeric': 0.12405237767057202, 'fraction_numerical': 0.004135079255685734, 'mean_word_length': 2.6469849246231156, 'pattern_counts': {'":': 0, '<': 5, '<?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': '288165', 'n_tokens_mistral': 873, 'n_tokens_neox': 842, 'n_words': 279}