-> #str result of :func:gen_rand_str
514312
def randstr(self):
        
        return gen_rand_str(
            4, 10, use=self.random, keyspace=list(string.ascii_letters))
364001
def _gen_sample(self):
        
        num_str = self.get_rand(self.num_digit_min, self.num_digit_max)
        return self.captcha.image(num_str), num_str
970334
def _ha_gen_method(func):
        '''  '''
        def wrapped(self, *args, **kw):
            self._reset_retries()
            while(True): # switch between all namenodes
                try:
                    results = func(self, *args, **kw)
                    while(True): # yield all results
                        yield results.next()
                except RequestError as e:
                    self.__handle_request_error(e)
                except socket.error as e:
                    self.__handle_socket_error(e)
        return wrapped
400674
def _random(cls):
        
        pid = os.getpid()
        if pid != cls._pid:
            cls._pid = pid
            cls.__random = _random_bytes()
        return cls.__random
1037668
def _random_string():
    
    rng = random.SystemRandom()
    token_value = u''.join(rng.choice(CHARSET) for _ in range(CHAR_GROUPS * CHARS_PER_GROUP))
    if CHARS_PER_GROUP > 1:
        return GROUP_SEP.join(map(u''.join, zip(*[iter(token_value)] * CHARS_PER_GROUP)))
    else:
        return token_value
1116890
def generate(self):
        '''
        
        '''
        generated_arr = np.random.uniform(
            low=0.1,
            high=0.9,
            size=((self.__batch_size, self.__seq_len, self.__dim))
        )

        if self.noise_sampler is not None:
            self.noise_sampler.output_shape = generated_arr.shape
            generated_arr += self.noise_sampler.generate()

        return generated_arr
1209509
def Random(self):
        
        p = numpy.random.gamma(self.params)
        return p / p.sum()
954688
def resample(self,N):
        
        return rand.random(size=N)*(self.maxval - self.minval) + self.minval
1273853
def get_rng(obj=None):
    
    seed = (id(obj) + os.getpid() +
            int(datetime.now().strftime("%Y%m%d%H%M%S%f"))) % 4294967295
    if _RNG_SEED is not None:
        seed = _RNG_SEED
    return np.random.RandomState(seed)
683468
def random(self):
        
        utc_now = datetime.datetime.utcnow()
        return self.valueFromString(utc_now.strftime(self.defaultFormat()))
442149
def rand_str(allowed, length):
    
    if (not isinstance(length, int)) or (length <= 0):
        raise Exception("length parameter has to be an integer greater than 0!")
    
    res = list()
    for _ in range(length):
        res.append(random.choice(allowed))
    return "".join(res)
1251693
function randNum (n) {
  let sNum = ''
  for (let i = 0; i < n; i++) {
    sNum += tools.rnd(0, 9)
  }
  return sNum
}
1235800
def rand_unicode(min_char=MIN_UNICHR, max_char=MAX_UNICHR, min_len=MIN_STRLEN,
                 max_len=MAX_STRLEN, **kwargs):
    '''
    '''
    from syn.five import unichr
    return unicode(rand_str(min_char, max_char, min_len, max_len, unichr))
246230
function genUID(len){
    function base36(val){
      return Math.round(val).toString(36);
    }

    // uid should starts with alpha
    var result = base36(10 + 25 * Math.random());

    if (!len)
      len = 16;

    while (result.length < len)
      result += base36(new Date * Math.random());

    return result.substr(0, len);
  }
946009
def _random_x(self):
        """"""
        return (tuple(random.random() for _ in range(self.fmodel.dim_x)),)
853492
def repr_return(func):
    

    def repr_return_decorator(*args, **kwargs):
        ret = func(*args, **kwargs)
        if isinstance(ret, basestring):
            return ret

        if type(ret) in repr_map:
            return repr_map[type(ret)](ret)

        print('=' * 80 + '\n' +
              ' FAILED TO GET REPR RETURN for type (' +
              str(type(ret)) + '\n' + '=' * 80)

        return ret

    return repr_return_decorator
336090
def gen_repr(cls, template, *args, **kwargs):
    """"""
    buf = io.StringIO()
    buf.write(u'<')
    buf.write(cls.__module__.decode() if kwargs.pop('full', False) else u'etc')
    buf.write(u'.')
    buf.write(cls.__name__.decode())
    if not kwargs.pop('dense', False):
        buf.write(u' ')
    buf.write(template.format(*args, **kwargs))
    options = kwargs.pop('options', [])
    for attr, value in options:
        if value is not None:
            buf.write(u' %s=%s' % (attr, value))
    buf.write(u'>')
    return buf.getvalue()