{"id":18985019,"url":"https://github.com/ipyflow/nbsafety-experiments","last_synced_at":"2026-04-12T09:30:21.332Z","repository":{"id":71474994,"uuid":"276818029","full_name":"ipyflow/nbsafety-experiments","owner":"ipyflow","description":null,"archived":false,"fork":false,"pushed_at":"2021-05-11T00:46:47.000Z","size":149,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-01T12:28:03.162Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ipyflow.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-07-03T05:47:11.000Z","updated_at":"2023-06-14T04:23:23.000Z","dependencies_parsed_at":"2023-03-09T22:15:12.782Z","dependency_job_id":null,"html_url":"https://github.com/ipyflow/nbsafety-experiments","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ipyflow%2Fnbsafety-experiments","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ipyflow%2Fnbsafety-experiments/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ipyflow%2Fnbsafety-experiments/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ipyflow%2Fnbsafety-experiments/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ipyflow","download_url":"https://codeload.github.com/ipyflow/nbsafety-experiments/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239993961,"owners_count":19730779,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-08T16:24:06.728Z","updated_at":"2026-04-12T09:30:21.291Z","avatar_url":"https://github.com/ipyflow.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Readme\n\nThere are two main functionalities in that this: scraping and replaying. You\ndon’t need to deal with scraping if using the already-scraped\n[traces.sqlite](https://drive.google.com/file/d/1Yf_17-SESPVdyawfNbxF54VIbe4om2eX/view?usp=sharing)\nsqlite database. Besides that there are two scripts worth\nnoting: one which replays a single notebook session, and one which replays\na whole set of sessions after filtering based on some criteria\n\n# Replaying a single session\n\n`replay-session.py` replays a single notebook session (given `trace_id` and\n`session_id`, basically ids for the repository and per-repository session),\nhandling things like timeouts, figuring out packages that need installation,\ncoverting Python 2 to Python 3 using the `2to3` tool,\netc. It also counts the number of exceptions that occurred during replay;\nprobably worth filtering out sessions where more than ~5-10% of the cell\nexecutions give an exception. There’s also a bunch of ancillary stuff in there\nthat’s specific to nbsafety, like counting how often the user picks a stale\ncell for re-execution or a refresher cell; if just using the replay functionality\nand not replicating nbsafety results, this can just be deleted. Note that it assumes\navailability of tables `replay_stats` and `replay_exception_stats` in the `traces.sqlite`\ndatabase whose schemas must be manually generated; the PyCharm sqlite connector is\npretty good for this.\n\n# Replaying all sessions satisfying filtering criteria\n\n`run-replay-experiments.py` runs all the sessions through a filtering process\nand replays all sessions that pass a filter. A bunch of the filtering criteria\nwere manually specified after seeing nonsensical sessions that were replayed.\nIt also accepts a `--version` argument; if you specify the same version, it skips\nsessions that were already replayed; if you specify a new version, it starts\nfrom scratch. There are also some nbsafety-specific parameters:\n- `--naive-refresher-computation`: is a baseline used in the paper,\n- `--forward-only-propagation`: used to measure utility of highlights where new\n  ones are only created in later cells (spacially relative to the currently\n  executed one) instead of both earlier and later cells\n- `--no-nbsafety`: used to determine how much faster non-nbsafety replay was (to\n  see what nbsafety overhead was like).\n  \nWhen replaying these sessions, it is probably a good idea to do so in a chrooted environment\nor docker container, since the sessions are untrusted code that sometimes do some fairly strange things.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fipyflow%2Fnbsafety-experiments","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fipyflow%2Fnbsafety-experiments","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fipyflow%2Fnbsafety-experiments/lists"}