code: def _calculate_page_index(index, data):
          
          if index > data['total_results']:
              raise ValueError('index not in paged data')
          page_length = len(data['results'])
          return (index // page_length) + 1, (index % page_length) - 1
docs: Determine the location of a given index in paged data.
  
          Arguments:
            index (:py:class:`int`): The overall index.
            data: (:py:class:`dict`) The first page of data.
  
          Returns:
            :py:class:`tuple`: The location of that index, in the format
              ``(page, index_in_page)``.