code: def mas_width1(log_attn_map):
      """mas with hardcoded width=1"""
      # assumes mel x text
      neg_inf = log_attn_map.dtype.type(-np.inf)
      log_p = log_attn_map.copy()
      log_p[0, 1:] = neg_inf
      for i in range(1, log_p.shape[0]):
          prev_log1 = neg_inf
          for j in range(log_p.shape[1]):
              prev_log2 = log_p[i - 1, j]
              log_p[i, j] += max(prev_log1, prev_log2)
              prev_log1 = prev_log2
  
      # now backtrack
      opt = np.zeros_like(log_p)
      one = opt.dtype.type(1)
      j = log_p.shape[1] - 1
      for i in range(log_p.shape[0] - 1, 0, -1):
          opt[i, j] = one
          if log_p[i - 1, j - 1] >= log_p[i - 1, j]:
              j -= 1
              if j == 0:
                  opt[1:i, j] = one
                  break
      opt[0, j] = one
      return opt
  
imports: from enum import Enum
  from typing import Optional, Tuple
  import librosa
  import matplotlib.pylab
  import numpy
  import torch
  from einops import rearrange
  from numba import jit, prange
  from nemo.collections.tts.torch.tts_data_types import DATA_STR2DATA_CLASS, MAIN_DATA_TYPES, WithLens
  from nemo.utils import logging
  from nemo.utils.decorators import deprecated
label_desc: Use image node_id 9 for calling a global function with example usage: mas_width1(log_attn_map) and returns: opt