code: def _lb_envelope(time_series, radius, be=None):
      """Compute time-series envelope as required by LB_Keogh.
  
      Parameters
      ----------
      time_series : array-like, shape=(sz, d)
          Time-series for which the envelope should be computed.
      radius : int
          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.
      """
      be = instantiate_backend(be, time_series)
      time_series = be.array(time_series)
      sz, d = be.shape(time_series)
      envelope_up = be.empty((sz, d))
      envelope_down = be.empty((sz, d))
  
      for i in range(sz):
          min_idx = i - radius
          max_idx = i + radius + 1
          if min_idx < 0:
              min_idx = 0
          if max_idx > sz:
              max_idx = sz
          for di in range(d):
              envelope_down[i, di] = be.min(
                  time_series[min_idx:max_idx, di]
              )
              envelope_up[i, di] = be.max(
                  time_series[min_idx:max_idx, di]
              )
  
      return envelope_down, envelope_up
  
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 35 for calling a global function with example usage: _lb_envelope(time_series, radius, be) and returns: envelope_down,  envelope_up