class_docstr: Mixin class for Cartesian 2D elements to add basic support for
  SelectionExpr streams.
class_docstr_tok: ["Mixin","class","for","Cartesian","2D","elements","to","add","basic","support","for","SelectionExpr","streams","."]
code: def _merge_regions(region1, region2, operation):
      if region1 is None or operation == "overwrite":
          return region2
      rect1 = region1.get(0)
      rect2 = region2.get(0)
      rects = rect1.clone(rect1.interface.concatenate([rect1, rect2]))
      poly1 = region1.get(1)
      poly2 = region2.get(1)
      polys = poly1.clone([poly1, poly2])
      return rects * polys
  
imports: import sys
  import numpy
  import pandas
  from ..core import Dataset, NdOverlay, util
  from ..streams import Lasso, Selection1D, SelectionXY
  from ..util.transform import dim
  from .annotation import HSpan, VSpan
label_desc: Use image node_id 9 for calling the Selection2DExpr obj's underlying member method code with example usage: obj._merge_regions(region1, region2, operation) and returns: unknown, region2