code: def _from_j_checkpoint_storage(j_checkpoint_storage):
      if j_checkpoint_storage is None:
          return None
      gateway = get_gateway()
      JCheckpointStorage = (
          gateway.jvm.org.apache.flink.runtime.state.CheckpointStorage
      )
      JJobManagerCheckpointStorage = (
          gateway.jvm.org.apache.flink.runtime.state.storage.JobManagerCheckpointStorage
      )
      JFileSystemCheckpointStorage = (
          gateway.jvm.org.apache.flink.runtime.state.storage.FileSystemCheckpointStorage
      )
  
      j_clz = j_checkpoint_storage.getClass()
  
      if not get_java_class(JCheckpointStorage).isAssignableFrom(j_clz):
          raise TypeError(
              "%s is not an instance of CheckpointStorage."
              % j_checkpoint_storage
          )
  
      if get_java_class(JJobManagerCheckpointStorage).isAssignableFrom(
          j_clz
      ):
          return JobManagerCheckpointStorage(
              j_jobmanager_checkpoint_storage=j_checkpoint_storage
          )
      elif get_java_class(
          JFileSystemCheckpointStorage
      ).isAssignableFrom(j_clz):
          return FileSystemCheckpointStorage(
              j_filesystem_checkpoint_storage=j_checkpoint_storage
          )
      else:
          return CustomCheckpointStorage(j_checkpoint_storage)
  
imports: from abc import ABCMeta
  from py4j.java_gateway import get_java_class
  from typing import Optional
  from pyflink.java_gateway import get_gateway
label_desc: Use image node_id 1 for calling a global function with example usage: _from_j_checkpoint_storage(j_checkpoint_storage) and returns: None, JobManagerCheckpointStorage, FileSystemCheckpointStorage, CustomCheckpointStorage