code: def write_client(captures, options):
      
      with open("{}/_client.py".format(options.output_dir), "w") as f:
          f.write(HEADER)
          f.write("from juju.client._definitions import *\n\n")
          clients = ", ".join("_client{}".format(v) for v in captures)
          f.write("from juju.client import " + clients + "\n\n")
          f.write(CLIENT_TABLE.format(clients=",\n    ".join(
              ['"{}": _client{}'.format(v, v) for v in captures])))
          f.write(LOOKUP_FACADE)
          f.write(TYPE_FACTORY)
          for key in sorted([k for k in factories.keys() if "Facade" in k]):
              print(factories[key], file=f)
docs: Write the TypeFactory classes to _client.py, along with some
      imports and tables so that we can look up versioned Facades.