<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def create_authorization_code(self, authorization_request, subject_identifier, scope=None):
 # type: (oic.oic.message.AuthorizationRequest, str, Optional[List[str]]) -> str """ Creates an authorization code bound to the authorization request and the authenticated user identified by the subject identifier. """


        if not self._is_valid_subject_identifier(subject_identifier):
            raise InvalidSubjectIdentifier('{} unknown'.format(subject_identifier))

        scope = ' '.join(scope or authorization_request['scope'])
        logger.debug('creating authz code for scope=%s', scope)

        authorization_code = rand_str()
        authz_info = {
            'used': False,
            'exp': int(time.time()) + self.authorization_code_lifetime,
            'sub': subject_identifier,
            'granted_scope': scope,
            self.KEY_AUTHORIZATION_REQUEST: authorization_request.to_dict()
        }
        self.authorization_codes[authorization_code] = authz_info
        logger.debug('new authz_code=%s to client_id=%s for sub=%s valid_until=%s', authorization_code,
                     authorization_request['client_id'], subject_identifier, authz_info['exp'])
        return authorization_code