class_docstr: Data provider communicating with API server.
class_docstr_tok: ["Data","provider","communicating","with","API","server","."]
code: def add_experiment(self, experiment, userid=None, compression=None):
      headers = self._get_headers()
      compression = compression if compression else self.compression
  
      for tag, art in experiment.artifacts.items():
          if not art.is_mutable and art.local_path is not None:
              art.hash = art.get_hash(art.local_path)
  
      data = {}
      data["experiment"] = experiment.__dict__
      data["compression"] = compression
  
      def post_request():
          request = requests.post(
              self.url + "/api/add_experiment",
              headers=headers,
              data=json.dumps(data),
          )
  
          self._raise_detailed_error(request)
          return request
  
      request = retry(
          post_request, no_retries=10, sleep_time=10, logger=self.logger
      )
  
      artifacts = request.json()["artifacts"]
  
      self._update_artifacts(experiment, artifacts)
  
imports: import requests
  import json
  import time
  import re
  from studio.util import logs
  from studio.auth import get_auth
  from studio.credentials.credentials import Credentials
  from studio.storage.storage_setup import get_storage_verbose_level
  from studio.storage.http_storage_handler import HTTPStorageHandler
  from studio.experiments.experiment import experiment_from_dict
  from studio.util.util import retry, check_for_kb_interrupt
label_desc: Use image node_id 2 for calling the HTTPProvider obj's underlying member method code with example usage: obj.add_experiment(experiment, userid, compression) and returns: request