<s> """<STR_LIT>""" <EOL> import logging <EOL> from geopy . compat import py3k <EOL> if not py3k : <EOL> NUMBER_TYPES = ( int , long , float ) <EOL> else : <EOL> NUMBER_TYPES = ( int , float ) <EOL> try : <EOL> from decimal import Decimal <EOL> NUMBER_TYPES = NUMBER_TYPES + ( Decimal , ) <EOL> except ImportError : <EOL> pass <EOL> __version__ = "<STR_LIT>" <EOL> class NullHandler ( logging . Handler ) : <EOL> """<STR_LIT>""" <EOL> def emit ( self , record ) : <EOL> pass <EOL> logger = logging . getLogger ( '<STR_LIT>' ) <EOL> logger . setLevel ( logging . CRITICAL ) <EOL> def pairwise ( seq ) : <EOL> """<STR_LIT>""" <EOL> for i in range ( <NUM_LIT:0> , len ( seq ) - <NUM_LIT:1> ) : <EOL> yield ( seq [ i ] , seq [ i + <NUM_LIT:1> ] ) <EOL> if not py3k : <EOL> def join_filter ( sep , seq , pred = bool ) : <EOL> """<STR_LIT>""" <EOL> return sep . join ( [ unicode ( i ) for i in seq if pred ( i ) ] ) <EOL> else : <EOL> def join_filter ( sep , seq , pred = bool ) : <EOL> """<STR_LIT>""" <EOL> return sep . join ( [ str ( i ) for i in seq if pred ( i ) ] ) <EOL> if not py3k : <EOL> def decode_page ( page ) : <EOL> """<STR_LIT>""" <EOL> if hasattr ( page , '<STR_LIT>' ) : <EOL> encoding = page . headers . getparam ( "<STR_LIT>" ) or "<STR_LIT:utf-8>" <EOL> return unicode ( page . read ( ) , encoding = encoding ) <EOL> else : <EOL> encoding = page . headers . get ( "<STR_LIT>" , "<STR_LIT:utf-8>" ) <EOL> return unicode ( page . content , encoding = encoding ) <EOL> else : <EOL> def decode_page ( page ) : <EOL> """<STR_LIT>""" <EOL> if hasattr ( page , '<STR_LIT>' ) : <EOL> encoding = page . headers . get_param ( "<STR_LIT>" ) or "<STR_LIT:utf-8>" <EOL> return str ( page . read ( ) , encoding = encoding ) <EOL> else : <EOL> encoding = page . headers . get ( "<STR_LIT>" ) or "<STR_LIT:utf-8>" <EOL> return str ( page . content , encoding = encoding ) <EOL> def get_version ( ) : <EOL> from geopy . version import GEOPY_VERSION <EOL> return str ( GEOPY_VERSION ) </s>
