<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def factory(token, alg=''):
 """ Instantiate an JWS instance if the token is a signed JWT. :param token: The token that might be a signed JWT :param alg: The expected signature algorithm :return: A JWS instance if the token was a signed JWT, otherwise None """


    _jw = JWS(alg=alg)
    if _jw.is_jws(token):
        return _jw
    else:
        return None