Returns a random entry from a list of things
506655
def choose_one(things):
    """"""
    choice = SystemRandom().randint(0, len(things) - 1)
    return things[choice].strip()
1134940
def get_random_theme(dark=True):
    """"""
    themes = [theme.path for theme in list_themes(dark)]
    random.shuffle(themes)
    return themes[0]
537855
def generator(self, random, args):
        """"""
        if self.duplicates:
            max_count = [self.capacity // item[0] for item in self.items]
            return [random.randint(0, m) for m in max_count]
        else:
            return [random.choice([0, 1]) for _ in range(len(self.items))]
318209
def _get_random_name(name_list):
        
        length = len(name_list)
        index = random.randrange(length)

        return name_list[index]['name']
201487
def randstring(l):
    
    return b"".join(struct.pack('B', random.randint(0, 255)) for _ in range(l))
940759
def findentry(self, item):
        """"""
        if not isinstance(item, str):
            raise TypeError(
                'Members of this object must be strings. '
                'You supplied \"%s\"' % type(item))
        for entry in self:
            if item.lower() == entry.lower():
                return entry
        return None
1084567
public static <T> T randomEle(List<T> list) {
		return randomEle(list, list.size());
	}
1285526
def random_list_elem(str_list):
        
        if isinstance(str_list, list):
            for elem in str_list:
                if not isinstance(elem, str):
                    raise TypeError("list element can only be string")
            return SeedString(random.choice(str_list))
        return None
1100828
def generate(self, N, *, seed=None, progressbar=False):
        
        if seed is not None:
            self.reset(seed)
        items = islice(self, N)
        if progressbar:
            items = tqdm(items, total=N)

        item_list = [x for x in items]

        #logger.warning("TODO: initialise ItemList with random seed!")
        return ItemList(item_list, N)
12488
def random_letters(count):
    """"""
    rv = random.choice(string.ascii_uppercase)
    while len(rv) < count:
        l = random.choice(string.ascii_uppercase)
        if not l in rv:
            rv += l
    return rv
404917
public static <T> /* @Nullable */ T random(final @NonNull Random random, final @NonNull Iterable<T> iterable, final @NonNull Collection<T> allowed) {
    return random(random, Iterables.filter(iterable, allowed::contains));
  }
902720
def p_fromitem_list(self,t):
    
    if len(t)==2: t[0] = [t[1]]
    elif len(t)==4: t[0] = t[1] + [t[3]]
    else: raise NotImplementedError('unk_len', len(t)) # pragma: no cover
426716
def query_random(num=6, kind='1'):
        '''
        
        '''
        return TabWiki.select().where(
            TabWiki.kind == kind
        ).order_by(
            peewee.fn.Random()
        ).limit(num)
902492
def generate_random_table(self):
        
        table = list(range(0, self.n))
        random.shuffle(table)
        return table
777011
function Random(opts) {
    Readable.apply(this, arguments);

    if (opts && opts.objectMode) {
        this.objectMode = true;
    }

    this.dictionary = ['1', '0'];
}
946009
def _random_x(self):
        """"""
        return (tuple(random.random() for _ in range(self.fmodel.dim_x)),)
764858
def do_random(context, seq):
    """"""
    try:
        return random.choice(seq)
    except IndexError:
        return context.environment.undefined('No random item, sequence was empty.')