Convert `snake_str` from snake_case to PascalCase

def snake_to_pascal(snake_str):
    '''
    Convert `snake_str` from snake_case to PascalCase
    '''
    components = snake_str.split('_')
    if len(components) > 1:
        camel = ''.join(x.title() for x in components)
        return camel
    # Not snake_case
    return snake_str