Function run by CreateProjectCommand to create the project.
    Runs in a background process.
    :param download_context: UploadContext: contains data service setup and project name to create.
509825
def download_file_part_run(download_context):
    
    destination_dir, file_url_data_dict, seek_amt, bytes_to_read = download_context.params
    project_file = ProjectFile(file_url_data_dict)
    local_path = project_file.get_local_path(destination_dir)
    retry_chunk_downloader = RetryChunkDownloader(project_file, local_path,
                                                  seek_amt, bytes_to_read,
                                                  download_context)
    retry_chunk_downloader.run()
    return 'ok'
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);
}
904481
function downloadProjectCompilation(project, platform, outputDir) {
	return waitForCompletion(project)
	.then(() => {
		if (project.compilations[platform]) {
			if (project.compilations[platform].isReady()) {
				return downloadFile(project.compilations[platform].downloadLink,
					outputDir + "/" + project.name + "-" + platform + ".zip")
				.catch((error) => {
					console.error("Couldn't download " + platform + " compilation from project " + project.id + ".");
					console.trace(error);
					throw error;
				});
			} else if (project.compilations[platform].isErred()) {
				console.error("Couldn't download " + platform + " compilation from " + project.name + " project: " + project.id +
					". The compilation failed.");
				throw new Error("Compilation failed");
			} else {
				console.error("Couldn't download " + platform + " compilation from " + project.name + " project: " + project.id +
					". Status: " + project.compilations[platform].status + ".");
				throw new Error("Platform ignored");
			}
		} else {
			console.error("Couldn't download " + platform + " compilation from " + project.name + " project: " + project.id +
				". There was not a compilation issued for the platform.");
			throw new Error("No compilation available");
		}
	})
	.catch((error) => {
		console.trace(error);
		throw error;
	});
}
1337428
def create_context(self, message_queue, task_id):
        
        parent_data = ParentData(self.parent.kind, self.parent.remote_id)
        path_data = self.local_file.get_path_data()
        params = parent_data, path_data, self.local_file.remote_id
        return UploadContext(self.settings, params, message_queue, task_id)
743415
def export_context(target_zip):
    
    from django_productline import utils
    context_file = tasks.get_context_path()
    return utils.create_or_append_to_zip(context_file, target_zip, 'context.json')
1083174
def create_tool(self, task):
        
        gp_tool = dict(taskName=task.name,
                       taskDisplayName=task.display_name,
                       taskDescription=task.description,
                       canRunInBackground=True,
                       taskUri=task.uri)

        gp_tool['execute'] = self._execute_template.substitute(gp_tool)
        gp_tool['parameterInfo'] = param_builder.create_param_info(task.parameters,
                                                                   self.parameter_map)
        gp_tool['updateParameter'] = param_builder.create_update_parameter(task.parameters,
                                                                           self.parameter_map)
        gp_tool['preExecute'] = param_builder.create_pre_execute(task.parameters,
                                                                 self.parameter_map)
        gp_tool['postExecute'] = param_builder.create_post_execute(task.parameters,
                                                                   self.parameter_map)
        return self._tool_template.substitute(gp_tool)
532469
def run(self, args):
        
        project_name_or_id = self.create_project_name_or_id_from_args(args)
        folder = args.folder                # path to a folder to download data into
        # Default to project name with spaces replaced with '_' if not specified
        if not folder:
            folder = replace_invalid_path_chars(project_name_or_id.value.replace(' ', '_'))
        destination_path = format_destination_path(folder)
        path_filter = PathFilter(args.include_paths, args.exclude_paths)
        project = self.fetch_project(args, must_exist=True)
        project_download = ProjectDownload(self.remote_store, project, destination_path, path_filter)
        project_download.run()
691563
def create_project(self, name, body=github.GithubObject.NotSet):
        
        assert isinstance(name, (str, unicode)), name
        assert body is github.GithubObject.NotSet or isinstance(body, (str, unicode)), body
        post_parameters = {
            "name": name,
            "body": body,
        }
        import_header = {"Accept": Consts.mediaTypeProjectsPreview}
        if body is not github.GithubObject.NotSet:
            post_parameters['body'] = body
        headers, data = self._requester.requestJsonAndCheck(
            "POST",
            self.url + "/projects",
            headers=import_header,
            input=post_parameters
        )
        return github.Project.Project(self._requester, headers, data, completed=True)
1359392
def create_source(self, datapusher=True):
        
        task.create_source(self.target, self._preload_image(), datapusher)
387617
def create(project, credentials): #pylint: disable=too-many-return-statements
        """"""

        if not settings.COMMAND:
            return flask.make_response("Projects disabled, no command configured",404)

        user, oauth_access_token = parsecredentials(credentials) #pylint: disable=unused-variable
        if not Project.validate(project):
            return withheaders(flask.make_response('Invalid project ID. Note that only alphanumerical characters are allowed.',403),headers={'allow_origin': settings.ALLOW_ORIGIN})
        printdebug("Checking if " + settings.ROOT + "projects/" + user + '/' + project + " exists")
        if not project:
            return withheaders(flask.make_response('No project name',403),headers={'allow_origin': settings.ALLOW_ORIGIN})
        if not os.path.isdir(settings.ROOT + "projects/" + user):
            printlog("Creating user directory '" + user + "'")
            os.makedirs(settings.ROOT + "projects/" + user)
            if not os.path.isdir(settings.ROOT + "projects/" + user): #verify:
                return withheaders(flask.make_response("Directory " + settings.ROOT + "projects/" + user + " could not be created succesfully",403),headers={'allow_origin': settings.ALLOW_ORIGIN})


        #checking user quota
        if settings.USERQUOTA > 0:
            _, totalsize = getprojects(user)
            if totalsize > settings.USERQUOTA:
                printlog("User " + user + " exceeded quota, refusing to create new project...")
                return withheaders(flask.make_response("Unable to create new project because you are exceeding your disk quota (max " + str(settings.USERQUOTA) + " MB, you now use " + str(totalsize) + " MB). Please delete some projects and try again.",403),headers={'allow_origin': settings.ALLOW_ORIGIN})

        if not os.path.isdir(settings.ROOT + "projects/" + user + '/' + project):
            printlog("Creating project '" + project + "'")
            os.makedirs(settings.ROOT + "projects/" + user + '/' + project)

        #project index will need to be regenerated, remove cache
        if os.path.exists(os.path.join(settings.ROOT + "projects/" + user,'.index')):
            os.unlink(os.path.join(settings.ROOT + "projects/" + user,'.index'))

        if not os.path.isdir(settings.ROOT + "projects/" + user + '/' + project + '/input/'):
            os.makedirs(settings.ROOT + "projects/" + user + '/' + project + "/input")
            if not os.path.isdir(settings.ROOT + "projects/" + user + '/' + project + '/input'):
                return withheaders(flask.make_response("Input directory " + settings.ROOT + "projects/" + user + '/' + project + "/input/  could not be created succesfully",403),headers={'allow_origin': settings.ALLOW_ORIGIN})
        if not os.path.isdir(settings.ROOT + "projects/" + user + '/' + project + '/output/'):
            os.makedirs(settings.ROOT + "projects/" + user + '/' + project + "/output")
            if not os.path.isdir(settings.ROOT + "projects/" + user + '/' + project + '/output'):
                return withheaders(flask.make_response("Output directory " + settings.ROOT + "projects/" + user + '/' + project + "/output/  could not be created succesfully",403),headers={'allow_origin': settings.ALLOW_ORIGIN})
        if not os.path.isdir(settings.ROOT + "projects/" + user + '/' + project + '/tmp/'):
            os.makedirs(settings.ROOT + "projects/" + user + '/' + project + "/tmp")
            if not os.path.isdir(settings.ROOT + "projects/" + user + '/' + project + '/tmp'):
                return withheaders(flask.make_response("tmp directory " + settings.ROOT + "projects/" + user + '/' + project + "/tmp/  could not be created succesfully",403),headers={'allow_origin': settings.ALLOW_ORIGIN})

        return None
385348
def _create_project(self, path):
        """"""
        self.open_project(path=path)
        self.setup_menu_actions()
        self.add_to_recent(path)
1074108
def run_preprocessor(self, files_to_download):
        
        for project_file in files_to_download:
            self.file_download_pre_processor.run(self.remote_store.data_service, project_file)
1110037
def download(self, timeout=5, wait_for_finish=False):
        
        return Task.execute(self, 'download', timeout=timeout,
            wait_for_finish=wait_for_finish)
1278518
function createProjectWithConfig(zipFile, configXml) {
	return createProject(zipFile)
	.then((project) => {
		return updateConfig(configXml, project)
		.then(() => {
			return project;
		})
		.catch((errorFromUpdate) => {
			deleteProject(project)
			.then(() => {
				console.error("The project with ID: " + project.id + " was not created because it wasn't possible to upload the custom XML.");
				throw errorFromUpdate;
			})
			.catch((errorFromDelete) => {
				console.error("The project with ID: " + project.id + " was created but it wasn't possible to upload the custom XML.");
				console.trace(errorFromDelete);
				throw errorFromDelete;
			});
		});
	})
	.catch((error) => {
		console.trace(error);
		throw error;
	});
}
283327
function do_create_context(context) {
		var context = context || {};
		
		if(!context.replace) {
			context.replace = (function(chunk, context, bodies, params) {
					return chunk.tap(function(data) {
						return (params.from && params.to && (data === params.from) ) ? params.to : data;
					}).render(bodies.block, context).untap();
				});
		}
		
		if(!context.toFixed) {
			context.toFixed = (function(chunk, context, bodies, params) {
					return chunk.tap(function(data) {
						return parseFloat(data).toFixed(params.x || 0);
					}).render(bodies.block, context).untap();
				}); // end of context
		}
		
		return context;
	}
848090
def submit(self, ctx: commands.Context):
        

        self.task_count += 1
        cmdtask = CommandTask(self.task_count, ctx, asyncio.Task.current_task())
        self.tasks.append(cmdtask)

        try:
            yield cmdtask
        finally:
            if cmdtask in self.tasks:
                self.tasks.remove(cmdtask)
262251
def create_on_task(self, task_id, file_content, file_name, file_content_type=None, **options):
        """"""
        path = '/tasks/%d/attachments' % (task_id)
        return self.client.request('post', path, files=[('file', (file_name, file_content, file_content_type))], **options)