add python versions of sample_crp_tablecounts and count_transitions