<commit_before>select = require('optimal-select').select

getSource = () ->
  getFramePath = () ->
    fid = []
    _get_frame_id = (win) ->
      parent = win.parent
      return if win == parent
      idx = '?'
      for frame, frame_idx in parent.frames
        if win == frame
          idx = frame_idx
          break
      fid.unshift idx
      _get_frame_id(parent)
    _get_frame_id(window)
    return fid.join ':'

  getSelector = (innerHTML) ->
    dictionary = {}
    frames = document.getElementsByTagName 'iframe'
    for iframe in frames
      i = 0
      while i<window.frames.length
        if iframe.contentWindow == window.frames[i]
          dictionary[select(iframe)] = i
          break
        i++
    return dictionary
    
  getDoctype = (doctype)->
    if doctype?
      return [doctype.name,doctype.publicId,doctype.systemId]
    return null

  getAttribute = (array)->
    mas = []
    for elem in array
      mas.push(elem.nodeName,elem.nodeValue)
    return mas

  # Function returns iframe url, content,html-atributes,iframe-selectors and iframe-path
  [ document.URL,
    document.documentElement.innerHTML,
    getAttribute(document.documentElement.attributes),
    getFramePath(),<commit_msg>remove one coffelint warning<commit_after>select = require('optimal-select').select

getSource = () ->
  getFramePath = () ->
    fid = []
    _get_frame_id = (win) ->
      parent = win.parent
      return if win == parent
      idx = '?'
      for frame, frame_idx in parent.frames
        if win == frame
          idx = frame_idx
          break
      fid.unshift idx
      _get_frame_id(parent)
    _get_frame_id(window)
    return fid.join ':'

  getSelector = (innerHTML) ->
    dictionary = {}
    frames = document.getElementsByTagName 'iframe'
    for iframe in frames
      i = 0
      while i<window.frames.length
        if iframe.contentWindow == window.frames[i]
          dictionary[select(iframe)] = i
          break
        i++
    return dictionary
    
  getDoctype = (doctype)->
    if doctype?
      return [doctype.name,doctype.publicId,doctype.systemId]
    return null

  getAttribute = (array)->
    mas = []
    for elem in array
      mas.push(elem.nodeName,elem.nodeValue)
    return mas

  # Function returns iframe url, content,html-atributes,
  # iframe-selectors and iframe-path
  [ document.URL,
    document.documentElement.innerHTML,
    getAttribute(document.documentElement.attributes),
    getFramePath(),
{'fraction_non_alphanumeric': 0.10323886639676114, 'fraction_numerical': 0.0008097165991902834, 'mean_word_length': 2.451117318435754, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 15, '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': '5291434', 'n_tokens_mistral': 770, 'n_tokens_neox': 739, 'n_words': 169}