<commit_before>var path_uuids = ['8cf69fb9-8475-4ea6-bca4-3ed4fd713201',
                    '4ab30852-d3eb-403e-85b1-7266941f9942',
                    '0d7b3d34-1e5f-457b-80bd-1418940ed30c',
                    'dfc1e04a-89df-41d6-aa9b-417c28422f4d',
                    '7f35615f-6e2d-4cd0-9bf9-aab42e238bf9',
                    'f603a54b-128d-413e-99f8-db2227a0498b',
                    '1353cd36-5984-43b4-9662-77f70ee3043e',
                    '9accb0b2-146a-4bb0-b42e-0bffb5a8cf97',
                    '0032751c-bbc8-47c5-b386-ad54a60722a1'
                    ]



function highlightPath(cy, uuids){
    cy.startBatch()
    cy.nodes().forEach(function(n){
        var highlighted = true
        var data = n.data()
        // highlight all non-parent nodes that match uuids
        //if (n.isParent() == false){
            var uuid_list = n.data().uuid_list
            for (u of uuid_list){
              if (path_uuids.indexOf(u) !== -1){
                highlighted = false
                break;
              }
            }
            if (highlighted === true){
              n.addClass('transparent')
            }
          //}// check if n.isParent()
      })
      // highlight all non-virtual edges that match uuids
      cy.edges().forEach(function(e){
          var highlighted = true
          var data = e.data()
          // highlight all non-parent nodes that match uuids
          if (e.hasClass('virtual') === false){
              var uuid_list = e.data().uuid_list
              for (u of uuid_list){
                if (path_uuids.indexOf(u) !== -1){
                  highlighted = false
                  break;
                }
              }
              if (highlighted === true){
                e.addClass('transparent')
              }
            }// check if n.isParent()
        })
  cy.endBatch()
}


function unHighlight(cy){
  cy.startBatch()

  cy.nodes().forEach(function(n){
    n.removeClass('transparent')
      if (n.hasClass('transparent') === false){
        console.log(n.name)

      }
  })
  cy.edges().forEach(function(e){
    e.removeClass('transparent')
    if (e.hasClass('transparent') === false){
      console.log(e.name)
    }
  })
  cy.endBatch()
}<commit_msg>Refactor path highlighting/unhighlighting code<commit_after>function highlightPath(cy, uuids){
    cy.startBatch()
    // nodes
    cy.nodes().forEach(function(n){
        var see_thru = true
        var data = n.data()
            // get each node's uuid_list and check if it is in the path
            var uuid_list = n.data().uuid_list
            for (u of uuid_list){
              // if the uuid is in the path, make it not see_thru
              if (path_uuids.indexOf(u) !== -1){
                see_thru = false
                break;
              }
            }
            // if still see_thru, then add the .transparent class
            if (see_thru === true){
              n.addClass('transparent')
            }
      })
      cy.edges().forEach(function(e){
          var see_thru = true
          var data = e.data()
          // only act on non-virtual edges, as virtual edges aren't rendered
          if (e.hasClass('virtual') === false){
              // get each edge's uuid_list and check if it is in the path
              var uuid_list = e.data().uuid_list
              for (u of uuid_list){
                // if the uuid is in the path, make it not see_thru
                if (path_uuids.indexOf(u) !== -1){
                  see_thru = false
                  break;
                }
              }
              // if still see_thru, then add the .transparent class
              if (see_thru === true){
                e.addClass('transparent')
              }
            }
        })
  cy.endBatch()
}


// removes .transparent class from all elements in the specified cytoscape obj
function unHighlight(cy){
  cy.startBatch()
  cy.nodes().forEach(function(n){
    n.removeClass('transparent')
      if (n.hasClass('transparent') === false){
      }
  })
  cy.edges().forEach(function(e){
    e.removeClass('transparent')
    if (e.hasClass('transparent') === false){
    }
  })
  cy.endBatch()
}
{'fraction_non_alphanumeric': 0.12284069097888675, 'fraction_numerical': 0.045105566218809984, 'mean_word_length': 1.512959614225437, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '7028444', 'n_tokens_mistral': 1393, 'n_tokens_neox': 1285, 'n_words': 270}