<commit_before>
fs = require 'fs'
krb5 = require '../build/Release/krb5'

module.exports = (options, callback) ->
  k = new Krb5 options
  k.kinit callback if callback
  k

module.exports.spnego = (options, callback) ->
  return callback new Error 'Params: Not an object' unless typeof options is 'object'
  return callback new Error 'Params: Please set principal property' unless options.principal?
  return callback new Error 'Params: principal is unvalid, please use ID@REALM' unless options.principal.match /[A-Za-z0-9_\-\/]*@[A-Za-z0-9_\-\.]*/
  return callback new Error 'Params: please set service_principal property' unless options.service_principal?<commit_msg>api: optional callback<commit_after>
fs = require 'fs'
krb5 = require '../build/Release/krb5'

module.exports = (options, callback) ->
  k = new Krb5 options
  if callback
    k.kinit (err) -> callback err, k
  k

module.exports.spnego = (options, callback) ->
  return callback new Error 'Params: Not an object' unless typeof options is 'object'
  return callback new Error 'Params: Please set principal property' unless options.principal?
  return callback new Error 'Params: principal is unvalid, please use ID@REALM' unless options.principal.match /[A-Za-z0-9_\-\/]*@[A-Za-z0-9_\-\.]*/
  return callback new Error 'Params: please set service_principal property' unless options.service_principal?
{'fraction_non_alphanumeric': 0.1154127100073046, 'fraction_numerical': 0.010226442658875092, 'mean_word_length': 4.269230769230769, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 8, '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': '301217', 'n_tokens_mistral': 417, 'n_tokens_neox': 412, 'n_words': 146}