Create a new namespace for the current namespace's object value.
557309
def object_ns(self):
        
        return Namespace(
            subject=self.object_,
            object_=None,
            prefix=self.prefix,
            qualifier=self.qualifier,
            version=self.version,
        )
1319321
public void createNamespace() {
        Map<String, String> namespaceAnnotations = annotationProvider.create(session.getId(), Constants.RUNNING_STATUS);
        if (namespaceService.exists(session.getNamespace())) {
            //namespace exists
        } else if (configuration.isNamespaceLazyCreateEnabled()) {
            namespaceService.create(session.getNamespace(), namespaceAnnotations);
        } else {
            throw new IllegalStateException("Namespace [" + session.getNamespace() + "] doesn't exist and lazily creation of namespaces is disabled. "
            + "Either use an existing one, or set `namespace.lazy.enabled` to true.");
        }
    }
545756
def in_namespace(name)
      name ||= generate_name
      @scope.push(name)
      ns = NameSpace.new(self, @scope)
      yield(ns)
      ns
    ensure
      @scope.pop
    end
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)
441997
def setArg(self, namespace, key, value):
        """"""
        assert key is not None
        assert value is not None
        namespace = self._fixNS(namespace)
        # try to ensure that internally it's consistent, at least: str -> str
        if isinstance(value, bytes):
            value = str(value, encoding="utf-8")
        self.args[(namespace, key)] = value
        if not (namespace is BARE_NS):
            self.namespaces.add(namespace)
842896
def reset_namespace(self):
        """"""
        self.shellwidget.reset_namespace(warning=self.reset_warning,
                                         message=True)
634380
function(ns, members) {
			var no;
			if (gui.Type.isString(ns)) {
				no = gui.Object.lookup(ns);
				no = new gui.Namespace(ns);
				no = gui.Object.assert(ns, no);
			} else {
				throw new TypeError("Expected a namespace string");
			}
			return gui.Object.extend(no, members || {});
		}
43194
def add_namespace(self, name, a_namespace):
        """"""
        # save a local copy of the namespace
        self.namespaces[name] = a_namespace
        # iterate through the namespace branding each of the options with the
        # name of the subparser to which they belong
        for k in a_namespace.keys_breadth_first():
            an_option = a_namespace[k]
            if not an_option.foreign_data:
                an_option.foreign_data = DotDict()
            an_option.foreign_data['argparse.owning_subparser_name'] = name
1248614
def import_object_ns(name_space, import_str, *args, **kwargs):
    
    import_value = "%s.%s" % (name_space, import_str)
    try:
        return import_class(import_value)(*args, **kwargs)
    except ImportError:
        return import_class(import_str)(*args, **kwargs)
46870
def namespace(self, name=None, function=None, recursive=None):
        

        return (
            self._find_single(
                scopedef.scopedef_t._impl_matchers[namespace_t.namespace],
                name=name,
                function=function,
                recursive=recursive)
        )
962423
function() {
    var str
      , prefix;
    this.expect('namespace');

    this.skipSpacesAndComments();
    if (prefix = this.accept('ident')) {
      prefix = prefix.val;
    }
    this.skipSpacesAndComments();

    str = this.accept('string') || this.url();
    this.allowPostfix = true;
    return new nodes.Namespace(str, prefix);
  }
647276
public ConnectorDescriptor addNamespace(String name, String value)
   {
      model.attribute(name, value);
      return this;
   }
1268694
def declare_namespace(packageName):
    """"""

    _imp.acquire_lock()
    try:
        if packageName in _namespace_packages:
            return

        path = sys.path
        parent, _, _ = packageName.rpartition('.')

        if parent:
            declare_namespace(parent)
            if parent not in _namespace_packages:
                __import__(parent)
            try:
                path = sys.modules[parent].__path__
            except AttributeError:
                raise TypeError("Not a package:", parent)

        # Track what packages are namespaces, so when new path items are added,
        # they can be updated
        _namespace_packages.setdefault(parent or None, []).append(packageName)
        _namespace_packages.setdefault(packageName, [])

        for path_item in path:
            # Ensure all the parent's path items are reflected in the child,
            # if they apply
            _handle_ns(packageName, path_item)

    finally:
        _imp.release_lock()
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)
747617
def new_context(environment, template_name, blocks, vars=None,
                shared=None, globals=None, locals=None):
    """"""
    if vars is None:
        vars = {}
    if shared:
        parent = vars
    else:
        parent = dict(globals or (), **vars)
    if locals:
        # if the parent is shared a copy should be created because
        # we don't want to modify the dict passed
        if shared:
            parent = dict(parent)
        for key, value in iteritems(locals):
            if value is not missing:
                parent[key] = value
    return environment.context_class(environment, parent, template_name,
                                     blocks)
51895
def reset_namespace(self, namespace=None, params=None):
        
        log = logging.getLogger("%s.%s" % (self.log_name,
                                           inspect.stack()[0][3]))
        log.setLevel(self.log_level)
        namespace = pick(namespace, self.namespace)
        params = pick(params, self.namespace_params)
        log.warning(" Reseting namespace '%s' at host: %s",
                 namespace,
                 self.url)
        try:
            self.delete_namespace(namespace)
        except RuntimeError:
            pass
        self.create_namespace(namespace, params)
587079
def newDocProp(self, name, value):
        
        ret = libxml2mod.xmlNewDocProp(self._o, name, value)
        if ret is None:raise treeError('xmlNewDocProp() failed')
        __tmp = xmlAttr(_obj=ret)
        return __tmp