<commit_before>require 'fy'
require 'fy/lib/codegen'
{
  Translator
} = require 'gram2'
module = @
# ###################################################################################################
#    scope state
# ###################################################################################################
# MAY BE move to trans
current_scope =
  id_map : {} # id -> ast pos list

scope_list = [current_scope]
scope_stack = []
fake_id = (type)->
  {
    mx_hash : {
      type
    }
  }

scope_state_reset = ()->
  current_scope =
    id_map : {
      Math : [
        fake_id mk_type 'object', [], {
          abs   : mk_type 'either', [
            mk_type 'function', [mk_type('int'), mk_type('int')]
            mk_type 'function', [mk_type('float'), mk_type('float')]
          ]
          round : mk_type 'function', [mk_type('int'), mk_type('float')]
        }
      ]
      Fail : [ # crafted object for more coverage
        fake_id mk_type 'object', [], {
          invalid_either   : mk_type 'either', [
            mk_type 'function', [mk_type('int'), mk_type('int')]
            mk_type 'int'
          ]
        }
      ]
    } # id -> ast pos list

  scope_list = [current_scope]
  scope_stack = []
  return<commit_msg>stdin stdout<commit_after>require 'fy'
require 'fy/lib/codegen'
{
  Translator
} = require 'gram2'
module = @
# ###################################################################################################
#    scope state
# ###################################################################################################
# MAY BE move to trans
current_scope =
  id_map : {} # id -> ast pos list

scope_list = [current_scope]
scope_stack = []
fake_id = (type)->
  {
    mx_hash : {
      type
    }
  }

scope_state_reset = ()->
  current_scope =
    id_map : {
      stdin : [
        fake_id mk_type 'Source', [mk_type 'string']
      ]
      stdout : [
        fake_id mk_type 'Sink', [mk_type 'string'],
      ]
      Math : [
        fake_id mk_type 'object', [], {
          abs   : mk_type 'either', [
            mk_type 'function', [mk_type('int'), mk_type('int')]
            mk_type 'function', [mk_type('float'), mk_type('float')]
          ]
          round : mk_type 'function', [mk_type('int'), mk_type('float')]
        }
      ]
      Fail : [ # crafted object for more coverage
        fake_id mk_type 'object', [], {
          invalid_either   : mk_type 'either', [
            mk_type 'function', [mk_type('int'), mk_type('int')]
            mk_type 'int'
          ]
        }
      ]
    } # id -> ast pos list

  scope_list = [current_scope]
  scope_stack = []
  return
{'fraction_non_alphanumeric': 0.27444318610796525, 'fraction_numerical': 0.0007550018875047187, 'mean_word_length': 2.581081081081081, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, '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': '1749286', 'n_tokens_mistral': 808, 'n_tokens_neox': 789, 'n_words': 166}