code: def _bartlett_formula(r: np.ndarray, m: int, length: int) -> float:
      """
      Computes the standard error of `r` at order `m` with respect to `length` according to Bartlett's formula.
  
      Parameters
      ----------
      r
          The array whose standard error is to be computed.
      m
          The order of the standard error.
      length
          The size of the underlying sample to be used.
  
      Returns
      -------
      float
          The standard error of `r` with order `m`.
      """
  
      if m == 1:
          return math.sqrt(1 / length)
      else:
          return math.sqrt(
              (1 + 2 * sum(map(lambda x: x**2, r[: m - 1]))) / length
          )
  
imports: import math
  from typing import List, Optional, Sequence, Tuple, Union
  import matplotlib.pyplot
  import numpy
  from scipy.signal import argrelmax
  from scipy.stats import norm
  from statsmodels.tsa.seasonal import MSTL, STL, seasonal_decompose
  from statsmodels.tsa.stattools import acf, adfuller, grangercausalitytests, kpss, pacf
  from darts import TimeSeries
  from darts.logging import get_logger, raise_if, raise_if_not, raise_log
  from .missing_values import fill_missing_values
  from .utils import ModelMode, SeasonalityMode
label_desc: Use image node_id 2 for calling a global function with example usage: _bartlett_formula(r, m, length) and returns: math, math