<commit_before>##
# Robinhood namespace

class BasicResponse(object):
  def __init__(self, response):
    self.response = response.json()


class PaginatedResponse(BasicResponse):

  def next():
    return self.response['next']

  def previous():
    return self.response['previous']


class BasicClient(object):

  def __init__(self, base_endpoint = 'https://api.robinhood.com'):
    self.base_endpoint = base_endpoint

  def normalize_uri(self, *uri):
    # TODO do not add base endpoint if given a fully qualified URI
    return '/'.join([ self.base_endpoint, *uri ])
<commit_msg>Improvements to paginated response<commit_after>##
# Robinhood namespace

class BasicResponse(object):
  def __init__(self, response):
    self.response = response.json()


class PaginatedResponse(BasicResponse):

  def next(self):
    return self.response.get('next')

  def previous(self):
    return self.response.get('previous')

  def results(self):
    return self.response.get('results', self.response)



class BasicClient(object):

  def __init__(self, base_endpoint = 'https://api.robinhood.com'):
    self.base_endpoint = base_endpoint

  def normalize_uri(self, *uri):
    # TODO do not add base endpoint if given a fully qualified URI
    return '/'.join([ self.base_endpoint, *uri ])

{'fraction_non_alphanumeric': 0.1209992193598751, 'fraction_numerical': 0.0, 'mean_word_length': 4.38655462184874, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, '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': '2582771', 'n_tokens_mistral': 390, 'n_tokens_neox': 370, 'n_words': 102}