Configure a model to be used with devise and google authentication
 @param [Array] modules a list of symbols used with a devise call
492724
def acts_as_google_user *modules
      # assign devise modules to module variable
      if modules.empty?
        self.devise_modules_to_include = [:omniauthable]
      else
        # restrict modules given to devise
        self.devise_modules_to_include = (modules + [:omniauthable] - FORBIDDEN_MODULES) & ALLOWED_MODULES
      end
      # include model methods
      include ActsAsGoogleUser::Model
    end
84240
def add_udas_to_model! uda_hash, type=nil, model=Models::TaskModel
      uda_hash.each do |attr, val|
        val.each do |k, v|
          type = Helpers.determine_type(v) if type.nil?
          model.attribute attr, type
        end
      end
    end
1118582
function AdminMethods(models, users, oauthApps, oauthAuth) {
      this.models = models;
      this.users = users;
      this.oauthApps = oauthApps;
      this.oauthAuth = oauthAuth;
      this.setup = __bind(this.setup, this);
      if (!this.models) {
        throw new Error("models parameter is required");
      }
      if (!this.users) {
        throw new Error("users parameter is required");
      }
      if (!this.oauthApps) {
        throw new Error("oauthApps parameter is required");
      }
      if (!this.oauthAuth) {
        throw new Error("oauthAuth parameter is required");
      }
    }
294449
function(attrs) {
    if (attrs.authentication !== 'KERBEROS') {
      if (attrs.kerberos_service_name) {
        throw new TypeError(format(
          'The kerberos_service_name field does not apply when '
          + 'using %s for authentication.', attrs.authentication));
      }
      if (attrs.kerberos_principal) {
        throw new TypeError(format(
          'The kerberos_principal field does not apply when '
          + 'using %s for authentication.', attrs.authentication));
      }
      if (attrs.kerberos_password) {
        throw new TypeError(format(
          'The kerberos_password field does not apply when '
          + 'using %s for authentication.', attrs.authentication));
      }
    }

    if (attrs.authentication === 'KERBEROS') {
      if (!attrs.kerberos_principal) {
        throw new TypeError(format(
          'The kerberos_principal field is required when '
          + 'using KERBEROS for authentication.'));
      }
    }
  }
744793
def _get_models(self, app):
        
        try:
            app_models = app.get_models()
            appmods = []
            for model in app_models:
                appmods.append(model)
        except Exception as e:
            self.err(e)
            return
        return appmods
1154712
function UserProviderMethods(models) {
      this.models = models;
      this.getUserFromProvider = bind(this.getUserFromProvider, this);
      Hoek.assert(this.models, i18n.assertModelsRequired);
    }
1153765
void setAlgorithmConstraints(AlgorithmConstraints algorithmConstraints) {
        activeCipherSuites = null;
        activeProtocols = null;

        this.algorithmConstraints =
            new SSLAlgorithmConstraints(algorithmConstraints);
        this.localSupportedSignAlgs = null;
    }
1076444
def linkify(self, modules):
        
        logger.debug("Linkify %s with %s", self, modules)
        self.linkify_s_by_module(modules)
37853
def _build_app_models(request, admin_apps, models_tuples, ensure_all_models=False):
    

    app_models = []
    for app_and_model, config in models_tuples:
        if app_and_model:
            app_label, model_name = app_and_model.split('.')

            for app in admin_apps:
                if app['app_label'] == app_label:
                    for model in app['models']:
                        if model['object_name'] == model_name:
                            try:
                                model['name'] = \
                                    config['name']
                            except KeyError:
                                pass

                            # Get each of the polymorphic types to allow addition.
                            model_class = apps.get_model(app_and_model)
                            model_admin = admin.site._registry[model_class]

                            if hasattr(model_admin, 'get_child_type_choices'):
                                model['polymorphic_classes'] = \
                                    model_admin.get_child_type_choices(
                                        request, 'add'
                                    )

                            # TODO: Fluent/polymorphic has a way of sorting child order which should be used instead
                            if 'default_poly_child' in config.keys():
                                ct = ContentType.objects.get_by_natural_key(
                                    *config['default_poly_child'].lower().split('.')
                                )
                                model.default_poly_child = ct.id

                            app_models.append(model)

                    break

    return app_models
316012
public function setAssociations() : void
    {
        foreach (Utility::findDirs(Configure::read('CsvMigrations.modules.path')) as $module) {
            $this->setByModule($module);
        }
    }
645544
def set_index_options
        limit              = params[:limit].to_i > 0 ? params[:limit].to_i : nil
        reverse            = params[:reverse].present? ?
                               params[:reverse].to_s.to_boolean(false) : nil
        with_group_members = params[:with_group_members].present? || params[:without_grouping].present? ?
                               params[:with_group_members].to_s.to_boolean(false) || params[:without_grouping].to_s.to_boolean(false) : nil
        @index_options     = params.permit(:filter, :filtered_by_type, :filtered_by_group_type, :filtered_by_group_id, :filtered_by_key, :routing_scope, :devise_default_routes)
                                   .to_h.symbolize_keys
                                   .merge(limit: limit, reverse: reverse, with_group_members: with_group_members)
      end
970311
def init_app(self, app):
        
        self.init_config(app)

        # Install datetime helpers.
        app.jinja_env.filters.update(
            from_isodate=from_isodate,
            from_isodatetime=from_isodatetime,
            to_arrow=to_arrow,
            format_arrow=format_arrow,
        )

        if app.config['FORMATTER_BADGES_ENABLE']:
            from invenio_formatter.context_processors.badges import \
                badges_processor

            # Registration of context processors.
            app.context_processor(badges_processor)
            # Register blueprint.
            app.register_blueprint(create_badge_blueprint(
                app.config['FORMATTER_BADGES_ALLOWED_TITLES']))

        app.extensions['invenio-formatter'] = self
76683
def module_paths(test_module)
      adapter = RSpec.configuration.adapter
      paths = adapter.modulepath.map do |dir|
        File.join(dir, test_module, 'manifests')
      end
      paths << adapter.manifest if adapter.manifest
      paths
    end
361546
def helpers
      @helpers ||= begin
        helpers = Module.new
        all = ActionController::Base.all_helpers_from_path(helpers_paths)
        ActionController::Base.modules_for_helpers(all).each do |mod|
          helpers.include(mod)
        end
        helpers
      end
    end
124197
function UserMethods(models) {
      this.models = models;
      this.removeEmail = bind(this.removeEmail, this);
      this.addEmail = bind(this.addEmail, this);
      this.resetPasswordToken = bind(this.resetPasswordToken, this);
      this.resetPassword = bind(this.resetPassword, this);
      this.removeRoles = bind(this.removeRoles, this);
      this.addRoles = bind(this.addRoles, this);
      this.removeIdentityFromUser = bind(this.removeIdentityFromUser, this);
      this.addIdentityToUser = bind(this.addIdentityToUser, this);
      this._profileImageFromProfile = bind(this._profileImageFromProfile, this);
      this._displayNameFromProfile = bind(this._displayNameFromProfile, this);
      this._usernameFromProfile = bind(this._usernameFromProfile, this);
      this.getOrCreateUserFromProvider = bind(this.getOrCreateUserFromProvider, this);
      this.create = bind(this.create, this);
      this._hashPassword = bind(this._hashPassword, this);
      this.validateUserByUsernameOrEmail = bind(this.validateUserByUsernameOrEmail, this);
      this.findUserByUsernameOrEmail = bind(this.findUserByUsernameOrEmail, this);
      this.setPassword = bind(this.setPassword, this);
      this.destroy = bind(this.destroy, this);
      this["delete"] = bind(this["delete"], this);
      this.patch = bind(this.patch, this);
      this.getByNameOrId = bind(this.getByNameOrId, this);
      this.getByPrimaryEmail = bind(this.getByPrimaryEmail, this);
      this.getByName = bind(this.getByName, this);
      this.lookup = bind(this.lookup, this);
      this.getByUsernames = bind(this.getByUsernames, this);
      this.getByIds = bind(this.getByIds, this);
      this.get = bind(this.get, this);
      this.all = bind(this.all, this);
      Hoek.assert(this.models, i18n.assertModelsRequired);
      Hoek.assert(this.models.User, i18n.assertUserInModelsRequired);
    }
1263203
function initModule(forge) {

forge.md = forge.md || {};
forge.md.algorithms = {
  md5: forge.md5,
  sha1: forge.sha1,
  sha256: forge.sha256
};
forge.md.md5 = forge.md5;
forge.md.sha1 = forge.sha1;
forge.md.sha256 = forge.sha256;

}
243069
def register_all_models(self, module_instance, exclude_name_list=[]):
        
        for class_instance in class_enumerator(module_instance, exclude_name_list):
            if is_inherit_from_model(class_instance):
                self.register(class_instance)