code: def test_morph_set(i_has):
      assert i_has[0].morph.get("PronType") == ["prs"]
      # set by string
      i_has[0].set_morph("PronType=unk")
      assert i_has[0].morph.get("PronType") == ["unk"]
      # set by string, fields are alphabetized
      i_has[0].set_morph("PronType=123|NounType=unk")
      assert str(i_has[0].morph) == "NounType=unk|PronType=123"
      # set by dict
      i_has[0].set_morph({"AType": "123", "BType": "unk"})
      assert str(i_has[0].morph) == "AType=123|BType=unk"
      # set by string with multiple values, fields and values are alphabetized
      i_has[0].set_morph("BType=c|AType=b,a")
      assert str(i_has[0].morph) == "AType=a,b|BType=c"
      # set by dict with multiple values, fields and values are alphabetized
      i_has[0].set_morph({"AType": "b,a", "BType": "c"})
      assert str(i_has[0].morph) == "AType=a,b|BType=c"
  
file_path: spaCy/spacy/tests/doc/test_morphanalysis.py
imports: import pytest
label_desc: Use image node_id 7 for calling a global function with example usage: test_morph_set(i_has) without return types