Return zero or more names.
968221
def _zom_name(lexer):
    """"""
    tok = next(lexer)
    # '.' NAME ZOM_NAME
    if isinstance(tok, DOT):
        first = _expect_token(lexer, {NameToken}).value
        rest = _zom_name(lexer)
        return (first, ) + rest
    # null
    else:
        lexer.unpop_token(tok)
        return tuple()
1087042
def get_next_name(old, fmt='%i'):
    """"""
    nums = re.findall('\d+', old)
    if not nums:
        raise ValueError("Could not get the next name because the old name "
                         "has no numbers in it")
    num0 = nums[-1]
    num1 = str(int(num0) + 1)
    return old[::-1].replace(num0[::-1], num1[::-1], 1)[::-1]
407826
def get_names_in_namespace( self, namespace_id, offset=None, count=None ):
        
        if offset is not None and offset < 0:
            offset = None 

        if count is not None and count < 0:
            count = None 

        cur = self.db.cursor()
        names = namedb_get_names_in_namespace( cur, namespace_id, self.lastblock, offset=offset, count=count )
        return names
1264536
def name(cls):
        """"""
        name = cls.__name__.replace("_", "-").lower()
        name = name[4:] if name.startswith("cmd-") else name
        return name
842064
def _n(name):
    """"""
    n = name.encode('ascii', errors='ignore').decode('ascii')
    n = re.sub('[^A-Za-z0-9_]', '_', n)
    n = re.sub(r'(^[0-9].*)', r'p\1', n)
    return n
665299
def count(cls, name):
        """"""
        counter = cls.collection.find_one({'name': name}) or {}
        return counter.get('seq', 0)
396665
def _bare_name_matches(self, nodes):
        """"""
        count = 0
        r = {}
        done = False
        max = len(nodes)
        while not done and count < max:
            done = True
            for leaf in self.content:
                if leaf[0].match(nodes[count], r):
                    count += 1
                    done = False
                    break
        r[self.name] = nodes[:count]
        return count, r
507438
def _get_name_filters(cls, filters):
        """"""
        filters = filters.get(cls.__uid_field__)
        if not filters:
            filters = '.*'
        elif not isinstance(filters, string_types):
            filters = r'(%s)' % ('|'.join(filters))
        return filters
705983
def extract_name(self, data):
        """"""
        name = re.search('<h1[^>]*>(.+?)</h1>', data).group(1)
        name = re.sub(r'<([^>]+)>', r'', name)
        name = re.sub(r'&gt;', r'>', name)
        name = re.sub(r'&lt;', r'<', name)
        return name
453533
def get_name(self, seq=None):
        """"""
        if seq is not None:
            it = iter(seq)

            def get_next_token():
                return next(it)
        else:
            get_next_token = self._get_next_token

        next_token = get_next_token()
        tokens = []
        last_token_was_name = False
        while (next_token.token_type == tokenize.NAME or
               (next_token.token_type == tokenize.SYNTAX and
                next_token.name in ('::', '<'))):
            # Two NAMEs in a row means the identifier should terminate.
            # It's probably some sort of variable declaration.
            if last_token_was_name and next_token.token_type == tokenize.NAME:
                break
            last_token_was_name = next_token.token_type == tokenize.NAME
            tokens.append(next_token)
            # Handle templated names.
            if next_token.name == '<':
                tokens.extend(self._get_matching_char('<', '>',
                                                      get_next_token))
                last_token_was_name = True
            next_token = get_next_token()
        return tokens, next_token
724203
def p_namelist(self,t):
    ""
    if len(t)==2: t[0] = [t[1]]
    elif len(t)==4: t[0] = t[1] + [t[3]]
    else: raise NotImplementedError('unk_len',len(t)) # pragma: no cover
560376
def _get_more(collection_name, num_to_return, cursor_id):
    """"""
    return b"".join([
        _ZERO_32,
        _make_c_string(collection_name),
        _pack_int(num_to_return),
        _pack_long_long(cursor_id)])
41573
def ids(self):
        """"""
        as_list = [seq.description.split()[0] for seq in self]
        as_set = frozenset(as_list)
        assert len(as_set) == len(as_list)
        return as_set
672304
def _names(lexer):
    """"""
    first = _expect_token(lexer, {NameToken}).value
    rest = _zom_name(lexer)
    rnames = (first, ) + rest
    return rnames[::-1]
446345
def _get_dsnames(cls, data, ignore_keys=['attrs', 'plotter', 'ds'],
                     concat_dim=False):
        """"""
        def filter_ignores(item):
            return item[0] not in ignore_keys and isinstance(item[1], dict)
        if 'fname' in data:
            return {tuple(
                [data['fname'], data['store']] +
                ([data.get('concat_dim')] if concat_dim else []))}
        return set(chain(*map(partial(cls._get_dsnames, concat_dim=concat_dim,
                                      ignore_keys=ignore_keys),
                              dict(filter(filter_ignores,
                                          six.iteritems(data))).values())))
384891
def nvalues(self):
        """"""
        if self._nvalues is None:
            self._nvalues = 0
            for val in self.values:
                if type(val) == type(int):
                    self._nvalues += val
                else:
                    self._nvalues = -1
                    break

        return self._nvalues
620933
def lookup_name_slow(self, name):
        """"""

        for index in xrange(self.__get_count_cached()):
            if self.__get_name_cached(index) == name:
                return self.__get_info_cached(index)