예제 #1
0
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)
예제 #2
0
파일: call.py 프로젝트: Chetver/vk_friends
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)
예제 #3
0
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)
예제 #4
0
파일: call.py 프로젝트: Chetver/vk_friends
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)