Generates the config for the current robot.

            .. note:: The generated config should be used as a basis and must probably be modified.
323454
def to_config(self):
        
        from ..dynamixel.controller import DxlController

        dxl_controllers = [c for c in self._controllers
                           if isinstance(c, DxlController)]

        config = {}

        config['controllers'] = {}
        for i, c in enumerate(dxl_controllers):
            name = 'dxl_controller_{}'.format(i)
            config['controllers'][name] = {
                'port': c.io.port,
                'sync_read': c.io._sync_read,
                'attached_motors': [m.name for m in c.motors],
            }

        config['motors'] = {}
        for m in self.motors:
            config['motors'][m.name] = {
                'id': m.id,
                'type': m.model,
                'offset': m.offset,
                'orientation': 'direct' if m.direct else 'indirect',
                'angle_limit': m.angle_limit,
            }

            if m.angle_limit == (0, 0):
                config['motors']['wheel_mode'] = True

        config['motorgroups'] = {}

        return config
113637
def config(self, steps_per_epoch, starting_epoch, max_epoch):
        
        self.starting_epoch = int(starting_epoch)
        self.max_epoch = int(max_epoch)
        self.steps_per_epoch = int(steps_per_epoch)
        # Allow empty epoch (no steps), if we want to run the callbacks only.
        assert self.steps_per_epoch >= 0 and self.max_epoch >= 0

        self._epoch_num = starting_epoch - 1
247869
def generate(self):
        
        s = self._docstring
        s += self._get_source().replace(
            'endpoints = {}',
            'endpoints = ' + self._config_src
        ).replace(
            'logger.setLevel(logging.INFO)',
            'logger.setLevel(logging.%s)' % self.config.logging_level
        )
        return s
768291
private function generateConfig()
    {
        return new AlgoliaConfig(
            $this->applicationId,
            $this->apiKey,
            $this->hostsArray,
            $this->options
        );
    }
880177
def generate_example():
    
    cmd_args = sys.argv[1:]
    parser = argparse.ArgumentParser(description='Confpy example generator.')
    parser.add_argument(
        '--module',
        action='append',
        help='A python module which should be imported.',
    )
    parser.add_argument(
        '--file',
        action='append',
        help='A python file which should be evaled.',
    )
    parser.add_argument(
        '--format',
        default='JSON',
        choices=('JSON', 'INI'),
        help='The output format of the configuration file.',
    )

    args = parser.parse_args(cmd_args)

    for module in args.module or ():

        __import__(module)

    for source_file in args.file or ():

        cfg = pyfile.PythonFile(path=source_file).config

    cfg = config.Configuration()

    print(example.generate_example(cfg, ext=args.format))
1027862
def generate(model, config, manifest, source_config=None, provider=None):
    
    return generate_model(model, config, manifest, source_config, provider)
284601
def _generate(cls, strategy, params):
        
        if cls._meta.abstract:
            raise errors.FactoryError(
                "Cannot generate instances of abstract factory %(f)s; "
                "Ensure %(f)s.Meta.model is set and %(f)s.Meta.abstract "
                "is either not set or False." % dict(f=cls.__name__))

        step = builder.StepBuilder(cls._meta, params, strategy)
        return step.build()
624362
final public function generate() {
        $options = array_merge($this->options, (array) 'generate');
        Generator::call($this->called, $this->args, $options);
    }
655249
def config(*args, **kwargs, &block)
      if block
        configuration_builder.config(*args, **kwargs, &block)
      else
        configuration_builder.config(*args, **kwargs)
      end
    end
862171
def _generate_config(self, mapping_class):
        """"""
        config = mapping_class()
        self._walk_config_copy_values(
            self.option_definitions,
            config,
            mapping_class
        )
        return config
507202
def configurations(self):
        
        if self._configuration_manager is None:
            self._configuration_manager = ConfigurationManager(session=self._session)
        return self._configuration_manager
1326526
def _config(self, **kargs):
        
        for key, value in kargs.items():
            setattr(self, key, value)
1026031
function(){
      console.log('');
      this.log('Usage: generate [resource]');
      this.log('Resources:');
      this.log('  all                    generates all components', false);
      this.log('  models                 generates all models', false);
      this.log('  controllers            generates all controllers', false);
      this.log('  configs                generates default configs', false);
      this.log('  views                  generates default view templates', false);
      this.log('  policies               generates all policies');
    }
529506
function generateModels(mongoose) {
  internals.modelsGenerated = true

  let config = defaultConfig

  extend(true, config, module.exports.config)

  let Log = getLogger('models')

  module.exports.logger = Log

  return modelGenerator(mongoose, Log, config).then(function(models) {
    internals.globalModels = models
    return models
  })
}
959114
def config_generation(options)
      config_contents = {}

      config_options = options.keys.map(&:to_sym).sort.uniq
      config_options.delete(:password)
      config_options.each do |config_option|
        config_contents.store(config_option.to_sym, options[config_option])
      end

      config_contents.store(:default_organization, options[:username])

      config_contents.to_yaml
    end
623838
private void generateOnConfigure(boolean useForeignKey) {
		// onConfigure

		MethodSpec.Builder methodBuilder = MethodSpec.methodBuilder("onConfigure").addAnnotation(Override.class)
				.addModifiers(Modifier.PUBLIC);
		methodBuilder.addParameter(SQLiteDatabase.class, "database");
		methodBuilder.addJavadoc("onConfigure\n");
		methodBuilder.addCode("// configure database\n");

		if (useForeignKey) {
			methodBuilder.addStatement("database.setForeignKeyConstraintsEnabled(true)");
		}

		methodBuilder.beginControlFlow("if (options.databaseLifecycleHandler != null)");
		methodBuilder.addStatement("options.databaseLifecycleHandler.onConfigure(database)");
		methodBuilder.endControlFlow();

		classBuilder.addMethod(methodBuilder.build());
	}
346725
def config(self):
        
        if self._full_config is None:
            self._full_config = DotDict()
            self._full_config.merge(self._default)
            self._full_config.merge(self._config)
            self._full_config.merge(self._environment)
            self._full_config.merge(self._override)
        return self._full_config