code: def transform_to_array(dataset, vocab, with_label=True):
      if with_label:
          return [
              (
                  make_array(tokens, vocab),
                  numpy.array([cls], numpy.int32),
              )
              for tokens, cls in dataset
          ]
      else:
          return [make_array(tokens, vocab) for tokens in dataset]
  
file_path: chainer/examples/text_classification/nlp_utils.py
imports: import collections
  import io
  import numpy
  import chainer
label_desc: Use image node_id 6 for calling a global function with example usage: transform_to_array(dataset, vocab, with_label) and returns: unknown, unknown