Create the new model
@param {Object} parameters - the parameters provided in the command and in the prompt
@returns {Promise<null>} - The execution stops here
770685
function executeCommand(parameters) {
    // If a name has been provided, we create the project directory
    const modelFilePath = path.join(process.cwd(), plugin.config.modelsPath);
    return mkdirpAsync(modelFilePath)
    .then(() => {
      const model = {
        type: 'object',
        properties: {}
      };
      return fs.writeFileAsync(modelFilePath + path.sep + parameters.name + '.json', JSON.stringify(model, null, 2));
    })
    .then(() => {
      let msg = '\n  A new model has been created!\n\n';
      msg += '  Its Swagger specification is available in ' + icli.format.info(modelFilePath + path.sep + parameters.name + '.json') + '\n';
      icli.print(msg);
    });
  }
420858
def _create_and_add_parameters(params):
    '''
    
    '''
    global _current_parameter
    if _is_simple_type(params):
        _current_parameter = SimpleParameter(params)
        _current_option.add_parameter(_current_parameter)
    else:
        # must be a list
        for i in params:
            if _is_simple_type(i):
                _current_parameter = SimpleParameter(i)
            else:
                _current_parameter = TypedParameter()
                _parse_typed_parameter(i)
            _current_option.add_parameter(_current_parameter)
119303
function createAction(config){
    // make a copy of config with defaults
    config = basis.object.extend({
      prepare: nothingToDo,
      request: nothingToDo
    }, config);

    // if body is function take in account special action context
    if (typeof config.body == 'function')
    {
      var bodyFn = config.body;
      config.body = function(){
        return bodyFn.apply(this.context, this.args);
      };
    }

    // splice properties
    var fn = basis.object.splice(config, ['prepare', 'request']);
    var callback = basis.object.merge(
      DEFAULT_CALLBACK,
      basis.object.splice(config, ['start', 'success', 'failure', 'abort', 'complete'])
    );

    // lazy transport
    var getTransport = basis.fn.lazyInit(function(){
      var transport = resolveTransport(config);

      transport.addHandler(CALLBACK_HANDLER, callback);

      return transport;
    });

    return function action(){
      // this - instance of AbstractData
      if (this.state != STATE_PROCESSING)
      {
        if (fn.prepare.apply(this, arguments))
        {
          /** @cut */ basis.dev.info('Prepare handler returns trulthy result. Operation aborted. Context: ', this);
          return Promise.reject('Prepare handler returns trulthy result. Operation aborted. Context: ', this);
        }

        var request;
        var requestData = basis.object.complete({
          origin: this,
          bodyContext: {
            context: this,
            args: basis.array(arguments)
          }
        }, fn.request.apply(this, arguments));

        // if body is function take in account special action context
        if (typeof requestData.body == 'function')
        {
          var bodyFn = requestData.body;
          requestData.body = function(){
            return bodyFn.apply(this.context, this.args);
          };
        }

        // do a request
        if (request = getTransport().request(requestData))
          return new Promise(function(fulfill, reject){
            request.addHandler(PROMISE_REQUEST_HANDLER, {
              request: request,
              fulfill: fulfill,
              reject: reject
            });
          });

        return Promise.reject('Request is not performed');
      }
      else
      {
        /** @cut */ basis.dev.warn('Context in processing state. Operation aborted. Context: ', this);
        return Promise.reject('Context in processing state, request is not performed');
      }
    };
  }
566949
function create(user, callback) {
      var cb = callback || angular.noop;

      return User.create(user,
        function (user) {
          return cb(user);
        },
        function (err) {
          return cb(err);
        }).$promise;
    }
480046
public static Arguments create(List<String> values, Map<String, String> params)
    {
        if (values == null)
        {
            values = emptyList();
        }
        if (params == null)
        {
            params = emptyMap();
        }
        if (values.isEmpty() && params.isEmpty())
        {
            return NONE;
        }
        return new Arguments(values, params);
    }
1135019
def instantiate(self, **extra_args):
        
        input_block = self.input_block.instantiate()
        backbone = self.backbone.instantiate(**extra_args)

        return NoisyQModel(
            input_block, backbone, extra_args['action_space'], initial_std_dev=self.initial_std_dev,
            factorized_noise=self.factorized_noise
        )
612721
function create(requestObj, callback) {

            var i, requestConfig, storage;

            storage = this;

            callback = callback || function(){};

            if ((typeof requestObj) === 'undefined' || requestObj === null) {
                callback(null);
                return this;
            }
            
            requestObj.config = {};
            requestObj.config.url = requestObj.config.url || this.url.post;
            requestObj.config.type = requestObj.config.type || this.constructor.REQUEST_TYPE_POST;

			for (i = 0; i < storage.preprocessors.length; i++) {
                requestObj.data = storage.preprocessors[i](requestObj.data, requestObj);
            }

            this.constructor._sendRequest(requestObj, function(data){
                for (i = 0; i < storage.processors.length; i++) {
                    data = storage.processors[i](data, requestObj);
                }
                callback(data);
            });

            return this;
        }
1362580
@Override public GLRMModel createImpl() {
    GLRMModel.GLRMParameters parms = parameters.createImpl();
    return new GLRMModel( model_id.key(), parms, null );
  }
1293084
function create(requestObj, callback) {
           
            var storage = this;

            callback = callback || function defaultPostCallback() {
                //setup Error Notification here
            };
            
            if ((typeof requestObj) === 'undefined' || requestObj === null) {
               callback();
               return this;
            }
            
            requestObj.data.id = this._generateUid();

			for (i = 0; i < storage.preprocessors.length; i++) {
                requestObj.data = storage.preprocessors[i](requestObj.data, requestObj);
            }
            this.storage[requestObj.data.id] = requestObj.data;
            
            var data = this.storage[requestObj.data.id];            

            for (i = 0; i < storage.processors.length; i++) {
                data = storage.processors[i](data);
            }
            callback(data);
            
            return this;
        }
170963
async function create(name, options, api, env) {
  // Grab the cwd and npmClient off of the environment. We can use these to
  // create the folder for the project and for determining what client to use
  // for npm-related commands
  const { CLI_ENV, cwd, npmClient } = env;
  // We support a couple of options for our `create` command, some only exist
  // during development (like link and linkCli).
  const { link, linkCli, plugins = [], presets = [], skip } = options;
  const root = path.join(cwd, name);

  logger.trace('Creating project:', name, 'at:', root);

  if (await fs.exists(root)) {
    throw new Error(`A folder already exists at \`${root}\``);
  }

  // Create the root directory for the new project
  await fs.ensureDir(root);

  const {
    writePackageJson,
    installDependencies,
    linkDependencies,
  } = await createClient(npmClient, root);
  const packageJson = {
    name,
    private: true,
    license: 'MIT',
    scripts: {},
    dependencies: {},
    devDependencies: {},
    toolkit: {},
  };

  // Write the packageJson to the newly created `root` folder
  await writePackageJson(packageJson);

  const installer = linkCli ? linkDependencies : installDependencies;
  await installer(['@carbon/toolkit']);

  if (CLI_ENV === 'production') {
    clearConsole();
  }

  if (skip) {
    displaySuccess(root, name, npmClient);
    return;
  }

  const toolkit = await which('toolkit', { cwd: root });

  if (presets.length > 0) {
    const args = ['add', ...presets, link && '--link'].filter(Boolean);
    await spawn(toolkit, args, {
      cwd: root,
      stdio: 'inherit',
    });
  }

  if (plugins.length > 0) {
    const args = ['add', ...plugins, link && '--link'].filter(Boolean);
    await spawn(toolkit, args, {
      cwd: root,
      stdio: 'inherit',
    });
  }

  displaySuccess(root, name, npmClient);
}
1331497
function(params) {

                            var that = this;
                            var paramsDefinition = this.getParamsDefinition();
                            var parameterProcessor = this.getParameterProcessor();

                            _.each(params, function(value, param) {
                                if (!(param in paramsDefinition)) {
                                    throw new Error('Parameter "' + param + '" does not defined!');
                                }
                                params[param] = parameterProcessor.process(value, paramsDefinition[param], param, that);
                            });

                            return params;
                        }
742006
function (route, parameters) {

        return new Promise((resolve, reject) => {

            request.get({
                url: baseUrl + route + '?' + querystring.stringify(parameters)
            }, (error, response, body) => {

                if (error) {
                    reject(error);
                } else if (response && body) {
                    var result;

                    try {
                        result = JSON.parse(body);
                    } catch (e) {
                        reject(e);
                    }

                    if (result.error == 'Method not allowed') {
                        this._post(route, parameters).then(
                            res => { resolve(res) },
                            err => { reject(err) }
                        );
                    } else {
                        resolve(result);
                    }
                } else {
                    reject(response);
                }
            });
        });
    }
473709
function makeType(param) {
	//console.log('makeType',param);
	param = Array.isArray(param)? param[0]: param;
	var strarr = [];
	if (param.format) {
	    strarr.push(formatType(param.format));
	    if ( Array.isArray(param.type) && param.type.indexOf('null') !== -1 ) {
            strarr.push('Null');
	    }
	    return strarr.join('/');
	}
	var str = '';
	if (Array.isArray(param.type)) {
        param.type.map(function(type){
            str = type;
            if (str === 'array') {
                str = makeType(param.items)+'[]';
            }
            strarr.push(formatType(str));
        });
        return strarr.join('/');
	} else if (param.type) {
	    str = param.type
	    if (str === 'array') {
    		str = makeType(param.items)+'[]';
    	}
    	return formatType(str);
	}

	return 'Unknown';
}
1090137
function executeCommand(parameters) {
    const configFilePath = path.join(process.cwd(), plugin.config.policiesPath);
    return mkdirpAsync(configFilePath)
    .then(() => {
      // We create the configuration file of the Lambda
      const document = {
        Version: '2012-10-17',
        Statement: [{
          Effect: 'Deny',
          Action: ['*'],
          Resource: ['*']
        }]
      };

      // We save the specification in a json file
      return fs.writeFileAsync(configFilePath + path.sep + parameters.identifier + '.json', JSON.stringify(document, null, 2));
    })
    .then(() => {
      const msg = '\n  The IAM policy ' + icli.format.info(parameters.identifier)
                + ' has been created in ' + icli.format.info(configFilePath + path.sep + parameters.identifier + '.json') + '\n\n';
      icli.print(msg);
    });
  }
308114
function _createConfig(){
        let file = repositoryPath + '/config.json';
        let config = {
            simulation: false
        };
        return new Promise(function(resolve, reject) {
            jsonfile.writeFile(file, config, function (err) {
                if(err){
                    reject(err);
                    return;
                }
                resolve();
            });

        });
    }
43404
function RequestApi(constructorOptions) {

    LOG.debug('Instantiating new Request object');
    LOG.debug('Validating options');

    try {

        this.options =
            new requestOptions.Constructor().validate(constructorOptions);

    } catch (err) {

        LOG.error('Received error: %s', err);

        throw(
            err
        );

    }

    this.requests = [];
    this.batchId = 1;

}
578586
function executeCommand(parameters) {
    // If a name has been provided, we create the project directory
    // Otherwise, the project will ne created in the current directory
    let configFilePath = process.cwd();
    let p = Promise.resolve();
    if (parameters.projectName) {
      configFilePath += path.sep + parameters.projectName;
      p = fs.mkdirAsync(configFilePath)
      .catch(e => {
        // Fail silently if the directory already exists
      });
    }
    return p.then(() => {
      icli.print('\n  Creating Myrmex config file (' + icli.format.info('myrmex.json') + ')');
      const projectConfig = {
        name: parameters.projectName || 'A Myrmex project',
        plugins: parameters.plugins,
        config: {
          colors: true,
          environment: ''
        }
      };
      return fs.writeFileAsync(configFilePath + path.sep + 'myrmex.json', JSON.stringify(projectConfig, null, 2));
    })
    .then(() => {
      try {
        require(configFilePath + path.sep + 'package.json');
        // If a package.json file already exist, we don't need to create it
        return Promise.resolve();
      } catch (e) {
        icli.print('\n  Creating a node project');
        const cmdArgs = ['init', '-f'];
        icli.print('  Running ' + icli.format.cmd('npm ' + cmdArgs.join(' ') + '\n'));
        icli.print('  Please wait...');
        return exec('npm ' + cmdArgs.join(' '), { cwd: parameters.projectName })
        .catch(e => {
          icli.print(e);
        });
      }
    })
    .then(() => {
      icli.print('\n  Installing Myrmex and Myrmex plugins');
      const cmdArgs = parameters.plugins;
      cmdArgs.unshift('@myrmex/core');
      cmdArgs.unshift('--save-dev');
      cmdArgs.unshift('install');
      icli.print('  Running ' + icli.format.cmd('npm ' + cmdArgs.join(' ') + '\n'));
      icli.print('  Please wait...');
      return exec('npm ' + cmdArgs.join(' '), { cwd: parameters.projectName });
    })
    .spread((stdOut, stdErr) => {
      icli.print(stdOut);
      icli.print(stdErr);
      let msg = icli.format.ok('  A new myrmex project has been created!\n\n');
      if (parameters.projectName) {
        msg += '  You should now enter in the ' + icli.format.info(parameters.projectName) + ' folder to start working\n';
      }
      msg += '  Execute ' + icli.format.cmd('myrmex -h') + ' in the root folder of the project to see available commands\n';
      icli.print(msg);
      return true;
    });
  }