Create a project on the OSF.
491948
def _create_osf_project(dlgr_id, description=None):
    """"""

    if not description:
        description = "Experiment {} registered by Dallinger.".format(dlgr_id)

    r = requests.post(
        "{}/nodes/".format(root),
        data={
            "type": "nodes",
            "category": "project",
            "title": "Experiment dlgr-{}".format(dlgr_id[0:8]),
            "description": description,
        },
        headers={"Authorization": "Bearer {}".format(config.get("osf_access_token"))},
    )
    r.raise_for_status()
    osf_id = r.json()["data"]["id"]

    logger.info("Project registered on OSF at http://osf.io/{}".format(osf_id))

    return osf_id
439289
def create_project(project, opts = {})
      data, _status_code, _headers = create_project_with_http_info(project, opts)
      return data
    end
187134
function createProjectObject (projectPath, projectName) {
    var locations = {
        root: projectPath,
        pbxproj: path.join(projectPath, projectName + '.xcodeproj', 'project.pbxproj')
    };

    return projectFile.parse(locations);
}
63469
def generate(self, project):
		
		for assignment in self.s2n_mapping:
			if assignment["ipprefix"] == project:
				self._name = assignment["package"]
				return self

		#
		# github.com -> github
		# code.google.com/p/ -> googlecode
		# golang.org/x/ -> golangorg
		# gopkg.in/check.v1 -> gopkg-check
		# camlistore.org
		#

		name = project
		if name.startswith("github.com"):
			name = re.sub(r"^github\.com", "github", name)

		if name.startswith("gopkg.in"):
			name = re.sub(r"gopkg\.in", "gopkg", name)
			# any version marks?
			name = re.sub(r"\.v\d", "", name)
			name = re.sub(r"/v\d/", "/", name)

		if name.startswith("code.google.com/p"):
			name = re.sub(r"^code\.google\.com/p", "googlecode", name)

		if name.startswith("golang.org/x"):
			name = re.sub(r"^golang\.org/x", "golangorg", name)

		if name.startswith("google.golang.org"):
			name = re.sub(r"^google\.golang\.org", "googlegolangorg", name)

		if name.startswith("bitbucket.org"):
			name = re.sub(r"^bitbucket\.org", "bitbucket", name)

		if name.startswith("k8s.io"):
			name = re.sub(r"^k8s\.io", "k8s", name)

		if name.endswith(".org"):
			name = re.sub(r"\.org$", "", name)

		name = name.replace("/", "-")

		self._name = "golang-%s" % name

		return self
258640
def _create(self):
        """"""

        self._raise_if_none()
        if not self._exists:
            mkdir_p(self.path)
            self._exists = True
614547
def deploy_project():
    
    
    project_root = '/'.join([deployment_root(),'env',env.project_fullname,'project'])
    local_dir = os.getcwd()
    
    if env.verbosity:
        print env.host,"DEPLOYING project", env.project_fullname
    #Exclude a few things that we don't want deployed as part of the project folder
    rsync_exclude = ['local_settings*','*.pyc','*.log','.*','/build','/dist','/media*','/static*','/www','/public','/template*']

    #make site local settings if they don't already exist
    _make_local_sitesettings()
    created = deploy_files(local_dir, project_root, rsync_exclude=rsync_exclude)
    if not env.patch:
        #hook the project into sys.path
        pyvers = run('python -V').split(' ')[1].split('.')[0:2] #Python x.x.x
        sitepackages = ''.join(['lib/python',pyvers[0],'.',pyvers[1],'/site-packages'])
        link_name = '/'.join([deployment_root(),'env',env.project_fullname,sitepackages,env.project_package_name])
        target = '/'.join([project_root,env.project_package_name])
        run(' '.join(['ln -s',target,link_name]))
        
        #make sure manage.py has exec permissions
        managepy = '/'.join([target,'sitesettings','manage.py'])
        if exists(managepy):
            sudo('chmod ugo+x %s'% managepy)
    
    return created
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)
368092
def build(self, *args, **kwargs):
        """"""
        # Create the directories of the work.
        self.indir.makedirs()
        self.outdir.makedirs()
        self.tmpdir.makedirs()

        # Build dirs and files of each task.
        for task in self:
            task.build(*args, **kwargs)

        # Connect signals within the work.
        self.connect_signals()
118524
def create(self, request, project):
        """"""
        job_id = int(request.data['job_id'])
        bug_id = int(request.data['bug_id'])

        try:
            BugJobMap.create(
                job_id=job_id,
                bug_id=bug_id,
                user=request.user,
            )
            message = "Bug job map saved"
        except IntegrityError:
            message = "Bug job map skipped: mapping already exists"

        return Response({"message": message})
798156
def create(self, project, email, role, **attrs):
        
        attrs.update({'project': project, 'email': email, 'role': role})
        return self._new_resource(payload=attrs)
1140529
def create(cls, path_name=None, name=None, project_id=None,
               log_modified_at=None, crawlable=True):
        """"""
        result = cls(path_name, name, project_id, log_modified_at, crawlable)

        db.session.add(result)
        db.session.commit()

        crawl_result(result, True)

        return result
290021
def create_project(self, name, description=None):
        
        description = description or ''
        data = self._run(
            url_path="projects/add",
            name=name,
            description=description
        )
        return data['result']['project']['id']
221735
def createproject():
    
    os.chdir(build_dir)
    if windows_build:
        command = 'cmake -A {} -DPYTHON_EXECUTABLE:FILEPATH="{}" ../..'.format("win32" if bitness==32 else "x64", sys.executable)
        os.system(command)
        if bitness==64:
            for line in fileinput.input("_rhino3dm.vcxproj", inplace=1):
                print(line.replace("WIN32;", "WIN64;"))
            for line in fileinput.input("opennurbs_static.vcxproj", inplace=1):
                print(line.replace("WIN32;", "WIN64;"))
        #os.system("cmake --build . --config Release --target _rhino3dm")
    else:
        rv = os.system("cmake -DPYTHON_EXECUTABLE:FILEPATH={} ../..".format(sys.executable))
        if int(rv) > 0: sys.exit(1)
90251
def create(client, output_file, revision, paths):
    """"""
    graph = Graph(client)
    outputs = graph.build(paths=paths, revision=revision)

    output_file.write(
        yaml.dump(
            ascwl(
                graph.ascwl(outputs=outputs),
                filter=lambda _, x: x is not None and x != [],
                basedir=os.path.dirname(getattr(output_file, 'name', '.')) or
                '.',
            ),
            default_flow_style=False
        )
    )
39208
def create_sconstruct(self, project_dir='', sayyes=False):
        """"""

        project_dir = util.check_dir(project_dir)

        sconstruct_name = 'SConstruct'
        sconstruct_path = util.safe_join(project_dir, sconstruct_name)
        local_sconstruct_path = util.safe_join(
            util.get_folder('resources'), sconstruct_name)

        if isfile(sconstruct_path):
            # -- If sayyes, skip the question
            if sayyes:
                self._copy_sconstruct_file(sconstruct_name, sconstruct_path,
                                           local_sconstruct_path)
            else:
                click.secho(
                    'Warning: {} file already exists'.format(sconstruct_name),
                    fg='yellow')

                if click.confirm('Do you want to replace it?'):
                    self._copy_sconstruct_file(sconstruct_name,
                                               sconstruct_path,
                                               local_sconstruct_path)
                else:
                    click.secho('Abort!', fg='red')

        else:
            self._copy_sconstruct_file(sconstruct_name, sconstruct_path,
                                       local_sconstruct_path)
371849
def startproject(project_name):
    
    # the destination path
    dst_path = os.path.join(os.getcwd(), project_name)
    start_init_info(dst_path)

    # create dst path
    _mkdir_p(dst_path)

    # create project tree
    os.chdir(dst_path)
    # create files
    init_code('manage.py', _manage_admin_code)
    init_code('requirement.txt', _requirement_admin_code)
    init_code('config.py', _config_sql_code)

    # create app/
    app_path = os.path.join(dst_path, 'app')
    _mkdir_p(app_path)

    # create files
    os.chdir(app_path)
    init_code('models.py', _models_admin_code)
    init_code('__init__.py', _init_admin_code)

    # create templates and static
    css_path, templates_path = create_templates_static_files(app_path)
    # create css files
    os.chdir(css_path)
    init_code('sign.css', _auth_login_css_code)

    # create main blueprint
    create_blueprint(
        app_path,
        'main',
        _views_blueprint_code % ('main', 'main'),
        _forms_basic_code,
        templates_path
    )

    # create auth blueprint
    auth_templates_path = create_blueprint(
        app_path,
        'auth',
        _auth_views_code,
        _auth_forms_code,
        templates_path
    )
    # create auth templates files
    os.chdir(auth_templates_path)
    init_code('login.html', _auth_login_html_code)

    # create admin site
    admin_path = os.path.join(app_path, 'admin')
    _mkdir_p(admin_path)

    # create admin files
    os.chdir(admin_path)
    init_code('__init__.py', '')
    init_code('views.py', _admin_views_code)

    # create admin templates
    os.chdir(templates_path)
    admin_templates_path = os.path.join(templates_path, 'admin')
    _mkdir_p(admin_templates_path)

    # create admin templates files
    os.chdir(admin_templates_path)
    init_code('index.html', _admin_index_html_code)
    init_code('logout.html', _admin_logout_html_code)

    init_done_info()
791208
def create_project_configuration(filename):
    """"""
    home = os.path.expanduser("~")
    project_root_folder = os.path.join(home, "hwr-experiments")
    config = {'root': project_root_folder,
              'nntoolkit': None,
              'dropbox_app_key': None,
              'dropbox_app_secret': None,
              'dbconfig': os.path.join(home, "hwrt-config/db.config.yml"),
              'data_analyzation_queue': [{'Creator': None}],
              'worker_api_key': '1234567890abc',
              'environment': 'development'}
    with open(filename, 'w') as f:
        yaml.dump(config, f, default_flow_style=False)