<s> from cloudfront import CommonParameters , send_request <EOL> from mako . template import Template <EOL> from optparse import OptionParser <EOL> import uuid <EOL> class Parameters ( CommonParameters ) : <EOL> def __init__ ( self , distribution_id , headers ) : <EOL> CommonParameters . __init__ ( self , '<STR_LIT:POST>' , headers ) <EOL> self . distribution_id = distribution_id <EOL> def createPath ( self ) : <EOL> return '<STR_LIT>' % self . distribution_id <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> parser = OptionParser ( usage = "<STR_LIT>" ) <EOL> parser . add_option ( "<STR_LIT>" , dest = "<STR_LIT>" , help = "<STR_LIT>" , metavar = "<STR_LIT>" ) <EOL> options , args = parser . parse_args ( ) <EOL> if options . distribution_id and len ( args ) > <NUM_LIT:0> : <EOL> callerRef = str ( uuid . uuid4 ( ) ) <EOL> template = Template ( filename = '<STR_LIT>' ) <EOL> invalidate_request = template . render ( objects = args , callerRef = callerRef ) <EOL> headers = { '<STR_LIT:Content-Type>' : '<STR_LIT>' , '<STR_LIT>' : str ( len ( invalidate_request ) ) } <EOL> parameters = Parameters ( options . distribution_id , headers ) <EOL> send_request ( parameters , invalidate_request ) <EOL> else : <EOL> parser . print_help ( ) </s>
