class_docstr: An unstructured triangular grid consisting of npoints points and
  ntri triangles.  The triangles can either be specified by the user
  or automatically generated using a Delaunay triangulation.
  
  Parameters
  ----------
  x, y : (npoints,) array-like
      Coordinates of grid points.
  triangles : (ntri, 3) array-like of int, optional
      For each triangle, the indices of the three points that make
      up the triangle, ordered in an anticlockwise manner.  If not
      specified, the Delaunay triangulation is calculated.
  mask : (ntri,) array-like of bool, optional
      Which triangles are masked out.
  
  Attributes
  ----------
  triangles : (ntri, 3) array of int
      For each triangle, the indices of the three points that make
      up the triangle, ordered in an anticlockwise manner. If you want to
      take the *mask* into account, use `get_masked_triangles` instead.
  mask : (ntri, 3) array of bool or None
      Masked out triangles.
  is_delaunay : bool
      Whether the Triangulation is a calculated Delaunay
      triangulation (where *triangles* was not specified) or not.
  
  Notes
  -----
  For a Triangulation to be valid it must not have duplicate points,
  triangles formed from colinear points, or overlapping triangles.
class_docstr_tok: ["An","unstructured","triangular","grid","consisting","of","npoints","points","and","ntri","triangles",".","The","triangles","can","either","be","specified","by","the","user","or","automatically","generated","using","a","Delaunay","triangulation",".","Parameters","--","--","--","--","--","x",",","y",":","(","npoints",",",")","array-like","Coordinates","of","grid","points",".","triangles",":","(","ntri",",","3",")","array-like","of","int",",","optional","For","each","triangle",",","the","indices","of","the","three","points","that","make","up","the","triangle",",","ordered","in","an","anticlockwise","manner",".","If","not","specified",",","the","Delaunay","triangulation","is","calculated",".","mask",":","(","ntri",",",")","array-like","of","bool",",","optional","Which","triangles","are","masked","out",".","Attributes","--","--","--","--","--","triangles",":","(","ntri",",","3",")","array","of","int","For","each","triangle",",","the","indices","of","the","three","points","that","make","up","the","triangle",",","ordered","in","an","anticlockwise","manner",".","If","you","want","to","take","the","*","mask","*","into","account",",","use","`","get_masked_triangles","`","instead",".","mask",":","(","ntri",",","3",")","array","of","bool","or","None","Masked","out","triangles",".","is_delaunay",":","bool","Whether","the","Triangulation","is","a","calculated","Delaunay","triangulation","(","where","*","triangles","*","was","not","specified",")","or","not",".","Notes","--","--","-","For","a","Triangulation","to","be","valid","it","must","not","have","duplicate","points",",","triangles","formed","from","colinear","points",",","or","overlapping","triangles","."]
code: def __init__(self, x, y, triangles=None, mask=None):
      from matplotlib import _qhull
  
      self.x = np.asarray(x, dtype=np.float64)
      self.y = np.asarray(y, dtype=np.float64)
      if self.x.shape != self.y.shape or self.x.ndim != 1:
          raise ValueError(
              "x and y must be equal-length 1D arrays, but "
              f"found shapes {self.x.shape!r} and "
              f"{self.y.shape!r}"
          )
  
      self.mask = None
      self._edges = None
      self._neighbors = None
      self.is_delaunay = False
  
      if triangles is None:
          # No triangulation specified, so use matplotlib._qhull to obtain
          # Delaunay triangulation.
          self.triangles, self._neighbors = _qhull.delaunay(
              x, y, sys.flags.verbose
          )
          self.is_delaunay = True
      else:
          # Triangulation specified. Copy, since we may correct triangle
          # orientation.
          try:
              self.triangles = np.array(
                  triangles, dtype=np.int32, order="C"
              )
          except ValueError as e:
              raise ValueError(
                  "triangles must be a (N, 3) int array, not "
                  f"{triangles!r}"
              ) from e
          if self.triangles.ndim != 2 or self.triangles.shape[1] != 3:
              raise ValueError(
                  "triangles must be a (N, 3) int array, but found shape "
                  f"{self.triangles.shape!r}"
              )
          if self.triangles.max() >= len(self.x):
              raise ValueError(
                  "triangles are indices into the points and must be in the "
                  f"range 0 <= i < {len(self.x)} but found value "
                  f"{self.triangles.max()}"
              )
          if self.triangles.min() < 0:
              raise ValueError(
                  "triangles are indices into the points and must be in the "
                  f"range 0 <= i < {len(self.x)} but found value "
                  f"{self.triangles.min()}"
              )
  
      # Underlying C++ object is not created until first needed.
      self._cpp_triangulation = None
  
      # Default TriFinder not created until needed.
      self._trifinder = None
  
      self.set_mask(mask)
  
file_path: catboost/contrib/python/matplotlib/py3/matplotlib/tri/_triangulation.py
imports: import sys
  import numpy
  from matplotlib import _api
label_desc: Use image node_id 1 to create a new Triangulation object  with example: obj = Triangulation(x, y, triangles, mask)