code: def test_dataset_adapter(dataset_adapter):
      loader = DataLoader(dataset_adapter, batch_size=2)
      batch = next(iter(loader))
      assert batch.x.shape == (6, 8)
      assert len(loader) == 2
  
      # Test sharding:
      dataset_adapter.apply_sharding(2, 0)
      assert len([data for data in dataset_adapter]) == 2
  
      assert dataset_adapter.is_shardable()
  
file_path: pytorch_geometric/test/data/test_datapipes.py
imports: import pytest
  import torch
  from torch_geometric.data import Data
  from torch_geometric.data.datapipes import DatasetAdapter
  from torch_geometric.loader import DataLoader
  from torch_geometric.testing import withPackage
  from torch_geometric.utils import to_smiles
label_desc: Use image node_id 2 for calling a global function with example usage: test_dataset_adapter(dataset_adapter) without return types