def _load_neighbors(self) -> None:
        """
        Loads all neighbors of the node from the local database and
        from the external data source if needed.
        """
        if not self.are_neighbors_cached:
            self._load_neighbors_from_external_source()
            db: GraphDatabaseInterface = self._graph.database
            db_node: DBNode = db.Node.find_by_name(self.name)
            db_node.are_neighbors_cached = True
            db.session.commit()
            self.are_neighbors_cached = True
        if not self._are_neighbors_loaded:
            self._load_neighbors_from_database()
def _load_neighbors ( self ) -> None : if not self . are_neighbors_cached : self . _load_neighbors_from_external_source ( ) db : GraphDatabaseInterface = self . _graph . database db_node : DBNode = db . Node . find_by_name ( self . name ) db_node . are_neighbors_cached = True db . session . commit ( ) self . are_neighbors_cached = True if not self . _are_neighbors_loaded : self . _load_neighbors_from_database ( )
Loads all neighbors of the node from the local database and
        from the external data source if needed.