# Path: app/model/user.py
# class User:
#     def __init__(self, user_id, first_name, last_name, photo, domain):
#         self._id = user_id
#         self._first_name = first_name
#         self._last_name = last_name
#         self._photo = photo
#         self._domain = domain
#         self._color = None
#     
#     @staticmethod
#     def from_vk_json(json):
#         return User(json['id'],
#                     json['first_name'], json['last_name'],
#                     json['photo_100'], json['domain'])
#     
#     def to_json(self):
#         return dict(id=self.id, name=self.name, photo=self.photo,
#                     link=self.link, color=self.color)
#     
#     @property
#     def id(self):
#         return self._id
#     
#     @property
#     def name(self):
#         return "{} {}".format(self._first_name, self._last_name)
#     
#     @property
#     def photo(self):
#         return self._photo
#     
#     @property
#     def link(self):
#         return "https://vk.com/{}".format(self._domain)
#     
#     @property
#     def color(self):
#         return self._color
#     
#     @color.setter
#     def color(self, value):
#         self._color = value


from typing import Dict, List, Set
from .user import User



class UsersGraph:
    def __init__(self, users: List[User], mutual_ids: Dict[int, List[int]]):
        self._users = users
        
        self._connections = []
        for user_id, mutual_friends_ids in mutual_ids.items():
            for mutual_friend_id in mutual_friends_ids:

# Path: app/model/user.py
# class User:
#     def __init__(self, user_id, first_name, last_name, photo, domain):
#         self._id = user_id
#         self._first_name = first_name
#         self._last_name = last_name
#         self._photo = photo
#         self._domain = domain
#         self._color = None
#     
#     @staticmethod
#     def from_vk_json(json):
#         return User(json['id'],
#                     json['first_name'], json['last_name'],
#                     json['photo_100'], json['domain'])
#     
#     def to_json(self):
#         return dict(id=self.id, name=self.name, photo=self.photo,
#                     link=self.link, color=self.color)
#     
#     @property
#     def id(self):
#         return self._id
#     
#     @property
#     def name(self):
#         return "{} {}".format(self._first_name, self._last_name)
#     
#     @property
#     def photo(self):
#         return self._photo
#     
#     @property
#     def link(self):
#         return "https://vk.com/{}".format(self._domain)
#     
#     @property
#     def color(self):
#         return self._color
#     
#     @color.setter
#     def color(self, value):
#         self._color = value


# Path: app/model/users_graph.py
from typing import Dict, List, Set
from .user import User




class UsersGraph:
    def __init__(self, users: List[User], mutual_ids: Dict[int, List[int]]):
        self._users = users
        
        self._connections = []
        for user_id, mutual_friends_ids in mutual_ids.items():
            for mutual_friend_id in mutual_friends_ids:

                self.add_connection(user_id, mutual_friend_id)