Simulate a random sequence with name and size
433579
def simulate_one(fw, name, size):
    
    from random import choice
    seq = Seq(''.join(choice('ACGT') for _ in xrange(size)))
    s = SeqRecord(seq, id=name, description="Fake sequence")
    SeqIO.write([s], fw, "fasta")
1141384
def _random(self, key):
        """"""

        if hasattr(key, "encode"):
            key = key.encode('ascii')

        value = (zlib.crc32(key, self.seed) & MAX_VALUE)

        return value * INV_MAX_VALUE
750014
def random_flip(sequence,rnum=None):
  """"""
  randin = rnum
  if not randin: randin = RandomSource()
  if randin.random() < 0.5:
    return rc(sequence)
  return sequence
1334960
def random_str(size=10):
    
    return ''.join(random.choice(string.ascii_lowercase) for _ in range(size))
694444
def simulate(self):
        
        min_ = 1 if self._min is None else self._min
        max_ = 10 if self._max is None else self._max
        n = min_ if (min_ >= max_) else random.randint(min_, max_)
        chars = string.ascii_letters + string.digits
        return ''.join(random.choice(chars) for x in range(n))
407197
def random_normal(attrs, inputs, proto_obj):
    """"""
    try:
        from onnx.mapping import TENSOR_TYPE_TO_NP_TYPE
    except ImportError:
        raise ImportError("Onnx and protobuf need to be installed. "
                          "Instructions to install - https://github.com/onnx/onnx")
    new_attr = translation_utils._remove_attributes(attrs, ['seed'])
    new_attr = translation_utils._fix_attribute_names(new_attr, {'mean': 'loc'})
    new_attr['dtype'] = TENSOR_TYPE_TO_NP_TYPE[int(new_attr.get('dtype', 1))]
    return 'random_normal', new_attr, inputs
470316
async def random(offset=0., width=1., interval=0.1):
    """"""
    while True:
        await asyncio.sleep(interval)
        yield offset + width * random_module.random()
589221
def make_random(cls):
        """"""
        self = object.__new__(cls)
        self.rank = Rank.make_random()
        self.suit = Suit.make_random()
        return self
873775
def random_string(len)
      rand_max = RAND_CHARS.bytesize
      ret = ""
      len.times{ ret << RAND_CHARS[rand(rand_max)] }
      ret
    end
877883
def generator(self, random, args):
        """"""
        locations = [i for i in range(len(self.weights))]
        random.shuffle(locations)
        return locations
1180963
def _sample(rng, arr, k):
  
  selected = numpy.empty(k, dtype="uint32")
  rng.sample(numpy.asarray(arr, dtype="uint32"),
             selected)
  return selected
872063
def _sampleRange(rng, start, end, step, k):
  
  array = numpy.empty(k, dtype="uint32")
  rng.sample(numpy.arange(start, end, step, dtype="uint32"), array)
  return array
1024286
def simulate(self):
        """"""
        # Simulates zero to 10 types
        return [t.simulate() for t in itertools.islice(self, random.choice(range(10)))]
52361
def random_samples(self, n):
        
        samples = self.samples
        inds = rand.randint(len(samples),size=int(n))

        newsamples = samples.iloc[inds]
        newsamples.reset_index(inplace=True)
        return newsamples
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
190597
def create(width, height, padding=0, padding_mode='constant', mode='x', tags=None):
    
    return RandomCrop(size=(width, height), padding=padding, padding_mode=padding_mode, mode=mode, tags=tags)
590913
def random_string(string_length=10):
    """"""
    random = str(uuid.uuid4())  # Convert UUID format to a Python string.
    random = random.upper()  # Make all characters uppercase.
    random = random.replace("-", "")  # Remove the UUID '-'.
    return random[0:string_length]