code: def riemann_builders(
      method: Riemann = Riemann.trapezoid,
  ) -> Tuple[
      Callable[[int], List[float]], Callable[[int], List[float]]
  ]:
      """
      Step sizes are identical and alphas are scaled in [0, 1].
  
      Parameters
      ----------
      n
          The number of integration steps.
      method
          Riemann method: ``Riemann.left`` | ``Riemann.right`` | ``Riemann.middle`` | ``Riemann.trapezoid``.
  
      Returns
      -------
      2-element tuple consisting of
  
       - `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].
  
      """
  
      def step_sizes(n: int) -> List[float]:
          assert n > 1, "The number of steps has to be larger than one"
          deltas = [1 / n] * n
          if method == Riemann.trapezoid:
              deltas[0] /= 2
              deltas[-1] /= 2
          return deltas
  
      def alphas(n: int) -> List[float]:
          assert n > 1, "The number of steps has to be larger than one"
          if method == Riemann.trapezoid:
              return list(np.linspace(0, 1, n))
          elif method == Riemann.left:
              return list(np.linspace(0, 1 - 1 / n, n))
          elif method == Riemann.middle:
              return list(np.linspace(1 / (2 * n), 1 - 1 / (2 * n), n))
          elif method == Riemann.right:
              return list(np.linspace(1 / n, 1, n))
          else:
              raise AssertionError(
                  "Provided Reimann approximation method is not valid."
              )
          # This is not a standard riemann method but in many cases it
          # leads to faster approximation. Test cases for small number of steps
          # do not make sense but for larger number of steps the approximation is
          # better therefore leaving this option available
          # if method == 'riemann_include_endpoints':
          #     return [i / (n - 1) for i in range(n)]
  
      return step_sizes, alphas
  
imports: from typing import List, Callable, Tuple
  import numpy
  from enum import Enum
label_desc: Use image node_id 2 for calling a global function with example usage: riemann_builders(method) and returns: step_sizes,  alphas, deltas, list, list, list, list