code: def get_uniform_rnnt_prune_ranges(
      encoded_lengths: torch.Tensor,
      target_lengths: torch.Tensor,
      window_size_with_blank: int,
      step: int = 1,
      max_seq_len: Optional[int] = None,
      begin_only: bool = False,
  ) -> torch.Tensor:
      """Creates the pruning ranges for the Encoder and Predictor of RNNT.
      The ranges are similar to https://k2-fsa.github.io/k2/python_api/api.html#k2.get_rnnt_prune_ranges
      but they are constructed under the assumption of the uniform distribution token activations across time frames
      and without any posterior knowledge.
      """
      assert window_size_with_blank > 1
      assert step >= 1
      assert window_size_with_blank > step
      assert len(encoded_lengths) == len(target_lengths)
      ranges_begin = torch.zeros(
          (
              len(encoded_lengths),
              encoded_lengths.max()
              if max_seq_len is None
              else max(max_seq_len, encoded_lengths.max()),
          ),
          dtype=torch.long,
      )
      for i in (target_lengths >= window_size_with_blank).nonzero(
          as_tuple=True
      )[0]:
          encoded_len = encoded_lengths[i]
          ranges_begin_raw = (
              torch.arange(
                  int(
                      (target_lengths[i] - window_size_with_blank)
                      / step
                      + 2
                  )
              )
              * step
          )
          ranges_begin_raw[-1] = (
              target_lengths[i] - window_size_with_blank + 1
          )
          ranges_begin[
              i, :encoded_len
          ] = torch.nn.functional.interpolate(
              ranges_begin_raw.reshape(1, 1, -1).to(dtype=torch.float),
              encoded_len,
              mode="nearest-exact",
          ).to(
              dtype=torch.long
          )
          ranges_begin[i, encoded_len:] = ranges_begin[
              i, encoded_len - 1
          ]
      return (
          ranges_begin
          if begin_only
          else ranges_begin.unsqueeze(-1).repeat(
              1, 1, window_size_with_blank
          )
          + torch.arange(window_size_with_blank)
      )
  
imports: import os
  import struct
  from pickle import UnpicklingError
  from typing import List, Optional, Tuple, Union
  import torch
  from nemo.core.utils.k2_guard import k2
  from nemo.utils import logging
label_desc: Use image node_id 16 for calling a global function with example usage: get_uniform_rnnt_prune_ranges(encoded_lengths, target_lengths, window_size_with_blank, step, max_seq_len, begin_only) and returns: unknown