<commit_before>/*!
 * Copyright 2012 Sakai Foundation (SF) Licensed under the
 * Educational Community License, Version 2.0 (the "License"); you may
 * not use this file except in compliance with the License. You may
 * obtain a copy of the License at
 *
 *     http://www.osedu.org/licenses/ECL-2.0
 *
 * Unless required by applicable law or agreed to in writing,
 * software distributed under the License is distributed on an "AS IS"
 * BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
 * or implied. See the License for the specific language governing
 * permissions and limitations under the License.
 */

var _ = require('underscore');
var fs = require('fs');
var Path = require('path');
var ShortId = require('shortid');

var AuthzUtil = require('oae-authz/lib/util');
var Cassandra = require('oae-util/lib/cassandra');
var log = require('oae-logger').logger('oae-principals');
var Redis = require('oae-util/lib/redis');
var Validator = require('oae-util/lib/validator').Validator;
var TenantsAPI = require('oae-tenants/lib/api');
var TZ = require('oae-util/lib/tz');
var Validator = require('oae-util/lib/validator').Validator;

var PrincipalsConstants = require('./constants').PrincipalsConstants;
var PrincipalsDAO = require('./internal/dao');
var PrincipalsEmitter = require('./internal/emitter');
var PrincipalsModel = require('./model');
var PrincipalsUtil = require('./util');

/**
 * Creates a new user under this tenant.
 *
 * @param   {Context}   ctx                     The current context
 * @param   {String}    displayName             A display name to represent the user on the UI
 * @param   {Object}    [opts]                  Optional parameters for the user
 * @param   {String}    [opts.visibility]       This user his visibility setting. (One of PrincipalsConstants.visibility)
 * @param   {String}    [opts.locale]           The user his locale
 * @param   {String}    [opts.timezone]         The user his timezone
 * @param   {String}    [opts.publicAlias]      This name will be what is seen when when the user is displayed to someone who does not have access to the profile
 * @param   {String}    [opts.smallPictureUri]  The URI for the small picture<commit_msg>Remove unused require<commit_after>/*!
 * Copyright 2012 Sakai Foundation (SF) Licensed under the
 * Educational Community License, Version 2.0 (the "License"); you may
 * not use this file except in compliance with the License. You may
 * obtain a copy of the License at
 *
 *     http://www.osedu.org/licenses/ECL-2.0
 *
 * Unless required by applicable law or agreed to in writing,
 * software distributed under the License is distributed on an "AS IS"
 * BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
 * or implied. See the License for the specific language governing
 * permissions and limitations under the License.
 */

var _ = require('underscore');
var fs = require('fs');
var Path = require('path');
var ShortId = require('shortid');

var AuthzUtil = require('oae-authz/lib/util');
var Cassandra = require('oae-util/lib/cassandra');
var log = require('oae-logger').logger('oae-principals');
var Redis = require('oae-util/lib/redis');
var Validator = require('oae-util/lib/validator').Validator;
var TZ = require('oae-util/lib/tz');
var Validator = require('oae-util/lib/validator').Validator;

var PrincipalsConstants = require('./constants').PrincipalsConstants;
var PrincipalsDAO = require('./internal/dao');
var PrincipalsEmitter = require('./internal/emitter');
var PrincipalsModel = require('./model');
var PrincipalsUtil = require('./util');

/**
 * Creates a new user under this tenant.
 *
 * @param   {Context}   ctx                     The current context
 * @param   {String}    displayName             A display name to represent the user on the UI
 * @param   {Object}    [opts]                  Optional parameters for the user
 * @param   {String}    [opts.visibility]       This user his visibility setting. (One of PrincipalsConstants.visibility)
 * @param   {String}    [opts.locale]           The user his locale
 * @param   {String}    [opts.timezone]         The user his timezone
 * @param   {String}    [opts.publicAlias]      This name will be what is seen when when the user is displayed to someone who does not have access to the profile
 * @param   {String}    [opts.smallPictureUri]  The URI for the small picture
{'fraction_non_alphanumeric': 0.11197263397947549, 'fraction_numerical': 0.0036488027366020524, 'mean_word_length': 3.578288100208768, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '4813061', 'n_tokens_mistral': 1213, 'n_tokens_neox': 1196, 'n_words': 456}