Creates and returns random generator point that satisfy BLS algorithm requirements.
        :return: BLS generator
357996
def new(cls) -> 'Generator':
        
        logger = logging.getLogger(__name__)
        logger.debug("Generator::new: >>>")

        c_instance = c_void_p()
        do_call(cls.new_handler, byref(c_instance))

        res = cls(c_instance)

        logger.debug("Generator::new: <<< res: %r", res)
        return res
1354760
def _create_random_layer(self):
        """"""

        return RandomLayer(n_hidden=self.n_hidden,
                           alpha=self.alpha,
                           random_state=self.random_state,
                           activation_func=self.activation_func,
                           activation_args=self.activation_args,
                           user_components=self.user_components,
                           rbf_width=self.rbf_width)
1336549
def random_draw(self, size=None):
        
        return scipy.asarray([scipy.stats.norm.rvs(loc=m, scale=s, size=size) for s, m in zip(self.sigma, self.mu)])
219587
def random_draw(self, size=None):
        
        return scipy.asarray([numpy.random.uniform(low=b[0], high=b[1], size=size) for b in self.bounds])
857847
def create_default_bls_bft_factory(node):
    '''
    
    '''
    bls_keys_dir = os.path.join(node.keys_dir, node.name)
    bls_crypto_factory = create_default_bls_crypto_factory(bls_keys_dir)
    return BlsFactoryBftPlenum(bls_crypto_factory, node)
1023246
def random_rotation():
        
        rand_seed = np.random.rand(3, 3)
        U, S, V = np.linalg.svd(rand_seed)
        return U
1005779
def generate(self):
        
        random_data = os.urandom(100)

        hash_gen = hashlib.new("sha512")
        hash_gen.update(random_data)

        return hash_gen.hexdigest()[:self.token_length]
29907
def _create_genetic_expander(problem, mutation_chance):
    '''
    
    '''
    def _expander(fringe, iteration, viewer):
        fitness = [x.value for x in fringe]
        sampler = InverseTransformSampler(fitness, fringe)
        new_generation = []

        expanded_nodes = []
        expanded_neighbors = []

        for _ in fringe:
            node1 = sampler.sample()
            node2 = sampler.sample()
            child = problem.crossover(node1.state, node2.state)
            action = 'crossover'
            if random.random() < mutation_chance:
                # Noooouuu! she is... he is... *IT* is a mutant!
                child = problem.mutate(child)
                action += '+mutation'

            child_node = SearchNodeValueOrdered(state=child, problem=problem, action=action)
            new_generation.append(child_node)

            expanded_nodes.append(node1)
            expanded_neighbors.append([child_node])
            expanded_nodes.append(node2)
            expanded_neighbors.append([child_node])

        if viewer:
            viewer.event('expanded', expanded_nodes, expanded_neighbors)

        fringe.clear()
        for node in new_generation:
            fringe.append(node)

    return _expander
168115
def random_draw(self, size=None):
        
        return scipy.asarray([scipy.stats.gamma.rvs(a, loc=0, scale=1.0 / b, size=size) for a, b in zip(self.a, self.b)])
1036500
def generate(self):
        '''
        
        '''
        generated_arr = np.random.normal(loc=self.__mu, scale=self.__sigma, size=self.__output_shape)
        if self.noise_sampler is not None:
            self.noise_sampler.output_shape = generated_arr.shape
            generated_arr += self.noise_sampler.generate()
        
        return generated_arr
1371213
def create_random_ind_grow(self, depth=0):
        ""
        lst = []
        self._depth = depth
        self._create_random_ind_grow(depth=depth, output=lst)
        return lst
488400
function generator(seed) {
    // Note: the generator didn't work with negative seed values, so here we
    // transform our original seed into a new (positive) seed value with which we
    // create a new generator.
    if (seed < 0) {
        var gen = generator(Math.abs(seed));
        for (var i = 0; i < 23; i += 1) {
            gen();
        }
        return generator(gen(0, 10000));
    }

    // Based on random number generator from
    // http://indiegamr.com/generate-repeatable-random-numbers-in-js/
    return function (min, max) {
        min = min || 0;
        max = max || 1;
        seed = (seed * 9301 + 49297) % 233280;
        var v = seed / 233280;
        return min + v * (max - min);
    };
}
240645
def draw(self):
        '''
        
        '''
        return np.random.uniform(loc=self.__low, scale=self.__high, size=self.__output_shape)
860048
def get_generator(self):
        
        s = self.slice
        gen = drange(s.start, s.stop, s.step) # intialises the generator
        return gen
159596
def get_random(min_pt, max_pt):
        """"""
        result = Point(random.random(), random.random())
        return result.get_component_product(max_pt - min_pt) + min_pt
1333177
def cycle_generator(cycle, step=1, begin=(0, 0), end=None):
    '''
        
    '''
    (cycle_begin, cycle_end) = cycle
    (major, minor) = begin
    (end_major, end_minor) = end if end is not None else (None, None)

    while True:
        if end is not None and (major > end_major or (major == end_major and minor > end_minor)):
            return
        yield (major, minor)
        minor += step
        if minor > cycle_end:
            major += 1
            minor = cycle_begin
201020
def generate_token(self, *args, **kwargs):
        
        # determine the length based on min_length and max_length
        length = random.randint(self.min_length, self.max_length)

        # generate the token using os.urandom and hexlify
        return binascii.hexlify(
            os.urandom(self.max_length)
        ).decode()[0:length]