create a random character
199420
def create_character():
    
    traits = character.CharacterCollection(character.fldr)
    c = traits.generate_random_character()
    print(c)
    return c
1263558
function randomString(length, chars) {
  length = length || 8;
  chars = chars || '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
  var result = '';
  for (var i = length; i > 0; --i) result += chars[Math.floor(Math.random() * chars.length)];
  return result;
}
731031
def random_string(random_length=None):
    
    choices = string.letters + ' '
    text = []
    if not random_length:
        random_length = random.randint(1, 30)
    for x in range(random_length):
        text.append(random.choice(choices))
    return "".join(text)
97934
def random_string(length):
    
    # avoid things that could be mistaken ex: 'I' and '1'
    letters = "23456789ABCDEFGHJKLMNPQRSTUVWXYZ"
    return "".join([random.choice(letters) for _ in range(length)])
765029
def random_string(length, charset):
    
    n = len(charset)
    return ''.join(charset[random.randrange(n)] for _ in range(length))
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)
1044060
private static char randomize253State(char ch, int codewordPosition) {
    int pseudoRandom = ((149 * codewordPosition) % 253) + 1;
    int tempVariable = ch + pseudoRandom;
    return (char) (tempVariable <= 254 ? tempVariable : tempVariable - 254);
  }
176066
public static String randomString(int len, Random random) {
        if (len < 1) {
            return "";
        }
        int start = ' ';
        int end = 'z' + 1;

        StringBuffer buffer = new StringBuffer();
        int gap = end - start;

        while (len-- != 0) {
            char ch;
            ch = (char) (random.nextInt(gap) + start);

            if (Character.isLetterOrDigit(ch)) {
                buffer.append(ch);
            } else {
                len++;
            }
        }
        return buffer.toString();
    }
815013
def random_string(length=6, alphabet=string.ascii_letters+string.digits):
    
    return ''.join([random.choice(alphabet) for i in xrange(length)])
1311091
def get_random_value(length=10, character_sets=[string.ascii_uppercase, string.ascii_lowercase]):
        

        return "".join(random.choice("".join(character_sets)) for i in range(length))
288203
def _make_random_string(length):
    
    chars = string.ascii_lowercase + string.ascii_uppercase + string.digits
    return ''.join(random.choice(chars) for x in range(length))
1256039
private static String generateKey(int num) {
        Random random = new Random();
        String key = "";

        for (int x = 0; x < num; x++) {
            key += CHARACTERS[random.nextInt(CHARACTERS.length)];
        }
        return key;
    }
864119
def rand_str(min_char=MIN_CHR, max_char=MAX_CHR, min_len=MIN_STRLEN, 
             max_len=MAX_STRLEN, func=chr, **kwargs):
    '''
    '''
    l = randint(min_len, max_len)

    ret = ''
    for k in xrange(l):
        ret += func(randint(min_char, max_char))
    return ret
140195
def random_hex(length):
    
    charset = ''.join(set(string.hexdigits.lower()))
    return random_string(length, charset)
1069751
public static function random($length = 64, $characters = self::ALNUM)
    {
        static $random_generator = null;

        if (null === $random_generator) {
            $random_generator = is_callable('mt_rand') ? 'mt_rand' : 'rand';
        }

        $len = strlen($characters);
        return join(
            '',
            array_map(
                function () use ($characters, $len, $random_generator) {
                    return $characters{$random_generator(0, $len - 1)};
                },
                range(0, $length - 1)
            )
        );
    }
1319438
def random_id(k=5):
  """"""
  #  https://stackoverflow.com/questions/2257441/random-string-generation-with-upper-case-letters-and-digits-in-python
  return ''.join(random.choices(string.ascii_lowercase + string.digits, k=k))
1259343
private String randomString(String[] s) {
        if (s == null || s.length <= 0) return "";
        return s[this.random.nextInt(s.length)];
    }