Given a namespace preorder hash, get the associated namespace
        reveal or ready (it may be expired).
439334
def get_namespace_by_preorder( self, preorder_hash ):
        
        cur = self.db.cursor()
        return namedb_get_namespace_by_preorder_hash( cur, preorder_hash )
734698
String getNamespacedKey(CacheNamespace cacheNamespace, String key) {
        String namespaceIndicator = getNamespaceIndicator(cacheNamespace);

        if (cacheNamespace.isNamespaceExpirationRequired() == false) {
            return namespaceIndicator + ":" + key;
        }

        String namespaceIndicatorKey = namespaceIndicator + NAMESPACE_NAME_SQUENCE_SEPARATOR;
        long namespaceSquence = memcachedClient.incr(namespaceIndicatorKey, 0L, System.currentTimeMillis(),
                DEFAULT_NAMESPACE_SEQUENCE_EXPIRY_SECONDS);

        return namespaceIndicatorKey + namespaceSquence + ":" + key;
    }
656374
def exploded_namespace_declarations(ns)
      Hash[ns.map do |prefix, uri|
             if prefix==""
               ["xmlns", uri]
             else
               [[prefix, "xmlns"], uri]
             end
           end]
    end
200388
def show_namespace(name, **kwargs):
    '''
    
    '''
    cfg = _setup_conn(**kwargs)
    try:
        api_instance = kubernetes.client.CoreV1Api()
        api_response = api_instance.read_namespace(name)

        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->read_namespace'
            )
            raise CommandExecutionError(exc)
    finally:
        _cleanup(**cfg)
354214
def namedb_get_name_from_name_hash128( cur, name_hash128, block_number ):
    

    unexpired_query, unexpired_args = namedb_select_where_unexpired_names( block_number )

    select_query = "SELECT name FROM name_records JOIN namespaces ON name_records.namespace_id = namespaces.namespace_id " + \
                   "WHERE name_hash128 = ? AND revoked = 0 AND " + unexpired_query + ";"

    args = (name_hash128,) + unexpired_args
    name_rows = namedb_query_execute( cur, select_query, args )

    name_row = name_rows.fetchone()
    if name_row is None:
        # no such namespace 
        return None 

    return name_row['name']
21959
def check
      @definition.namespaces.each do |(namespace, ns)|
        ns.items.each do |key, _|
          lookup(namespace, key)
        end
      end
    end
604098
def get_constants namespace, context = ''
      namespace ||= ''
      cached = cache.get_constants(namespace, context)
      return cached.clone unless cached.nil?
      skip = []
      result = []
      bases = context.split('::')
      while bases.length > 0
        built = bases.join('::')
        fqns = qualify(namespace, built)
        visibility = [:public]
        visibility.push :private if fqns == context
        result.concat inner_get_constants(fqns, visibility, skip)
        bases.pop
      end
      fqns = qualify(namespace, '')
      visibility = [:public]
      visibility.push :private if fqns == context
      result.concat inner_get_constants(fqns, visibility, skip)
      cache.set_constants(namespace, context, result)
      result
    end
672150
def hbp_namespace(name: str, sha: Optional[str] = None) -> str:
    """"""
    return HBP_NAMESPACE_URL.format(sha=sha or LAST_HASH, keyword=name)
626256
def GET_namespace_info( self, path_info, namespace_id ):
        
        if not check_namespace(namespace_id):
            return self._reply_json({'error': 'Invalid namespace'}, status_code=400)

        blockstackd_url = get_blockstackd_url()
        namespace_rec = blockstackd_client.get_namespace_record(namespace_id, hostport=blockstackd_url)
        if json_is_error(namespace_rec):
            # error
            status_code = namespace_rec.get('http_status', 502)
            return self._reply_json({'error': namespace_rec['error']}, status_code=status_code)

        self._reply_json(namespace_rec)
        return
445641
def check( state_engine, nameop, block_id, checked_ops ):
    

    namespace_id = nameop['namespace_id']
    sender = nameop['sender']

    # must have been revealed
    if not state_engine.is_namespace_revealed( namespace_id ):
       log.warning("Namespace '%s' is not revealed" % namespace_id )
       return False

    # must have been sent by the same person who revealed it
    revealed_namespace = state_engine.get_namespace_reveal( namespace_id )
    if revealed_namespace['recipient'] != sender:
       log.warning("Namespace '%s' is not owned by '%s' (but by %s)" % (namespace_id, sender, revealed_namespace['recipient']))
       return False

    # can't be ready yet
    if state_engine.is_namespace_ready( namespace_id ):
       # namespace already exists
       log.warning("Namespace '%s' is already registered" % namespace_id )
       return False

    # preserve from revealed 
    nameop['sender_pubkey'] = revealed_namespace['sender_pubkey']
    nameop['address'] = revealed_namespace['address']

    # can commit imported nameops
    return True
1019017
protected static function _namespaceIsset($namespace, $name = null)
    {
        if (self::$_readable === false) {
            /**
             * @see Zend_Session_Exception
             */
            require_once 'Zend/Session/Exception.php';
            throw new Zend_Session_Exception(self::_THROW_NOT_READABLE_MSG);
        }

        if ($name === null) {
            return ( isset($_SESSION[$namespace]) || isset(self::$_expiringData[$namespace]) );
        } else {
            return ( isset($_SESSION[$namespace][$name]) || isset(self::$_expiringData[$namespace][$name]) );
        }
    }
539094
def namedb_get_names_with_value_hash( cur, value_hash, block_number ):
    

    unexpired_query, unexpired_args = namedb_select_where_unexpired_names( block_number )
    select_query = "SELECT name FROM name_records JOIN namespaces ON name_records.namespace_id = namespaces.namespace_id " + \
                   "WHERE value_hash = ? AND revoked = 0 AND " + unexpired_query + ";"

    args = (value_hash,) + unexpired_args
    name_rows = namedb_query_execute( cur, select_query, args )
    names = []

    for name_row in name_rows:
        names.append( name_row['name'] )

    if len(names) == 0:
        return None
    else:
        return names
846052
def is_new_namespace_preorder( self, namespace_id_hash, lastblock=None ):
        
        if lastblock is None:
            lastblock = self.lastblock 

        preorder = namedb_get_namespace_preorder( self.db, namespace_id_hash, lastblock )
        if preorder is not None:
            return False 
        else:
            return True
923864
def raise_for_missing_namespace(self, line: str, position: int, namespace: str, name: str) -> None:
        """"""
        if not self.has_namespace(namespace):
            raise UndefinedNamespaceWarning(self.get_line_number(), line, position, namespace, name)
959457
def price_namespace( namespace_id, block_height, units ):
    
    price_table = get_epoch_namespace_prices( block_height, units )
    if price_table is None:
        return None

    if len(namespace_id) >= len(price_table) or len(namespace_id) == 0:
        return None

    return price_table[len(namespace_id)]
624276
def namespace(namespace = nil, options = {})
      return @namespace unless namespace

      @namespace      = namespace.to_sym if namespace
      @base_namespace = options[:base].to_sym if options[:base]
    end
530023
def skin_namespace_hash(options = {})
      { 
        :match   =>  options[:match] ? options[:match] : /[\/]/, 
        :replace =>  options[:replace] ? options[:replace] : "_", 
        :prefix  =>  options[:prefix] ? options[:prefix] : nil,
        :root    =>  options[:root] ? options[:root] : "root"
      }
    end