docs: def compress_flood_fill_regions(targets):
      """Generate a reduced set of flood fill parameters.
  
      Parameters
      ----------
      targets : {(x, y) : set([c, ...]), ...}
          For each used chip a set of core numbers onto which an application
          should be loaded.  E.g., the output of
          :py:func:`~rig.place_and_route.util.build_application_map` when indexed
          by an application.
  
      Yields
      ------
      (region, core mask)
          Pair of integers which represent a region of a SpiNNaker machine and a
          core mask of selected cores within that region for use in flood-filling
          an application.  `region` and `core_mask` are both integer
          representations of bit fields that are understood by SCAMP.
  
          The pairs are yielded in an order suitable for direct use with SCAMP's
          flood-fill core select (FFCS) method of loading.
      """
      t = RegionCoreTree()
  
      for (x, y), cores in iteritems(targets):
          for p in cores:
              t.add_core(x, y, p)
  
      return sorted(t.get_regions_and_coremasks())