parameters: (path, shard_index=0, num_shards=1)
docstring: Regenerates all playthroughs in the path.
docstring_summary: Regenerates all playthroughs in the path.
docstring_tokens: Regenerates all playthroughs in the path .
function: def update_path(path, shard_index=0, num_shards=1):
    """Regenerates all playthroughs in the path."""
    for filename in sorted(os.listdir(path))[shard_index::num_shards]:
      try:
        original, kwargs = _read_playthrough(os.path.join(path, filename))
        try:
          pyspiel.load_game(kwargs["game_string"])
        except pyspiel.SpielError as e:
          if "Unknown game" in str(e):
            print("[Skipped] Skipping game ", filename, " as ",
                  kwargs["game_string"], " is not available.")
            continue
          else:
            raise
        new = playthrough(**kwargs)
        if original == new:
          print("        {}".format(filename))
        else:
          with open(os.path.join(path, filename), "w") as f:
            f.write(new)
          print("Updated {}".format(filename))
      except Exception as e:  # pylint: disable=broad-except
        print("{} failed: {}".format(filename, e))
        raise
function_tokens: def update_path ( path , shard_index = 0 , num_shards = 1 ) : for filename in sorted ( os . listdir ( path ) ) [ shard_index : : num_shards ] : try : original , kwargs = _read_playthrough ( os . path . join ( path , filename ) ) try : pyspiel . load_game ( kwargs [ "game_string" ] ) except pyspiel . SpielError as e : if "Unknown game" in str ( e ) : print ( "[Skipped] Skipping game " , filename , " as " , kwargs [ "game_string" ] , " is not available." ) continue else : raise new = playthrough ( * * kwargs ) if original == new : print ( "        {}" . format ( filename ) ) else : with open ( os . path . join ( path , filename ) , "w" ) as f : f . write ( new ) print ( "Updated {}" . format ( filename ) ) except Exception as e : # pylint: disable=broad-except print ( "{} failed: {}" . format ( filename , e ) ) raise