import hmac
import hashlib


def hmac_sha1(key, s):
  """
  returns the hmac-sha1 signature of key and string s.

  key: bytes or bytearray
  s: any type supported by hashlib
  """
  hmacsha1 = hmac.new(key, digestmod=hashlib.sha1)
  hmacsha1.update(s)
  return hmacsha1.hexdigest()