Get the number of names in a namespace
        Return {'status': true, 'count': count} on success
        Return {'error': ...} on error
428427
def rpc_get_num_names_in_namespace( self, namespace_id, **con_info ):
        
        if not check_namespace(namespace_id):
            return {'error': 'Invalid name or namespace', 'http_status': 400}

        db = get_db_state(self.working_dir)
        num_names = db.get_num_names_in_namespace( namespace_id )
        db.close()

        return self.success_response( {'count': num_names} )
897013
def get_all_namespace_ids( self ):
        
        cur = self.db.cursor()
        namespace_ids = namedb_get_all_namespace_ids( cur )
        return namespace_ids
252397
def info(self):
        
        result = dict()
        for name, namespace in self._namespaces.items():
            result[name] = namespace.info_all()
        return result
888035
def count_waiting_jobs(cls, names):
        
        return sum([queue.waiting.llen() for queue in cls.get_all(names)])
89136
def GET_namespace_names( self, path_info, namespace_id ):
        
        if not check_namespace(namespace_id):
            return self._reply_json({'error': 'Invalid namespace'}, status_code=400)

        qs_values = path_info['qs_values']
        page = qs_values.get('page', None)
        if page is None:
            log.error("Page required")
            return self._reply_json({'error': 'page= argument required'}, status_code=400)

        try:
            page = int(page)
            if page < 0:
                raise ValueError()

        except ValueError:
            log.error("Invalid page")
            return self._reply_json({'error': 'Invalid page= value'}, status_code=400)

        offset = page * 100
        count = 100

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

        self._reply_json(namespace_names)
        return
1369660
def get_by_name(self, name, namespace=None):
        
        if not namespace:
            namespace, name = get_namespace_from_name(name)
        if not namespace:
            namespace = AuthConfigManager.get_access_token().username
        try:
            response = self.request('GET', '%s/%s/%s' % (self.url, namespace, name))
            return Dataset.from_dict(response.json())
        except NotFoundException:
            return None
782197
def getArgs(self, namespace):
        
        namespace = self._fixNS(namespace)
        return dict([
            (ns_key, value)
            for ((pair_ns, ns_key), value)
            in self.args.iteritems()
            if pair_ns == namespace
            ])
936935
def get_status(self):
        

        try:
            api_response = self.api.read_namespaced_service_status(self.name, self.namespace)
        except ApiException as e:
            raise ConuException(
                "Exception when calling Kubernetes API - read_namespaced_service_status: %s\n" % e)

        return api_response.status
90012
def get_count(self):
        
        params = self.get_params()
        params["offset"] = self.low_mark
        params["limit"] = 1

        r = self.resource._meta.api.http_resource("GET", self.resource._meta.resource_name, params=params)
        data = self.resource._meta.api.resource_deserialize(r.text)

        number = data["meta"]["total_count"]

        # Apply offset and limit constraints manually, since using limit/offset
        # in the API doesn't change the total_count output.
        number = max(0, number - self.low_mark)
        if self.high_mark is not None:
            number = min(number, self.high_mark - self.low_mark)

        return number
891329
def get_unique_name(self, obj, name='', name_from_system=''):
        
        ns = self.namespace
        newname = name
        if not newname:
            newname = name_from_system

        if not newname:
            newname = u"Nameless_" + obj.__class__.__name__

        if not newname in ns:
            return newname

        counter = 0
        while True:
            newname1 = u"%s_%.2d" % (newname, counter)
            if not newname1 in ns:
                return newname1
            counter += 1
1186706
def validate_nodes_count(namespace):
    """"""
    if namespace.min_count is not None:
        if namespace.min_count < 1 or namespace.min_count > 100:
            raise CLIError('--min-count must be in the range [1,100]')
    if namespace.max_count is not None:
        if namespace.max_count < 1 or namespace.max_count > 100:
            raise CLIError('--max-count must be in the range [1,100]')
1027472
def getCounts
      result = {}
      @classes.each do |c|
        count = 0
        ObjectSpace.each_object(c){ count += 1 }
        result[c] = count
      end
      result
    end
327832
def find_count_label(d):
    
    for name in COUNT_NAMES:
        if name in d:
            return name
    for name in COUNT_NAMES:
        if str(name).lower() in d:
            return name
102287
def collection_names
      namespaces = self["system.namespaces"].find(name: { "$not" => /#{name}\.system\.|\$/ })
      namespaces.map do |doc|
        _name = doc["name"]
        _name[name.length + 1, _name.length]
      end
    end
199246
def get(self):
        """"""
        namespaces = db.ConfigNamespace.order_by(
            ConfigNamespace.sort_order,
            ConfigNamespace.name
        ).all()

        return self.make_response({
            'message': None,
            'namespaces': namespaces
        }, HTTP.OK)
1297419
def get(self, namespacePrefix):
        """"""
        ns = db.ConfigNamespace.find_one(ConfigNamespace.namespace_prefix == namespacePrefix)
        if not ns:
            return self.make_response('No such namespace: {}'.format(namespacePrefix), HTTP.NOT_FOUND)

        return self.make_response({
            'message': None,
            'namespace': ns
        })
628346
def namedb_get_num_names_in_namespace( cur, namespace_id, current_block ):
    
    unexpired_query, unexpired_args = namedb_select_where_unexpired_names( current_block )

    query = "SELECT COUNT(name_records.name) FROM name_records JOIN namespaces ON name_records.namespace_id = namespaces.namespace_id WHERE name_records.namespace_id = ? AND " + unexpired_query + " ORDER BY name;"
    args = (namespace_id,) + unexpired_args

    num_rows = namedb_select_count_rows( cur, query, args, count_column='COUNT(name_records.name)' )
    return num_rows