code: def main(argv):
      if len(argv) <= 1:
          raise app.UsageError(
              "Please give one or more replay files/directories to scan as argv."
          )
  
      run_config = run_configs.get()
  
      # Use a set over the full version struct to catch cases where Blizzard failed
      # to update the version field properly (eg 5.0.0).
      versions = set()
  
      def replay_version(replay_path):
          """Query a replay for information."""
          if replay_path.lower().endswith("sc2replay"):
              data = run_config.replay_data(replay_path)
              try:
                  version = replay.get_replay_version(data)
              except (ValueError, KeyError):
                  pass  # Either corrupt or just old.
              except Exception as e:  # pylint: disable=broad-except
                  print("Invalid replay:", replay_path, e)
              else:
                  versions.add(version)
  
      try:
          for path in argv[1:]:
              if os.path.isdir(path):
                  for root, _, files in os.walk(path):
                      for file in files:
                          replay_version(os.path.join(root, file))
              else:
                  replay_version(path)
      except KeyboardInterrupt:
          pass
  
      for version in sorted(versions):
          print(version)
  
imports: import os
  from absl import app
  from pysc2 import run_configs
  from pysc2.lib import replay
label_desc: Use image node_id 1 for calling a global function with example usage: main(argv) without return types