Fixed #51 : I can compile simple recognize
This commit is contained in:
@@ -305,6 +305,40 @@ def dict_product(a, b):
|
||||
return res
|
||||
|
||||
|
||||
def merge_dictionaries(a, b):
|
||||
"""
|
||||
Returns a new dictionary which is the merge
|
||||
:param a:
|
||||
:param b:
|
||||
:return:
|
||||
"""
|
||||
if a is None and b is None:
|
||||
return None
|
||||
|
||||
res = {}
|
||||
if a:
|
||||
res.update(a)
|
||||
|
||||
if b:
|
||||
res.update(b)
|
||||
|
||||
return res
|
||||
|
||||
|
||||
def merge_sets(a, b):
|
||||
if a is None and b is None:
|
||||
return None
|
||||
|
||||
res = set()
|
||||
if a:
|
||||
res.update(a)
|
||||
|
||||
if b:
|
||||
res.update(b)
|
||||
|
||||
return res
|
||||
|
||||
|
||||
def get_n_clones(obj, n):
|
||||
objs = [obj]
|
||||
for i in range(n - 1):
|
||||
|
||||
Reference in New Issue
Block a user