code: def add_local_charm(self, charm_file, series, size=None):
          
          conn, headers, path_prefix = self.connection().https_connection()
          path = "%s/charms?series=%s" % (path_prefix, series)
          headers['Content-Type'] = 'application/zip'
          if size:
              headers['Content-Length'] = size
          conn.request("POST", path, charm_file, headers)
          response = conn.getresponse()
          result = response.read().decode()
          if not response.status == 200:
              raise JujuError(result)
          result = json.loads(result)
          return result['charm-url']
docs: Upload a local charm archive to the model.
  
          Returns the 'local:...' url that should be used to deploy the charm.
  
          :param charm_file: Path to charm zip archive
          :param series: Charm series
          :param size: Size of the archive, in bytes
          :return str: 'local:...' url for deploying the charm
          :raises: :class:`JujuError` if the upload fails
  
          Uses an https endpoint at the same host:port as the wss.
          Supports large file uploads.
  
          .. warning::
  
             This method will block. Consider using :meth:`add_local_charm_dir`
             instead.