improve lpa and implement copra lpa.

move estimate_stop_cond into lpa in both lpa.py and copra_lpa.py
add few funcs that used for termination, such as label_set, label_count, mc and so on