code: def parse_consumer_offsets(cls, json_file):
          
          with open(json_file, 'r') as consumer_offsets_json:
              try:
                  parsed_offsets = {}
                  parsed_offsets_data = json.load(consumer_offsets_json)
                  # Create new dict with partition-keys as integers
                  parsed_offsets['groupid'] = parsed_offsets_data['groupid']
                  parsed_offsets['offsets'] = {}
                  for topic, topic_data in six.iteritems(parsed_offsets_data['offsets']):
                      parsed_offsets['offsets'][topic] = {}
                      for partition, offset in six.iteritems(topic_data):
                          parsed_offsets['offsets'][topic][int(partition)] = offset
                  return parsed_offsets
              except ValueError:
                  print(
                      "Error: Given consumer-data json data-file {file} could not be "
                      "parsed".format(file=json_file),
                      file=sys.stderr,
                  )
                  raise
docs: Parse current offsets from json-file.