code: def check_loops_in_grpah(self, current=None, visited=[]):
          '''
          :param current: current node to check if visited
          :param visited: list of visited fields
          :raise: KittyException if loop found
          '''
          if current in visited:
              path = ' -> '.join(v.get_name() for v in (visited + [current]))
              raise KittyException('loop detected in model: %s' % path)
          current = current if current else self._root
          for conn in self._graph[current.hash()]:
              self.check_loops_in_grpah(conn.dst, visited + [conn.src]f check_loops_in_grpah(self, current=None, visited=[]):
          '''
          :param current: current node to check if visited
          :param visited: list of visited fields
          :raise: KittyException if loop found
          '''
          if current in visited:
              path = ' -> '.join(v.get_name() for v in (visited + [current]))
              raise KittyException('loop detected in model: %s' % path)
          current = current if current else self._root
          for conn in self._graph[current.hash()]:
              self.check_loops_in_grpah(conn.dst, visited + [conn.src])
docs: :param current: current node to check if visited
          :param visited: list of visited fields
          :raise: KittyException if loop found