code: def flatten_indices(seq_lens, width):
      flat = []
      for i, l in enumerate(seq_lens):
          for j in range(l):
              flat.append(i * width + j)
      return flat
  
imports: import argparse
  from collections import Counter
  from contextlib import contextmanager
  import gzip
  import json
  import logging
  import lzma
  import os
  import random
  import re
  import sys
  import unicodedata
  import zipfile
  import torch
  import numpy
  from stanza.models.common.constant import lcode2lang
  import stanza.models.common.seq2seq_constant
  from stanza.resources.default_packages import TRANSFORMER_NICKNAMES
  import stanza.utils.conll18_ud_eval
  from stanza.utils.conll18_ud_eval import UDError
label_desc: Use image node_id 10 for calling a global function with example usage: flatten_indices(seq_lens, width) and returns: flat