Skip to content

Instantly share code, notes, and snippets.

View amoodie's full-sized avatar

Andrew Moodie amoodie

View GitHub Profile
# test the possibility of setting and getting mwe within jitted functions
import numpy as np
import numba
@numba.jit
def set_random_seed(_seed):
np.random.seed(_seed)
@amoodie
amoodie / make_random_names.md
Last active April 28, 2022 13:52
Make random names in Python

The following code is written for Python3. Complete random name function in next file.

The first bit of code grabs a disctionary listing from the web and returns a list of all the entries in that dictionary.
(see https://stackoverflow.com/a/49524775/4038393)

import urllib.request

word_url = "http://svnweb.freebsd.org/csrg/share/dict/words?view=co&content-type=text/plain"
response = urllib.request.urlopen(word_url)