code: def make_classifier_data(n, d, seed=None):
      """
      Construct a synthetic dataset with a variety of data types to test the
      nearest neighbors classifier.
      """
      if seed:
          np.random.seed(seed)
  
      sf = tc.SFrame()
  
      # integer and float columns
      for i in range(d):
          sf["int{}".format(i)] = np.random.randint(
              low=-10, high=10, size=n
          )
  
      for i in range(d):
          v = np.random.rand(n)
          sf["float{}".format(i)] = v * 20 - 10
  
      # array column
      array_feature = []
      for i in range(n):
          array_feature.append(array.array("f", np.random.rand(d)))
      sf["array0"] = array_feature
  
      # string and dict columns
      for i in range(d + 1):
          sf["str{}".format(i)] = test_util.uniform_string_column(
              n, word_length=5, alphabet_size=5, missingness=0.0
          )
  
      sf["dict0"] = tc.text_analytics.count_ngrams(
          sf["str{}".format(d)], n=3, method="character", to_lower=False
      )
      sf.remove_column("str{}".format(d), inplace=True)
  
      # target column (string)
      sf["class"] = test_util.uniform_string_column(
          n, word_length=1, alphabet_size=3, missingness=0.0
      )
  
      return sf
  
imports: from __future__ import print_function
  from __future__ import division
  from __future__ import absolute_import
  import unittest
  import copy
  import array
  import numpy
  import turicreate
  from .None import util
  from turicreate.util import _assert_sframe_equal
  from turicreate.toolkits._main import ToolkitError
  import sys
label_desc: Use image node_id 1 for calling a global function with example usage: make_classifier_data(n, d, seed) and returns: sf