<commit_before>filterNils = (obj) ->
  for own key, val of obj
    obj[key] = filterNils val  if val? and 'object' is typeof val

  if obj?[0]?.$?.nil?
  then [ null ]
  else obj

ifString = (str)-> if typeof str is 'string' then str else ''

class exports.Error
  # Recurly's error entry structure. I'll use the same structure
  # for socket/http errors.
  constructor: (@short = '', @message = '', @field = '') ->

class exports.Account
  #
  # ACCOUNTS
  # See https://docs.recurly.com/api/accounts for XML format
  #
  constructor: (f) ->
    from = filterNils f
    @firstName  = from.first_name[0]
    @lastName   = from.last_name[0]
    @email      = from.email[0]
    @username   = from.username[0]
    # TODO: move the configuration out of the code:
    @url        = "https://koding.recurly.com/account/#{ from.hosted_login_token[0] }"
    @billing    = billing

class exports.Adjustment
  #
  # ADJUSTMENTS (ONE-TIME CHARGE/CREDIT TO SUBSCRIPTION)
  # See https://docs.recurly.com/api/invoices for XML format
  #
  constructor: (f) -><commit_msg>payment: bugfix: fix a ReferenceError<commit_after>filterNils = (obj) ->
  for own key, val of obj
    obj[key] = filterNils val  if val? and 'object' is typeof val

  if obj?[0]?.$?.nil?
  then [ null ]
  else obj

ifString = (str)-> if typeof str is 'string' then str else ''

class exports.Error
  # Recurly's error entry structure. I'll use the same structure
  # for socket/http errors.
  constructor: (@short = '', @message = '', @field = '') ->

class exports.Account
  #
  # ACCOUNTS
  # See https://docs.recurly.com/api/accounts for XML format
  #
  constructor: (f, @billing) ->
    from = filterNils f
    @firstName  = from.first_name[0]
    @lastName   = from.last_name[0]
    @email      = from.email[0]
    @username   = from.username[0]
    # TODO: move the configuration out of the code:
    @url        = "https://koding.recurly.com/account/#{ from.hosted_login_token[0] }"

class exports.Adjustment
  #
  # ADJUSTMENTS (ONE-TIME CHARGE/CREDIT TO SUBSCRIPTION)
  # See https://docs.recurly.com/api/invoices for XML format
  #
  constructor: (f) ->
{'fraction_non_alphanumeric': 0.1357210179076343, 'fraction_numerical': 0.005655042412818096, 'mean_word_length': 2.9906015037593985, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 13, 'https://': 6, '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': '4735121', 'n_tokens_mistral': 754, 'n_tokens_neox': 734, 'n_words': 203}