def f(process_number):
    resource_name = RESOURCE_NAME
    raw_body = ('{"title": "%i", "lifetime": 300, "wait": 20}' % process_number)
    r = requests.post(('%s/locks/%s' % (BASE_URL, resource_name)), data=raw_body)
    if (r.status_code != 201):
        raise Exception(('bad status code %i from post request' % r.status_code))
    lock_url = r.headers['Location']
    r = requests.delete(lock_url)
    if (r.status_code != 204):
        raise Exception(('bad status code %i from delete request' % r.status_code))
def f(process_number):
    resource_name = RESOURCE_NAME
    raw_body = ('{"title": "%i", "lifetime": 300, "wait": 20}' % process_number)
    r = requests.post(('%s/locks/%s' % (BASE_URL, resource_name)), data=raw_body)
    if (r.status_code != 201):
        raise Exception(('bad status code %i from post request' % r.status_code))
    lock_url = r.headers['Location']
    r = requests.delete(lock_url)
    if (r.status_code != 204):
        raise Exception(('bad status code %i from delete request' % r.status_code))