<jupyter_start><jupyter_text>pycallgraph2 - hello world  basic<jupyter_code>%%time

import time
from pycallgraph2 import PyCallGraph
from pycallgraph2.output import GraphvizOutput

from happy_jupyter_utils import imageUtils

def sub_test():
    time.sleep(1)
    print("I am sub test")

def test():
    print("I am test function")
    sub_test()

def run():
    file_path = '/'.join([
            'data/output/images',
            'basic.png'
        ])
    graphviz = GraphvizOutput()
    graphviz.output_file = file_path
    with PyCallGraph(output=graphviz):
        test()
        sub_test()
        
    return imageUtils.show_image_with_title_by_url({
                'url': file_path,
                'title': "fig - basic flow"
            })
        
    
    
run()<jupyter_output>I am test function
I am sub test
I am sub test
CPU times: user 5.29 ms, sys: 2 ms, total: 7.28 ms
Wall time: 2.03 s
{'fraction_non_alphanumeric': 0.09933774834437085, 'fraction_numerical': 0.01545253863134658, 'mean_word_length': 2.4356060606060606, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '440206', 'license': 'Apache-2.0', 'n_tokens_mistral': 314, 'n_tokens_neox': 303, 'n_words': 81, 'path': 'doc/steps_to_make/0202_0301_hello_world.ipynb', 'repo_name': 'ggservice007/my-happy-flow', 'size': '906'}