Creates an authorization environment for a project.
@param project project name
@return environment to evaluate authorization for a project
359886
public static Set<Attribute> authorizationEnvironment(final String project) {
        return Collections.singleton(new Attribute(URI.create(EnvironmentalContext.URI_BASE + "project"),
                project));
    }
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
1320919
@Deprecated
  public static BigtableInstanceAdminClient create(
      @Nonnull com.google.bigtable.admin.v2.ProjectName projectName,
      @Nonnull BigtableInstanceAdminStub stub) {
    return create(projectName.getProject(), stub);
  }
380421
@Post("/metadata/{projectName}/repos/{repoName}/perm/users")
    public CompletableFuture<Revision> addSpecificUserPermission(
            @Param("projectName") String projectName,
            @Param("repoName") String repoName,
            IdentifierWithPermissions memberWithPermissions,
            Author author) {
        final User member = new User(loginNameNormalizer.apply(memberWithPermissions.id()));
        return mds.addPerUserPermission(author, projectName, repoName,
                                        member, memberWithPermissions.permissions());
    }
440067
def _get_explicit_environ_credentials():
    """"""
    explicit_file = os.environ.get(environment_vars.CREDENTIALS)

    if explicit_file is not None:
        credentials, project_id = _load_credentials_from_file(
            os.environ[environment_vars.CREDENTIALS])

        return credentials, project_id

    else:
        return None, None
1071065
public function environment(SS_HTTPRequest $request) {
		$project = $this->getProject();
		if(!$project) {
			return new SS_HTTPResponse('Project "' . Convert::raw2xml($request->latestParam('Project')) . '" not found.', 404);
		}

		$environment = $this->getEnvironment();
		if(!$environment) {
			return new SS_HTTPResponse('Environment "' . Convert::raw2xml($request->latestParam('Environment')) . '" not found.', 404);
		}
		return new APIEnvironment($this, $environment);
	}
561503
public static ZoneOperationId of(String project, String zone, String operation) {
    return new ZoneOperationId(project, zone, operation);
  }
1150270
public static void setSystemSARLConfigurationFor(IProject project) {
		final IPreferenceStore preferenceStore = getSARLPreferencesFor(project);
		preferenceStore.setValue(IS_PROJECT_SPECIFIC, false);
	}
559967
private static IProject createBaseProject(String projectName, URI location)
	{
		// it is acceptable to use the ResourcesPlugin class
		IProject newProject = ResourcesPlugin.getWorkspace().getRoot().getProject(projectName);

		if (!newProject.exists())
		{
			URI projectLocation = location;
			IProjectDescription desc = newProject.getWorkspace().newProjectDescription(newProject.getName());

			if (location != null
					|| ResourcesPlugin.getWorkspace().getRoot().getLocationURI().equals(location))
			{
				projectLocation = null;
			}

			desc.setLocationURI(projectLocation);
			try
			{
				newProject.create(desc, null);
				if (!newProject.isOpen())
				{
					newProject.open(null);
				}
			} catch (CoreException e)
			{
				VdmCore.log("VdmModelManager createBaseProject", e);
			}
		}

		return newProject;
	}
487708
public static Map<String, String> createEnvironment(Map<String, String> environment)
    {
        Map<String, String> result = null;
        
        try
        {
            result = EnvironmentUtils.getProcEnvironment();
        }
        catch (IOException ex)
        {
            throw new ElasticsearchSetupException(
                    "Cannot get the current process environment", ex);
        }
        
        // Clean up the base environment:

        // The elasticsearch start and plugin scripts print warnings if these environment variables
        // are set, so lets unset them.
        result.remove("JAVA_TOOL_OPTIONS");
        result.remove("JAVA_OPTS");

        // The following environment variables may interfere with the elasticsearch instance.
        result.remove("ES_HOME");
        result.remove("ES_JAVA_OPTS");
        result.remove("ES_PATH_CONF");
        result.remove("ES_TMPDIR");

        // Now that we have a clean environment, set the provided variables on it.
        if (environment != null)
        {
            result.putAll(environment);
        }

        return result;
    }
217328
public static function create(
        string $projectRoot, $default = self::ENV_PRODUCTION, array $allowed = []
    ): EnvironmentInterface
    {
        if (! $allowed) {
            $allowed = [
                self::ENV_PRODUCTION,
                self::ENV_STAGING,
                self::ENV_TESTING,
                self::ENV_DEVELOPMENT,
            ];
        }

        $projectRoot = realpath($projectRoot);

        $filename = $projectRoot . '/.environment';
        if (! $projectRoot || ! file_exists($filename)) {
            return new static($default, $projectRoot);
        }

        // get the environment name
        $name = file_get_contents($filename);

        if (! in_array($name, $allowed)) {
            throw new UnknownEnvironmentException(
                'Unknown environment "' . $name . '". Either add to the allowed list or provide one of: '
                . join(', ', $allowed)
            );
        }

        return new static($name, $projectRoot);
    }
1072950
@SuppressWarnings("static-method")
	protected Job createJobForJavaProject(IProject project) {
		return new Job(Messages.EnableSarlMavenNatureAction_0) {

			@Override
			protected IStatus run(IProgressMonitor monitor) {
				final SubMonitor mon = SubMonitor.convert(monitor, 3);
				// Force the project configuration to SARL.
				SARLProjectConfigurator.configureSARLProject(
						// Project to configure
						project,
						// Add SARL natures
						true,
						// Force java configuration
						true,
						// Create folders
						true,
						// Monitor
						mon.newChild(3));
				return Status.OK_STATUS;
			}
		};
	}
967585
@SuppressWarnings("unchecked")
  public <T extends CMAResource> T setEnvironmentId(String environmentId) {
    if (getSystem().getEnvironment() == null) {
      getSystem().environment = new CMALink(CMAType.Environment);
    }

    getSystem().environment.setId(environmentId);

    return (T) this;
  }
109126
public static synchronized MCAAuthorizationManager createInstance(Context context) {
        if (instance == null) {
            instance = new MCAAuthorizationManager(context.getApplicationContext());

            instance.bluemixRegionSuffix = BMSClient.getInstance().getBluemixRegionSuffix();
            instance.tenantId = BMSClient.getInstance().getBluemixAppGUID();

            AuthorizationRequest.setup();
        }
        return instance;
    }
618585
@RequestMapping(value = "projects/{projectId}/{type}/{id}", method = RequestMethod.PUT)
    public Ack saveProjectPermission(@PathVariable ID projectId, @PathVariable PermissionTargetType type, @PathVariable int id, @RequestBody PermissionInput input) {
        return accountService.saveProjectPermission(projectId, type, id, input);
    }
72594
public Environment createEnvironment(String name, Map<String, Object> attributes) {
        return getInstance().create().environment(name, this, attributes);
    }
1156221
@CheckForNull
    public static GitHubRepositoryName create(GithubProjectProperty projectProperty) {
        if (projectProperty == null) {
            return null;
        }

        return GitHubRepositoryName.create(projectProperty.getProjectUrlStr());
    }