code: async def deploy(self, charm, series, application, options, constraints,
                       storage, endpoint_bindings, *args):
          
          # resolve indirect references
          charm = self.resolve(charm)
  
          if len(args) == 1:
              # Juju 2.4 and below only sends the resources
              resources = args[0]
              devices, num_units = None, None
          else:
              # Juju 2.5+ sends devices before resources, as well as num_units
              # There might be placement but we need to ignore that.
              devices, resources, num_units = args[:3]
  
          if not charm.startswith('local:'):
              resources = await self.model._add_store_resources(
                  application, charm, overrides=resources)
          await self.model._deploy(
              charm_url=charm,
              application=application,
              series=series,
              config=options,
              constraints=constraints,
              endpoint_bindings=endpoint_bindings,
              resources=resources,
              storage=storage,
              devices=devices,
              num_units=num_units,
          )
          return application
docs: :param charm string:
              Charm holds the URL of the charm to be used to deploy this
              application.
  
          :param series string:
              Series holds the series of the application to be deployed
              if the charm default is not sufficient.
  
          :param application string:
              Application holds the application name.
  
          :param options map[string]interface{}:
              Options holds application options.
  
          :param constraints string:
              Constraints holds the optional application constraints.
  
          :param storage map[string]string:
              Storage holds the optional storage constraints.
  
          :param endpoint_bindings map[string]string:
              EndpointBindings holds the optional endpoint bindings
  
          :param devices map[string]string:
              Devices holds the optional devices constraints.
              (Only given on Juju 2.5+)
  
          :param resources map[string]int:
              Resources identifies the revision to use for each resource
              of the application's charm.
  
          :param num_units int:
              NumUnits holds the number of units required.  For IAAS models, this
              will be 0 and separate AddUnitChanges will be used.  For Kubernetes
              models, this will be used to scale the application.
              (Only given on Juju 2.5+)