Generate a key from one or more values.
777991
def gen_key(self, *values):
        """"""
        key = md5()
        KeyGen._recursive_convert(values, key)
        return key.hexdigest()
487222
def value(self, key, value=1):
        """"""
        if isinstance(key, six.string_types):
            key = (key, )
        # assert all(isinstance(k, six.string_types) for k in key)
        assert isinstance(key, tuple), "event key type error"
        if key not in self.counters:
            self.counters[key] = self.cls()
        self.counters[key].value(value)
        return self
668116
def gen_key_input(self, key_params={}):
        '''
        
        '''
        params = self.default_key_params.copy()
        params.update(key_params)
        result = ['Key-Type: %s' % params.pop('Key-Type')]
        result += ('%s: %s' % (param, value) for param, value in params.items())
        result.append('%commit\n')
        return '\n'.join(result)
569901
def hmset(self, key, field, value, *pairs):
        """"""
        if len(pairs) % 2 != 0:
            raise TypeError("length of pairs must be even number")
        return wait_ok(self.execute(b'HMSET', key, field, value, *pairs))
1138166
def pkeys(self,parent,field):
    ""
    template=[(parent[k] if k is not None else None) for k in self.pkey]
    inull=template.index(None)
    def mk(x):
      "helper for constructing pkey tuples in a list comp"
      template[inull]=x
      return tuple(template)
    val=parent[field]
    if self.getter is not None: return map(mk,self.getter(val))
    elif isinstance(val,VDList): return map(mk,val.generate())
    else: raise NotImplementedError(type(val))
463639
def massage_keys(keys):
    """"""
    m_keys = []
    for key in keys:
        if key.startswith('keybase:'):
            m_keys.append(cryptorito.key_from_keybase(key[8:])['fingerprint'])
        else:
            m_keys.append(key)

    return m_keys
59017
function slice(source, keys){
    var result = {};

    if (!keys)
      return extend(result, source);

    for (var i = 0, key; key = keys[i++];)
      if (key in source)
        result[key] = source[key];

    return result;
  }
814474
def make_key(self, key, version=None):
        """"""
        return '{}:{}:{}'.format(
            self.prefix,
            version or self.version,
            key,
        )
651892
def fromkeys(cls, iterable, value, **kwargs):
        
        return cls(((k, value) for k in iterable), **kwargs)
1089036
def _batch_key(self, query):
    '''
    
    '''
    return ''.join( ['%s%s'%(k,v) for k,v in sorted(query.items())] )
77282
def get_single_key(d):
    """"""
    assert len(d) == 1, 'Single-item dict must have just one item, not %d.' % len(d)
    return next(six.iterkeys(d))
105169
def fromkeys(cls, seq, v=None):
        """"""

        return super(HeaderDict, cls).fromkeys(cls,
                                               [s.title() for s in seq], v)
1100143
def _keys2sls(self, keys, key2sl):
        """"""
        sls = list()
        if isinstance(keys, tuple):
            for key in keys:
                sls.append(key2sl(key))
        else:
            sls.append(key2sl(keys))
        if len(sls) > self.ndim:
            fstr = "expected <= {0.ndim} slice dimensions, got {1}"
            raise ValueError(fstr.format(self, len(sls)))
        return sls
527460
def from_dict(cls, d):
        """"""
        return cls(**{k: v for k, v in d.items() if k in cls.ENTRIES})
168311
def normalise_key(self, key):
        """"""
        key = key.replace('-', '_')
        if key.startswith("noy_"):
            key = key[4:]
        return key
1256039
private static String generateKey(int num) {
        Random random = new Random();
        String key = "";

        for (int x = 0; x < num; x++) {
            key += CHARACTERS[random.nextInt(CHARACTERS.length)];
        }
        return key;
    }
1354340
def create_keys_in():
    
    keys = Group(
        Optional(Suppress("("))
        + value
        + Optional(Suppress(",") + value)
        + Optional(Suppress(")"))
    )
    return (Suppress(upkey("keys") + upkey("in")) + delimitedList(keys)).setResultsName(
        "keys_in"
    )