<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def cred_def_id2seq_no(cd_id: str) -> int: """ Given a credential definition identifier, return its schema sequence number. Raise BadIdentifier on input that is not a credential definition identifier. :param cd_id: credential definition identifier :return: sequence number """


    if ok_cred_def_id(cd_id):
        return int(cd_id.split(':')[3])  # sequence number is token at 0-based position 3
    raise BadIdentifier('Bad credential definition identifier {}'.format(cd_id))