code: def _validate_sub(claims, subject=None):
      
  
      if 'sub' not in claims:
          return
  
      if not isinstance(claims['sub'], string_types):
          raise JWTClaimsError('Subject must be a string.')
  
      if subject is not None:
          if claims.get('sub') != subject:
              raise JWTClaimsError('Invalid subject')
docs: Validates that the 'sub' claim is valid.
  
      The "sub" (subject) claim identifies the principal that is the
      subject of the JWT.  The claims in a JWT are normally statements
      about the subject.  The subject value MUST either be scoped to be
      locally unique in the context of the issuer or be globally unique.
      The processing of this claim is generally application specific.  The
      "sub" value is a case-sensitive string containing a StringOrURI
      value.  Use of this claim is OPTIONAL.
  
      Args:
          claims (dict): The claims dictionary to validate.
          subject (str): The subject of the token.