original_docstring: Make sure an existing checkpoint looks correct.
docstring: Make sure an existing checkpoint looks correct.
docstring_tokens: Make sure an existing checkpoint looks correct .
code: def validate_checkpoint(checkpoint_dir: str) -> None:
      """Make sure an existing checkpoint looks correct."""
      assert os.path.exists(checkpoint_dir)
      files_found = set(storage.StorageManager._list_directory(checkpoint_dir))
      assert files_found == set(EXPECTED_FILES.keys())
      for found in files_found:
          path = os.path.join(checkpoint_dir, found)
          if EXPECTED_FILES[found] is None:
              assert os.path.isdir(path)
          else:
              assert os.path.isfile(path)
              with open(path) as f:
                  assert f.read() == EXPECTED_FILES[found]
code_tokens: def validate_checkpoint ( checkpoint_dir : str ) -> None : assert os . path . exists ( checkpoint_dir ) files_found = set ( storage . StorageManager . _list_directory ( checkpoint_dir ) ) assert files_found == set ( EXPECTED_FILES . keys ( ) ) for found in files_found : path = os . path . join ( checkpoint_dir , found ) if EXPECTED_FILES [ found ] is None : assert os . path . isdir ( path ) else : assert os . path . isfile ( path ) with open ( path ) as f : assert f . read ( ) == EXPECTED_FILES [ found ]
short_docstring: Make sure an existing checkpoint looks correct.
short_docstring_tokens: Make sure an existing checkpoint looks correct .
comment: """Make sure an existing checkpoint looks correct."""