code: def rev_reg_id2cred_def_id(rr_id: str) -> str:
      
  
      if ok_rev_reg_id(rr_id):
          return ':'.join(rr_id.split(':')[2:-2])  # rev reg id comprises (prefixes):<cred_def_id>:(suffixes)
      raise BadIdentifier('Bad revocation registry identifier {}'.format(rr_id))
docs: Given a revocation registry identifier, return its corresponding credential definition identifier.
      Raise BadIdentifier if input is not a revocation registry identifier.
  
      :param rr_id: revocation registry identifier
      :return: credential definition identifier