<commit_before>import requests
#import grequests #hold until grequests package update
#import copy

HTTP_SUCCESS = 200
SHIPWIRE_GET_ALL_LIMIT = 200

class ShipwireResponse(object):
    def __init__(self, response, shipwire_instance):
        r = response
        self.response = r
        j = r.json()
        self.json = j
        self.status = j.get('status')
        self.message = j.get('message')
        self.location = j.get('resourceLocation')
        self.resource_location = self.location
        self.resource = j.get('resource')
        self.warnings = j.get('warnings')
        self.errors = j.get('errors')
        self.shipwire = shipwire_instance

"""
The following class names are paired with the methods listed
at the top of the api module. If you add a method to the api
module you must also add a corresponding Response class below.
"""

class ListResponse(ShipwireResponse):
    def __init__(self, response, shipwire_instance):
        super(ListResponse, self).__init__(response, shipwire_instance)

        #check to make sure that you have a valid response
        if self.status is not HTTP_SUCCESS:
            return

        r = self.resource
        self.total =  r.get('total')
        self.previous = r.get('previous')
        self.next = r.get('next')
        self.offset = r.get('offset')<commit_msg>add __next__ attribute<commit_after>import requests
#import grequests #hold until grequests package update
#import copy

HTTP_SUCCESS = 200
SHIPWIRE_GET_ALL_LIMIT = 200

class ShipwireResponse(object):
    def __init__(self, response, shipwire_instance):
        r = response
        self.response = r
        j = r.json()
        self.json = j
        self.status = j.get('status')
        self.message = j.get('message')
        self.location = j.get('resourceLocation')
        self.resource_location = self.location
        self.resource = j.get('resource')
        self.warnings = j.get('warnings')
        self.errors = j.get('errors')
        self.shipwire = shipwire_instance

"""
The following class names are paired with the methods listed
at the top of the api module. If you add a method to the api
module you must also add a corresponding Response class below.
"""

class ListResponse(ShipwireResponse):
    def __init__(self, response, shipwire_instance):
        super(ListResponse, self).__init__(response, shipwire_instance)

        #check to make sure that you have a valid response
        if self.status is not HTTP_SUCCESS:
            return

        r = self.resource
        self.total =  r.get('total')
        self.previous = r.get('previous')
        self.next = r.get('next')
        self.__next__ = r.get('next')
        self.offset = r.get('offset')
{'fraction_non_alphanumeric': 0.09694065610025801, 'fraction_numerical': 0.0044231478068558795, 'mean_word_length': 2.7590027700831024, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3671558', 'n_tokens_mistral': 770, 'n_tokens_neox': 755, 'n_words': 233}