code: def test_sha1_get(sha1_store, compress):
      """Testing the get() API: normal and exception cases."""
      if sys.version_info.major == 3 and sys.version_info.minor > 10:
          pytest.skip(
              "pgzip package doesn't work with 3.11's gzip module"
          )
  
      os.chdir(TESTING_STORE_DIR)
  
      # Add a file, a state dict and a tensor.
      file = "test_get.pt"
      torch.save(nn.Linear(100, 100).state_dict(), file)
      state_dict = nn.Sequential(
          nn.Linear(10, 10), nn.Linear(10, 20)
      ).state_dict()
      tensor = torch.ones(20, 30)
  
      # Check that we can get them back.
      file_sha1 = sha1_store.add(file, compress)
      sd = sha1_store.get(file_sha1)
      assert objects_are_equal(sd, torch.load(file))
  
      sd_sha1 = sha1_store.add(state_dict, compress)
      sd = sha1_store.get(sd_sha1)
      assert objects_are_equal(sd, state_dict)
  
      tensor_sha1 = sha1_store.add(tensor, compress)
      tensor_got = sha1_store.get(tensor_sha1)
      assert objects_are_equal(tensor_got, tensor)
  
      # Make sure invalid sha1 cause exceptions.
      with pytest.raises(ValueError):
          sha1_store.get(tensor_sha1[:-1])
  
file_path: fairscale/tests/experimental/wgit/test_sha1_store.py
imports: import os
  from pathlib import Path
  import shutil
  import sys
  import pytest
  import torch
  from torch import nn
  from fairscale.experimental.wgit.sha1_store import SHA1_Store
  from fairscale.fair_dev.testing.testing import objects_are_equal
label_desc: Use image node_id 5 for calling a global function with example usage: test_sha1_get(sha1_store, compress) without return types