Prepare the config data.
357997
def prepare_config(data: dict) -> dict:
        """"""
        data_copy = deepcopy(data)
        # handle single sample cases with 'unknown' phenotype
        if len(data_copy['samples']) == 1:
            if data_copy['samples'][0]['phenotype'] == 'unknown':
                LOG.info("setting 'unknown' phenotype to 'unaffected'")
                data_copy['samples'][0]['phenotype'] = 'unaffected'
        # set the mother/father to '0' if they are not set for a sample
        for sample_data in data_copy['samples']:
            sample_data['mother'] = sample_data.get('mother') or '0'
            sample_data['father'] = sample_data.get('father') or '0'
            if sample_data['analysis_type'] == 'wgs' and sample_data.get('capture_kit') is None:
                sample_data['capture_kit'] = DEFAULT_CAPTURE_KIT
        return data_copy
674585
def set_config(self, config, and_restart=False):
        
        assert isinstance(config, dict)
        self.post('config', data=config)
        if and_restart:
            self.restart()
186528
protected function prepareImportData()
    {
        if (empty($this->arImportData)) {
            return;
        }

        foreach ($this->arImportData as $sKey => $sValue) {
            if (!is_string($sValue)) {
                continue;
            }

            $this->arImportData[$sKey] = trim($sValue);
        }
    }
810582
def prepare_data():
  """"""
  ((x_train, y_train), (x_test, y_test)) = DATASET.load_data()
  x_train = x_train.astype("float32")
  x_test = x_test.astype("float32")
  x_train /= 255.0
  x_test /= 255.0
  return ((x_train, y_train), (x_test, y_test))
574352
def ready(self):
        """"""
        models_config.auto_load_configs()

        self.auto_load_app_modules(['layouts', 'signals'])

        app_menu.auto_load_model_menu()

        auto_register_search_models()
        tabs.auto_generate_missing_tabs()
1277524
protected function loadConfig()
    {
        $this->hook->trigger(self::HOOK_LOAD_CONFIG_BEFORE);
        $this->config->load();
        $this->hook->trigger(self::HOOK_LOAD_CONFIG_AFTER);
    }
1276546
def config(ctx):
    """"""

    from hfos import database
    database.initialize(ctx.obj['dbhost'], ctx.obj['dbname'])

    from hfos.schemata.component import ComponentConfigSchemaTemplate
    ctx.obj['col'] = model_factory(ComponentConfigSchemaTemplate)
1045316
protected function config()
    {
        $this->globals['CFG'] =& load_class('Config', 'core');

        $this->globals['UNI'] =& load_class('Utf8', 'core');

        $this->globals['SEC'] =& load_class('Security', 'core');

        $this->core();
    }
185406
def save(self, filename=None, debug=False):
        """"""
        if not filename: filename = self.name
        with open(filename, "w") as f: # save config data file
            f.write(self.toJson(self.attrs))
        if self.debug or debug:
            print("saved configuration %s"%(self.name))
            for k,v in sorted(iteritems(self.attrs)):
                print("%15s : %s"%(k,v))
1358340
def config(self, config):
        """"""
        for section, data in config.items():
            for variable, value in data.items():
                self.set_value(section, variable, value)
1013648
private final function loadConfig(): void
    {
        $this->config = new Config();

        $file = sprintf('%s/app/service/%s/config/config.php', APP_DIR, $this->name);
        if (file_exists($file) && is_array($data = include $file)) {
            $this->config->setData($data);
        }
    }
63277
def ready(self):
        """"""

        self.log('Got', len(schemastore), 'data and',
                 len(configschemastore), 'component schemata.', lvl=debug)
1334348
def prepare(self):
        """"""
        p = PreparedRequest()
        p.prepare(
            method=self.method,
            url=self.url,
            headers=self.headers,
            files=self.files,
            data=self.data,
            params=self.params,
            auth=self.auth,
            cookies=self.cookies,
            hooks=self.hooks,
        )
        return p
945199
def _prepare_transforms(self):
        """"""
        for offset, value in enumerate(self._config.get(config.TRANSFORMS, [])):
            self._config[config.TRANSFORMS][offset] = self._import_class(value)
414176
protected function configure()
    {
        $config = $this->config->get('app');

        $this->charset = $config['charset'];
        mb_internal_encoding($this->charset);

        date_default_timezone_set($config['timezone']);
    }
237115
def _config(self):
        """"""
        cfg_wr = self.repo.config_writer()
        cfg_wr.add_section('user')
        cfg_wr.set_value('user', 'name', self.metadata.author)
        cfg_wr.set_value('user', 'email', self.metadata.email)
        cfg_wr.release()
956152
def save(self):
        """"""
        with open(self._config_file_path, 'w') as file:
            self._config_parser.write(file)