How to export dataflow pattern from relay automatically

Given a relay mod, can we extract the dataflow pattern and generate the python code of the pattern for DFPatternCallback automatically?