code: def test_to_str():
      """Tests to string representation of Dataset."""
      dataset = dc.data.NumpyDataset(
          X=np.random.rand(5, 3),
          y=np.random.rand(
              5,
          ),
          ids=np.arange(5),
      )
      ref_str = "<NumpyDataset X.shape: (5, 3), y.shape: (5,), w.shape: (5,), ids: [0 1 2 3 4], task_names: [0]>"
      assert str(dataset) == ref_str
  
      # Test id shrinkage
      dc.utils.set_print_threshold(10)
      dataset = dc.data.NumpyDataset(
          X=np.random.rand(50, 3),
          y=np.random.rand(
              50,
          ),
          ids=np.arange(50),
      )
      ref_str = "<NumpyDataset X.shape: (50, 3), y.shape: (50,), w.shape: (50,), ids: [0 1 2 ... 47 48 49], task_names: [0]>"
      assert str(dataset) == ref_str
  
      # Test task shrinkage
      dataset = dc.data.NumpyDataset(
          X=np.random.rand(50, 3),
          y=np.random.rand(50, 20),
          ids=np.arange(50),
      )
      ref_str = "<NumpyDataset X.shape: (50, 3), y.shape: (50, 20), w.shape: (50, 1), ids: [0 1 2 ... 47 48 49], task_names: [ 0  1  2 ... 17 18 19]>"
      assert str(dataset) == ref_str
  
      # Test max print size
      dc.utils.set_max_print_size(25)
      dataset = dc.data.NumpyDataset(
          X=np.random.rand(50, 3),
          y=np.random.rand(
              50,
          ),
          ids=np.arange(50),
      )
      ref_str = "<NumpyDataset X.shape: (50, 3), y.shape: (50,), w.shape: (50,), task_names: [0]>"
      assert str(dataset) == ref_str
  
imports: import random
  import math
  import unittest
  import os
  import numpy
  import pytest
  import deepchem
  import pandas
  import tempfile
label_desc: Use image node_id 28 for calling a global function with example usage: test_to_str() without return types