Yes, line 107 is the output mask. The `scan` method is used by the `create_regions_mask` function which takes the shape of the science data array and the JSON file with regions definitions. It creates the byte array with 0's initially and for each region uses its `scan` method to find which science array pixels it contains and sets those values in the mask to the region's label.