code: async def check_response(response, valid_response_codes):
      
      if response.status == 204:
          return True
      if response.status in valid_response_codes:
          _js = await response.json()
          return _js
      else:
          raise PvApiResponseStatusError(response.status)
docs: Check the response for correctness.