docs: def table_is_subset_of(entries_a, entries_b):
      """Check that every key matched by every entry in one table results in the
      same route when checked against the other table.
  
      For example, the table::
  
          >>> from rig.routing_table import Routes
          >>> table = [
          ...     RoutingTableEntry({Routes.north, Routes.north_east}, 0x0, 0xf),
          ...     RoutingTableEntry({Routes.east}, 0x1, 0xf),
          ...     RoutingTableEntry({Routes.south_west}, 0x5, 0xf),
          ...     RoutingTableEntry({Routes.north, Routes.north_east}, 0x8, 0xf),
          ...     RoutingTableEntry({Routes.east}, 0x9, 0xf),
          ...     RoutingTableEntry({Routes.south_west}, 0xe, 0xf),
          ...     RoutingTableEntry({Routes.north, Routes.north_east}, 0xc, 0xf),
          ...     RoutingTableEntry({Routes.south, Routes.south_west}, 0x0, 0xb),
          ... ]
  
      is a functional subset of a minimised version of itself::
  
          >>> from rig.routing_table.ordered_covering import minimise
          >>> other_table = minimise(table, target_length=None)
          >>> other_table == table
          False
          >>> table_is_subset_of(table, other_table)
          True
  
      But not vice-versa::
  
          >>> table_is_subset_of(other_table, table)
          False
  
      Default routes are taken into account, such that the table::
  
          >>> table = [
          ...     RoutingTableEntry({Routes.north}, 0x0, 0xf, {Routes.south}),
          ... ]
  
      is a subset of the empty table::
  
          >>> table_is_subset_of(table, list())
          True
  
      Parameters
      ----------
      entries_a : [:py:class:`~rig.routing_table.RoutingTableEntry`, ...]
      entries_b : [:py:class:`~rig.routing_table.RoutingTableEntry`, ...]
          Ordered of lists of routing table entries to compare.
  
      Returns
      -------
      bool
          True if every key matched in `entries_a` would result in an equivalent
          route for the packet when matched in `entries_b`.
      """
      # Determine which bits we don't need to explicitly test for
      common_xs = get_common_xs(entries_b)
  
      # For every entry in the first table
      for entry in expand_entries(entries_a, ignore_xs=common_xs):
          # Look at every entry in the second table
          for other_entry in entries_b:
              # If the first entry matches the second
              if other_entry.mask & entry.key == other_entry.key:
                  if other_entry.route == entry.route:
                      # If the route is the same then we move on to the next
                      # entry in the first table.
                      break
                  else:
                      # Otherwise we return false as the tables are different
                      return False
          else:
              # If we didn't break out of the loop then the entry from the first
              # table never matched an entry in the second table. If the entry
              # from the first table could not be default routed we return False
              # as the tables cannot be equivalent.
              default_routed = False
  
              if len(entry.route) == 1 and len(entry.sources) == 1:
                  source = next(iter(entry.sources))
                  sink = next(iter(entry.route))
  
                  if (source is not None and
                          sink.is_link and
                          source is sink.opposite):
                      default_routed = True
  
              if not default_routed:
                  return False
  
      return True