<s> from functools import wraps <EOL> def validate_params ( valid_options , params ) : <EOL> """<STR_LIT>""" <EOL> if not params : <EOL> return <EOL> data_filter = [ '<STR_LIT:data>' , '<STR_LIT:source>' , '<STR_LIT>' , '<STR_LIT>' ] <EOL> multiple_data = [ key for key in params . keys ( ) if key in data_filter ] <EOL> if len ( multiple_data ) > <NUM_LIT:1> : <EOL> raise Exception ( "<STR_LIT>" ) <EOL> disallowed_fields = [ key for key in params . keys ( ) if key not in valid_options ] <EOL> if disallowed_fields : <EOL> field_strings = "<STR_LIT:U+002C>" . join ( disallowed_fields ) <EOL> raise Exception ( "<STR_LIT>" . format ( field_strings ) ) <EOL> def validate_blogname ( fn ) : <EOL> """<STR_LIT>""" <EOL> @ wraps ( fn ) <EOL> def add_dot_tumblr ( * args , ** kwargs ) : <EOL> if ( len ( args ) > <NUM_LIT:1> and ( "<STR_LIT:.>" not in args [ <NUM_LIT:1> ] ) ) : <EOL> args = list ( args ) <EOL> args [ <NUM_LIT:1> ] += "<STR_LIT>" <EOL> return fn ( * args , ** kwargs ) <EOL> return add_dot_tumblr </s>
