<commit_before># The `Message` class represents a single <message>, returned in a
# Samurai response. Messages typically have a `subclass`, `context` and `key`
# and optionally provide the text of the message.
module.exports = class Message
  DEFAULT_RESPONSE_MAPPINGS =
    # Transaction Responses
    { 'info processor.transaction success'      : 'The transaction was successful.'
    , 'error processor.transaction declined'    : 'The card was declined.'
    , 'error processor.issuer call'             : 'Call the card issuer for further instructions.'
    , 'error processor.issuer unavailable'      : 'The authorization did not respond within the alloted time.'
    , 'error input.card_number invalid'         : 'The card number was invalid.'
    , 'error input.expiry_month invalid'        : 'The expiration date month was invalid, or prior to today.'
    , 'error input.expiry_year invalid'         : 'The expiration date year was invalid, or prior to today.'
    , 'error processor.pin invalid'             : 'The PIN number is incorrect.'
    , 'error input.amount invalid'              : 'The transaction amount was invalid.'
    , 'error processor.transaction declined_insufficient_funds' : 'The transaction was declined due to insufficient funds.'
    , 'error processor.network_gateway merchant_invalid'        : 'The Merchant Number is incorrect.'
    , 'error input.merchant_login invalid'      : 'The merchant ID is not valid or active.'
    , 'error input.store_number invalid'        : 'Invalid Store Number.'
    , 'error processor.bank_info invalid'       : 'Invalid banking information.'
    , 'error processor.transaction not_allowed' : 'This transaction type is not allowed.'
    , 'error processor.transaction type_invalid'    : 'Requested transaction type is not allowed for this card/merchant.'
    , 'error processor.transaction method_invalid'  : 'The requested transaction could not be performed for this merchant.'
    , 'error input.amount exceeds_limit'            : 'The maximum transaction amount was exceeded.'
    , 'error input.cvv invalid'                     : 'The CVV data entered is not correct.'
    , 'error processor.network_gateway communication_error'     : 'There was a fatal communication error.'
    , 'error processor.network_gateway unresponsive'            : 'The processing network is temporarily unavailable.'
    , 'error processor.network_gateway merchant_invalid'        : 'The merchant number is not on file.'

    # AVS Responses
    , 'info processor.avs_result_code 0'  : 'No response.'
    , 'info processor.avs_result_code Y'  : 'The address and 5-digit ZIP match.'
    , 'info processor.avs_result_code Z'  : 'The 5-digit ZIP matches, the address does not.'
    , 'info processor.avs_result_code X'  : 'The address and 9-digit ZIP match.'
    , 'info processor.avs_result_code A'  : 'The address matches, the ZIP does not.'
    , 'info processor.avs_result_code E'  : 'There was an AVS error, or the data was illegible.'
    , 'info processor.avs_result_code R'  : 'The AVS request timed out.'
    , 'info processor.avs_result_code S'  : 'The issuer does not support AVS.'
    , 'info processor.avs_result_code F'  : 'The street addresses and postal codes match.'
    , 'info processor.avs_result_code N'  : 'The address and ZIP do not match.'

    # CVV Responses
    , 'error input.cvv declined' : 'The CVV code was not correct.'

    # Input validations
    , 'error input.card_number is_blank'        : 'The card number was blank.'
    , 'error input.card_number not_numeric'     : 'The card number was invalid.'
    , 'error input.card_number too_short'       : 'The card number was too short.'
    , 'error input.card_number too_long'        : 'The card number was too long.'
    , 'error input.card_number failed_checksum' : 'The card number was invalid.'
    , 'error input.cvv is_blank'                : 'The CVV was blank.'
    , 'error input.cvv not_numeric'             : 'The CVV was invalid.'
    , 'error input.cvv too_short'               : 'The CVV was too short.'
    , 'error input.cvv too_long'                : 'The CVV was too long.'
    , 'error input.expiry_month is_blank'       : 'The expiration month was blank.'
    , 'error input.expiry_month not_numeric'    : 'The expiration month was invalid.'
    , 'error input.expiry_month is_invalid'     : 'The expiration month was invalid.'
    , 'error input.expiry_year is_blank'        : 'The expiration year was blank.'
    , 'error input.expiry_year not_numeric'     : 'The expiration year was invalid.'
    , 'error input.expiry_year is_invalid'      : 'The expiration year was invalid.'

    }

  constructor: (@subclass, @context, @key, @text) ->
    @text ?= ''

  # Tries to return the description for the context/key combo of the
  # current message. If an appropriate mapping can't be found, return
  # the `text` attribute (which could be blank).
  description: ->
    key = [@subclass, @context, @key].join(' ')
    DEFAULT_RESPONSE_MAPPINGS[key] or @text<commit_msg>Message should use the "text" attribute unless it is null/blank<commit_after># The `Message` class represents a single <message>, returned in a
# Samurai response. Messages typically have a `subclass`, `context` and `key`
# and optionally provide the text of the message.
module.exports = class Message
  DEFAULT_RESPONSE_MAPPINGS =
    # Transaction Responses
    { 'info processor.transaction success'      : 'The transaction was successful.'
    , 'error processor.transaction declined'    : 'The card was declined.'
    , 'error processor.issuer call'             : 'Call the card issuer for further instructions.'
    , 'error processor.issuer unavailable'      : 'The authorization did not respond within the alloted time.'
    , 'error input.card_number invalid'         : 'The card number was invalid.'
    , 'error input.expiry_month invalid'        : 'The expiration date month was invalid, or prior to today.'
    , 'error input.expiry_year invalid'         : 'The expiration date year was invalid, or prior to today.'
    , 'error processor.pin invalid'             : 'The PIN number is incorrect.'
    , 'error input.amount invalid'              : 'The transaction amount was invalid.'
    , 'error processor.transaction declined_insufficient_funds' : 'The transaction was declined due to insufficient funds.'
    , 'error processor.network_gateway merchant_invalid'        : 'The Merchant Number is incorrect.'
    , 'error input.merchant_login invalid'      : 'The merchant ID is not valid or active.'
    , 'error input.store_number invalid'        : 'Invalid Store Number.'
    , 'error processor.bank_info invalid'       : 'Invalid banking information.'
    , 'error processor.transaction not_allowed' : 'This transaction type is not allowed.'
    , 'error processor.transaction type_invalid'    : 'Requested transaction type is not allowed for this card/merchant.'
    , 'error processor.transaction method_invalid'  : 'The requested transaction could not be performed for this merchant.'
    , 'error input.amount exceeds_limit'            : 'The maximum transaction amount was exceeded.'
    , 'error input.cvv invalid'                     : 'The CVV data entered is not correct.'
    , 'error processor.network_gateway communication_error'     : 'There was a fatal communication error.'
    , 'error processor.network_gateway unresponsive'            : 'The processing network is temporarily unavailable.'
    , 'error processor.network_gateway merchant_invalid'        : 'The merchant number is not on file.'

    # AVS Responses
    , 'info processor.avs_result_code 0'  : 'No response.'
    , 'info processor.avs_result_code Y'  : 'The address and 5-digit ZIP match.'
    , 'info processor.avs_result_code Z'  : 'The 5-digit ZIP matches, the address does not.'
    , 'info processor.avs_result_code X'  : 'The address and 9-digit ZIP match.'
    , 'info processor.avs_result_code A'  : 'The address matches, the ZIP does not.'
    , 'info processor.avs_result_code E'  : 'There was an AVS error, or the data was illegible.'
    , 'info processor.avs_result_code R'  : 'The AVS request timed out.'
    , 'info processor.avs_result_code S'  : 'The issuer does not support AVS.'
    , 'info processor.avs_result_code F'  : 'The street addresses and postal codes match.'
    , 'info processor.avs_result_code N'  : 'The address and ZIP do not match.'

    # CVV Responses
    , 'error input.cvv declined' : 'The CVV code was not correct.'

    # Input validations
    , 'error input.card_number is_blank'        : 'The card number was blank.'
    , 'error input.card_number not_numeric'     : 'The card number was invalid.'
    , 'error input.card_number too_short'       : 'The card number was too short.'
    , 'error input.card_number too_long'        : 'The card number was too long.'
    , 'error input.card_number failed_checksum' : 'The card number was invalid.'
    , 'error input.cvv is_blank'                : 'The CVV was blank.'
    , 'error input.cvv not_numeric'             : 'The CVV was invalid.'
    , 'error input.cvv too_short'               : 'The CVV was too short.'
    , 'error input.cvv too_long'                : 'The CVV was too long.'
    , 'error input.expiry_month is_blank'       : 'The expiration month was blank.'
    , 'error input.expiry_month not_numeric'    : 'The expiration month was invalid.'
    , 'error input.expiry_month is_invalid'     : 'The expiration month was invalid.'
    , 'error input.expiry_year is_blank'        : 'The expiration year was blank.'
    , 'error input.expiry_year not_numeric'     : 'The expiration year was invalid.'
    , 'error input.expiry_year is_invalid'      : 'The expiration year was invalid.'

    }

  constructor: (@subclass, @context, @key, @text) ->
    @text ?= ''

  # Tries to return the description for the context/key combo of the
  # current message. If an appropriate mapping can't be found, return
  # the `text` attribute (which could be blank).
  description: ->
    key = [@subclass, @context, @key].join(' ')
	(@text? || @text!='') ? @text : DEFAULT_RESPONSE_MAPPINGS[key]
{'fraction_non_alphanumeric': 0.09439936671284385, 'fraction_numerical': 0.0007916089451810805, 'mean_word_length': 3.0138999205718826, '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': '2313030', 'n_tokens_mistral': 2870, 'n_tokens_neox': 2769, 'n_words': 1039}