class_docstr: A reference to data persisted as a directory in local or remote storage.
  
  Access the checkpoint contents locally using ``checkpoint.to_directory()``
  or ``checkpoint.as_directory``.
  
  Example creating a checkpoint using ``Checkpoint.from_directory``:
  
      >>> from ray.train import Checkpoint
      >>> checkpoint = Checkpoint.from_directory("/tmp/example_checkpoint_dir")
      >>> checkpoint.filesystem  # doctest: +ELLIPSIS
      <pyarrow._fs.LocalFileSystem object...
      >>> checkpoint.path
      '/tmp/example_checkpoint_dir'
  
  Example creating a checkpoint from a remote URI:
  
      >>> checkpoint = Checkpoint("s3://bucket/path/to/checkpoint")
      >>> checkpoint.filesystem  # doctest: +ELLIPSIS
      <pyarrow._s3fs.S3FileSystem object...
      >>> checkpoint.path
      'bucket/path/to/checkpoint'
  
  Example creating a checkpoint with a custom filesystem:
  
      >>> checkpoint = Checkpoint(
      ...     path="bucket/path/to/checkpoint",
      ...     filesystem=pyarrow.fs.S3FileSystem(),
      ... )
      >>> checkpoint.filesystem  # doctest: +ELLIPSIS
      <pyarrow._s3fs.S3FileSystem object...
      >>> checkpoint.path
      'bucket/path/to/checkpoint'
  
  Attributes:
      path: A path on the filesystem containing the checkpoint contents.
      filesystem: PyArrow FileSystem that can be used to access data at the `path`.
class_docstr_tok: ["A","reference","to","data","persisted","as","a","directory","in","local","or","remote","storage",".","Access","the","checkpoint","contents","locally","using","``","checkpoint.to_directory","(",")","``","or","``","checkpoint.as_directory","``",".","Example","creating","a","checkpoint","using","``","Checkpoint.from_directory","``",":",">",">",">","from","ray.train","import","Checkpoint",">",">",">","checkpoint","=","Checkpoint.from_directory","(","``","\/tmp\/example_checkpoint_dir","''",")",">",">",">","checkpoint.filesystem","#","doctest",":","+ELLIPSIS","<","pyarrow._fs.LocalFileSystem","object","...",">",">",">","checkpoint.path","'\/tmp\/example_checkpoint_dir'","Example","creating","a","checkpoint","from","a","remote","URI",":",">",">",">","checkpoint","=","Checkpoint","(","``","s3",":","\/\/bucket\/path\/to\/checkpoint","''",")",">",">",">","checkpoint.filesystem","#","doctest",":","+ELLIPSIS","<","pyarrow._s3fs.S3FileSystem","object","...",">",">",">","checkpoint.path","'bucket\/path\/to\/checkpoint'","Example","creating","a","checkpoint","with","a","custom","filesystem",":",">",">",">","checkpoint","=","Checkpoint","(","...","path=","''","bucket\/path\/to\/checkpoint","''",",","...","filesystem=pyarrow.fs.S3FileSystem","(",")",",","...",")",">",">",">","checkpoint.filesystem","#","doctest",":","+ELLIPSIS","<","pyarrow._s3fs.S3FileSystem","object","...",">",">",">","checkpoint.path","'bucket\/path\/to\/checkpoint'","Attributes",":","path",":","A","path","on","the","filesystem","containing","the","checkpoint","contents",".","filesystem",":","PyArrow","FileSystem","that","can","be","used","to","access","data","at","the","`","path","`","."]
docstr: Create checkpoint object from a local directory.
  
  Args:
      path: Local directory containing checkpoint data.
  
  Returns:
      A ray.train.Checkpoint object.
docstr_tok: ["Create","checkpoint","object","from","a","local","directory",".","Args",":","path",":","Local","directory","containing","checkpoint","data",".","Returns",":","A","ray.train.Checkpoint","object","."]
code: def from_directory(
      cls, path: Union[str, os.PathLike]
  ) -> "Checkpoint":
      """Create checkpoint object from a local directory.
  
      Args:
          path: Local directory containing checkpoint data.
  
      Returns:
          A ray.train.Checkpoint object.
      """
      return cls(path, filesystem=pyarrow.fs.LocalFileSystem())
  
imports: import contextlib
  import glob
  import json
  import logging
  import os
  import platform
  import shutil
  import tempfile
  import traceback
  import uuid
  from typing import Any, Dict, Iterator, List, Optional, Union
  import pyarrow.fs
  from ray.air._internal.filelock import TempFileLock
  from ray.train._internal.storage import _download_from_fs_path, _exists_at_fs_path
  from ray.util.annotations import PublicAPI
label_desc: Use image node_id 6 for calling the Checkpoint obj's underlying member method code with example usage: obj.from_directory(cls, path) and returns: cls