Example codes for causality analysis