# Path: pt_law_parser/network.py
# class UndirectedNetwork(object):
#     """
#     An undirected network has a list of points p_i and links p_i<->p_j.
#     There are no self-links (i.e. p_i<->p_i is forbidden).
#     """
#     def __init__(self):
#         self._points = set()
#         self._links = dict()
# 
#     @property
#     def points(self):
#         return self._points
# 
#     def __iter__(self):
#         return iter(self.points)
# 
#     def __len__(self):
#         return len(self.points)
# 
#     @property
#     def links(self):
#         return self._links
# 
#     def add_point(self, point):
#         if point not in self._points:
#             self._points.add(point)
#             self._links[point] = set()
# 
#     def remove_point(self, point):
#         assert(point in self)
# 
#         # remove links from other points
#         for point_prime in self._links[point]:
#             self._links[point_prime].remove(point)
# 
#         # remove links
#         del self._links[point]
# 
#         # remove point
#         self._points.remove(point)
# 
#     def add_link(self, point, point_prime):
#         assert(point != point_prime)
#         assert(point in self and point_prime in self)
# 
#         self._links[point].add(point_prime)
#         self._links[point_prime].add(point)
# 
#         self.assert_consistency()
# 
#     def remove_link(self, point, point_prime):
#         assert(point in self and point_prime in self)
#         assert(point_prime in self.links[point] and
#                point in self._links[point_prime])
# 
#         self._links[point].remove(point_prime)
#         self._links[point_prime].remove(point)
# 
#     def links_list(self):
#         links = []
#         for point in self.links:
#             for link in self.links[point]:
#                 if (link, point) not in links and (point, link) not in links:
#                     points = sorted((point, link), key=lambda p: (p.x, p.y))
#                     links.append(tuple(points))
#         return links
# 
#     def print_links(self):
#         print('{%s}' % ','.join('{%s,%s}' % ('{%s}' % point, '{%s}' % link)
#                                 for point, link in self.links_list()))
# 
#     def print_nodes(self):
#         print('{%s}' % ','.join('{%s}' % point for point in self._points))
# 
#     def assert_consistency(self):
#         for point in self:
#             for link in self.links[point]:
#                 if point not in self.links[link]:
#                     assert(False)
# 
# Path: pt_law_parser/point.py
# class Point(object):
#     """
#     A point with two coordinates that can be compared and used in sets.
#     """
#     def __init__(self, point):
#         self._x = point[0]
#         self._y = point[1]
# 
#     def __hash__(self):
#         return hash(tuple(sorted(self.__dict__.items())))
# 
#     @property
#     def x(self):
#         return self._x
# 
#     @property
#     def y(self):
#         return self._y
# 
#     def __eq__(self, other):
#         return self.x == other.x and self.y == other.y
# 
#     def __ne__(self, other):
#         return not self == other
# 
#     def __iter__(self):
#         return iter([self._x, self._y])
# 
#     def __str__(self):
#         return '%d,%d' % (self._x, self._y)
# 
#     def __repr__(self):
#         return '<%s (%s)>' % (self.__class__.__name__, str(self))


import unittest
from pt_law_parser.network import UndirectedNetwork
from pt_law_parser.point import Point



class TestCase(unittest.TestCase):

    def test_a(self):
        network = UndirectedNetwork()


# Path: pt_law_parser/network.py
# class UndirectedNetwork(object):
#     """
#     An undirected network has a list of points p_i and links p_i<->p_j.
#     There are no self-links (i.e. p_i<->p_i is forbidden).
#     """
#     def __init__(self):
#         self._points = set()
#         self._links = dict()
# 
#     @property
#     def points(self):
#         return self._points
# 
#     def __iter__(self):
#         return iter(self.points)
# 
#     def __len__(self):
#         return len(self.points)
# 
#     @property
#     def links(self):
#         return self._links
# 
#     def add_point(self, point):
#         if point not in self._points:
#             self._points.add(point)
#             self._links[point] = set()
# 
#     def remove_point(self, point):
#         assert(point in self)
# 
#         # remove links from other points
#         for point_prime in self._links[point]:
#             self._links[point_prime].remove(point)
# 
#         # remove links
#         del self._links[point]
# 
#         # remove point
#         self._points.remove(point)
# 
#     def add_link(self, point, point_prime):
#         assert(point != point_prime)
#         assert(point in self and point_prime in self)
# 
#         self._links[point].add(point_prime)
#         self._links[point_prime].add(point)
# 
#         self.assert_consistency()
# 
#     def remove_link(self, point, point_prime):
#         assert(point in self and point_prime in self)
#         assert(point_prime in self.links[point] and
#                point in self._links[point_prime])
# 
#         self._links[point].remove(point_prime)
#         self._links[point_prime].remove(point)
# 
#     def links_list(self):
#         links = []
#         for point in self.links:
#             for link in self.links[point]:
#                 if (link, point) not in links and (point, link) not in links:
#                     points = sorted((point, link), key=lambda p: (p.x, p.y))
#                     links.append(tuple(points))
#         return links
# 
#     def print_links(self):
#         print('{%s}' % ','.join('{%s,%s}' % ('{%s}' % point, '{%s}' % link)
#                                 for point, link in self.links_list()))
# 
#     def print_nodes(self):
#         print('{%s}' % ','.join('{%s}' % point for point in self._points))
# 
#     def assert_consistency(self):
#         for point in self:
#             for link in self.links[point]:
#                 if point not in self.links[link]:
#                     assert(False)
# 
# Path: pt_law_parser/point.py
# class Point(object):
#     """
#     A point with two coordinates that can be compared and used in sets.
#     """
#     def __init__(self, point):
#         self._x = point[0]
#         self._y = point[1]
# 
#     def __hash__(self):
#         return hash(tuple(sorted(self.__dict__.items())))
# 
#     @property
#     def x(self):
#         return self._x
# 
#     @property
#     def y(self):
#         return self._y
# 
#     def __eq__(self, other):
#         return self.x == other.x and self.y == other.y
# 
#     def __ne__(self, other):
#         return not self == other
# 
#     def __iter__(self):
#         return iter([self._x, self._y])
# 
#     def __str__(self):
#         return '%d,%d' % (self._x, self._y)
# 
#     def __repr__(self):
#         return '<%s (%s)>' % (self.__class__.__name__, str(self))


# Path: tests/test_network.py
import unittest
from pt_law_parser.network import UndirectedNetwork
from pt_law_parser.point import Point




class TestCase(unittest.TestCase):

    def test_a(self):
        network = UndirectedNetwork()


        points = {Point((0, 0)), Point((1, 0)), Point((0, 1)), Point((1, 1))}