code: def gauss_legendre_builders() -> (
      Tuple[Callable[[int], List[float]], Callable[[int], List[float]]]
  ):
      r"""Numpy's `np.polynomial.legendre` function helps to compute step sizes
      and alpha coefficients using gauss-legendre quadrature rule.
      Since numpy returns the integration parameters in different scales we need to
      rescale them to adjust to the desired scale.
  
      Gauss Legendre quadrature rule for approximating the integrals was originally
      proposed by [Xue Feng and her intern Hauroun Habeeb]
      (https://research.fb.com/people/feng-xue/).
  
      Returns:
          2-element tuple of **step_sizes**, **alphas**:
          - **step_sizes** (*Callable*):
                      `step_sizes` takes the number of steps as an
                      input argument and returns an array of steps sizes which
                      sum is smaller than or equal to one.
  
          - **alphas** (*Callable*):
                      `alphas` takes the number of steps as an input argument
                      and returns the multipliers/coefficients for the inputs
                      of integrand in the range of [0, 1]
  
      """
  
      # allow using riemann even without np
      import numpy as np
  
      def step_sizes(n: int) -> List[float]:
          assert n > 0, "The number of steps has to be larger than zero"
          # Scaling from 2 to 1
          return list(0.5 * np.polynomial.legendre.leggauss(n)[1])
  
      def alphas(n: int) -> List[float]:
          assert n > 0, "The number of steps has to be larger than zero"
          # Scaling from [-1, 1] to [0, 1]
          return list(0.5 * (1 + np.polynomial.legendre.leggauss(n)[0]))
  
      return step_sizes, alphas
  
file_path: captum/captum/attr/_utils/approximation_methods.py
imports: from enum import Enum
  from typing import Callable, List, Tuple
  import torch
label_desc: Use image node_id 3 for calling a global function with example usage: gauss_legendre_builders() and returns: step_sizes,  alphas, list, list