code: def flatten_str_batch(
      batch: Union[str, Iterable]
  ) -> Union[list, chain]:
      """Joins all strings from nested lists to one ``itertools.chain``.
  
      Args:
          batch: List with nested lists to flatten.
  
      Returns:
          Generator of flat List[str]. For str ``batch`` returns [``batch``].
  
      Examples:
          >>> [string for string in flatten_str_batch(['a', ['b'], [['c', 'd']]])]
          ['a', 'b', 'c', 'd']
  
      """
      if isinstance(batch, str):
          return [batch]
      else:
          return chain(*[flatten_str_batch(sample) for sample in batch])
  
imports: import collections
  import gzip
  import os
  import secrets
  import shutil
  import tarfile
  import zipfile
  from hashlib import md5
  from itertools import chain
  from logging import getLogger
  from pathlib import Path
  from typing import Any, Generator, Iterable, List, Mapping, Optional, Sequence, Sized, Union, Collection
  from urllib.parse import urlencode, parse_qs, urlsplit, urlunsplit, urlparse
  import numpy
  import requests
  from tqdm import tqdm
label_desc: Use image node_id 16 for calling a global function with example usage: flatten_str_batch(batch) and returns: list, chain