code: def find_shard_index(nodeid: str, num_shards: int) -> int:
      """
      Return the index of the shard that should run this test
      """
      for prefix, target_shard_idx in FIXED_ALLOCATION_PREFIXES.items():
          if nodeid.startswith(prefix):
              if target_shard_idx >= num_shards:
                  raise RuntimeError(
                      f"Cannot collect sharded tests, {nodeid} has hardcoded shard index {target_shard_idx} among only {num_shards} shards"
                  )
              return target_shard_idx
  
      if nodeid in HARDCODED_ALLOCATIONS:
          hash = HARDCODED_ALLOCATIONS[nodeid]
      else:
          hash = hashlib.md5(nodeid.encode())
          hash = int(hash.hexdigest(), 16)
  
      return hash % num_shards
  
file_path: tvm/conftest.py
imports: import hashlib
  import pytest
  import sys
  import os
  from pathlib import Path
label_desc: Use image node_id 1 for calling a global function with example usage: find_shard_index(nodeid, num_shards) and returns: unknown, target_shard_idx