Returns a :class:`GramGenerator` that produces only keys.
487301
def keys(self):
        
        return GramGenerator(self.path, self.elem, keys=True,
                             ignore_hash=self.ignore_hash)
888703
def dict_of(**kwargs):
    

    class DictOfKeyGenerators(ArbitraryInterface):
        """
        A closure class around the keys and generators specified above, which
        generates a dict of the keys and generators.
        """

        @classmethod
        def arbitrary(cls):
            """
            Generate a dict of the enclosed keys and generators.
            """
            return {
                key: arbitrary(generator)
                for key, generator in kwargs.iteritems()
            }

    DictOfKeyGenerators.__name__ = ''.join([
        'dict_of(', ', '.join([
            key + '=' + generator.__name__
            for key, generator in kwargs.iteritems()
        ]), ')'
    ])
    return DictOfKeyGenerators
1055320
def asDict(self, returnIntegers=True):
        
        d = {}
        for k, v in self.items():
            d[k] = v if not returnIntegers else normalizers.normalizeRounding(v)
        return d
76152
def as_translation_key(self):
        
        return TranslationKey(**{
            name: getattr(self, name)
            for name in TranslationKey._fields})
780808
def recreate_grams(self):
        

        session = self.Session()

        for document in session.query(Document).all():
            logger.info(document.text)
            grams = self._get_grams(session, document.text, make=True)
            document.grams = list(grams)

        broken_links = session.query(Gram) \
            .filter(~Gram.documents.any()).all()
        for gram in broken_links:
            session.delete(gram)

        session.commit()
4
def key_to_kind(cls, key):
    
    if key.kind() == Kind.KIND_NAME:
      return key.id()
    else:
      return key.parent().id()
1274055
def keys(self):
        
        keys = ['text']
        keys.extend([n for (n, t, r) in self.c_attributes.values()])
        keys.extend([v[0] for v in self.c_children.values()])
        return keys
17951
def generate_terminals(grammar)
      terminals = [:$EOF]

      grammar.terminals.each do |term|
        terminals << term.name.to_sym
      end

      return terminals
    end
1033065
def gen_typedefs(self) -> str:
        
        rval = []
        for typ in self.schema.types.values():
            typname = self.python_name_for(typ.name)
            parent = self.python_name_for(typ.typeof)
            rval.append(f'class {typname}({parent}):\n\tpass')
        return '\n\n\n'.join(rval) + ('\n' if rval else '')
248454
def only(self, *keys):
        
        items = []

        for key, value in enumerate(self.items):
            if key in keys:
                items.append(value)

        return self.__class__(items)
1242258
def make_key(self, *parts):
        """"""
        separator = getattr(self.model_class, 'index_separator', '.')
        parts = map(decode, parts)
        return '%s%s' % (self._base_key, separator.join(map(str, parts)))
696203
def _get_generator(parser, extract, keep, check_maf):
    """"""
    if extract is not None:
        parser = Extractor(parser, names=extract)

    for data in parser.iter_genotypes():
        data.genotypes = data.genotypes[keep]

        # Checking the MAF, if required
        if check_maf:
            data.code_minor()

        yield data
654583
function simpleKeys (original) {
        return Object.keys(original).reduce(function (obj, key) {
          obj[key] = typeof original[key] === 'object' ? '{ ... }' : original[key];
          return obj;
        }, {});
      }
1094377
def _keygen(self, event, ts=None):
        
        return "%s:%s" % (self.namespace(ts or time.time()), event)
856966
def _get_subword_units(token, gram):
    
    if token == '</s>':  # special token for padding purpose.
        return [token]
    t = '#' + token + '#'
    return [t[i:i + gram] for i in range(0, len(t) - gram + 1)]
486437
def _keys(expr):
    
    if isinstance(expr, SequenceExpr):
        dtype = expr.data_type
    else:
        dtype = expr.value_type
    return composite_op(expr, DictKeys, df_types.List(dtype.key_type))
494020
def dictionary(self):
        
        output = {}
        for i in range(self.topLevelItemCount() - 1):
            item = self.topLevelItem(i)
            output[nativestring(item.text(1))] = nativestring(item.text(2))
        return output