
import sys
import re

NUMBER_REGEX = re.compile(r'([0-9])([a-z])')

def to_camel_case(text):
	# We only care about types that end with '_t'
    if not text.endswith('_t'):
		return text

    res = []
    for token in text[:-2].split('_'):
        uc_token = token.title()

		# We need to do this for types like graphene_point3d_t, which
		# need to be transformed into GraphenePoint3D, not GraphenePoint3d
        matches = NUMBER_REGEX.match(uc_token)
        if matches and matches.group(2):
            uc_token = ''.join([matches.group(1), matches.group(2).title])

        res.append(uc_token)

    return ''.join(res)

if __name__ == '__main__':
	in_text = sys.stdin.read()
	sys.stdout.write(to_camel_case(in_text))


import sys
import re

NUMBER_REGEX = re.compile(r'([0-9])([a-z])')

def to_camel_case(text):
    # We only care about types that end with '_t'
    if not text.endswith('_t'):
        return text

    res = []
    for token in text[:-2].split('_'):
        uc_token = token.title()

	# We need to do this for types like graphene_point3d_t, which
	# need to be transformed into GraphenePoint3D, not GraphenePoint3d
        matches = NUMBER_REGEX.match(uc_token)
        if matches and matches.group(2):
            uc_token = ''.join([matches.group(1), matches.group(2).title])

        res.append(uc_token)

    return ''.join(res)

if __name__ == '__main__':
    in_text = sys.stdin.read()
    sys.stdout.write(to_camel_case(in_text))

Fix spacing in the filter script
Fix spacing in the filter script

Conflicting file loading directives in Vim screwed up the tab stops.

  
  import sys
  import re
  
  NUMBER_REGEX = re.compile(r'([0-9])([a-z])')
  
  def to_camel_case(text):
- 	# We only care about types that end with '_t'
+     # We only care about types that end with '_t'
      if not text.endswith('_t'):
- 		return text
+         return text
  
      res = []
      for token in text[:-2].split('_'):
          uc_token = token.title()
  
- 		# We need to do this for types like graphene_point3d_t, which
+ 	# We need to do this for types like graphene_point3d_t, which
- 		# need to be transformed into GraphenePoint3D, not GraphenePoint3d
+ 	# need to be transformed into GraphenePoint3D, not GraphenePoint3d
          matches = NUMBER_REGEX.match(uc_token)
          if matches and matches.group(2):
              uc_token = ''.join([matches.group(1), matches.group(2).title])
  
          res.append(uc_token)
  
      return ''.join(res)
  
  if __name__ == '__main__':
- 	in_text = sys.stdin.read()
+     in_text = sys.stdin.read()
- 	sys.stdout.write(to_camel_case(in_text))
+     sys.stdout.write(to_camel_case(in_text))
  
Fix spacing in the filter script
## Code Before:

import sys
import re

NUMBER_REGEX = re.compile(r'([0-9])([a-z])')

def to_camel_case(text):
	# We only care about types that end with '_t'
    if not text.endswith('_t'):
		return text

    res = []
    for token in text[:-2].split('_'):
        uc_token = token.title()

		# We need to do this for types like graphene_point3d_t, which
		# need to be transformed into GraphenePoint3D, not GraphenePoint3d
        matches = NUMBER_REGEX.match(uc_token)
        if matches and matches.group(2):
            uc_token = ''.join([matches.group(1), matches.group(2).title])

        res.append(uc_token)

    return ''.join(res)

if __name__ == '__main__':
	in_text = sys.stdin.read()
	sys.stdout.write(to_camel_case(in_text))

## Instruction:
Fix spacing in the filter script
## Code After:

import sys
import re

NUMBER_REGEX = re.compile(r'([0-9])([a-z])')

def to_camel_case(text):
    # We only care about types that end with '_t'
    if not text.endswith('_t'):
        return text

    res = []
    for token in text[:-2].split('_'):
        uc_token = token.title()

	# We need to do this for types like graphene_point3d_t, which
	# need to be transformed into GraphenePoint3D, not GraphenePoint3d
        matches = NUMBER_REGEX.match(uc_token)
        if matches and matches.group(2):
            uc_token = ''.join([matches.group(1), matches.group(2).title])

        res.append(uc_token)

    return ''.join(res)

if __name__ == '__main__':
    in_text = sys.stdin.read()
    sys.stdout.write(to_camel_case(in_text))
