code: def sign(claims, jwk, add_header=None, alg='HS256'):
      
      (hash_fn, _), mod = JWA[alg]
  
      header = dict((add_header or {}).items() + [(HEADER_ALG, alg)])
      header, payload = map(b64encode_url, map(json_encode, (header, claims)))
  
      sig = b64encode_url(hash_fn(_jws_hash_str(header, payload), jwk['k'],
          mod=mod))
  
      return JWS(header, payload, sig)
docs: Signs the given claims and produces a :class:`~jose.JWS`
  
      :param claims: A `dict` representing the claims for this
                     :class:`~jose.JWS`.
      :param jwk: A `dict` representing the JWK to be used for signing of the
                  :class:`~jose.JWS`. This parameter is algorithm-specific.
      :parameter add_header: Additional items to be added to the header.
                             Additional headers *will* be authenticated.
      :parameter alg: The algorithm to use to produce the signature.
      :rtype: :class:`~jose.JWS`