Set our overall model (a loader object) and populate sub-controls
429521
def SetModel(self, loader):
        """"""
        self.loader = loader
        self.adapter, tree, rows = self.RootNode()
        self.listControl.integrateRecords(rows.values())
        self.activated_node = tree
        self.squareMap.SetModel(tree, self.adapter)
        self.RecordHistory()
277503
void loadHandlers(ControllerAddress address) throws CommandLineException, CommandLineParserException {

        ModelControllerClient client = ctx.getModelControllerClient();
        assert client != null : "client is null";

        if(moduleLoader == null) {
            ctx.printLine("Warning! The CLI is running in a non-modular environment and cannot load commands from management extensions.");
            return;
        }

        if(address != null && currentAddress != null && address.equals(currentAddress)) {
            return;
        }

        // remove previously loaded commands
        resetHandlers();
        currentAddress = address;

        final ModelNode req = new ModelNode();
        req.get(Util.ADDRESS).setEmptyList();
        req.get(Util.OPERATION).set(Util.READ_CHILDREN_RESOURCES);
        req.get(Util.CHILD_TYPE).set(Util.EXTENSION);

        final ModelNode response;
        try {
            response = client.execute(req);
        } catch (IOException e) {
            throw new CommandLineException("Extensions loader failed to read extensions", e);
        }

        if(!Util.isSuccess(response)) {
            throw new CommandLineException("Extensions loader failed to read extensions: " + Util.getFailureDescription(response));
        }

        final ModelNode result = response.get(Util.RESULT);
        if(!result.isDefined()) {
            throw new CommandLineException("Extensions loader failed to read extensions: " + result.asString());
        }

        for(Property ext : result.asPropertyList()) {
            ModelNode module = ext.getValue().get(Util.MODULE);
            if(!module.isDefined()) {
                addError("Extension " + ext.getName() + " is missing module attribute");
            } else {
                final ModuleIdentifier moduleId = ModuleIdentifier.fromString(module.asString());
                ModuleClassLoader cl;
                try {
                    cl = moduleLoader.loadModule(moduleId).getClassLoader();
                    ServiceLoader<CommandHandlerProvider> loader = ServiceLoader.load(CommandHandlerProvider.class, cl);
                    for (CommandHandlerProvider provider : loader) {
                        try {
                            registry.registerHandler(provider.createCommandHandler(ctx), provider.isTabComplete(), provider.getNames());
                            addHandlers(Arrays.asList(provider.getNames()));
                        } catch(CommandRegistry.RegisterHandlerException e) {
                            addError(e.getLocalizedMessage());
                            final List<String> addedCommands = new ArrayList<String>(Arrays.asList(provider.getNames()));
                            addedCommands.removeAll(e.getNotAddedNames());
                            addHandlers(addedCommands);
                        }
                    }
                    ServiceLoader<Command> loader2 = ServiceLoader.load(Command.class, cl);
                    for (Command provider : loader2) {
                        try {
                            CommandContainer container = aeshRegistry.addCommand(provider);
                            addCommand(container.getParser().getProcessedCommand().name());
                        } catch (CommandLineException e) {
                            addError(e.getLocalizedMessage());
                        }
                    }
                } catch (ModuleLoadException e) {
                    addError("Module " + module.asString() + " from extension " + ext.getName() +
                            " available on the server couldn't be loaded locally: " + e.getLocalizedMessage());
                }
            }
        }

        if(!errors.isEmpty()) {
            ctx.printLine("Warning! There were errors trying to load extensions. For more details, please, execute 'extension-commands --errors'");
        }
    }
372679
def populate_load_commands
      permissive = options.fetch(:permissive, false)
      offset = header.class.bytesize
      load_commands = []

      header.ncmds.times do
        fmt = Utils.specialize_format("L=", endianness)
        cmd = @raw_data.slice(offset, 4).unpack(fmt).first
        cmd_sym = LoadCommands::LOAD_COMMANDS[cmd]

        raise LoadCommandError, cmd unless cmd_sym || permissive

        # If we're here, then either cmd_sym represents a valid load
        # command *or* we're in permissive mode.
        klass = if (klass_str = LoadCommands::LC_STRUCTURES[cmd_sym])
          LoadCommands.const_get klass_str
        else
          LoadCommands::LoadCommand
        end

        view = MachOView.new(@raw_data, endianness, offset)
        command = klass.new_from_bin(view)

        load_commands << command
        offset += command.cmdsize
      end

      load_commands
    end
1245509
def _setup_delegate(self):
        """"""
        delegate = self.DELEGATE_CLASS(self)
        self.setItemDelegate(delegate)
        delegate.sizeHintChanged.connect(
            lambda index: self.resizeRowToContents(index.row()))
        if self.RESIZE_COLUMN:
            delegate.sizeHintChanged.connect(
                lambda index: self.resizeColumnToContents(index.column()))
        delegate.closeEditor.connect(
            lambda ed: self.resizeRowToContents(delegate.row_done_))
392091
def load_models(module):
    """"""
    modules = _import_submodules(module)
    return {m for module in modules for m in filter(
        _check_model, (getattr(module, name) for name in dir(module))
    )}
1309935
private void setUp() {
		addExamples("AJAX", ExampleData.AJAX_EXAMPLES);
		addExamples("Form controls", ExampleData.FORM_CONTROLS);
		addExamples("Feedback and indicators", ExampleData.FEEDBACK_AND_INDICATORS);
		addExamples("Layout", ExampleData.LAYOUT_EXAMPLES);
		addExamples("Menus", ExampleData.MENU_EXAMPLES);
		addExamples("Links", ExampleData.LINK_EXAMPLES);
		addExamples("Popups / dialogs", ExampleData.POPUP_EXAMPLES);
		addExamples("Subordinate", ExampleData.SUBORDINATE_EXAMPLES);
		addExamples("Tabs", ExampleData.TABSET_EXAMPLES);
		addExamples("Tables", ExampleData.WTABLE_EXAMPLES);
		addExamples("Validation", ExampleData.VALIDATION_EXAMPLES);
		addExamples("Other examples (uncategorised)", ExampleData.MISC_EXAMPLES);
		addExamples("DataTable (deprecated)", ExampleData.WDATATABLE_EXAMPLES);
	}
876209
def set_model_pathnames(self):
        """"""
        self.control_path = self.expt.control_path
        self.input_basepath = self.expt.lab.input_basepath
        self.work_path = self.expt.work_path
        self.codebase_path = self.expt.lab.codebase_path

        if len(self.expt.models) > 1:

            self.control_path = os.path.join(self.control_path, self.name)
            self.work_path = os.path.join(self.work_path, self.name)
            self.codebase_path = os.path.join(self.codebase_path, self.name)

        # NOTE: Individual models may override the work subdirectories
        self.work_input_path = self.work_path
        self.work_restart_path = self.work_path
        self.work_output_path = self.work_path
        self.work_init_path = self.work_path

        self.exec_prefix = self.config.get('exe_prefix', '')
        self.exec_name = self.config.get('exe', self.default_exec)
        if self.exec_name:
            # By default os.path.join will not prepend the lab bin_path
            # to an absolute path
            self.exec_path = os.path.join(self.expt.lab.bin_path,
                                          self.exec_name)
        else:
            self.exec_path = None

        if self.exec_path:
            # Make exec_name consistent for models with fully qualified path.
            # In all cases it will just be the name of the executable without a
            # path
            self.exec_name = os.path.basename(self.exec_path)
470778
def add_to_class(self, cls, name):
        '''
        
        '''
        self._name = name
        self._container_model_class = cls
        setattr(cls, name, FieldDescriptor(self))
        self._bound = True
495967
private void setupData(ValidationConfig config, ClassLoader classLoader) {
        // A config object is always used to use a common code path, so the parsed
        // ValidationConfig may be null if a validation.xml wasn't found.
        if (config != null) {
            versionID = config.getVersionID();

            defaultProvider = config.getDefaultProvider();
            defaultProvider = defaultProvider != null ? defaultProvider.trim() : defaultProvider;

            messageInterpolator = config.getMessageInterpolator();
            messageInterpolator = messageInterpolator != null ? messageInterpolator.trim() : messageInterpolator;

            traversableResolver = config.getTraversableResolver();
            traversableResolver = traversableResolver != null ? traversableResolver.trim() : traversableResolver;

            constraintMapping = config.getConstraintMappings();

            constraintValidatorFactory = config.getConstraintValidatorFactory();
            constraintValidatorFactory = constraintValidatorFactory != null ? constraintValidatorFactory.trim() : constraintValidatorFactory;

            properties = config.getProperties();
        }
        appClassloader = classLoader;
    }
404507
public void loadModel() {
        model = newModel();
        model.loadModel(this.modelPath);
        model.printModel();
        fm = FunctionMap.loadFunctionMap();
    }
387132
private void initNestedContainers() {

        for (CmsContainer container : m_controller.getContainers().values()) {
            if (container.isSubContainer()) {
                CmsContainerPageContainer containerWidget = m_controller.m_targetContainers.get(container.getName());
                // check if the sub container is a valid drop targets
                if (m_dragInfos.keySet().contains(containerWidget)) {
                    CmsContainer parentContainer = m_controller.getContainers().get(container.getParentContainerName());
                    // add the container to all it's ancestors as a dnd child
                    while (parentContainer != null) {
                        if (m_dragInfos.keySet().contains(
                            m_controller.m_targetContainers.get(parentContainer.getName()))) {
                            m_controller.m_targetContainers.get(parentContainer.getName()).addDndChild(containerWidget);
                        }
                        if (parentContainer.isSubContainer()) {
                            parentContainer = m_controller.getContainers().get(
                                parentContainer.getParentContainerName());
                        } else {
                            parentContainer = null;
                        }
                    }
                }
            }

        }
    }
1180804
public void setObjectAndLoadpath() {

		StringProperty sname = StringProperty.getInstance(objectTemplate.name);

		setGlobalVariable("OBJECT", sname, true);
		setGlobalVariable("LOADPATH", new ListResource(), false);
	}
126645
private void initialize() {
        this.setTitle(Constant.messages.getString("history.managetags.title"));
        this.setContentPane(getJPanel());
        if (Model.getSingleton().getOptionsParam().getViewParam().getWmUiHandlingOption() == 0) {
        	this.setSize(panelWidth, panelHeight);
        }
        this.addWindowListener(new java.awt.event.WindowAdapter() {   
        	@Override
        	public void windowOpened(java.awt.event.WindowEvent e) {    
        	} 

        	@Override
        	public void windowClosing(java.awt.event.WindowEvent e) {
        	}
        });

		pack();
	}
1268097
function() {
  setups = {}
  model.servers = []
  model.headers = []
  model.ui = _.clone(uidefaults)
  model.controls = _.clone(controldefaults)

  if (DEBUG) { console.log('discover started') }
  wampsession.publish('discover', [])
  setTimeout(function () {
    if (DEBUG) { console.log('discover ended') }
    model.servers = _.values(setups)
  }, 500)
}
1044760
function() {
		var i, j, item, controls,
		    config = this.config = this.system.config.input;

		for ( i = 0; i < config.length; i++ ) {
			item = config[ i ];
			
			this.setController( i, item.type );

			controls = item.controls;
			if ( !Array.isArray(controls) ) {
				controls = [ controls ];
			}

			for ( j = 0; j < controls.length; j++ ) {
				this.configure( i, controls[ j ].type, controls[ j ].config );
			}
		}
	}
982858
private void populateModel()
   {
      if (m_count != 0)
      {
         m_count = 0;
         Arrays.fill(m_flags, false);
      }

      for (Task task : m_parentFile.getTasks())
      {
         for (int loop = 0; loop < MPXTaskField.MAX_FIELDS; loop++)
         {
            if (!m_flags[loop] && isFieldPopulated(task, MPXTaskField.getMpxjField(loop)))
            {
               m_flags[loop] = true;
               m_fields[m_count] = loop;
               ++m_count;
            }
         }
      }

      //
      // Ensure the the model fields always appear in the same order
      //
      Arrays.sort(m_fields);
      System.arraycopy(m_fields, m_fields.length - m_count, m_fields, 0, m_count);
   }
1209885
def bind_settings():
    
    from django_productline import settings

    if settings.TEMPLATE_LOADER_CACHED_ENABLED:
        loaders = [
            ['django.template.loaders.cached.Loader', settings.DJANGO_TEMPLATE_LOADERS]
        ]
    else:
        loaders = settings.DJANGO_TEMPLATE_LOADERS

    if compare_version(django.get_version(), '1.9') >= 0:

        TEMPLATES = [
            {
                'BACKEND': settings.DJANGO_TEMPLATE_BACKEND,
                'DIRS': settings.DJANGO_TEMPLATE_DIRS,
                'OPTIONS': {
                    'builtins': settings.DJANGO_TEMPLATE_BUILTINS,
                    'context_processors': settings.DJANGO_TEMPLATE_CONTEXT_PROCESSORS,
                    'loaders': loaders,
                    'debug': settings.DJANGO_TEMPLATE_DEBUG
                },
            },
        ]

        setattr(settings, 'TEMPLATES', TEMPLATES)

    else:
        setattr(settings, 'TEMPLATE_DEBUG', settings.DJANGO_TEMPLATE_DEBUG)
        setattr(settings, 'TEMPLATE_DIRS', settings.DJANGO_TEMPLATE_DIRS)
        setattr(settings, 'TEMPLATE_CONTEXT_PROCESSORS', settings.DJANGO_TEMPLATE_CONTEXT_PROCESSORS)
        setattr(settings, 'TEMPLATE_LOADERS', loaders)