code: def read_2columns_text(path: Union[Path, str]) -> Dict[str, str]:
      """Read a text file having 2 columns as dict object.
  
      Examples:
          wav.scp:
              key1 /some/path/a.wav
              key2 /some/path/b.wav
  
          >>> read_2columns_text('wav.scp')
          {'key1': '/some/path/a.wav', 'key2': '/some/path/b.wav'}
  
      """
      assert check_argument_types()
  
      data = {}
      with Path(path).open("r", encoding="utf-8") as f:
          for linenum, line in enumerate(f, 1):
              sps = line.rstrip().split(maxsplit=1)
              if len(sps) == 1:
                  k, v = sps[0], ""
              else:
                  k, v = sps
  
              if k in data:
                  raise RuntimeError(
                      f"{k} is duplicated ({path}:{linenum})"
                  )
              data[k] = v
      return data
  
file_path: espnet/espnet2/fileio/read_text.py
imports: import collections.abc
  import logging
  from mmap import mmap
  from pathlib import Path
  from random import randint
  from typing import Dict, List, Optional, Tuple, Union
  from typeguard import check_argument_types
label_desc: Use image node_id 1 for calling a global function with example usage: read_2columns_text(path) and returns: data