def _makeHDB2(ACK, NAK):
 SAB = 1
 DAB = 1
 PFB = 0
 HDB2val = ((((((DAB & 3) * pow(2, 6)) | ((SAB & 3) * pow(2, 4))) | ((PFB & 3) * pow(2, 2))) | ((ACK & 1) * pow(2, 1))) | (NAK & 1))
 return HDB2val

def _makeHDB2 ( ACK , NAK ) : SAB = 1 DAB = 1 PFB = 0 HDB2val = ( ( ( ( ( ( DAB & 3 ) * pow ( 2 , 6 ) ) | ( ( SAB & 3 ) * pow ( 2 , 4 ) ) ) | ( ( PFB & 3 ) * pow ( 2 , 2 ) ) ) | ( ( ACK & 1 ) * pow ( 2 , 1 ) ) ) | ( NAK & 1 ) ) return HDB2val
encode header byte 2 .