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","."]
docstr: Return a Triangulation object from the args and kwargs, and
  the remaining args and kwargs with the consumed values removed.
  
  There are two alternatives: either the first argument is a
  Triangulation object, in which case it is returned, or the args
  and kwargs are sufficient to create a new Triangulation to
  return.  In the latter case, see Triangulation.__init__ for
  the possible args and kwargs.
docstr_tok: ["Return","a","Triangulation","object","from","the","args","and","kwargs",",","and","the","remaining","args","and","kwargs","with","the","consumed","values","removed",".","There","are","two","alternatives",":","either","the","first","argument","is","a","Triangulation","object",",","in","which","case","it","is","returned",",","or","the","args","and","kwargs","are","sufficient","to","create","a","new","Triangulation","to","return",".","In","the","latter","case",",","see","Triangulation.__init__","for","the","possible","args","and","kwargs","."]
code: def get_from_args_and_kwargs(*args, **kwargs):
      """
      Return a Triangulation object from the args and kwargs, and
      the remaining args and kwargs with the consumed values removed.
  
      There are two alternatives: either the first argument is a
      Triangulation object, in which case it is returned, or the args
      and kwargs are sufficient to create a new Triangulation to
      return.  In the latter case, see Triangulation.__init__ for
      the possible args and kwargs.
      """
      if isinstance(args[0], Triangulation):
          triangulation, *args = args
          if "triangles" in kwargs:
              _api.warn_external(
                  "Passing the keyword 'triangles' has no effect when also "
                  "passing a Triangulation"
              )
          if "mask" in kwargs:
              _api.warn_external(
                  "Passing the keyword 'mask' has no effect when also "
                  "passing a Triangulation"
              )
      else:
          (
              x,
              y,
              triangles,
              mask,
              args,
              kwargs,
          ) = Triangulation._extract_triangulation_params(args, kwargs)
          triangulation = Triangulation(x, y, triangles, mask)
      return triangulation, args, kwargs
  
file_path: matplotlib/lib/matplotlib/tri/_triangulation.py
imports: import sys
  import numpy
  from matplotlib import _api
label_desc: Use image node_id 6 for calling the Triangulation obj's underlying member method code with example usage: obj.get_from_args_and_kwargs() and returns: triangulation,  args,  kwargs