def getMutual(): all_friends = friends(my_id) c_friends = group( mutual_friends.s(i) for i in parts(list(all_friends[0].keys()), 75))().get() result = {k: v for d in c_friends for k, v in d.items()} return cleaner(result)
def getDeep(): result = {} for i in range(deep): if result: # те айди, которых нет в ключах + не берем id:None lst = list(set([item for sublist in result.values() if sublist for item in sublist]) - set(result.keys())) d_friends = group(deep_friends.s(i) for i in parts(list(lst), 75))().get() result = {k: v for d in d_friends for k, v in d.items()} result.update(result) else: all_friends = friends(my_id) d_friends = group(deep_friends.s(i) for i in parts(list(all_friends[0].keys()), 75))().get() result = {k: v for d in d_friends for k, v in d.items()} result.update(result) return cleaner(result)
def getDeep(): result = {} for i in range(deep): if result: # те айди, которых нет в ключах + не берем id:None lst = list( set([ item for sublist in result.values() if sublist for item in sublist ]) - set(result.keys())) d_friends = group(deep_friends.s(i) for i in parts(list(lst), 75))().get() result = {k: v for d in d_friends for k, v in d.items()} result.update(result) else: all_friends = friends(my_id) d_friends = group( deep_friends.s(i) for i in parts(list(all_friends[0].keys()), 75))().get() result = {k: v for d in d_friends for k, v in d.items()} result.update(result) return cleaner(result)
def getMutual(): all_friends = friends(my_id) c_friends = group(mutual_friends.s(i) for i in parts(list(all_friends[0].keys()), 75))().get() result = {k: v for d in c_friends for k, v in d.items()} return cleaner(result)