Get a namespace reveal, and optionally its history, given its namespace ID.
    Only return a namespace record if:
    * it is not ready
    * it is not expired
484583
def namedb_get_namespace_reveal( cur, namespace_id, current_block, include_history=True ):
    

    select_query = "SELECT * FROM namespaces WHERE namespace_id = ? AND op = ? AND reveal_block <= ? AND ? < reveal_block + ?;"
    args = (namespace_id, NAMESPACE_REVEAL, current_block, current_block, NAMESPACE_REVEAL_EXPIRE)

    namespace_reveal_rows = namedb_query_execute( cur, select_query, args )

    namespace_reveal_row = namespace_reveal_rows.fetchone()
    if namespace_reveal_row is None:
        # no such reveal 
        return None 

    reveal_rec = {}
    reveal_rec.update( namespace_reveal_row )

    if include_history:
        hist = namedb_get_history( cur, namespace_id )
        reveal_rec['history'] = hist
    
    reveal_rec = op_decanonicalize('NAMESPACE_REVEAL', reveal_rec)
    return reveal_rec
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
1046802
function(namespace, handler) {
            if (Logger.namespaces[namespace] == null) {
                Logger.namespaces[namespace] = new Logger({
                    namespace: namespace,
                    handler: handler
                });
            }
            return Logger.namespaces[namespace];
        }
796184
def get_all_revealed_namespace_ids( self ):
        
        cur = self.db.cursor()
        namespace_ids = namedb_get_all_revealed_namespace_ids( cur, self.lastblock )
        return namespace_ids
942796
def namespace(self):
        
        if self.prefix is None:
            return Namespace.default
        else:
            return self.resolvePrefix(self.prefix)
301496
def namedb_namespace_fields_check( namespace_rec ):
    

    assert namespace_rec.has_key('namespace_id'), "BUG: namespace record has no ID"
    assert namespace_rec.has_key('buckets'), 'BUG: missing price buckets'
    assert isinstance(namespace_rec['buckets'], str), 'BUG: namespace data is not in canonical form'

    return namespace_rec
304562
public DatanodeProtocol getNSNamenode(int namespaceId) throws IOException {
    NamespaceService nsos = namespaceManager.get(namespaceId);
    if(nsos == null || nsos.getDatanodeProtocol() == null) {
      throw new IOException("cannot find a namnode proxy for namespaceId=" + namespaceId);
    }
    return nsos.getDatanodeProtocol();
  }
848143
def get_num_names_in_namespace( self, namespace_id ):
        
        cur = self.db.cursor()
        return namedb_get_num_names_in_namespace( cur, namespace_id, self.lastblock )
880314
def is_namespace_preordered( self, namespace_id_hash ):
        
        namespace_preorder = self.get_namespace_preorder(namespace_id_hash)
        if namespace_preorder is None:
            return False 
        else:
            return True
907634
def namedb_namespace_insert( cur, input_namespace_rec ):
    

    namespace_rec = copy.deepcopy( input_namespace_rec )

    namedb_namespace_fields_check( namespace_rec )

    try:
        query, values = namedb_insert_prepare( cur, namespace_rec, "namespaces" )
    except Exception, e:
        log.exception(e)
        log.error("FATAL: Failed to insert revealed namespace '%s'" % namespace_rec['namespace_id']) 
        os.abort()

    namedb_query_execute( cur, query, values )
    return True
521941
def get_instance namespace, classname=nil, properties={}
    case namespace
    when Openwsman::ObjectPath
      classname = namespace.classname
      properties = namespace.properties
      namespace = namespace.namespace
      uri = epr_uri_for(namespace, classname)
    when Openwsman::EndPointReference
      namespace.each do |k,v|
        properties[k] = v
      end
      classname = namespace.classname
      uri = namespace.resource_uri
      namespace = namespace.namespace
    else
      uri = epr_uri_for(namespace, classname)
    end
    @options.set_dump_request if Wbem.debug
    @options.cim_namespace = namespace if @product == :openwsman
    @options.selectors = properties unless properties.empty?
    STDERR.puts "@client.get(namepace '#{@options.cim_namespace}', props #{properties.inspect}, uri #{uri}" if Wbem.debug
    res = @client.get(@options, uri)
    raise Openwsman::Exception.new res if res.fault?
    Wbem::Instance.new self, Openwsman::EndPointReference.new(uri, "", properties), res
  end
596936
def get_namespace(self, name_seq):
        
        namespaces = self.namespaces
        result = []
        for name in name_seq:
            namespaces = namespaces.get(name)
            if not namespaces:
                break
            result.append(name)
        return result
390850
def namespace_uri(self):
        
        try:
            return next(
                iter(filter(lambda uri: URI(uri).namespace, self._uri))
            )
        except StopIteration:
            return None
1009893
def is_namespace_revealed( self, namespace_id ):
        
        namespace_reveal = self.get_namespace_reveal( namespace_id )
        if namespace_reveal is not None:
            return True
        else:
            return False
816145
def backend_to_retrieve(self, namespace, stream):
    
    if namespace not in self.namespaces:
      raise NamespaceMissing('`{}` namespace is not configured'
                             .format(namespace))
    stream_prefix = self.get_matching_prefix(namespace, stream)
    read_backend = self.prefix_read_backends[namespace][stream_prefix]
    return (read_backend,
            self.prefix_confs[namespace][stream_prefix][read_backend])
896323
def _key_for_namespace(namespace, app):
  
  if namespace:
    return db.Key.from_path(metadata.Namespace.KIND_NAME,
                            namespace,
                            _app=app)
  else:
    return db.Key.from_path(metadata.Namespace.KIND_NAME,
                            metadata.Namespace.EMPTY_NAMESPACE_ID,
                            _app=app)
42627
def _extract_operation_and_namespace(self):
        
        split_tokens = self.split_tokens

        if not self._datetime_nextpos:
            # force evaluation of thread to get access to datetime_offset and
            # to protect from changes due to line truncation.
            _ = self.thread

        if not self._datetime_nextpos or (len(split_tokens) <=
                                          self._datetime_nextpos + 2):
            return

        op = split_tokens[self._datetime_nextpos + 1].lower()

        if op == 'warning:':
            # check if this log line got truncated
            if ("warning: log line attempted" in self._line_str and
                    "over max size" in self._line_str):
                self._datetime_nextpos = split_tokens.index('...')
                op = split_tokens[self._datetime_nextpos + 1]
            else:
                # unknown warning, bail out
                return

        if op in self.log_operations:
            self._operation = op
            self._namespace = split_tokens[self._datetime_nextpos + 2]