def build_hmac_signature(self, http_request, oauth_params, consumer_secret,
    token_secret):
  raw = build_signature_base_string(http_request, oauth_params)
  key = None
  hashed = None
  if token_secret:
    key = '%s&%s' % (escape(consumer_secret), escape(token_secret))
  else:
    key = '%s&' % escape(consumer_secret)
  try:
    import hashlib
    hashed = hmac.new(key, raw, hashlib.sha1) 
  except __HOLE__:
    import sha
    hashed = hmac.new(key, raw, sha)
  # Calculate the digest base 64.
  return binascii.b2a_base64(hashed.digest())[:-1]

#?
dataset/ETHPy150Open kuri65536/python-for-android/python-build/python-libs/gdata/build/lib/gdata/experimental_oauth.py/build_hmac_signature