#NEWLINE# @ split . record #NEWLINE# def init_app( state ) : #NEWLINE# #INDENT# '\n    Prepare the Flask application for Flask-Split.\n\n    :param state: :class:`BlueprintSetupState` instance\n    ' #NEWLINE# app = state . app #NEWLINE# app . config . setdefault ( 'SPLIT_ALLOW_MULTIPLE_EXPERIMENTS' , False ) #NEWLINE# app . config . setdefault ( 'SPLIT_DB_FAILOVER' , False ) #NEWLINE# app . config . setdefault ( 'SPLIT_IGNORE_IP_ADDRESSES' , [ ] ) #NEWLINE# app . config . setdefault ( 'SPLIT_ROBOT_REGEX' , '\n        (?i)\\b(\n            Baidu|\n            Gigabot|\n            Googlebot|\n            libwww-perl|\n            lwp-trivial|\n            msnbot|\n            SiteUptime|\n            Slurp|\n            WordPress|\n            ZIBB|\n            ZyBorg\n        )\\b\n    ' ) #NEWLINE# app . jinja_env . globals . update ( { #NEWLINE# #INDENT# 'ab_test' : ab_test , #NEWLINE# 'finished' : finished , #NEWLINE# #UNINDENT# } ) #NEWLINE# @ app . template_filter ( ) #NEWLINE# def percentage( number ) : #NEWLINE# #INDENT# number *= 100 #NEWLINE# if ( abs ( number ) < 10 ) : #NEWLINE# #INDENT# return ( '%.1f%%' % round ( number , 1 ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# return ( '%d%%' % round ( number ) )