              if south_style_migrations:
                  self.unmigrated_apps.add(app_config.label)
  
      def get_migration(self, app_label, name_prefix):
          "Gets the migration exactly named, or raises KeyError"
          return self.graph.nodes[app_label, name_prefix]
  
      def get_migration_by_prefix(self, app_label, name_prefix):
          "Returns the migration(s) which match the given app label and name _prefix_"
          # Do the search
 
</s> remove                 self.graph.add_dependency(migration, key, parent)
 </s> add                 try:
                    self.graph.add_dependency(migration, key, parent)
                except NodeNotFoundError as e:
                    # Since we added "key" to the nodes before this implies
                    # "parent" is not in there. To make the raised exception
                    # more understandable we check if parent could have been
                    # replaced but hasn't (eg partially applied squashed
                    # migration)
                    _reraise_missing_dependency(migration, parent, e) </s> remove                     self.graph.add_dependency(migration, child, key)
 </s> add                     try:
                        self.graph.add_dependency(migration, child, key)
                    except NodeNotFoundError as e:
                        # Since we added "key" to the nodes before this implies
                        # "child" is not in there.
                        _reraise_missing_dependency(migration, child, e) </s> remove             raise ValueError("Node %r not a valid node" % (node, ))
 </s> add             raise NodeNotFoundError("Node %r not a valid node" % (node, ), node) </s> remove                 else:
 </s> add                 else:  # "__latest__"
        "Gets the migration exactly named, or raises `graph.NodeNotFoundError`"
              if south_style_migrations:
                  self.unmigrated_apps.add(app_config.label)
  
      def get_migration(self, app_label, name_prefix):
        "Gets the migration exactly named, or raises `graph.NodeNotFoundError`"
          return self.graph.nodes[app_label, name_prefix]
  
      def get_migration_by_prefix(self, app_label, name_prefix):
          "Returns the migration(s) which match the given app label and name _prefix_"
          # Do the search
keep keep keep keep replace keep keep keep keep keep
 Fixed #23556 -- Raised a more meaningful error message when migrations refer to an unavailable node 
django/db/migrations/loader.py