code: def lb_envelope(ts, radius=1, be=None):
      r"""Compute time-series envelope as required by LB_Keogh.
  
      LB_Keogh was originally presented in [1]_.
  
      Parameters
      ----------
      ts : array-like, shape=(sz, d) or (sz,)
          Time-series for which the envelope should be computed.
          If shape is (sz,), the time series is assumed to be univariate.
      radius : int (default: 1)
          Radius to be used for the envelope generation (the envelope at time
          index i will be generated based on all observations from the time series
          at indices comprised between i-radius and i+radius).
      be : Backend object or string or None
          Backend. If `be` is an instance of the class `NumPyBackend` or the string `"numpy"`,
          the NumPy backend is used.
          If `be` is an instance of the class `PyTorchBackend` or the string `"pytorch"`,
          the PyTorch backend is used.
          If `be` is `None`, the backend is determined by the input arrays.
          See our :ref:`dedicated user-guide page <backend>` for more information.
  
      Returns
      -------
      envelope_down : array-like, shape=(sz, d)
          Lower-side of the envelope.
      envelope_up : array-like, shape=(sz, d)
          Upper-side of the envelope.
  
      Examples
      --------
      >>> ts1 = [1, 2, 3, 2, 1]
      >>> env_low, env_up = lb_envelope(ts1, radius=1)
      >>> env_low
      array([[1.],
             [1.],
             [2.],
             [1.],
             [1.]])
      >>> env_up
      array([[2.],
             [3.],
             [3.],
             [3.],
             [2.]])
  
      See also
      --------
      lb_keogh : Compute LB_Keogh similarity
  
      References
      ----------
      .. [1] Keogh, E. Exact indexing of dynamic time warping. In International
         Conference on Very Large Data Bases, 2002. pp 406-417.
      """
      be = instantiate_backend(be, ts)
      ts = be.array(ts)
      ts = to_time_series(ts, be=be)
      if be.is_numpy:
          return _njit_lb_envelope(ts, radius=radius)
      return _lb_envelope(ts, radius=radius, be=be)
  
imports: import warnings
  import numpy
  from numba import njit, prange
  from tslearn.backend import instantiate_backend
  from tslearn.utils import to_time_series
  from .utils import _cdist_generic
label_desc: Use image node_id 36 for calling a global function with example usage: lb_envelope(ts, radius, be) and returns: _lb_envelope, _njit_lb_envelope