code: def num_objects(memory_str):
      n = 0
      for line in data_lines(memory_str):
          n += 1
      return n
  
imports: import os
  import time
  import numpy
  import pytest
  import ray
  from ray._private.internal_api import memory_summary
  from ray._private.test_utils import Semaphore, wait_for_condition
  from ray.cluster_utils import Cluster, cluster_not_supported
label_desc: Use image node_id 2 for calling a global function with example usage: num_objects(memory_str) and returns: n