<s> import hashlib <EOL> import urllib . parse <EOL> def gravatar ( email , size = <NUM_LIT> ) : <EOL> if email is None : <EOL> email = "<STR_LIT>" <EOL> email_hash = hashlib . md5 ( email . strip ( ) . lower ( ) . encode ( "<STR_LIT:utf8>" ) ) . hexdigest ( ) <EOL> url = "<STR_LIT>" . format ( email_hash ) <EOL> params = { <EOL> "<STR_LIT:size>" : size , <EOL> } <EOL> return "<STR_LIT:?>" . join ( [ url , urllib . parse . urlencode ( params ) ] ) </s>
