If ``number`` is None, returns a random member of set ``name``.

        If ``number`` is supplied, returns a list of ``number`` random
        memebers of set ``name``. Note this is only available when running
        Redis 2.6+.
965002
async def srandmember(self, name, number=None):
        
        args = number and [number] or []
        return await self.execute_command('SRANDMEMBER', name, *args)
358905
def random_sort(set)
      set.order do
        # this is a bit of a hack obviously, but it checks the sort of
        # data engine being used to figure out how to randomly sort
        if set.class.name !~ /mysql/i
          random.function
        else
          rand.function
        end
      end
    end
1248302
def name(random=random, *args, **kwargs):
    
    if random.choice([True, True, True, False]):
        return firstname(random=random) + " " + lastname(random=random)
    elif random.choice([True, False]):
        return title(random=random) + " " + firstname(random=random) + " " + lastname(random=random)
    else:
        return title(random=random) + " " + lastname(random=random)
400674
def _random(cls):
        
        pid = os.getpid()
        if pid != cls._pid:
            cls._pid = pid
            cls.__random = _random_bytes()
        return cls.__random
263302
def randhex(ndigits: int) -> str:
    
    if not isinstance(ndigits, int):
        raise TypeError('number of digits must be an integer')
    if ndigits <= 0:
        raise ValueError('number of digits must be greater than zero')

    nbytes = ceil(ndigits / 2)
    rbytes = random_randbytes(nbytes)
    hexstr = rbytes.hex()[:ndigits]

    return hexstr
766133
public static <T> Set<T> getRandomSubset(Set<T> set, int count) {
		Set<T> result = new HashSet<>();
		HashList<T> opSet = new HashList<>(set);
		while (result.size() < count) {
			int next = rand.nextInt(opSet.size());
			if (!result.contains(opSet.get(next))) {
				result.add(opSet.get(next));
			}
		}
		return result;
	}
426716
def query_random(num=6, kind='1'):
        '''
        
        '''
        return TabWiki.select().where(
            TabWiki.kind == kind
        ).order_by(
            peewee.fn.Random()
        ).limit(num)
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 ''
372545
def get_random_id(length):
    """"""
    alphabet = string.ascii_uppercase + string.ascii_lowercase + string.digits
    return ''.join(random.choice(alphabet) for _ in range(length))
1051333
private Name getNameObject(List<? extends Name> list, double probability) {
        int index = Collections.binarySearch(list, new Name(null, probability), locateNameByCumulativeProbability);
        if (index >= 0) {
            return list.get(index);
        } else if (-index > list.size()) {
            throw new RuntimeException("Invalid probability provided - (" + probability +
                    "). Max allowed for this list is " + getMax(list));
        } else {
            return list.get((-index) - 1);
        }
    }
805990
def llen(self, name):
        
        with self.pipe as pipe:
            return pipe.llen(self.redis_key(name))
43841
def get_random_integer(N, randfunc=None):
    
    if randfunc is None:
        randfunc = Random.new().read

    S = randfunc(N>>3)
    odd_bits = N % 8
    if odd_bits != 0:
        char = ord(randfunc(1)) >> (8-odd_bits)
        S = bchr(char) + S
    value = bytes_to_long(S)
    return value
1152860
def random_alphanum(length):
    
    charset = string.ascii_letters + string.digits
    return random_string(length, charset)
24813
def _find_set_members(set):
    '''
    
    '''

    cmd = '{0} list {1}'.format(_ipset_cmd(), set)
    out = __salt__['cmd.run_all'](cmd, python_shell=False)

    if out['retcode'] > 0:
        # Set doesn't exist return false
        return False

    _tmp = out['stdout'].split('\n')
    members = []
    startMembers = False
    for i in _tmp:
        if startMembers:
            members.append(i)
        if 'Members:' in i:
            startMembers = True
    return members
22513
def get_random_choice(self):    
        
        i = random.randint(0,len(self.dat)-1)
        return self.dat[i]['name']
230117
def getmember(self, name):
        '''
        
        '''
        members = self.getmembers()
        for m in members[::-1]:
            if m.name == name:
                return m

        raise KeyError("member %s could not be found" % name)
1220481
function randomNumber() {
  var min = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
  var max = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1000;

  return Math.floor(Math.random() * (max - min + 1)) + min;
}