code: def subdict(d, expected_dict):
      """Return a new dict with only the items from `d` whose keys occur in `expected_dict`."""
      return {k: v for k, v in d.items() if k in expected_dict}
  
file_path: wandb/tests/pytest_tests/unit_tests_old/utils/utils.py
imports: import io
  import os
  import shutil
  import socket
  from typing import Union
label_desc: Use image node_id 4 for calling a global function with example usage: subdict(d, expected_dict) and returns: unknown