code: def to_multiregion(region):
      
      assert isinstance(region, (list, tuple)), region
      if isinstance(region[0], (list, tuple)):
          return region
      else:
          assert len(region) == 3
          return [tuple(region)]
docs: Convert a single region or multiple region specification into multiregion list.
  
      If a single region (chrom, start, end), returns [(chrom, start, end)]
      otherwise returns multiregion.