Utilities for pulsar candidate simulation and machine learning based detection