get a random scan
760902
def getScans(self, modifications=True, fdr=True):
        
        if not self.scans:
            for i in self:
                yield i
        else:
            for i in self.scans.values():
                yield i
        yield None
168115
def random_draw(self, size=None):
        
        return scipy.asarray([scipy.stats.gamma.rvs(a, loc=0, scale=1.0 / b, size=size) for a, b in zip(self.a, self.b)])
300294
function scan(sp, cb) {
    cb = u.onceMaybe(cb);
    var timer = u.timer();
    sp.route = sp.route || '/';

    var src = sp.src;

    // only construct src, defaults, sendOpts etc. once
    if (!src) {
      sp.name = sp.name || 'staticPath:' + sp.path;
      sp.depth = sp.depth || opts.staticDepth || 5;
      sp.maxAge = 'maxAge' in sp ? sp.maxAge : '10m';
      sp.includeBinaries = true;
      src = sp.src = fsbase(sp);
      if (src.isfile()) { sp.depth = 1; }
      sp.sendOpts = u.assign(
        u.pick(sp, 'maxAge', 'lastModified', 'etag'),
        { dotfiles:'ignore',
          index:false,      // handled at this level
          extensions:false, // ditto
          root:src.path } );
    }

    src.listfiles(function(err, files) {
      if (err) return cb(log(err));
      sp.files = files;
      self.scanCnt++;
      mapAllFiles();
      debug('static scan %s-deep %sms %s', sp.depth, timer(), sp.path.replace(/.*\/node_modules\//g, ''));
      debug(files.length > 10 ? '[' + files.length + ' files]' : u.pluck(files, 'filepath'));
      cb();
    });
  }
1180963
def _sample(rng, arr, k):
  
  selected = numpy.empty(k, dtype="uint32")
  rng.sample(numpy.asarray(arr, dtype="uint32"),
             selected)
  return selected
947043
def get_random(self, size=10):
        
        bin_i = np.random.choice(np.arange(len(self.bin_centers)), size=size, p=self.normalized_histogram)
        return self.bin_centers[bin_i] + np.random.uniform(-0.5, 0.5, size=size) * self.bin_volumes()[bin_i]
425158
def next(self):
        
        if self.probability == 1:
            x, y = next(self.scan)
        else:
            while True:
                x, y = next(self.scan)
                if random.random() <= self.probability: break
        return x, y
829342
def scan(self):
        """"""
        devices = []
        diff = 65
        rom = False
        count = 0
        for _ in range(0xff):
            rom, diff = self._search_rom(rom, diff)
            if rom:
                count += 1
                if count > self.maximum_devices:
                    raise RuntimeError(
                        "Maximum device count of {} exceeded."\
                        .format(self.maximum_devices))
                devices.append(OneWireAddress(rom))
            if diff == 0:
                break
        return devices
1294873
function random(array, len) {
  const size = array.length;
  const randomIndexes = crypto.randomBytes(len).toJSON().data;
  return randomIndexes.map((char) => array[char % size]).join('');
}
163997
def random(cls, engine_or_session, limit=5):
        
        ses, auto_close = ensure_session(engine_or_session)
        result = ses.query(cls).order_by(func.random()).limit(limit).all()
        if auto_close:  # pragma: no cover
            ses.close()
        return result
641255
def scan(self, t, dt=None, aggfunc=None):
        
        return self.data.scan(t, dt, aggfunc)
1013681
def random_sleep(self, previous_attempt_number, delay_since_first_attempt_ms):
        """"""
        return random.randint(self._wait_random_min, self._wait_random_max)
1221587
public static function get_random_local_image()
    {
        self::install_mock_files();
        return self::get_mock_files()->sort(DB::get_conn()->random())->first();
    }
939842
def random_new(algo: int = RNG_CMWC) -> tcod.random.Random:
    
    return tcod.random.Random(algo)
1184479
def get_random(self, n, l=None):
        
        random_f = Fasta()
        if l:
            ids = self.ids[:]
            random.shuffle(ids)
            i = 0
            while (i < n) and (len(ids) > 0):
                seq_id = ids.pop()
                if (len(self[seq_id]) >= l):
                    start = random.randint(0, len(self[seq_id]) - l)
                    random_f["random%s" % (i + 1)] = self[seq_id][start:start+l]
                    i += 1
            if len(random_f) != n:
                sys.stderr.write("Not enough sequences of required length")
                return
            else:
                return random_f

        else:
            choice = random.sample(self.ids, n)
            for i in range(n):
                random_f[choice[i]] = self[choice[i]]
        return random_f
452843
def random(length: int = 8, chars: str = digits + ascii_lowercase) -> Iterator[str]:
    
    while True:
        yield "".join([choice(chars) for _ in range(length)])
587234
function getUniqueRandomNumberAsync(callback) {
    if (cb.check(callback)) { return; }
    setTimeout(() => {
        debugger
        cb.done(Math.random());
    }, 1000);
}
1053364
def get_random_giphy(phrase):
    """"""
    with warnings.catch_warnings():
        warnings.simplefilter('ignore')

        giphy = giphypop.Giphy()

    results = giphy.search_list(phrase=phrase, limit=100)

    if not results:
        raise ValueError('There were no results for that phrase')

    return random.choice(results).media_url