code: def _load_state(checkpoint_directory: pathlib.Path) -> Any:
      checkpoint_directory = pathlib.Path(checkpoint_directory)
      with checkpoint_directory.joinpath("metadata.json").open(
          "r"
      ) as f:
          metadata = json.load(f)
          return metadata
  
imports: import abc
  import json
  import logging
  import math
  import os
  import pathlib
  import uuid
  import warnings
  from typing import TYPE_CHECKING, Any, ContextManager, Dict, Optional, Set, Sized, Type
  import torch
  import torch.distributed
  from torch import nn
  from torch.utils import data
  import determined
  from determined import common, core, pytorch
label_desc: Use image node_id 4 for calling a global function with example usage: _load_state(checkpoint_directory) and returns: metadata