1310192fd0a322b2bd87199b1715978cdb7da06a,examples/run_on_save.py,,,#,6

Before Change



with open(__file__, "a") as f:
    status = st.text("Sleeping 1s...")
    time.sleep(1)
    status.text("Touching %s" % __file__)
    os.utime(os.path.realpath(__file__), None)

After Change


import time

st.title("Test of run-on-save")
secs_to_wait = 10

st.write("This should change every ", secs_to_wait, " seconds: ", random())

with open(__file__, "a") as f:
    // Sleep for 10s (rather than, say, 1s) because on the first run we need to
    // make sure Streamlit and its proxy are fully initialized before the timer
    // below expires. This can take several seconds.
    status = st.empty()
    for i in range(secs_to_wait, 0, -1):
        time.sleep(1)
        status.text("Sleeping %ss..." % i)

    status.text("Touching %s" % __file__)
    os.utime(os.path.realpath(__file__), None)
    status.text("Touched %s" % __file__)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 6

Instances


Project Name: streamlit/streamlit
Commit Name: 1310192fd0a322b2bd87199b1715978cdb7da06a
Time: 2018-10-12
Author: thiagot@gmail.com
File Name: examples/run_on_save.py
Class Name:
Method Name:


Project Name: streamlit/streamlit
Commit Name: 0a2a1c8874c987706091b6e417fe2ebb62c525a4
Time: 2018-10-12
Author: thiagot@gmail.com
File Name: examples/run_on_save.py
Class Name:
Method Name:


Project Name: ray-project/ray
Commit Name: b71c912da70e307ff1a9f07c7ca277a727306126
Time: 2020-07-05
Author: rliaw@berkeley.edu
File Name: python/ray/tune/examples/mlflow_example.py
Class Name:
Method Name: easy_objective