Return a random item from the sequence.
764858
def do_random(context, seq):
    """"""
    try:
        return random.choice(seq)
    except IndexError:
        return context.environment.undefined('No random item, sequence was empty.')
220737
def random(self, n: Optional[int] = None) -> Union[List[float], float]:
        
        return self._generate_randoms(self._request_randoms, max_n=self.config.MAX_NUMBER_OF_FLOATS,
                                      n=n)
750014
def random_flip(sequence,rnum=None):
  """"""
  randin = rnum
  if not randin: randin = RandomSource()
  if randin.random() < 0.5:
    return rc(sequence)
  return sequence
796785
def _choice(rand_gen: Callable[[], float], sequence: Sequence[T]) -> T:
    
    return sequence[int(rand_gen() * len(sequence))]
485626
def randomize(length=6, choices=None):
    """"""
    if type(choices) == str:
        choices = list(choices)
    choices = choices or ascii_lowercase
    return "".join(choice(choices) for _ in range(length))
400674
def _random(cls):
        
        pid = os.getpid()
        if pid != cls._pid:
            cls._pid = pid
            cls.__random = _random_bytes()
        return cls.__random
217486
def from_sequence(cls, seq):
        
        args = tuple(islice(seq, 4))
        if len(args) > 3:
            raise ValueError('When creating a Point from sequence, it '
                             'must not have more than 3 items.')
        return cls(*args)
1261899
def shuffle_sattolo(items):
    """"""
    _randrange = random.randrange
    for i in reversed(range(1, len(items))):
        j = _randrange(i)  # 0 <= j < i
        items[j], items[i] = items[i], items[j]
470316
async def random(offset=0., width=1., interval=0.1):
    """"""
    while True:
        await asyncio.sleep(interval)
        yield offset + width * random_module.random()
654032
public static Ordering shuffledBy(final Random random) {
        return new Ordering() {
            @Override
            boolean validateOrderingIsCorrect() {
                return false;
            }

            @Override
            protected List<Description> orderItems(Collection<Description> descriptions) {
                List<Description> shuffled = new ArrayList<Description>(descriptions);
                Collections.shuffle(shuffled, random);
                return shuffled;
            }
        };
    }
833291
def random_letter(self):
        """"""
        return self.generator.random.choice(
            getattr(string, 'letters', string.ascii_letters))
951557
public static <T> /* @Nullable */ T random(final @NonNull Random random, final @NonNull Iterable<T> iterable) {
    final int size = Iterables.size(iterable);
    if(size == 0) {
      throw new IndexOutOfBoundsException("cannot get random value from empty iterable");
    }
    final int index = random.nextInt(size);
    return Iterables.get(iterable, index);
  }
445376
def get_item(self, sequence_id, position):
        
        return self.from_record(self.get_record(sequence_id, position))
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));
  }
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
372545
def get_random_id(length):
    """"""
    alphabet = string.ascii_uppercase + string.ascii_lowercase + string.digits
    return ''.join(random.choice(alphabet) for _ in range(length))
452843
def random(length: int = 8, chars: str = digits + ascii_lowercase) -> Iterator[str]:
    
    while True:
        yield "".join([choice(chars) for _ in range(length)])