-
Notifications
You must be signed in to change notification settings - Fork 2
/
RandomData.py
51 lines (33 loc) · 1.22 KB
/
RandomData.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
from random import randint
from urllib.request import urlopen
first_names_female = list()
url = "https://www.cs.cmu.edu/Groups/AI/areas/nlp/corpora/names/female.txt"
for line in urlopen(url):
first_names_female.append(line.strip().decode())
first_names_male = list()
url = "https://www.cs.cmu.edu/Groups/AI/areas/nlp/corpora/names/male.txt"
for line in urlopen(url):
first_names_male.append(line.strip().decode())
last_names = list()
url = "https://raw.githubusercontent.com/colinangusmackay/Xander.PasswordValidator/master/src/Xander.PasswordValidator/Resources/Surnames.txt"
for line in urlopen(url):
last_names.append(line.strip().decode())
def get_gender():
return randint(1,2)
def get_first_name_female():
return first_names_female[randint(0, len(first_names_female)-1)]
def get_first_name_male():
return first_names_male[randint(0, len(first_names_male)-1)]
def get_firstname(gender):
if gender == 1:
return get_first_name_female()
else:
return get_first_name_male()
def get_last_name():
return last_names[randint(0, len(last_names)-1)]
def get_year():
return randint(1970,1999)
def get_month():
return randint(1,12)
def get_day():
return randint(1,28)