code: def sort_ds_by_id(ds):
      return sorted(dataset_utils.as_numpy(ds), key=lambda x: x["id"])
  
imports: import os
  from typing import Iterable
  import apache_beam
  from apache_beam.testing.test_pipeline import TestPipeline
  import numpy
  import tensorflow
  from tensorflow_datasets import testing
  from tensorflow_datasets.core import dataset_builder
  from tensorflow_datasets.core import dataset_utils
  from tensorflow_datasets.core.dataset_builders import adhoc_builder
  import tensorflow_datasets.public_api
label_desc: Use image node_id 2 for calling a global function with example usage: sort_ds_by_id(ds) and returns: sorted