import requests
import config

def get_recommended_versions():
    return request("/versions")

def get_experiments():
    return request("/experiments")

def get_results():
    return request("/results")

def get_clients():
    return request("/clients")

def request(slug):
    url = "%s%s" % (config.server_url, slug)
    req = requests.get(url)
    return req.json()

import requests
import config

def request(slug):
    url = "%s%s" % (config.server_url, slug)
    req = requests.get(url)

    if req.status_code != requests.codes.ok:
        raise req.raise_for_status()

    return req.json()

def get_recommended_versions():
    return request("/versions")

def get_experiments():
    return request("/experiments")

def get_results():
    return request("/results")

def get_clients():
    return request("/clients")

def request(slug):
    url = "%s%s" % (config.server_url, slug)
    req = requests.get(url)
    return req.json()

Raise exception if status code is not ok
Raise exception if status code is not ok

  import requests
  import config
+ 
+ def request(slug):
+     url = "%s%s" % (config.server_url, slug)
+     req = requests.get(url)
+ 
+     if req.status_code != requests.codes.ok:
+         raise req.raise_for_status()
+ 
+     return req.json()
  
  def get_recommended_versions():
      return request("/versions")
  
  def get_experiments():
      return request("/experiments")
  
  def get_results():
      return request("/results")
  
  def get_clients():
      return request("/clients")
  
  def request(slug):
      url = "%s%s" % (config.server_url, slug)
      req = requests.get(url)
      return req.json()
  
Raise exception if status code is not ok
## Code Before:
import requests
import config

def get_recommended_versions():
    return request("/versions")

def get_experiments():
    return request("/experiments")

def get_results():
    return request("/results")

def get_clients():
    return request("/clients")

def request(slug):
    url = "%s%s" % (config.server_url, slug)
    req = requests.get(url)
    return req.json()

## Instruction:
Raise exception if status code is not ok
## Code After:
import requests
import config

def request(slug):
    url = "%s%s" % (config.server_url, slug)
    req = requests.get(url)

    if req.status_code != requests.codes.ok:
        raise req.raise_for_status()

    return req.json()

def get_recommended_versions():
    return request("/versions")

def get_experiments():
    return request("/experiments")

def get_results():
    return request("/results")

def get_clients():
    return request("/clients")

def request(slug):
    url = "%s%s" % (config.server_url, slug)
    req = requests.get(url)
    return req.json()
