<commit_before>'use strict';

angular.module('scegratooApp')
  .service('x3dQuery', function x3dQuery() {
    // AngularJS will instantiate a singleton by calling "new" on this function

    angular.element.fn.extend({
      color: function color(clr) {
        var node = this.get(0)

        if (clr) {
          if (angular.isArray(clr)) {
            clr = angular.copy(clr)

            angular.forEach(node.getElementsByTagName('Material'), function(material) {
              material.diffuseColor = clr.shift()
            })
            angular.forEach(node.getElementsByTagName('material'), function(material) {
              material.diffuseColor = clr.shift()
            })
          } else {
            angular.forEach(node.getElementsByTagName('Material'), function(material) {
              material.diffuseColor = clr
            })
            angular.forEach(node.getElementsByTagName('material'), function(material) {
              material.diffuseColor = clr
            })
          }

          return this
        } else {
          var colors = []

          angular.forEach(node.getElementsByTagName('Material'), function(material) {
            colors.push(material.diffuseColor)
          })
          angular.forEach(node.getElementsByTagName('material'), function(material) {
            colors.push(material.diffuseColor)
          })

          return colors
        }
      },

      runtime: function runtime() {
        var _this = this
        var boundRuntime = {}
        var runtime = this.firstParent('x3d').get(0).runtime

        angular.forEach(Object.getPrototypeOf(runtime), function(method, name) {
          boundRuntime[name] = angular.bind(runtime, method, _this.get(0))
        })

        return boundRuntime
      },

      firstParent: function firstParent(parentName) {
        var _firstParent
        var next = this.get(0)

        while (next.nodeName.toLowerCase() !== '#document') {
          next = next.parentNode

          if (next.nodeName.toLowerCase() === parentName) {
            _firstParent = next
            break
          }
        }

        if (_firstParent) {
          return angular.element(_firstParent)
        } else {
          return angular.element()
        }
      },

      lastParent: function lastParent(parentName) {<commit_msg>:art: standard style<commit_after>'use strict'

const angular = window.angular

angular.module('scegratooApp')
  .service('x3dQuery', function x3dQuery () {
    // AngularJS will instantiate a singleton by calling "new" on this function

    angular.element.fn.extend({
      color: function color (clr) {
        var node = this.get(0)

        if (clr) {
          if (angular.isArray(clr)) {
            clr = angular.copy(clr)

            angular.forEach(node.getElementsByTagName('Material'), function (material) {
              material.diffuseColor = clr.shift()
            })
            angular.forEach(node.getElementsByTagName('material'), function (material) {
              material.diffuseColor = clr.shift()
            })
          } else {
            angular.forEach(node.getElementsByTagName('Material'), function (material) {
              material.diffuseColor = clr
            })
            angular.forEach(node.getElementsByTagName('material'), function (material) {
              material.diffuseColor = clr
            })
          }

          return this
        } else {
          var colors = []

          angular.forEach(node.getElementsByTagName('Material'), function (material) {
            colors.push(material.diffuseColor)
          })
          angular.forEach(node.getElementsByTagName('material'), function (material) {
            colors.push(material.diffuseColor)
          })

          return colors
        }
      },

      runtime: function runtime () {
        var _this = this
        var boundRuntime = {}
        var runtime = this.firstParent('x3d').get(0).runtime

        angular.forEach(Object.getPrototypeOf(runtime), function (method, name) {
          boundRuntime[name] = angular.bind(runtime, method, _this.get(0))
        })

        return boundRuntime
      },

      firstParent: function firstParent (parentName) {
        var _firstParent
        var next = this.get(0)

        while (next.nodeName.toLowerCase() !== '#document') {
          next = next.parentNode

          if (next.nodeName.toLowerCase() === parentName) {
            _firstParent = next
            break
          }
        }

        if (_firstParent) {
          return angular.element(_firstParent)
        } else {
          return angular.element()
        }
      },

      lastParent: function lastParent (parentName) {
{'fraction_non_alphanumeric': 0.11023454157782515, 'fraction_numerical': 0.0029850746268656717, 'mean_word_length': 1.9410658307210031, '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': '5980537', 'n_tokens_mistral': 1246, 'n_tokens_neox': 1223, 'n_words': 233}