#!usr/bin/env/ python
from collections import Counter

def getFriendNameAndLikes(f_api):
    f_like = f_api.get_object('me', fields='friends.fields(name,likes)')
    likes = {}
    for friend in f_like['friends']['data']:
        f_name = friend['name']
        if friend.has_key('likes'):
            likes[f_name] = friend['likes']['data']
    return likes

def getLikeCount(likes):
    return Counter([like['name']
                for friend in likes
                for like in likes[friend]
                if like.get('name')])

731b97d12085c4ec9df06227bc18ebf7344367da
<mask token>

<mask token>


def getFriendNameAndLikes(f_api):
    f_like = f_api.get_object('me', fields='friends.fields(name,likes)')
    likes = {}
    for friend in f_like['friends']['data']:
        f_name = friend['name']
        if friend.has_key('likes'):
            likes[f_name] = friend['likes']['data']
    return likes


<mask token>

<mask token>


def getFriendNameAndLikes(f_api):
    f_like = f_api.get_object('me', fields='friends.fields(name,likes)')
    likes = {}
    for friend in f_like['friends']['data']:
        f_name = friend['name']
        if friend.has_key('likes'):
            likes[f_name] = friend['likes']['data']
    return likes


def getLikeCount(likes):
    return Counter([like['name'] for friend in likes for like in likes[
        friend] if like.get('name')])

from collections import Counter


def getFriendNameAndLikes(f_api):
    f_like = f_api.get_object('me', fields='friends.fields(name,likes)')
    likes = {}
    for friend in f_like['friends']['data']:
        f_name = friend['name']
        if friend.has_key('likes'):
            likes[f_name] = friend['likes']['data']
    return likes


def getLikeCount(likes):
    return Counter([like['name'] for friend in likes for like in likes[
        friend] if like.get('name')])

#!usr/bin/env/ python
from collections import Counter

def getFriendNameAndLikes(f_api):
    f_like = f_api.get_object('me', fields='friends.fields(name,likes)')
    likes = {}
    for friend in f_like['friends']['data']:
        f_name = friend['name']
        if friend.has_key('likes'):
            likes[f_name] = friend['likes']['data']
    return likes

def getLikeCount(likes):
    return Counter([like['name']
                for friend in likes
                for like in likes[friend]
                if like.get('name')])
