<commit_before># Public: Fz2D
class Fz2D
  # Public: Version Number.
  @VERSION: '0.0.1'

  # Public: None.
  @NONE   = 0
  # Public: Top.
  @TOP    = 1 << 1
  # Public: Left.
  @LEFT   = 1 << 2
  # Public: Right.
  @RIGHT  = 1 << 3
  # Public: Bottom.
  @BOTTOM = 1 << 4

  # Public: Default foreground color.
  @FG: '#FFFFFF'
  # Public: Default background color.
  @BG: '#000000'

  # Public: Default canvas selector.
  @SELECTOR: '#canvas'

  # Public: Default assets path.
  @PATH: 'assets'

  # Public: Hash of parsed and unescaped query paramaters.
  @query:(()->
    hash = {}

    query = window.location.href.split('?').pop()

    for q in query.split('&')
      [k, v] = q.split('=')

      kk = unescape(k)
      vv = unescape(v)

      if /^\d+$/.test(vv) # convert numbers
        vv = parseInt(vv)
      else if /^true|false$/i.test(vv) # convert booleans
        vv = JSON.parse(vv)
        unless kk of Fz2D
          Fz2D[kk] = kk if vv # alias booleans; but only if they are true?

      hash[kk] = vv

    hash
  )()

  # Public: URL without parameters.
  @url: (() ->
    window.location.href.split('?')[0]
  )()

  # Public: Is HTTPS supported?
  @https: (() ->
    if window.location.protocol == 'https:'
      'https'
    else
      null
  )()

  # Public: Production environment?
  @production: null

  # Public: Development environment?
  @development: (() ->
    return 'development' if Fz2D.debug?
    return 'development' if /localhost|127.0.0.1/i.test(window.location.hostname)
    # return 'development' if document.getElementById('_fz2d_development')?
    Fz2D.production = 'production'
    null
  )()

  # Public: Is touch device?
  @touch: (() ->
    return 'supported' if Fz2D.forcetouch?

    if 'ontouchstart' in window or window.navigator.maxTouchPoints or window.navigator.msMaxTouchPoints
      'supported'
    else
      null
  )()

  # Public: Is mobile device?
  @mobile: (() ->
    m = window.navigator.userAgent.match(/(iphone|ipod|ipad|android|iemobile|blackberry|bada)/i)
    if m
      m[1]
    else
      null
  )()

  # Public: Clamps a given number between two limits.
  #
  # d   - number<commit_msg>added consider 192.168.xxx.xxx as development, added Firefox and IE detection<commit_after># Public: Fz2D
class Fz2D
  # Public: Version Number.
  @VERSION: '0.0.1'

  # Public: None.
  @NONE   = 0
  # Public: Top.
  @TOP    = 1 << 1
  # Public: Left.
  @LEFT   = 1 << 2
  # Public: Right.
  @RIGHT  = 1 << 3
  # Public: Bottom.
  @BOTTOM = 1 << 4

  # Public: Default foreground color.
  @FG: '#FFFFFF'
  # Public: Default background color.
  @BG: '#000000'

  # Public: Default canvas selector.
  @SELECTOR: '#canvas'

  # Public: Default assets path.
  @PATH: 'assets'

  # Public: Hash of parsed and unescaped query paramaters.
  @query:(()->
    hash = {}

    query = window.location.href.split('?').pop()

    for q in query.split('&')
      [k, v] = q.split('=')

      kk = unescape(k)
      vv = unescape(v)

      if /^\d+$/.test(vv) # convert numbers
        vv = parseInt(vv)
      else if /^true|false$/i.test(vv) # convert booleans
        vv = JSON.parse(vv)
        unless kk of Fz2D
          Fz2D[kk] = kk if vv # alias booleans; but only if they are true?

      hash[kk] = vv

    hash
  )()

  # Public: URL without parameters.
  @url: (() ->
    window.location.href.split('?')[0]
  )()

  # Public: Is HTTPS supported?
  @https: (() ->
    if window.location.protocol == 'https:'
      'https'
    else
      null
  )()

  # Public: Production environment?
  @production: null

  # Public: Development environment?
  @development: (() ->
    return 'development' if Fz2D.debug?
    return 'development' if /localhost|127.0.0.1|192.168.\d+.\d+/i.test(window.location.hostname)
    Fz2D.production = 'production'
    null
  )()

  # Public: Is touch device?
  @touch: (() ->
    return 'supported' if Fz2D.forcetouch?

    if 'ontouchstart' in window or window.navigator.maxTouchPoints or window.navigator.msMaxTouchPoints
      'supported'
    else
      null
  )()

  # Public: Is mobile device?
  @mobile: (() ->
    m = window.navigator.userAgent.match(/(iphone|ipod|ipad|android|iemobile|blackberry|bada)/i)
    if m
      m[1]
    else
      null
  )()

  # Public: Is Firefox?
  @firefox: (() ->
    if /firefox/i.test(window.navigator.userAgent)
      'firefox'
    else
      null
  )()

  # Public: Is Internet Explorer?
  @ie: (() ->
    m = window.navigator.userAgent.match(/(msie \d+|iemobile\/\d+|WPDesktop)/i)
    if m
      parseInt(m[1].replace(/(msie\s+|iemobile\/)/i, '')) || 11
    else
      null
  )()

  # Public: Clamps a given number between two limits.
  #
  # d   - number
{'fraction_non_alphanumeric': 0.15257864326984807, 'fraction_numerical': 0.017547613952493046, 'mean_word_length': 2.4673590504451037, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5663232', 'n_tokens_mistral': 1772, 'n_tokens_neox': 1657, 'n_words': 419}