code: def ParametricTorus(
      ringradius=None, crosssectionradius=None, **kwargs
  ):
      """Generate a torus.
  
      Parameters
      ----------
      ringradius : float, default: 1.0
          The radius from the center to the middle of the ring of the
          torus.
  
      crosssectionradius : float, default: 0.5
          The radius of the cross section of ring of the torus.
  
      **kwargs : dict, optional
          See :func:`surface_from_para` for additional keyword arguments.
  
      Returns
      -------
      pyvista.PolyData
          ParametricTorus surface.
  
      Examples
      --------
      Create a ParametricTorus mesh.
  
      >>> import pyvista as pv
      >>> mesh = pv.ParametricTorus()
      >>> mesh.plot(color='w', smooth_shading=True)
  
      """
      parametric_function = _vtk.vtkParametricTorus()
      if ringradius is not None:
          parametric_function.SetRingRadius(ringradius)
  
      if crosssectionradius is not None:
          parametric_function.SetCrossSectionRadius(crosssectionradius)
  
      center = kwargs.pop("center", [0.0, 0.0, 0.0])
      direction = kwargs.pop("direction", [1.0, 0.0, 0.0])
      kwargs.setdefault("clean", True)
      surf = surface_from_para(parametric_function, **kwargs)
      translate(surf, center, direction)
      return surf
  
imports: from math import pi
  import warnings
  import numpy
  import pyvista
  from pyvista.core import _vtk_core
  from pyvista.core.errors import PyVistaDeprecationWarning
  from .geometric_objects import translate
  from .helpers import wrap
  from .misc import check_valid_vector
label_desc: Use image node_id 23 for calling a global function with example usage: ParametricTorus(ringradius, crosssectionradius) and returns: surf