code: def taylor(ctx, f, x, n, **options):
      r"""
      Produces a degree-`n` Taylor polynomial around the point `x` of the
      given function `f`. The coefficients are returned as a list.
  
          >>> from mpmath import *
          >>> mp.dps = 15; mp.pretty = True
          >>> nprint(chop(taylor(sin, 0, 5)))
          [0.0, 1.0, 0.0, -0.166667, 0.0, 0.00833333]
  
      The coefficients are computed using high-order numerical
      differentiation. The function must be possible to evaluate
      to arbitrary precision. See :func:`~mpmath.diff` for additional details
      and supported keyword options.
  
      Note that to evaluate the Taylor polynomial as an approximation
      of `f`, e.g. with :func:`~mpmath.polyval`, the coefficients must be reversed,
      and the point of the Taylor expansion must be subtracted from
      the argument:
  
          >>> p = taylor(exp, 2.0, 10)
          >>> polyval(p[::-1], 2.5 - 2.0)
          12.1824939606092
          >>> exp(2.5)
          12.1824939607035
  
      """
      gen = enumerate(ctx.diffs(f, x, n, **options))
      if options.get("chop", True):
          return [ctx.chop(d) / ctx.factorial(i) for i, d in gen]
      else:
          return [d / ctx.factorial(i) for i, d in gen]
  
file_path: catboost/contrib/python/mpmath/py3/mpmath/calculus/differentiation.py
imports: from ..libmp.backend import xrange
  from .calculus import defun
label_desc: Use image node_id 12 for calling a global function with example usage: taylor(ctx, f, x, n) and returns: unknown, unknown