Get a random non-ASCII unicode string of size *n*.
(n, seed=42)
| 92 | |
| 93 | |
| 94 | def get_random_unicode(n, seed=42): |
| 95 | """ |
| 96 | Get a random non-ASCII unicode string of size *n*. |
| 97 | """ |
| 98 | indices = np.frombuffer(get_random_bytes(n * 2, seed=seed), |
| 99 | dtype=np.int16) & 1023 |
| 100 | unicode_arr = np.array(_1024_random_unicode_letters)[indices] |
| 101 | |
| 102 | result = ''.join(unicode_arr.tolist()) |
| 103 | assert len(result) == n, (len(result), len(unicode_arr)) |
| 104 | return result |
| 105 | |
| 106 | |
| 107 | class BuiltinsGenerator(object): |
nothing calls this directly
no test coverage detected