code: def get_dict_from_response(response):
      
      if getattr(response, '_resp') and response._resp.code > 400:
          raise OAuthResponseError(
                  'Application mis-configuration in Globus', None, response
              )
  
      return response.data
docs: Check for errors in the response and return the resulting JSON.