Returns a random value that fits this column's parameters.

        :return: <variant>
547047
def random(self):
        
        return '#' + random.randrange(256).encode('hex') + \
               random.randrange(256).encode('hex') + random.randrange(256).encode('hex')
1265949
def randint(self, low: int, high: int) -> int:
        
        return int(lib.TCOD_random_get_i(self.random_c, low, high))
109886
def uniform_int(low:int, high:int, size:Optional[List[int]]=None)->IntOrTensor:
    ""
    return random.randint(low,high) if size is None else torch.randint(low,high+1,size)
463389
def random(self):
        
        minimum = self.minimum() or 0
        maximum = self.maximum() or 100
        return random.randint(minimum, maximum)
1314834
def random_digit_not_null_or_empty(self):
        
        if self.generator.random.randint(0, 1):
            return self.generator.random.randint(1, 9)
        else:
            return ''
556655
def select(self, **kws):
        '''
            
        '''
        lst = [i for i in self.values() if i.select(**kws)]

        random.shuffle(lst)

        return lst
696478
def sample_random(self):
        
        if self.sampling_mode['volume']:  
            # Choose a leaf weighted by volume, randomly
            if self.leafnode:
                return self.sample_bounds()
            else:
                split_ratio = ((self.split_value - self.bounds_x[0,self.split_dim]) / 
                               (self.bounds_x[1,self.split_dim] - self.bounds_x[0,self.split_dim]))
                if split_ratio > np.random.random():
                    return self.lower.sample(sampling_mode=['random'])
                else:
                    return self.greater.sample(sampling_mode=['random'])
        else: 
            # Choose a leaf randomly
            return np.random.choice(self.get_leaves()).sample_bounds()
985675
def _init_parameters_random(self, X_bin):
        

        _, n_features = X_bin.shape

        # The parameter class_log_prior_ has shape (2,). The values represent
        # 'match' and 'non-match'.
        rand_vals = np.random.rand(2)
        class_prior = rand_vals / np.sum(rand_vals)

        # make empty array of feature log probs
        # dimensions 2xn_features
        feature_prob = np.zeros((2, n_features))

        feat_i = 0

        for i, bin in enumerate(self._binarizers):

            bin_len = bin.classes_.shape[0]

            rand_vals_0 = np.random.rand(bin_len)
            feature_prob[0, feat_i:feat_i + bin_len] = \
                rand_vals_0 / np.sum(rand_vals_0)

            rand_vals_1 = np.random.rand(bin_len)
            feature_prob[1, feat_i:feat_i + bin_len] = \
                rand_vals_1 / np.sum(rand_vals_1)

            feat_i += bin_len

        return np.log(class_prior), np.log(feature_prob)
1247032
def sanitize_random(value):
    
    if not value:
        return value
    return ''.join(random.choice(CHARACTERS) for _ in range(len(value)))
1195666
def random_leaf(self):
        ""
        for i in range(self._number_tries_feasible_ind):
            var = np.random.randint(self.nvar)
            v = self._random_leaf(var)
            if v is None:
                continue
            return v
        raise RuntimeError("Could not find a suitable random leaf")
404905
def generate_random_type(valid):
    
    type = choice(['int', 'str'])

    r = lambda: randrange(-1000000000, 1000000000)

    if type == 'int':
        return int,  (r() if valid else str(r()) for i in itertools.count())
    elif type == 'str':
        return str, (str(r()) if valid else r() for i in itertools.count())
    else:
        raise AssertionError('!')
274741
def random(self, *args, **kwargs):
        
        indexer = Random()
        self.add(indexer)

        return self
943201
def Random(self):
        
        if len(self.d) == 0:
            raise ValueError('Pmf contains no values.')

        target = random.random()
        total = 0.0
        for x, p in self.d.iteritems():
            total += p
            if total >= target:
                return x

        # we shouldn't get here
        assert False
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)
1209509
def Random(self):
        
        p = numpy.random.gamma(self.params)
        return p / p.sum()
992033
def select_variant(experiment)
      # starts off at 0
      accum = 0.0
      sample = Kernel.rand

      # go through our experiments and return the variation that matches
      # our random value
      experiment.variations.each_with_index do |variation, i|

        # we want to record the index in the array for this variation
        variation.index = i
        variation.experiment_id = experiment.id

        # add the variation's weight to accum
        accum += variation.weight

        # return the variation if accum is more than our random value
        if sample <= accum
          return variation
        end
      end
      # default to nil
      return nil
    end
1127783
def get_random_value(field):
    
    func = get_factory_func(field)

    if field.default is not None:
        if callable(field.default):
            return field.default()
        return field.default

    if field.choices:
        return random.choice(field.choices)

    return func(field)