code: def test_sorted_sampler():
      dataset = data.SimpleDataset(
          [
              np.random.normal(0, 1, (np.random.randint(10, 100), 1, 1))
              for _ in range(N)
          ]
      )
      gt_sample_id = sorted(
          range(len(dataset)),
          key=lambda i: dataset[i].shape,
          reverse=True,
      )
      sample_ret = list(
          s.SortedSampler([ele.shape[0] for ele in dataset])
      )
      for lhs, rhs in zip(gt_sample_id, sample_ret):
          assert lhs == rhs
  
file_path: gluon-nlp/tests/test_data_sampler.py
imports: import pytest
  import numpy
  from mxnet.gluon import data
  from gluonnlp.data import sampler
label_desc: Use image node_id 1 for calling a global function with example usage: test_sorted_sampler() without return types