class_docstr: Quadrature rules are implemented using this class, in order to
  simplify the code and provide a common infrastructure
  for tasks such as error estimation and node caching.
  
  You can implement a custom quadrature rule by subclassing
  :class:`QuadratureRule` and implementing the appropriate
  methods. The subclass can then be used by :func:`~mpmath.quad` by
  passing it as the *method* argument.
  
  :class:`QuadratureRule` instances are supposed to be singletons.
  :class:`QuadratureRule` therefore implements instance caching
  in :func:`~mpmath.__new__`.
class_docstr_tok: ["Quadrature","rules","are","implemented","using","this","class",",","in","order","to","simplify","the","code","and","provide","a","common","infrastructure","for","tasks","such","as","error","estimation","and","node","caching",".","You","can","implement","a","custom","quadrature","rule","by","subclassing",":","class",":","`","QuadratureRule","`","and","implementing","the","appropriate","methods",".","The","subclass","can","then","be","used","by",":","func",":","`","~mpmath.quad","`","by","passing","it","as","the","*","method","*","argument",".",":","class",":","`","QuadratureRule","`","instances","are","supposed","to","be","singletons",".",":","class",":","`","QuadratureRule","`","therefore","implements","instance","caching","in",":","func",":","`","~mpmath.__new__","`","."]
docstr: Return nodes for given interval, degree and precision. The
  nodes are retrieved from a cache if already computed;
  otherwise they are computed by calling :func:`~mpmath.calc_nodes`
  and are then cached.
  
  Subclasses should probably not implement this method,
  but just implement :func:`~mpmath.calc_nodes` for the actual
  node computation.
docstr_tok: ["Return","nodes","for","given","interval",",","degree","and","precision",".","The","nodes","are","retrieved","from","a","cache","if","already","computed",";","otherwise","they","are","computed","by","calling",":","func",":","`","~mpmath.calc_nodes","`","and","are","then","cached",".","Subclasses","should","probably","not","implement","this","method",",","but","just","implement",":","func",":","`","~mpmath.calc_nodes","`","for","the","actual","node","computation","."]
code: def get_nodes(self, a, b, degree, prec, verbose=False):
      """
      Return nodes for given interval, degree and precision. The
      nodes are retrieved from a cache if already computed;
      otherwise they are computed by calling :func:`~mpmath.calc_nodes`
      and are then cached.
  
      Subclasses should probably not implement this method,
      but just implement :func:`~mpmath.calc_nodes` for the actual
      node computation.
      """
      key = (a, b, degree, prec)
      if key in self.transformed_cache:
          return self.transformed_cache[key]
      orig = self.ctx.prec
      try:
          self.ctx.prec = prec + 20
          # Get nodes on standard interval
          if (degree, prec) in self.standard_cache:
              nodes = self.standard_cache[degree, prec]
          else:
              nodes = self.calc_nodes(degree, prec, verbose)
              self.standard_cache[degree, prec] = nodes
          # Transform to general interval
          nodes = self.transform_nodes(nodes, a, b, verbose)
          if key in self.interval_count:
              self.transformed_cache[key] = nodes
          else:
              self.interval_count[key] = True
      finally:
          self.ctx.prec = orig
      return nodes
  
imports: import math
  from ..libmp.backend import xrange
label_desc: Use image node_id 4 for calling the QuadratureRule obj's underlying member method code with example usage: obj.get_nodes(a, b, degree, prec, verbose) and returns: nodes, self