code: def test_sent_id_comment(doc):
      """
      Test that setting the sent_id on a sentence sets the sentiment comment
      """
      for sent_idx, sentence in enumerate(doc.sentences):
          assert (
              len(
                  [
                      x
                      for x in sentence.comments
                      if x.startswith("# sent_id")
                  ]
              )
              == 1
          )
          assert sentence.sent_id == "%d" % sent_idx
      doc.sentences[0].sent_id = "foo"
      assert doc.sentences[0].sent_id == "foo"
      assert (
          len(
              [
                  x
                  for x in doc.sentences[0].comments
                  if x.startswith("# sent_id")
              ]
          )
          == 1
      )
      assert "# sent_id = foo" in doc.sentences[0].comments
  
      doc.reindex_sentences(10)
      for sent_idx, sentence in enumerate(doc.sentences):
          assert sentence.sent_id == "%d" % (sent_idx + 10)
          assert (
              len(
                  [
                      x
                      for x in doc.sentences[0].comments
                      if x.startswith("# sent_id")
                  ]
              )
              == 1
          )
          assert "# sent_id = %d" % (sent_idx + 10) in sentence.comments
  
      doc.sentences[0].add_comment("# sent_id = bar")
      assert doc.sentences[0].sent_id == "bar"
      assert "# sent_id = bar" in doc.sentences[0].comments
      assert (
          len(
              [
                  x
                  for x in doc.sentences[0].comments
                  if x.startswith("# sent_id")
              ]
          )
          == 1
      )
  
file_path: stanza/stanza/tests/common/test_doc.py
imports: import pytest
  import stanza
  from stanza.tests import *
  from stanza.models.common.doc import Document, ID, TEXT, NER, CONSTITUENCY, SENTIMENT
label_desc: Use image node_id 8 for calling a global function with example usage: test_sent_id_comment(doc) without return types