code: def _register(self, session, url):
          
          dist = self._poetry.file.parent / "dist"
          file = dist / "{}-{}.tar.gz".format(
              self._package.name, normalize_version(self._package.version.text)
          )
  
          if not file.exists():
              raise RuntimeError('"{0}" does not exist.'.format(file.name))
  
          data = self.post_data(file)
          data.update({":action": "submit", "protocol_version": "1"})
  
          data_to_send = self._prepare_data(data)
          encoder = MultipartEncoder(data_to_send)
          resp = session.post(
              url,
              data=encoder,
              allow_redirects=False,
              headers={"Content-Type": encoder.content_type},
          )
  
          resp.raise_for_status()
  
          return resp
docs: Register a package to a repository.