Changed all files to (mostly) conform to PEP8

This commit is contained in:
Grant Sanderson
2018-04-06 13:58:59 -07:00
parent 7c272c6236
commit d4392de600
71 changed files with 3736 additions and 3604 deletions

View File

@ -1,22 +1,26 @@
import re
import string
def to_camel_case(name):
return "".join([
filter(
lambda c : c not in string.punctuation + string.whitespace, part
lambda c: c not in string.punctuation + string.whitespace, part
).capitalize()
for part in name.split("_")
])
def initials(name, sep_values = [" ", "_"]):
def initials(name, sep_values=[" ", "_"]):
return "".join([
(s[0] if s else "")
(s[0] if s else "")
for s in re.split("|".join(sep_values), name)
])
def camel_case_initials(name):
return filter(lambda c : c.isupper(), name)
return filter(lambda c: c.isupper(), name)
def complex_string(complex_num):
return filter(lambda c : c not in "()", str(complex_num))
return filter(lambda c: c not in "()", str(complex_num))