<commit_before>#!/usr/bin/env python

import boilerplate

def cksum(plate):
  input_string = plate.args.input_string
  log = plate.log
  log.debug('Input string: {}'.format(input_string))
  cap_string = ''.join([str.capitalize(x) for x in input_string])
  log.debug('Capitalized string: {}'.format(cap_string))
  prefix = cap_string[:2]
  log.debug('Prefix string: {}'.format(prefix))
  suffix_string = cap_string[2:]
  log.debug('Suffix string: {}'.format(suffix_string))
  suffix_sum = sum([ord(x)-ord('A') for x in suffix_string])
  log.debug('Suffix sum: {}'.format(suffix_sum))
  return('{}{}'.format(prefix, suffix_sum % 999))

def main(self, args):
  plate.log.info('Starting program.')
  print(cksum(plate))
  plate.log.info('Stopping program.')
  pass

if __name__ == '__main__':
  plate = boilerplate.Boilerplate(main, 'Compute simple checksum')
  plate.parser.add_argument('input_string', type=str,
    help='The string to compute the checksum for')
  plate.main()
  pass<commit_msg>Output will not have spaces.<commit_after>#!/usr/bin/env python

import boilerplate
import logging
import re

def cksum(input_string):
  log = logging.getLogger(__name__)
  log.debug('Input string: {}'.format(input_string))
  cap_string = ''.join([str.capitalize(x) for x in input_string])
  log.debug('Capitalized string: {}'.format(cap_string))
  space_free_string = re.sub('\s+', '', cap_string)
  log.debug('Space free string: {}'.format(space_free_string))
  prefix = space_free_string[:2]
  log.debug('Prefix string: {}'.format(prefix))
  suffix_string = cap_string[2:]
  log.debug('Suffix string: {}'.format(suffix_string))
  suffix_sum = sum([ord(x)-ord('A') for x in suffix_string])
  log.debug('Suffix sum: {}'.format(suffix_sum))
  return('{}{}'.format(prefix, suffix_sum % 999))

def main(self, args):
  plate.log.info('Starting program.')
  print(cksum(plate.args.input_string))
  plate.log.info('Stopping program.')
  pass

if __name__ == '__main__':
  plate = boilerplate.Boilerplate(main, 'Compute simple checksum')
  plate.parser.add_argument('input_string', type=str,
    help='The string to compute the checksum for')
  plate.main()
  pass
{'fraction_non_alphanumeric': 0.16403345724907062, 'fraction_numerical': 0.004646840148698885, 'mean_word_length': 5.3698224852071, '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': '5535646', 'n_tokens_mistral': 763, 'n_tokens_neox': 734, 'n_words': 156}