def _generate_signature(self, base_url, private_key):
url = urllib.parse.urlparse(base_url)<EOL>url_to_sign = url.path + '<STR_LIT:?>' + url.query<EOL>decoded_key = base64.urlsafe_b64decode(private_key)<EOL>signature = hmac.new(decoded_key, url_to_sign, hashlib.sha1)<EOL>return base64.urlsafe_b64encode(signature.digest())<EOL>
http://code.google.com/apis/maps/documentation/webservices/index.html#PythonSignatureExample