code: def _check_ocs_status(tree, accepted_codes=[100]):
          
          code_el = tree.find('meta/statuscode')
          if code_el is not None and int(code_el.text) not in accepted_codes:
              r = requests.Response()
              msg_el = tree.find('meta/message')
              if msg_el is None:
                  msg_el = tree  # fallback to the entire ocs response, if we find no message.
              r._content = ET.tostring(msg_el)
              r.status_code = int(code_el.text)
              raise OCSResponseError(r)
docs: Checks the status code of an OCS request
  
          :param tree: response parsed with elementtree
          :param accepted_codes: list of statuscodes we consider good. E.g. [100,102] can be used to accept a POST
                 returning an 'already exists' condition
          :raises: HTTPResponseError if the http status is not 200, or OCSResponseError if the OCS status is not one of the accepted_codes.