create a random group id that we haven't seen before.
422623
function() {
    var groupId = getString(libsignal.crypto.getRandomBytes(16));
    return this.getGroup(groupId).then(function(group) {
      if (group === undefined) {
        return groupId;
      } else {
        console.warn("group id collision"); // probably a bad sign.
        return this.generateNewGroupId();
      }
    });
  }
939842
def random_new(algo: int = RNG_CMWC) -> tcod.random.Random:
    
    return tcod.random.Random(algo)
419786
def add_group(self, group_name, payment_address):
        
        if (self.is_group_name_exists(group_name)):
            raise Exception("the group \"%s\" is already present"%str(group_name))
        group_id_base64 = base64.b64encode(secrets.token_bytes(32))
        self.m["groups"] += [{"group_name"      : group_name ,
                              "group_id"        : group_id_base64.decode("ascii"),
                              "payment_address" : payment_address}]
        return group_id_base64
71139
def DiscreteUniform(n=10,LB=1,UB=99,B=100):
    """"""
    B = 100
    s = [0]*n
    for i in range(n):
        s[i] = random.randint(LB,UB)
    return s,B
493004
function makeRandomId(digits) {
    digits = digits || 16;
    var id = "";
    for (var ii = 0; ii < digits; ++ii) {
      id = id + ((Math.random() * 16 | 0)).toString(16);
    }
    return id;
  }
981215
def create_usuario_grupo(self):
        """"""
        return UsuarioGrupo(
            self.networkapi_url,
            self.user,
            self.password,
            self.user_ldap)
566579
def make_msg_id():
    
    random_string = get_rand_string(12)
    timestamp = time.strftime("%Y%m%d%I%M%S")
    msg_id = timestamp + "-" + random_string
    return msg_id
364223
def _guess_group(info):
    """"""
    value = "fake"
    if "metadata" in info:
        if info["metadata"]:
            return ",".join(map(str, info["metadata"].values()))
    return value
295990
def _uniqueid(n=30):
    
    return ''.join(random.SystemRandom().choice(
                   string.ascii_uppercase + string.ascii_lowercase)
                   for _ in range(n))
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))]
697034
def create(self, create_missing=None):
        
        return UserGroup(
            self._server_config,
            id=self.create_json(create_missing)['id'],
        ).read()
727000
public static String createUniqueIdentifier() {
		String id;
		do {
			id = UUID.randomUUID().toString();
		} while (getSREFromId(id) != null);
		return id;
	}
407396
public function randomId($random_id_length = 10)
    {
        //generate a random id encrypt it and store it in $rnd_id 
        $rnd_id = crypt(uniqid(rand(), 1), uniqid(rand(), 1));

        //to remove any slashes that might have come 
        $rnd_id = strip_tags(stripslashes($rnd_id));

        //Removing any . or / and reversing the string 
        $rnd_id = strrev(str_replace("/", "", str_replace(".", "", $rnd_id)));

        if (strlen($rnd_id) < $random_id_length) {
            $rnd_id = $rnd_id . $this->randomId($random_id_length - strlen($rnd_id));
        }

        //finally I take the first 10 characters from the $rnd_id 
        $rnd_id = substr($rnd_id, 0, $random_id_length);
        $this->BackyardError->log(5, "Random id is " . $rnd_id, array(16));
        return $rnd_id;
    }
1076664
function randomNode (g) {
  var keys = Object.keys(g)
  return keys[~~(keys.length*Math.random())]
}
735214
def id_generator(size=15, random_state=None):
    """"""
    chars = list(string.ascii_uppercase + string.digits)
    return ''.join(random_state.choice(chars, size, replace=True))
1159874
private ArrayDBIDs initialSet(DBIDs sampleSet, int k, Random random) {
    return DBIDUtil.ensureArray(DBIDUtil.randomSample(sampleSet, k, random));
  }
285399
def acts_as_random_id(options={:field => :id}, &block)
      before_create do |record|
        if block
          record.ensure_unique_id(options, &block)
        else
          record.ensure_unique_id(options) do
            rand(2_147_483_647) + 1 # mysql and SQLite type integer
          end
        end
      end
    end