code: def load_from_party(
      f=None,
      preloaded=None,
      encrypted=False,
      model_class=None,
      src=0,
      load_closure=torch.load,
      **kwargs,
  ):
      """
      Loads an object saved with `torch.save()` or `crypten.save_from_party()`.
  
      Args:
          f: a file-like object (has to implement `read()`, `readline()`,
                `tell()`, and `seek()`), or a string containing a file name
          preloaded: Use the preloaded value instead of loading a tensor/model from f.
          encrypted: Determines whether crypten should load an encrypted tensor
                        or a plaintext torch tensor.
          model_class: Takes a model architecture class that is being communicated. This
                      class will be considered safe for deserialization so non-source
                      parties will be able to receive a model of this type from the
                      source party.
          src: Determines the source of the tensor. If `src` is None, each
              party will attempt to read in the specified file. If `src` is
              specified, the source party will read the tensor from `f` and it
              will broadcast it to the other parties
          load_closure: Custom load function that matches the interface of `torch.load`,
          to be used when the tensor is saved with a custom save function in
          `crypten.save_from_party`. Additional kwargs are passed on to the closure.
      """
  
      if encrypted:
          raise NotImplementedError(
              "Loading encrypted tensors is not yet supported"
          )
      else:
          assert isinstance(
              src, int
          ), "Load failed: src argument must be an integer"
          assert (
              src >= 0 and src < Communicator.get().get_world_size()
          ), "Load failed: src must be in [0, world_size)"
  
          # source party
          if Communicator.get().get_rank() == src:
              assert (f is None and (preloaded is not None)) or (
                  (f is not None) and preloaded is None
              ), "Exactly one of f and preloaded must not be None"
  
              if f is None:
                  result = preloaded
              if preloaded is None:
                  result = load_closure(f, **kwargs)
  
              # Zero out the tensors / modules to hide loaded data from broadcast
              if torch.is_tensor(result):
                  result_zeros = result.new_zeros(result.size())
              elif isinstance(result, torch.nn.Module):
                  result_zeros = copy.deepcopy(result)
                  for p in result_zeros.parameters():
                      p.data.fill_(0)
              else:
                  result = Communicator.get().broadcast_obj(-1, src)
                  raise TypeError(
                      "Unrecognized load type %s" % type(result)
                  )
  
              Communicator.get().broadcast_obj(result_zeros, src)
  
          # Non-source party
          else:
              if model_class is not None:
                  from .common import serial
  
                  serial.register_safe_class(model_class)
              result = Communicator.get().broadcast_obj(None, src)
              if isinstance(result, int) and result == -1:
                  raise TypeError(
                      "Unrecognized load type from src party"
                  )
  
          if torch.is_tensor(result):
              result = cryptensor(result, src=src)
  
          # TODO: Encrypt modules before returning them
          # if isinstance(result, torch.nn.Module):
          #     result = crypten.nn.from_pytorch(result, src=src)
  
          result.src = src
          return result
  
imports: import builtins
  import copy
  import logging
  import os
  import typing
  import torch
  from .None import nn
  from .None import primitives, provider
  from .communicator import Communicator
  from .config import cfg
  from .cryptensor import CrypTensor
  from .mpc import MPCTensor
  from .ptype import ptype
label_desc: Use image node_id 6 for calling a global function with example usage: load_from_party(f, preloaded, encrypted, model_class, src, load_closure) and returns: result