class_docstr: Writer class for 'midi.scp'
  
  Examples:
      key1 /some/path/a.musicxml
      key2 /some/path/b.musicxml
      key3 /some/path/c.musicxml
      key4 /some/path/d.musicxml
      ...
  
      >>> writer = XMLScpWriter('./data/', './data/xml.scp')
      >>> writer['aa'] = xml_obj
      >>> writer['bb'] = xml_obj
class_docstr_tok: ["Writer","class","for","'midi.scp'","Examples",":","key1","\/some\/path\/a.musicxml","key2","\/some\/path\/b.musicxml","key3","\/some\/path\/c.musicxml","key4","\/some\/path\/d.musicxml","...",">",">",">","writer","=","XMLScpWriter","(","'.\/data\/","'",",","'.\/data\/xml.scp","'",")",">",">",">","writer","[","'aa","'","]","=","xml_obj",">",">",">","writer","[","'bb","'","]","=","xml_obj"]
code: def __init__(
      self,
      outdir: Union[Path, str],
      scpfile: Union[Path, str],
  ):
      assert check_argument_types()
      self.dir = Path(outdir)
      self.dir.mkdir(parents=True, exist_ok=True)
      scpfile = Path(scpfile)
      scpfile.parent.mkdir(parents=True, exist_ok=True)
      self.fscp = scpfile.open("w", encoding="utf-8")
      self.data = {}
  
imports: import collections.abc
  import json
  from pathlib import Path
  from typing import Union
  import numpy
  from typeguard import check_argument_types
  from espnet2.fileio.read_text import read_2columns_text
label_desc: Use image node_id 1 to create a new XMLWriter object  with example: obj = XMLWriter(outdir, scpfile)