View .eslintrc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"extends": "airbnb", | |
"rules": { | |
"no-undef": 2, | |
"react/jsx-no-undef": 2, | |
"no-const-assign":2, | |
"space-before-function-paren": [2,"always"], | |
"max-len": [2,80,4], | |
"max-params":[2,6], | |
"eqeqeq": [2,"smart"], |
View reject.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def function_name (iterable, f): | |
for x in iterable: | |
if not f(x): yield x |
View reduce_right.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def function_name (iterable, f, i = None): | |
result = i | |
for x in iterable[::-1]: | |
result = f(result, x) | |
return result | |
View group_by.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def function_name (collection, k): | |
result = {} | |
for x in collection: | |
prop = x[k] | |
if prop not in result: | |
result[prop] = [] | |
result[prop].append(x) | |
return result | |
View invert.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def function_name (dict): | |
result = {} | |
for k, v in dict.items(): | |
result[v] = k | |
return result |
View omit.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def function_name (dict, keys): | |
result = {} | |
for k, v in dict.items(): | |
if k not in keys: | |
result[k] = v | |
return result |
View reduce.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def function_name (iterable, f, i = None): | |
result = i | |
for x in iterable: | |
result = f(result, x) | |
return result | |
View values.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def function_name (dict): | |
for _, v in dict.items(): | |
yield v |
View keys.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def function_name (dict): | |
for k in dict: | |
yield k |
View memoize.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def function_name (f): | |
dict = {} | |
def inner_function(x): | |
if x not in dict: | |
dict[x] = f(x) | |
return dict[x] | |
return inner_function |
NewerOlder