Create a new space with the given name in the current target
        organization.
356603
def create_space(self, space_name, add_users=True):
        
        body = {
            'name': space_name,
            'organization_guid': self.api.config.get_organization_guid()
        }

        # MAINT: may need to do this more generally later
        if add_users:
            space_users = []
            org_users = self.org.get_users()
            for org_user in org_users['resources']:
                guid = org_user['metadata']['guid']
                space_users.append(guid)

            body['manager_guids'] = space_users
            body['developer_guids'] = space_users

        return self.api.post('/v2/spaces', body)
529944
@Path("/{spaceID}")
    @PUT
    public Response addSpace(@PathParam("spaceID") String spaceID,
                             @QueryParam("storeID") String storeID) {
        String msg = "adding space(" + spaceID + ", " + storeID + ")";

        try {
            log.debug(msg);
            return doAddSpace(spaceID, storeID);

        } catch (InvalidIdException e) {
            return responseBad(msg, e, BAD_REQUEST);

        } catch (ResourceException e) {
            return responseBad(msg, e, INTERNAL_SERVER_ERROR);

        } catch (Exception e) {
            return responseBad(msg, e, INTERNAL_SERVER_ERROR);
        }
    }
240411
def new_name(self, template=u"xxx_todo_changeme"):
        
        name = template
        while name in self.used_names:
            name = template + unicode(self.numbers.next())
        self.used_names.add(name)
        return name
861125
def rename(self, name):
        """"""
        self.ec2.create_tags(Resources = [self.instance_id],
                             Tags      = [{'Key':   'Name',
                                           'Value':  name}])
        self.refresh_info()
125080
def target(self):
        
        # MAINT: I don't like this, but will deal later
        os.environ['PREDIX_SPACE_GUID'] = self.guid
        os.environ['PREDIX_SPACE_NAME'] = self.name
        os.environ['PREDIX_ORGANIZATION_GUID'] = self.org.guid
        os.environ['PREDIX_ORGANIZATION_NAME'] = self.org.name
596850
def context_new(zap_helper, name):
    """"""
    console.info('Creating context with name: {0}'.format(name))
    res = zap_helper.zap.context.new_context(contextname=name)
    console.info('Context "{0}" created with ID: {1}'.format(name, res))
684688
def name_replace(self, to_replace, replacement):
        """"""
        self.name = self.name.replace(to_replace, replacement)
383126
def delete_space(self, name=None, guid=None):
        

        if not guid:
            if name:
                spaces = self._get_spaces()
                for space in spaces['resources']:
                    if space['entity']['name'] == name:
                        guid = space['metadata']['guid']
                        break
                if not guid:
                    raise ValueError("Space with name %s not found." % (name))
            else:
                guid = self.guid

        logging.warning("Deleting space (%s) and all services." % (guid))

        return self.api.delete("/v2/spaces/%s" % (guid), params={'recursive':
        'true'})
930901
public String createNamespace(String name) {
        String requestId = Long.toString(System.nanoTime());

        CreatePublicDnsNamespaceRequest publicDnsNamespaceRequest =
                new CreatePublicDnsNamespaceRequest().withCreatorRequestId(requestId)
                        .withName(name)
                        .withDescription("test");
        CreatePublicDnsNamespaceResult clientResult = getDiscoveryClient().createPublicDnsNamespace(publicDnsNamespaceRequest);
        String operationId = clientResult.getOperationId();
        GetOperationResult opResult = checkOperation(operationId);
        return opResult.getOperation().getTargets().get("NAMESPACE");
    }
256213
private void createNamespace(boolean isUpdate)
    {
        boolean isNameSpaceAvailable = isNamespaceAvailable(databaseName);
        if (isNameSpaceAvailable && !isUpdate)
        {
            drop();
        }
        if (!(isNameSpaceAvailable && isUpdate))
        {
            try
            {
                NamespaceDescriptor descriptor = NamespaceDescriptor.create(databaseName).build();
                admin.createNamespace(descriptor);
            }
            catch (IOException ioex)
            {
                logger.error("Either table isn't in enabled state or some network problem, Caused by: ", ioex);
                throw new SchemaGenerationException(ioex, "Hbase");
            }
        }
    }
83170
public ISarlSpaceBuilder addSarlSpace(String name) {
		ISarlSpaceBuilder builder = this.sarlSpaceProvider.get();
		builder.eInit(getScript(), name, getTypeResolutionContext());
		return builder;
	}
717644
def update_name(self, name):
        """"""
        if name != self.name:
            self.parent.executables[name] = self
            del self.parent.executables[self.name]
            self.name = name
654244
def rename(self, new_name, range=None):
        """"""
        self.log.debug('rename: in')
        if not new_name:
            new_name = self.editor.ask_input("Rename to:")
        self.editor.write(noautocmd=True)
        b, e = self.editor.word_under_cursor_pos()
        current_file = self.editor.path()
        self.editor.raw_message(current_file)
        self.send_refactor_request(
            "RefactorReq",
            {
                "typehint": "RenameRefactorDesc",
                "newName": new_name,
                "start": self.get_position(b[0], b[1]),
                "end": self.get_position(e[0], e[1]) + 1,
                "file": current_file,
            },
            {"interactive": False}
        )
104764
def new_workspace(self, name=None, layout=None, workspace_id=None, index=None) -> WorkspaceLayout.WorkspaceLayout:
        
        workspace = WorkspaceLayout.WorkspaceLayout()
        self.document_model.insert_workspace(index if index is not None else len(self.document_model.workspaces), workspace)
        d = create_image_desc()
        d["selected"] = True
        workspace.layout = layout if layout is not None else d
        workspace.name = name if name is not None else _("Workspace")
        if workspace_id:
            workspace.workspace_id = workspace_id
        return workspace
639335
def create_namespace(
        name,
        **kwargs):
    '''
    
    '''

    meta_obj = kubernetes.client.V1ObjectMeta(name=name)
    body = kubernetes.client.V1Namespace(metadata=meta_obj)
    body.metadata.name = name

    cfg = _setup_conn(**kwargs)

    try:
        api_instance = kubernetes.client.CoreV1Api()
        api_response = api_instance.create_namespace(body)

        return api_response.to_dict()
    except (ApiException, HTTPError) as exc:
        if isinstance(exc, ApiException) and exc.status == 404:
            return None
        else:
            log.exception(
                'Exception when calling '
                'CoreV1Api->create_namespace'
            )
            raise CommandExecutionError(exc)
    finally:
        _cleanup(**cfg)
361481
def rename_workspace(self) -> None:
        

        def rename_clicked(text):
            if len(text) > 0:
                command = Workspace.RenameWorkspaceCommand(self, text)
                command.perform()
                self.document_controller.push_undo_command(command)

        self.pose_get_string_message_box(caption=_("Enter new name for workspace"), text=self.__workspace.name,
                                         accepted_fn=rename_clicked, accepted_text=_("Rename"),
                                         message_box_id="rename_workspace")
1076196
def _add_namespace(self, namespace):
        """"""
        src_name = namespace.source_name
        if "*" in src_name:
            self._regex_map.append((namespace_to_regex(src_name), namespace))
        else:
            self._add_plain_namespace(namespace)