code: def _get_data(n):
      t = [1] * (n - n // 2) + [0] * (n // 2)
      sf = tc.SFrame({"target": t})
      sf = sf.add_row_number()
      sf["id"] = sf["id"].apply(
          lambda x: {x: 1} if x != 0 else {i: 1 for i in range(n)}
      )
      return sf
  
file_path: turicreate/src/python/turicreate/test/test_external_memory_tree.py
imports: from __future__ import print_function
  from __future__ import division
  from __future__ import absolute_import
  import unittest
  import turicreate
  from array import array
  import pytest
label_desc: Use image node_id 1 for calling a global function with example usage: _get_data(n) and returns: sf