<s> from __future__ import absolute_import , division , print_function <EOL> from twisted . web . client import Agent <EOL> from treq . client import HTTPClient <EOL> from treq . _utils import default_pool , default_reactor <EOL> def head ( url , ** kwargs ) : <EOL> """<STR_LIT>""" <EOL> return _client ( ** kwargs ) . head ( url , ** kwargs ) <EOL> def get ( url , headers = None , ** kwargs ) : <EOL> """<STR_LIT>""" <EOL> return _client ( ** kwargs ) . get ( url , headers = headers , ** kwargs ) <EOL> def post ( url , data = None , ** kwargs ) : <EOL> """<STR_LIT>""" <EOL> return _client ( ** kwargs ) . post ( url , data = data , ** kwargs ) <EOL> def put ( url , data = None , ** kwargs ) : <EOL> """<STR_LIT>""" <EOL> return _client ( ** kwargs ) . put ( url , data = data , ** kwargs ) <EOL> def patch ( url , data = None , ** kwargs ) : <EOL> """<STR_LIT>""" <EOL> return _client ( ** kwargs ) . patch ( url , data = data , ** kwargs ) <EOL> def delete ( url , ** kwargs ) : <EOL> """<STR_LIT>""" <EOL> return _client ( ** kwargs ) . delete ( url , ** kwargs ) <EOL> def request ( method , url , ** kwargs ) : <EOL> """<STR_LIT>""" <EOL> return _client ( ** kwargs ) . request ( method , url , ** kwargs ) <EOL> def _client ( * args , ** kwargs ) : <EOL> agent = kwargs . get ( '<STR_LIT>' ) <EOL> if agent is None : <EOL> reactor = default_reactor ( kwargs . get ( '<STR_LIT>' ) ) <EOL> pool = default_pool ( reactor , <EOL> kwargs . get ( '<STR_LIT>' ) , <EOL> kwargs . get ( '<STR_LIT>' ) ) <EOL> agent = Agent ( reactor , pool = pool ) <EOL> return HTTPClient ( agent ) </s>
