code: def itakura_mask(sz1, sz2, max_slope=2.0, be=None):
      """Compute the Itakura mask.
  
      Parameters
      ----------
      sz1 : int
          The size of the first time series
      sz2 : int
          The size of the second time series.
      max_slope : float (default = 2)
          The maximum slope of the parallelogram.
      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
      -------
      mask : array-like, shape=(sz1, sz2)
          Itakura mask.
  
      Examples
      --------
      >>> itakura_mask(6, 6)
      array([[ 0., inf, inf, inf, inf, inf],
             [inf,  0.,  0., inf, inf, inf],
             [inf,  0.,  0.,  0., inf, inf],
             [inf, inf,  0.,  0.,  0., inf],
             [inf, inf, inf,  0.,  0., inf],
             [inf, inf, inf, inf, inf,  0.]])
      """
      be = instantiate_backend(be)
  
      if be.is_numpy:
          mask = _njit_itakura_mask(sz1, sz2, max_slope=max_slope)
      else:
          mask = _itakura_mask(sz1, sz2, max_slope=max_slope, be=be)
  
      # Post-check
      raise_warning = False
      for i in range(sz1):
          if not be.any(be.isfinite(mask[i])):
              raise_warning = True
              break
      if not raise_warning:
          for j in range(sz2):
              if not be.any(be.isfinite(mask[:, j])):
                  raise_warning = True
                  break
      if raise_warning:
          warnings.warn(
              "'itakura_max_slope' constraint is unfeasible "
              "(ie. leads to no admissible path) for the "
              "provided time series sizes",
              RuntimeWarning,
          )
  
      return mask
  
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 30 for calling a global function with example usage: itakura_mask(sz1, sz2, max_slope, be) and returns: mask