class_docstr: Base class for save handlers
  
  Methods to override:
  
  - :meth:`~ignite.handlers.checkpoint.BaseSaveHandler.__call__`
  - :meth:`~ignite.handlers.checkpoint.BaseSaveHandler.remove`
  
  
  Note:
      In derived class, please, make sure that in distributed configuration overridden methods are called by a single
      process. Distributed configuration on XLA devices should be treated slightly differently: for saving checkpoint
      with `xm.save() <https://pytorch.org/xla/release/1.5/index.html#torch_xla.core.xla_model.save>`_  all processes
      should pass into the function. Otherwise, application gets stuck.
class_docstr_tok: ["Base","class","for","save","handlers","Methods","to","override",":","-",":","meth",":","`","~ignite.handlers.checkpoint.BaseSaveHandler.__call__","`","-",":","meth",":","`","~ignite.handlers.checkpoint.BaseSaveHandler.remove","`","Note",":","In","derived","class",",","please",",","make","sure","that","in","distributed","configuration","overridden","methods","are","called","by","a","single","process",".","Distributed","configuration","on","XLA","devices","should","be","treated","slightly","differently",":","for","saving","checkpoint","with","`","xm.save","(",")","<","https",":","\/\/pytorch.org\/xla\/release\/1.5\/index.html","#","torch_xla.core.xla_model.save",">","`","_","all","processes","should","pass","into","the","function",".","Otherwise",",","application","gets","stuck","."]
docstr: Method to save `checkpoint` with `filename`. Additionally, metadata dictionary is provided.
  
  Metadata contains:
  
  - `basename`: file prefix (if provided) with checkpoint name, e.g. `epoch_checkpoint`.
  - `score_name`: score name if provided, e.g `val_acc`.
  - `priority`: checkpoint priority value (higher is better), e.g. `12` or `0.6554435`
  
  Args:
      checkpoint: checkpoint dictionary to save.
      filename: filename associated with checkpoint.
      metadata: metadata on checkpoint to save.
docstr_tok: ["Method","to","save","`","checkpoint","`","with","`","filename","`",".","Additionally",",","metadata","dictionary","is","provided",".","Metadata","contains",":","-","`","basename","`",":","file","prefix","(","if","provided",")","with","checkpoint","name",",","e.g",".","`","epoch_checkpoint","`",".","-","`","score_name","`",":","score","name","if","provided",",","e.g","`","val_acc","`",".","-","`","priority","`",":","checkpoint","priority","value","(","higher","is","better",")",",","e.g",".","`","12","`","or","`","0.6554435","`","Args",":","checkpoint",":","checkpoint","dictionary","to","save",".","filename",":","filename","associated","with","checkpoint",".","metadata",":","metadata","on","checkpoint","to","save","."]
code: def __call__(
      self,
      checkpoint: Mapping,
      filename: str,
      metadata: Optional[Mapping] = None,
  ) -> None:
      """Method to save `checkpoint` with `filename`. Additionally, metadata dictionary is provided.
  
      Metadata contains:
  
      - `basename`: file prefix (if provided) with checkpoint name, e.g. `epoch_checkpoint`.
      - `score_name`: score name if provided, e.g `val_acc`.
      - `priority`: checkpoint priority value (higher is better), e.g. `12` or `0.6554435`
  
      Args:
          checkpoint: checkpoint dictionary to save.
          filename: filename associated with checkpoint.
          metadata: metadata on checkpoint to save.
  
      """
  
imports: import collections.abc
  import numbers
  import os
  import stat
  import tempfile
  from abc import ABCMeta, abstractmethod
  from collections import OrderedDict
  from pathlib import Path
  from typing import Any, Callable, cast, Dict, List, Mapping, NamedTuple, Optional, Union
  import torch
  import torch.nn
  from packaging.version import Version
  import ignite.distributed
  from ignite.base import Serializable
  from ignite.engine import Engine, Events
  from ignite.utils import _tree_apply2, _tree_map
label_desc: Use image node_id 1 for calling the BaseSaveHandler obj's underlying member method code with example usage: obj.__call__(checkpoint, filename, metadata) without return types