code: def write_facades(captures, options):
      
      for version in sorted(captures.keys()):
          filename = "{}/_client{}.py".format(options.output_dir, version)
          with open(filename, "w") as f:
              f.write(HEADER)
              f.write("from juju.client.facade import Type, ReturnMapping\n")
              f.write("from juju.client._definitions import *\n\n")
              for key in sorted(
                      [k for k in captures[version].keys() if "Facade" in k]):
                  print(captures[version][key], file=f)
  
      # Return the last (most recent) version for use in other routines.
      return version
docs: Write the Facades to the appropriate _client<version>.py