<commit_before>package info.spielproject.spiel
package focus

import android.view.accessibility._

case class RichAccessibilityNode(node:AccessibilityNodeInfo) {

  def root = {
    def iterate(v:AccessibilityNodeInfo):AccessibilityNodeInfo = v.getParent match {
      case null => v
      case v2 => iterate(v2)
    }
    iterate(node)
  }

  def parent = node.getParent

  def children =
    (for(i <- 0 to node.getChildCount-1) yield(node.getChild(i))).toList

  def siblings = node.parent.children

  def descendants:List[AccessibilityNodeInfo] = children.map { c =>
    List(c)++c.descendants
  }.flatten

}<commit_msg>Filter nulls from list of children.<commit_after>package info.spielproject.spiel
package focus

import android.view.accessibility._

case class RichAccessibilityNode(node:AccessibilityNodeInfo) {

  def root = {
    def iterate(v:AccessibilityNodeInfo):AccessibilityNodeInfo = v.getParent match {
      case null => v
      case v2 => iterate(v2)
    }
    iterate(node)
  }

  def parent = node.getParent

  def children =
    (for(i <- 0 to node.getChildCount-1) yield(node.getChild(i))).toList.filterNot(_ == null)

  def siblings = node.parent.children

  def descendants:List[AccessibilityNodeInfo] = children.map { c =>
    List(c)++c.descendants
  }.flatten

}
{'fraction_non_alphanumeric': 0.10844306738962045, 'fraction_numerical': 0.006196746707978312, 'mean_word_length': 3.857142857142857, 'pattern_counts': {'":': 0, '<': 5, '<?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': '1045735', 'n_tokens_mistral': 432, 'n_tokens_neox': 402, 'n_words': 88}