def connect(self): 
        try:
            self.connection = pymongo.Connection(self.host, self.port)
            self.db = self.connection[self.name]
        except AutoReconnect:
            raise DatabaseException("It's not possible connect to the database")
def remove_attributes(self, model):
        """
        Removes the x and y attributes which were added by the forward handles
        Recursively searches for non-container layers
        """
        for child in model.children():
            if 'nn.modules.container' in str(type(child)):
                self.remove_attributes(child)
            else:
                try:
                    del child.x
                except AttributeError:
                    pass
                try:
                    del child.y
                except AttributeError:
                    pass