code: def test_validator_instance_is_picklable():
      # Needs to be picklable because the validator instance may be sent between processes
  
      original_validator = RSASignatureValidator()
      unpickled_validator = pickle.loads(
          pickle.dumps(original_validator)
      )
  
      # To check that the private key was pickled and unpickled correctly, we sign a record
      # with the original public key using the unpickled validator and then validate the signature
  
      record = DHTRecord(
          key=b"key",
          subkey=b"subkey" + original_validator.local_public_key,
          value=b"value",
          expiration_time=get_dht_time() + 10,
      )
      signed_record = dataclasses.replace(
          record, value=unpickled_validator.sign_value(record)
      )
  
      assert b"[signature:" in signed_record.value
      assert original_validator.validate(signed_record)
      assert unpickled_validator.validate(signed_record)
  
file_path: hivemind/tests/test_dht_crypto.py
imports: import dataclasses
  import multiprocessing
  import pickle
  import pytest
  import hivemind
  from hivemind.dht.crypto import RSASignatureValidator
  from hivemind.dht.node import DHTNode
  from hivemind.dht.validation import DHTRecord
  from hivemind.utils.crypto import RSAPrivateKey
  from hivemind.utils.timed_storage import get_dht_time
label_desc: Use image node_id 3 for calling a global function with example usage: test_validator_instance_is_picklable() without return types