code: def create_sentiment_document(name, text, index):
      _, split, sentiment_str, _ = name.split("/")
      sentiment = {"pos": 1.0, "neg": 0.0, "unsup": None}[sentiment_str]
  
      if sentiment is None:
          split = "extra"
  
      tokens = gensim.utils.to_unicode(text).split()
      return SentimentDocument(tokens, [index], split, sentiment)
  
imports: import logging
  import collections
  import io
  import re
  import tarfile
  import os.path
  import smart_open
  import gensim.utils
  import multiprocessing
  from collections import OrderedDict
  import gensim.models.doc2vec
  from gensim.models.doc2vec import Doc2Vec
  from gensim.test.test_doc2vec import ConcatenatedDoc2Vec
  import numpy
  import statsmodels.api
  from random import sample
  from collections import defaultdict
  from random import shuffle
  import random
  import random
  from gensim.test.utils import datapath
label_desc: Use image node_id 2 for calling a global function with example usage: create_sentiment_document(name, text, index) and returns: SentimentDocument