code: def bridge(image, mask=None, iterations = 1):
      '''Fill in pixels that bridge gaps.
      
      1 0 0    1 0 0
      0 0 0 -> 0 1 0
      0 0 1    0 0 1
      '''
      global bridge_table
      if mask is None:
          masked_image = image
      else:
          masked_image = image.astype(bool).copy()
          masked_image[~mask] = False
      result = table_lookup(masked_image, bridge_table, False, iterations)
      if not mask is None:
          result[~mask] = image[~mask]
      return resulf bridge(image, mask=None, iterations = 1):
      '''Fill in pixels that bridge gaps.
      
      1 0 0    1 0 0
      0 0 0 -> 0 1 0
      0 0 1    0 0 1
      '''
      global bridge_table
      if mask is None:
          masked_image = image
      else:
          masked_image = image.astype(bool).copy()
          masked_image[~mask] = False
      result = table_lookup(masked_image, bridge_table, False, iterations)
      if not mask is None:
          result[~mask] = image[~mask]
      return result
docs: Fill in pixels that bridge gaps.
      
      1 0 0    1 0 0
      0 0 0 -> 0 1 0
      0 0 1    0 0 1