code: def van_der_corput(
      n: IntNumber,
      base: IntNumber = 2,
      *,
      start_index: IntNumber = 0,
      scramble: bool = False,
      seed: SeedType = None,
  ) -> np.ndarray:
      """Van der Corput sequence.
  
      Pseudo-random number generator based on a b-adic expansion.
  
      Scrambling uses permutations of the remainders (see [1]_). Multiple
      permutations are applied to construct a point. The sequence of
      permutations has to be the same for all points of the sequence.
  
      Parameters
      ----------
      n : int
          Number of element of the sequence.
      base : int, optional
          Base of the sequence. Default is 2.
      start_index : int, optional
          Index to start the sequence from. Default is 0.
      scramble : bool, optional
          If True, use Owen scrambling. Otherwise no scrambling is done.
          Default is True.
      seed : {None, int, `numpy.random.Generator`}, optional
          If `seed` is None the `numpy.random.Generator` singleton is used.
          If `seed` is an int, a new ``Generator`` instance is used,
          seeded with `seed`.
          If `seed` is already a ``Generator`` instance then that instance is
          used.
  
      Returns
      -------
      sequence : list (n,)
          Sequence of Van der Corput.
  
      References
      ----------
      .. [1] A. B. Owen. "A randomized Halton algorithm in R",
         arXiv:1706.02808, 2017.
  
      """
      rng = check_random_state(seed)
      sequence = np.zeros(n)
  
      quotient = np.arange(start_index, start_index + n)
      b2r = 1 / base
  
      while (1 - b2r) < 1:
          remainder = quotient % base
  
          if scramble:
              # permutation must be the same for all points of the sequence
              perm = rng.permutation(base)
              remainder = perm[np.array(remainder).astype(int)]
  
          sequence += remainder * b2r
          b2r /= base
          quotient = (quotient - remainder) / base
  
      return sequence
  
imports: from __future__ import annotations
  import os
  import copy
  import numbers
  from abc import ABC, abstractmethod
  import math
  from typing import ClassVar, List, Optional, overload, TYPE_CHECKING
  import warnings
  import numpy
  import scipy.stats
  from scipy._lib._util import rng_integers
  from scipy.stats._sobol import initialize_v, _cscramble, _fill_p_cumulative, _draw, _fast_forward, _categorize, initialize_direction_numbers, _MAXDIM, _MAXBIT
  from scipy.stats._qmc_cy import _cy_wrapper_centered_discrepancy, _cy_wrapper_wrap_around_discrepancy, _cy_wrapper_mixture_discrepancy, _cy_wrapper_l2_star_discrepancy, _cy_wrapper_update_discrepancy
label_desc: Use image node_id 9 for calling a global function with example usage: van_der_corput(n, base) and returns: sequence