repo_full_name stringlengths 6 93 | repo_url stringlengths 25 112 | repo_api_url stringclasses 28
values | owner stringclasses 28
values | repo_name stringclasses 28
values | description stringclasses 28
values | stars int64 617 98.8k | forks int64 31 355 ⌀ | watchers int64 990 999 ⌀ | license stringclasses 2
values | default_branch stringclasses 2
values | repo_created_at timestamp[s]date 2012-07-24 23:12:50 2025-06-16 08:07:28 ⌀ | repo_updated_at timestamp[s]date 2026-02-23 15:23:15 2026-05-03 18:52:12 ⌀ | repo_topics listlengths 0 13 ⌀ | repo_languages unknown | is_fork bool 1
class | open_issues int64 3 104 ⌀ | file_path stringlengths 3 208 | file_name stringclasses 509
values | file_extension stringclasses 1
value | file_size_bytes int64 101 84k ⌀ | file_url stringclasses 627
values | file_raw_url stringclasses 627
values | file_sha stringclasses 624
values | language stringclasses 8
values | parsed_at stringdate 2026-05-04 01:12:36 2026-05-04 19:41:55 | text stringlengths 100 102k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
hugsy/gef | https://github.com/hugsy/gef | null | null | null | null | 8,143 | null | null | mit | null | null | null | null | null | null | null | tests/commands/reset_cache.py | null | null | null | null | null | null | Python | 2026-05-04T02:13:42.361387 | """
`reset-cache` command test module
"""
from tests.base import RemoteGefUnitTestGeneric
class ResetCacheCommand(RemoteGefUnitTestGeneric):
"""`reset-cache` command test module"""
def test_cmd_reset_cache(self):
gdb = self._gdb
gdb.execute("start")
res = gdb.execute("reset-cache", t... |
hugsy/gef | https://github.com/hugsy/gef | null | null | null | null | 8,143 | null | null | mit | null | null | null | null | null | null | null | tests/commands/process_search.py | null | null | null | null | null | null | Python | 2026-05-04T02:13:42.378868 | """
`process-search` command test module
"""
from tests.base import RemoteGefUnitTestGeneric
from tests.utils import debug_target
class ProcessSearchCommand(RemoteGefUnitTestGeneric):
"""`process-search` command test module"""
def setUp(self) -> None:
self._target = debug_target("pattern")
r... |
hugsy/gef | https://github.com/hugsy/gef | null | null | null | null | 8,143 | null | null | mit | null | null | null | null | null | null | null | tests/commands/print_format.py | null | null | null | null | null | null | Python | 2026-05-04T02:13:42.379618 | """
print-format command test module
"""
from tests.base import RemoteGefUnitTestGeneric
from tests.utils import ERROR_INACTIVE_SESSION_MESSAGE, p32
class PrintFormatCommand(RemoteGefUnitTestGeneric):
"""`print-format` command test module"""
def test_cmd_print_format(self):
gdb = self._gdb
g... |
hugsy/gef | https://github.com/hugsy/gef | null | null | null | null | 8,143 | null | null | mit | null | null | null | null | null | null | null | tests/commands/process_status.py | null | null | null | null | null | null | Python | 2026-05-04T02:13:42.380329 | """
`process-status` command test module
"""
from tests.base import RemoteGefUnitTestGeneric
from tests.utils import ERROR_INACTIVE_SESSION_MESSAGE
class ProcessStatusCommand(RemoteGefUnitTestGeneric):
"""`process-status` command test module"""
def test_cmd_process_status(self):
gdb = self._gdb
... |
hugsy/gef | https://github.com/hugsy/gef | null | null | null | null | 8,143 | null | null | mit | null | null | null | null | null | null | null | tests/commands/registers.py | null | null | null | null | null | null | Python | 2026-05-04T02:13:42.394763 | """
`registers` command test module
"""
import pytest
from tests.base import RemoteGefUnitTestGeneric
from tests.utils import ARCH, ERROR_INACTIVE_SESSION_MESSAGE
class RegistersCommand(RemoteGefUnitTestGeneric):
"""`registers` command test module"""
@pytest.mark.skipif(
ARCH not in ["aarch64", "ar... |
hugsy/gef | https://github.com/hugsy/gef | null | null | null | null | 8,143 | null | null | mit | null | null | null | null | null | null | null | tests/commands/search_pattern.py | null | null | null | null | null | null | Python | 2026-05-04T02:13:42.402696 | """
search_pattern command test module
"""
from tests.base import RemoteGefUnitTestGeneric
from tests.utils import BIN_SH, ERROR_INACTIVE_SESSION_MESSAGE
class SearchPatternCommand(RemoteGefUnitTestGeneric):
"""`search_pattern` command test module"""
def test_cmd_search_pattern(self):
gdb = self._gd... |
hugsy/gef | https://github.com/hugsy/gef | null | null | null | null | 8,143 | null | null | mit | null | null | null | null | null | null | null | tests/commands/skipi.py | null | null | null | null | null | null | Python | 2026-05-04T02:13:42.403307 | """
`skipi` command test module
"""
import pytest
from tests.base import RemoteGefUnitTestGeneric
from tests.utils import ARCH, ERROR_INACTIVE_SESSION_MESSAGE, p32, p64, u16, u32
class SkipiCommand(RemoteGefUnitTestGeneric):
"""`skipi` command test module"""
cmd = "skipi"
def test_cmd_nop_inactive(sel... |
hugsy/gef | https://github.com/hugsy/gef | null | null | null | null | 8,143 | null | null | mit | null | null | null | null | null | null | null | tests/commands/smart_eval.py | null | null | null | null | null | null | Python | 2026-05-04T02:13:42.472886 | """
`smart_eval` command test module
"""
from tests.base import RemoteGefUnitTestGeneric
class SmartEvalCommand(RemoteGefUnitTestGeneric):
"""`smart_eval` command test module"""
def test_cmd_smart_eval(self):
gdb = self._gdb
gef = self._gef
gdb.execute("start")
examples = (
... |
hugsy/gef | https://github.com/hugsy/gef | null | null | null | null | 8,143 | null | null | mit | null | null | null | null | null | null | null | tests/commands/heap.py | null | null | null | null | null | null | Python | 2026-05-04T02:13:44.722855 | """
Heap commands test module
"""
import pytest
from tests.base import RemoteGefUnitTestGeneric
from tests.utils import (
ARCH,
ERROR_INACTIVE_SESSION_MESSAGE,
debug_target,
findlines,
is_glibc_ge,
is_32b,
is_64b,
)
class HeapCommand(RemoteGefUnitTestGeneric):
"""Generic class for com... |
reactive-python/reactpy | https://github.com/reactive-python/reactpy | null | null | null | null | 8,138 | null | null | mit | null | null | null | null | null | null | null | docs/docs_app/dev.py | null | null | null | null | null | null | Python | 2026-05-04T02:13:47.347393 | import asyncio
import os
import threading
import time
import webbrowser
from sphinx_autobuild.cli import (
Server,
_get_build_args,
_get_ignore_handler,
find_free_port,
get_builder,
get_parser,
)
from docs_app.app import make_app, reload_examples
from reactpy.backend.sanic import serve_develop... |
reactive-python/reactpy | https://github.com/reactive-python/reactpy | null | null | null | null | 8,138 | null | null | mit | null | null | null | null | null | null | null | docs/docs_app/app.py | null | null | null | null | null | null | Python | 2026-05-04T02:13:47.353545 | from logging import getLogger
from pathlib import Path
from sanic import Sanic, response
from docs_app.examples import get_normalized_example_name, load_examples
from reactpy import component
from reactpy.backend.sanic import Options, configure, use_request
from reactpy.types import ComponentConstructor
THIS_DIR = P... |
reactive-python/reactpy | https://github.com/reactive-python/reactpy | null | null | null | null | 8,138 | null | null | mit | null | null | null | null | null | null | null | docs/source/_exts/autogen_api_docs.py | null | null | null | null | null | null | Python | 2026-05-04T02:13:47.357735 | from __future__ import annotations
import sys
from collections.abc import Collection, Iterator
from pathlib import Path
from sphinx.application import Sphinx
HERE = Path(__file__).parent
SRC = HERE.parent.parent.parent / "src"
PYTHON_PACKAGE = SRC / "reactpy"
AUTO_DIR = HERE.parent / "_auto"
AUTO_DIR.mkdir(exist_ok... |
reactive-python/reactpy | https://github.com/reactive-python/reactpy | null | null | null | null | 8,138 | null | null | mit | null | null | null | null | null | null | null | docs/source/_exts/build_custom_js.py | null | null | null | null | null | null | Python | 2026-05-04T02:13:47.358874 | import subprocess
from pathlib import Path
from sphinx.application import Sphinx
SOURCE_DIR = Path(__file__).parent.parent
CUSTOM_JS_DIR = SOURCE_DIR / "_custom_js"
def setup(app: Sphinx) -> None:
subprocess.run("bun install", cwd=CUSTOM_JS_DIR, shell=True) # noqa S607
subprocess.run("bun run build", cwd=C... |
reactive-python/reactpy | https://github.com/reactive-python/reactpy | null | null | null | null | 8,138 | null | null | mit | null | null | null | null | null | null | null | docs/docs_app/examples.py | null | null | null | null | null | null | Python | 2026-05-04T02:13:47.381194 | from __future__ import annotations
from collections.abc import Callable, Iterator
from io import StringIO
from pathlib import Path
from traceback import format_exc
import reactpy
from reactpy.types import ComponentType
HERE = Path(__file__)
SOURCE_DIR = HERE.parent.parent / "source"
CONF_FILE = SOURCE_DIR / "conf.py... |
reactive-python/reactpy | https://github.com/reactive-python/reactpy | null | null | null | null | 8,138 | null | null | mit | null | null | null | null | null | null | null | docs/source/_exts/async_doctest.py | null | null | null | null | null | null | Python | 2026-05-04T02:13:47.387006 | from doctest import DocTest, DocTestRunner
from textwrap import indent
from typing import Any
from sphinx.application import Sphinx
from sphinx.ext.doctest import DocTestBuilder
from sphinx.ext.doctest import setup as doctest_setup
test_template = """
import asyncio as __test_template_asyncio
async def __test_templa... |
reactive-python/reactpy | https://github.com/reactive-python/reactpy | null | null | null | null | 8,138 | null | null | mit | null | null | null | null | null | null | null | docs/source/_exts/copy_vdom_json_schema.py | null | null | null | null | null | null | Python | 2026-05-04T02:13:47.395912 | import json
from pathlib import Path
from sphinx.application import Sphinx
from reactpy.core.vdom import VDOM_JSON_SCHEMA
def setup(app: Sphinx) -> None:
schema_file = Path(__file__).parent.parent / "vdom-json-schema.json"
current_schema = json.dumps(VDOM_JSON_SCHEMA, indent=2, sort_keys=True)
# We nee... |
reactive-python/reactpy | https://github.com/reactive-python/reactpy | null | null | null | null | 8,138 | null | null | mit | null | null | null | null | null | null | null | docs/docs_app/prod.py | null | null | null | null | null | null | Python | 2026-05-04T02:13:47.411992 | import os
from docs_app.app import make_app
app = make_app("docs_prod_app")
def main() -> None:
app.run(
host="0.0.0.0", # noqa: S104
port=int(os.environ.get("PORT", "5000")),
workers=int(os.environ.get("WEB_CONCURRENCY", "1")),
debug=bool(int(os.environ.get("DEBUG", "0"))),
... |
reactive-python/reactpy | https://github.com/reactive-python/reactpy | null | null | null | null | 8,138 | null | null | mit | null | null | null | null | null | null | null | docs/main.py | null | null | null | null | null | null | Python | 2026-05-04T02:13:47.443305 | import sys
from docs_app import dev, prod
if __name__ == "__main__":
if len(sys.argv) == 1:
prod.main()
else:
dev.main()
|
reactive-python/reactpy | https://github.com/reactive-python/reactpy | null | null | null | null | 8,138 | null | null | mit | null | null | null | null | null | null | null | docs/source/_exts/reactpy_example.py | null | null | null | null | null | null | Python | 2026-05-04T02:13:47.944516 | from __future__ import annotations
import re
from pathlib import Path
from typing import Any, ClassVar
from docs_app.examples import (
SOURCE_DIR,
get_example_files_by_name,
get_normalized_example_name,
)
from docutils.parsers.rst import directives
from docutils.statemachine import StringList
from sphinx.... |
reactive-python/reactpy | https://github.com/reactive-python/reactpy | null | null | null | null | 8,138 | null | null | mit | null | null | null | null | null | null | null | docs/source/_exts/custom_autosectionlabel.py | null | null | null | null | null | null | Python | 2026-05-04T02:13:47.945792 | """Mostly copied from sphinx.ext.autosectionlabel
See Sphinx BSD license:
https://github.com/sphinx-doc/sphinx/blob/f9968594206e538f13fa1c27c065027f10d4ea27/LICENSE
"""
from __future__ import annotations
from fnmatch import fnmatch
from typing import Any, cast
from docutils import nodes
from docutils.nodes import N... |
reactive-python/reactpy | https://github.com/reactive-python/reactpy | null | null | null | null | 8,138 | null | null | mit | null | null | null | null | null | null | null | docs/source/guides/adding-interactivity/components-with-state/_examples/adding_state_variable/main.py | null | null | null | null | null | null | Python | 2026-05-04T02:13:47.988793 | import json
from pathlib import Path
from reactpy import component, hooks, html, run
HERE = Path(__file__)
DATA_PATH = HERE.parent / "data.json"
sculpture_data = json.loads(DATA_PATH.read_text())
@component
def Gallery():
index, set_index = hooks.use_state(0)
def handle_click(event):
set_index(inde... |
reactive-python/reactpy | https://github.com/reactive-python/reactpy | null | null | null | null | 8,138 | null | null | mit | null | null | null | null | null | null | null | docs/source/conf.py | null | null | null | null | null | null | Python | 2026-05-04T02:13:48.018389 | #
# Configuration file for the Sphinx documentation builder.
#
# This file does only contain a selection of the most common options. For a
# full list see the documentation:
# http://www.sphinx-doc.org/en/master/config
import sys
from doctest import DONT_ACCEPT_TRUE_FOR_1, ELLIPSIS, NORMALIZE_WHITESPACE
from pathlib i... |
reactive-python/reactpy | https://github.com/reactive-python/reactpy | null | null | null | null | 8,138 | null | null | mit | null | null | null | null | null | null | null | docs/source/_exts/patched_html_translator.py | null | null | null | null | null | null | Python | 2026-05-04T02:13:48.019514 | from sphinx.util.docutils import is_html5_writer_available
from sphinx.writers.html import HTMLTranslator
from sphinx.writers.html5 import HTML5Translator
class PatchedHTMLTranslator(
HTML5Translator if is_html5_writer_available() else HTMLTranslator
):
def starttag(self, node, tagname, *args, **attrs):
... |
reactive-python/reactpy | https://github.com/reactive-python/reactpy | null | null | null | null | 8,138 | null | null | mit | null | null | null | null | null | null | null | docs/source/guides/adding-interactivity/components-with-state/_examples/when_variables_are_not_enough/main.py | null | null | null | null | null | null | Python | 2026-05-04T02:13:48.023354 | # flake8: noqa
# errors F841,F823 for `index = index + 1` inside the closure
# :lines: 7-
# :linenos:
import json
from pathlib import Path
from reactpy import component, html, run
HERE = Path(__file__)
DATA_PATH = HERE.parent / "data.json"
sculpture_data = json.loads(DATA_PATH.read_text())
@component
def Gallery... |
reactive-python/reactpy | https://github.com/reactive-python/reactpy | null | null | null | null | 8,138 | null | null | mit | null | null | null | null | null | null | null | docs/source/_exts/reactpy_view.py | null | null | null | null | null | null | Python | 2026-05-04T02:13:48.031123 | import os
from typing import Any, ClassVar
from docs_app.examples import get_normalized_example_name
from docutils.nodes import raw
from docutils.parsers.rst import directives
from sphinx.application import Sphinx
from sphinx.util.docutils import SphinxDirective
_REACTPY_EXAMPLE_HOST = os.environ.get("REACTPY_DOC_EXA... |
reactive-python/reactpy | https://github.com/reactive-python/reactpy | null | null | null | null | 8,138 | null | null | mit | null | null | null | null | null | null | null | docs/source/guides/adding-interactivity/components-with-state/_examples/multiple_state_variables/main.py | null | null | null | null | null | null | Python | 2026-05-04T02:13:48.032338 | import json
from pathlib import Path
from reactpy import component, hooks, html, run
HERE = Path(__file__)
DATA_PATH = HERE.parent / "data.json"
sculpture_data = json.loads(DATA_PATH.read_text())
@component
def Gallery():
index, set_index = hooks.use_state(0)
show_more, set_show_more = hooks.use_state(False... |
reactive-python/reactpy | https://github.com/reactive-python/reactpy | null | null | null | null | 8,138 | null | null | mit | null | null | null | null | null | null | null | docs/source/guides/adding-interactivity/dangers-of-mutability/_examples/dict_remove.py | null | null | null | null | null | null | Python | 2026-05-04T02:13:48.076586 | from reactpy import component, html, run, use_state
@component
def Definitions():
term_to_add, set_term_to_add = use_state(None)
definition_to_add, set_definition_to_add = use_state(None)
all_terms, set_all_terms = use_state({})
def handle_term_to_add_change(event):
set_term_to_add(event["tar... |
reactive-python/reactpy | https://github.com/reactive-python/reactpy | null | null | null | null | 8,138 | null | null | mit | null | null | null | null | null | null | null | docs/source/guides/adding-interactivity/components-with-state/_examples/isolated_state/main.py | null | null | null | null | null | null | Python | 2026-05-04T02:13:48.101341 | import json
from pathlib import Path
from reactpy import component, hooks, html, run
HERE = Path(__file__)
DATA_PATH = HERE.parent / "data.json"
sculpture_data = json.loads(DATA_PATH.read_text())
@component
def Gallery():
index, set_index = hooks.use_state(0)
show_more, set_show_more = hooks.use_state(False... |
reactive-python/reactpy | https://github.com/reactive-python/reactpy | null | null | null | null | 8,138 | null | null | mit | null | null | null | null | null | null | null | docs/source/guides/adding-interactivity/dangers-of-mutability/_examples/dict_update.py | null | null | null | null | null | null | Python | 2026-05-04T02:13:48.512233 | from reactpy import component, html, run, use_state
@component
def Form():
person, set_person = use_state(
{
"first_name": "Barbara",
"last_name": "Hepworth",
"email": "bhepworth@sculpture.com",
}
)
def handle_first_name_change(event):
set_perso... |
reactive-python/reactpy | https://github.com/reactive-python/reactpy | null | null | null | null | 8,138 | null | null | mit | null | null | null | null | null | null | null | docs/source/guides/adding-interactivity/dangers-of-mutability/_examples/list_re_order.py | null | null | null | null | null | null | Python | 2026-05-04T02:13:48.622258 | from reactpy import component, html, run, use_state
@component
def ArtistList():
artists, set_artists = use_state(
["Marta Colvin Andrade", "Lamidi Olonade Fakeye", "Louise Nevelson"]
)
def handle_sort_click(event):
set_artists(sorted(artists))
def handle_reverse_click(event):
... |
reactive-python/reactpy | https://github.com/reactive-python/reactpy | null | null | null | null | 8,138 | null | null | mit | null | null | null | null | null | null | null | docs/source/guides/adding-interactivity/dangers-of-mutability/_examples/list_insert.py | null | null | null | null | null | null | Python | 2026-05-04T02:13:48.623298 | from reactpy import component, html, run, use_state
@component
def ArtistList():
artist_to_add, set_artist_to_add = use_state("")
artists, set_artists = use_state([])
def handle_change(event):
set_artist_to_add(event["target"]["value"])
def handle_click(event):
if artist_to_add and a... |
reactive-python/reactpy | https://github.com/reactive-python/reactpy | null | null | null | null | 8,138 | null | null | mit | null | null | null | null | null | null | null | docs/source/guides/adding-interactivity/dangers-of-mutability/_examples/list_replace.py | null | null | null | null | null | null | Python | 2026-05-04T02:13:48.624901 | from reactpy import component, html, run, use_state
@component
def CounterList():
counters, set_counters = use_state([0, 0, 0])
def make_increment_click_handler(index):
def handle_click(event):
new_value = counters[index] + 1
set_counters([*counters[:index], new_value, *counte... |
reactive-python/reactpy | https://github.com/reactive-python/reactpy | null | null | null | null | 8,138 | null | null | mit | null | null | null | null | null | null | null | docs/source/guides/adding-interactivity/dangers-of-mutability/_examples/moving_dot.py | null | null | null | null | null | null | Python | 2026-05-04T02:13:48.642223 | from reactpy import component, html, run, use_state
@component
def MovingDot():
position, set_position = use_state({"x": 0, "y": 0})
async def handle_pointer_move(event):
outer_div_info = event["currentTarget"]
outer_div_bounds = outer_div_info["boundingClientRect"]
set_position(
... |
reactive-python/reactpy | https://github.com/reactive-python/reactpy | null | null | null | null | 8,138 | null | null | mit | null | null | null | null | null | null | null | docs/source/guides/adding-interactivity/dangers-of-mutability/_examples/list_remove.py | null | null | null | null | null | null | Python | 2026-05-04T02:13:48.651577 | from reactpy import component, html, run, use_state
@component
def ArtistList():
artist_to_add, set_artist_to_add = use_state("")
artists, set_artists = use_state(
["Marta Colvin Andrade", "Lamidi Olonade Fakeye", "Louise Nevelson"]
)
def handle_change(event):
set_artist_to_add(event[... |
reactive-python/reactpy | https://github.com/reactive-python/reactpy | null | null | null | null | 8,138 | null | null | mit | null | null | null | null | null | null | null | docs/source/guides/adding-interactivity/dangers-of-mutability/_examples/set_remove.py | null | null | null | null | null | null | Python | 2026-05-04T02:13:48.652826 | from reactpy import component, html, run, use_state
@component
def Grid():
line_size = 5
selected_indices, set_selected_indices = use_state({1, 2, 4})
def make_handle_click(index):
def handle_click(event):
if index in selected_indices:
set_selected_indices(selected_ind... |
reactive-python/reactpy | https://github.com/reactive-python/reactpy | null | null | null | null | 8,138 | null | null | mit | null | null | null | null | null | null | null | docs/source/guides/adding-interactivity/dangers-of-mutability/_examples/moving_dot_broken.py | null | null | null | null | null | null | Python | 2026-05-04T02:13:48.683924 | # :linenos:
from reactpy import component, html, run, use_state
@component
def MovingDot():
position, _ = use_state({"x": 0, "y": 0})
def handle_pointer_move(event):
outer_div_info = event["currentTarget"]
outer_div_bounds = outer_div_info["boundingClientRect"]
position["x"] = event[... |
reactive-python/reactpy | https://github.com/reactive-python/reactpy | null | null | null | null | 8,138 | null | null | mit | null | null | null | null | null | null | null | docs/source/guides/adding-interactivity/dangers-of-mutability/_examples/set_update.py | null | null | null | null | null | null | Python | 2026-05-04T02:13:48.713682 | from reactpy import component, html, run, use_state
@component
def Grid():
line_size = 5
selected_indices, set_selected_indices = use_state(set())
def make_handle_click(index):
def handle_click(event):
set_selected_indices(selected_indices | {index})
return handle_click
... |
reactive-python/reactpy | https://github.com/reactive-python/reactpy | null | null | null | null | 8,138 | null | null | mit | null | null | null | null | null | null | null | docs/source/guides/adding-interactivity/multiple-state-updates/_examples/delay_before_count_updater.py | null | null | null | null | null | null | Python | 2026-05-04T02:13:48.714913 | import asyncio
from reactpy import component, html, run, use_state
@component
def Counter():
number, set_number = use_state(0)
async def handle_click(event):
await asyncio.sleep(3)
set_number(lambda old_number: old_number + 1)
return html.div(
html.h1(number),
html.butto... |
reactive-python/reactpy | https://github.com/reactive-python/reactpy | null | null | null | null | 8,138 | null | null | mit | null | null | null | null | null | null | null | docs/source/guides/adding-interactivity/responding-to-events/_examples/audio_player.py | null | null | null | null | null | null | Python | 2026-05-04T02:13:50.018521 | import json
import reactpy
@reactpy.component
def PlayDinosaurSound():
event, set_event = reactpy.hooks.use_state(None)
return reactpy.html.div(
reactpy.html.audio(
{
"controls": True,
"on_time_update": lambda e: set_event(e),
"src": "https:... |
reactive-python/reactpy | https://github.com/reactive-python/reactpy | null | null | null | null | 8,138 | null | null | mit | null | null | null | null | null | null | null | docs/source/guides/adding-interactivity/multiple-state-updates/_examples/set_color_3_times.py | null | null | null | null | null | null | Python | 2026-05-04T02:13:50.019063 | from reactpy import component, html, run, use_state
@component
def ColorButton():
color, set_color = use_state("gray")
def handle_click(event):
set_color("orange")
set_color("pink")
set_color("blue")
def handle_reset(event):
set_color("gray")
return html.div(
... |
reactive-python/reactpy | https://github.com/reactive-python/reactpy | null | null | null | null | 8,138 | null | null | mit | null | null | null | null | null | null | null | docs/source/guides/adding-interactivity/responding-to-events/_examples/prevent_default_event_actions.py | null | null | null | null | null | null | Python | 2026-05-04T02:13:50.503665 | from reactpy import component, event, html, run
@component
def DoNotChangePages():
return html.div(
html.p("Normally clicking this link would take you to a new page"),
html.a(
{
"on_click": event(lambda event: None, prevent_default=True),
"href": "https:... |
reactive-python/reactpy | https://github.com/reactive-python/reactpy | null | null | null | null | 8,138 | null | null | mit | null | null | null | null | null | null | null | docs/source/guides/adding-interactivity/responding-to-events/_examples/button_prints_event.py | null | null | null | null | null | null | Python | 2026-05-04T02:13:50.505149 | from reactpy import component, html, run
@component
def Button():
def handle_event(event):
print(event)
return html.button({"on_click": handle_event}, "Click me!")
run(Button)
|
reactive-python/reactpy | https://github.com/reactive-python/reactpy | null | null | null | null | 8,138 | null | null | mit | null | null | null | null | null | null | null | docs/source/guides/adding-interactivity/responding-to-events/_examples/button_prints_message.py | null | null | null | null | null | null | Python | 2026-05-04T02:13:50.721351 | from reactpy import component, html, run
@component
def PrintButton(display_text, message_text):
def handle_event(event):
print(message_text)
return html.button({"on_click": handle_event}, display_text)
@component
def App():
return html.div(
PrintButton("Play", "Playing"),
Print... |
reactive-python/reactpy | https://github.com/reactive-python/reactpy | null | null | null | null | 8,138 | null | null | mit | null | null | null | null | null | null | null | docs/source/guides/adding-interactivity/multiple-state-updates/_examples/delay_before_set_count.py | null | null | null | null | null | null | Python | 2026-05-04T02:13:50.852079 | import asyncio
from reactpy import component, html, run, use_state
@component
def Counter():
number, set_number = use_state(0)
async def handle_click(event):
await asyncio.sleep(3)
set_number(number + 1)
return html.div(
html.h1(number),
html.button({"on_click": handle_c... |
reactive-python/reactpy | https://github.com/reactive-python/reactpy | null | null | null | null | 8,138 | null | null | mit | null | null | null | null | null | null | null | docs/source/guides/adding-interactivity/multiple-state-updates/_examples/set_state_function.py | null | null | null | null | null | null | Python | 2026-05-04T02:13:51.081412 | from reactpy import component, html, run, use_state
def increment(old_number):
new_number = old_number + 1
return new_number
@component
def Counter():
number, set_number = use_state(0)
def handle_click(event):
set_number(increment)
set_number(increment)
set_number(increment)... |
reactive-python/reactpy | https://github.com/reactive-python/reactpy | null | null | null | null | 8,138 | null | null | mit | null | null | null | null | null | null | null | docs/source/guides/adding-interactivity/state-as-a-snapshot/_examples/delayed_print_after_set.py | null | null | null | null | null | null | Python | 2026-05-04T02:13:51.089901 | import asyncio
from reactpy import component, html, run, use_state
@component
def Counter():
number, set_number = use_state(0)
async def handle_click(event):
set_number(number + 5)
print("about to print...")
await asyncio.sleep(3)
print(number)
return html.div(
h... |
reactive-python/reactpy | https://github.com/reactive-python/reactpy | null | null | null | null | 8,138 | null | null | mit | null | null | null | null | null | null | null | docs/source/guides/adding-interactivity/responding-to-events/_examples/button_does_nothing.py | null | null | null | null | null | null | Python | 2026-05-04T02:13:51.252629 | from reactpy import component, html, run
@component
def Button():
return html.button("I don't do anything yet")
run(Button)
|
reactive-python/reactpy | https://github.com/reactive-python/reactpy | null | null | null | null | 8,138 | null | null | mit | null | null | null | null | null | null | null | docs/source/guides/adding-interactivity/responding-to-events/_examples/stop_event_propagation.py | null | null | null | null | null | null | Python | 2026-05-04T02:13:51.260423 | from reactpy import component, event, hooks, html, run
@component
def DivInDiv():
stop_propagatation, set_stop_propagatation = hooks.use_state(True)
inner_count, set_inner_count = hooks.use_state(0)
outer_count, set_outer_count = hooks.use_state(0)
div_in_div = html.div(
{
"on_cli... |
reactive-python/reactpy | https://github.com/reactive-python/reactpy | null | null | null | null | 8,138 | null | null | mit | null | null | null | null | null | null | null | docs/source/guides/adding-interactivity/state-as-a-snapshot/_examples/print_count_after_set.py | null | null | null | null | null | null | Python | 2026-05-04T02:13:51.277193 | from reactpy import component, html, run, use_state
@component
def Counter():
number, set_number = use_state(0)
def handle_click(event):
set_number(number + 5)
print(number)
return html.div(
html.h1(number),
html.button({"on_click": handle_click}, "Increment"),
)
ru... |
reactive-python/reactpy | https://github.com/reactive-python/reactpy | null | null | null | null | 8,138 | null | null | mit | null | null | null | null | null | null | null | docs/source/guides/adding-interactivity/state-as-a-snapshot/_examples/print_chat_message.py | null | null | null | null | null | null | Python | 2026-05-04T02:13:51.360197 | import asyncio
from reactpy import component, event, html, run, use_state
@component
def App():
recipient, set_recipient = use_state("Alice")
message, set_message = use_state("")
@event(prevent_default=True)
async def handle_submit(event):
set_message("")
print("About to send message... |
reactive-python/reactpy | https://github.com/reactive-python/reactpy | null | null | null | null | 8,138 | null | null | mit | null | null | null | null | null | null | null | docs/source/guides/adding-interactivity/state-as-a-snapshot/_examples/send_message.py | null | null | null | null | null | null | Python | 2026-05-04T02:13:51.533726 | from reactpy import component, event, html, run, use_state
@component
def App():
is_sent, set_is_sent = use_state(False)
message, set_message = use_state("")
if is_sent:
return html.div(
html.h1("Message sent!"),
html.button(
{"on_click": lambda event: set_... |
reactive-python/reactpy | https://github.com/reactive-python/reactpy | null | null | null | null | 8,138 | null | null | mit | null | null | null | null | null | null | null | docs/source/guides/adding-interactivity/state-as-a-snapshot/_examples/set_counter_3_times.py | null | null | null | null | null | null | Python | 2026-05-04T02:13:51.651348 | from reactpy import component, html, run, use_state
@component
def Counter():
number, set_number = use_state(0)
def handle_click(event):
set_number(number + 1)
set_number(number + 1)
set_number(number + 1)
return html.div(
html.h1(number),
html.button({"on_click":... |
reactive-python/reactpy | https://github.com/reactive-python/reactpy | null | null | null | null | 8,138 | null | null | mit | null | null | null | null | null | null | null | docs/source/guides/creating-interfaces/rendering-data/_examples/sorted_and_filtered_todo_list.py | null | null | null | null | null | null | Python | 2026-05-04T02:13:51.747521 | from reactpy import component, html, run
@component
def DataList(items, filter_by_priority=None, sort_by_priority=False):
if filter_by_priority is not None:
items = [i for i in items if i["priority"] <= filter_by_priority]
if sort_by_priority:
items = sorted(items, key=lambda i: i["priority"])... |
reactive-python/reactpy | https://github.com/reactive-python/reactpy | null | null | null | null | 8,138 | null | null | mit | null | null | null | null | null | null | null | docs/source/guides/creating-interfaces/rendering-data/_examples/todo_list_with_keys.py | null | null | null | null | null | null | Python | 2026-05-04T02:13:51.820074 | from reactpy import component, html, run
@component
def DataList(items, filter_by_priority=None, sort_by_priority=False):
if filter_by_priority is not None:
items = [i for i in items if i["priority"] <= filter_by_priority]
if sort_by_priority:
items = sorted(items, key=lambda i: i["priority"])... |
reactive-python/reactpy | https://github.com/reactive-python/reactpy | null | null | null | null | 8,138 | null | null | mit | null | null | null | null | null | null | null | docs/source/guides/creating-interfaces/rendering-data/_examples/todo_from_list.py | null | null | null | null | null | null | Python | 2026-05-04T02:13:51.933007 | from reactpy import component, html, run
@component
def DataList(items):
list_item_elements = [html.li(text) for text in items]
return html.ul(list_item_elements)
@component
def TodoList():
tasks = [
"Make breakfast (important)",
"Feed the dog (important)",
"Do laundry",
... |
reactive-python/reactpy | https://github.com/reactive-python/reactpy | null | null | null | null | 8,138 | null | null | mit | null | null | null | null | null | null | null | docs/source/guides/creating-interfaces/your-first-components/_examples/bad_conditional_todo_list.py | null | null | null | null | null | null | Python | 2026-05-04T02:13:51.933597 | from reactpy import component, html, run
@component
def Item(name, done):
if done:
return html.li(name, " ✔")
else:
return html.li(name)
@component
def TodoList():
return html.section(
html.h1("My Todo List"),
html.ul(
Item("Find a cool problem to solve", done... |
reactive-python/reactpy | https://github.com/reactive-python/reactpy | null | null | null | null | 8,138 | null | null | mit | null | null | null | null | null | null | null | docs/source/guides/adding-interactivity/responding-to-events/_examples/button_handler_as_arg.py | null | null | null | null | null | null | Python | 2026-05-04T02:13:53.294876 | from reactpy import component, html, run
@component
def Button(display_text, on_click):
return html.button({"on_click": on_click}, display_text)
@component
def PlayButton(movie_name):
def handle_click(event):
print(f"Playing {movie_name}")
return Button(f"Play {movie_name}", on_click=handle_cli... |
reactive-python/reactpy | https://github.com/reactive-python/reactpy | null | null | null | null | 8,138 | null | null | mit | null | null | null | null | null | null | null | docs/source/guides/adding-interactivity/responding-to-events/_examples/button_async_handlers.py | null | null | null | null | null | null | Python | 2026-05-04T02:13:59.335070 | import asyncio
from reactpy import component, html, run
@component
def ButtonWithDelay(message, delay):
async def handle_event(event):
await asyncio.sleep(delay)
print(message)
return html.button({"on_click": handle_event}, message)
@component
def App():
return html.div(
Button... |
py-why/dowhy | https://github.com/py-why/dowhy | null | null | null | null | 8,097 | null | null | mit | null | null | null | null | null | null | null | docs/source/conf.py | null | null | null | null | null | null | Python | 2026-05-04T02:14:01.766673 | # -*- coding: utf-8 -*-
#
# Configuration file for the Sphinx documentation builder.
#
# This file does only contain a selection of the most common options. For a
# full list see the documentation:
# http://www.sphinx-doc.org/en/stable/config
# -- Path setup ------------------------------------------------------------... |
py-why/dowhy | https://github.com/py-why/dowhy | null | null | null | null | 8,097 | null | null | mit | null | null | null | null | null | null | null | dowhy/__init__.py | null | null | null | null | null | null | Python | 2026-05-04T02:14:01.790876 | import logging
from dowhy.causal_identifier import EstimandType, identify_effect, identify_effect_auto, identify_effect_id
from dowhy.causal_model import CausalModel
logging.getLogger(__name__).addHandler(logging.NullHandler())
#
# 0.0.0 is standard placeholder for poetry-dynamic-versioning
# any changes to this sho... |
py-why/dowhy | https://github.com/py-why/dowhy | null | null | null | null | 8,097 | null | null | mit | null | null | null | null | null | null | null | dowhy/causal_estimators/__init__.py | null | null | null | null | null | null | Python | 2026-05-04T02:14:01.794421 | import string
from importlib import import_module
from dowhy.causal_estimator import CausalEstimator
def get_class_object(method_name, estimator_name=None, *args, **kwargs):
# from https://www.bnmetrics.com/blog/factory-pattern-in-python3-simple-version
try:
module_name = method_name
class_na... |
py-why/dowhy | https://github.com/py-why/dowhy | null | null | null | null | 8,097 | null | null | mit | null | null | null | null | null | null | null | dowhy/api/causal_data_frame.py | null | null | null | null | null | null | Python | 2026-05-04T02:14:01.795730 | import networkx as nx
import pandas as pd
import dowhy.do_samplers as do_samplers
from dowhy import EstimandType
from dowhy.graph import build_graph
from dowhy.utils.api import parse_state
@pd.api.extensions.register_dataframe_accessor("causal")
class CausalAccessor(object):
def __init__(self, pandas_obj):
... |
py-why/dowhy | https://github.com/py-why/dowhy | null | null | null | null | 8,097 | null | null | mit | null | null | null | null | null | null | null | dowhy/causal_estimators/econml.py | null | null | null | null | null | null | Python | 2026-05-04T02:14:01.799721 | import inspect
from importlib import import_module
from typing import Any, Callable, List, Optional, Protocol, Union
from warnings import warn
import numpy as np
import pandas as pd
from dowhy.causal_estimator import CausalEstimate, CausalEstimator
from dowhy.causal_identifier import IdentifiedEstimand
from dowhy.uti... |
py-why/dowhy | https://github.com/py-why/dowhy | null | null | null | null | 8,097 | null | null | mit | null | null | null | null | null | null | null | dowhy/causal_estimators/causalml.py | null | null | null | null | null | null | Python | 2026-05-04T02:14:01.801424 | import inspect
import logging
from importlib import import_module
from typing import Any, List, Optional, Protocol, Union
from warnings import warn
import pandas as pd
from dowhy.causal_estimator import CausalEstimate, CausalEstimator
from dowhy.causal_identifier import IdentifiedEstimand
class _CausalmlEstimator(P... |
py-why/dowhy | https://github.com/py-why/dowhy | null | null | null | null | 8,097 | null | null | mit | null | null | null | null | null | null | null | dowhy/causal_estimators/distance_matching_estimator.py | null | null | null | null | null | null | Python | 2026-05-04T02:14:01.808833 | from typing import Any, List, Optional, Union
import numpy as np
import pandas as pd
from sklearn.neighbors import NearestNeighbors
from dowhy.causal_estimator import CausalEstimate, CausalEstimator
from dowhy.causal_identifier import IdentifiedEstimand
class DistanceMatchingEstimator(CausalEstimator):
"""Simpl... |
py-why/dowhy | https://github.com/py-why/dowhy | null | null | null | null | 8,097 | null | null | mit | null | null | null | null | null | null | null | dowhy/causal_estimators/doubly_robust_estimator.py | null | null | null | null | null | null | Python | 2026-05-04T02:14:01.810047 | from typing import Any, List, Optional, Type, Union
import numpy as np
import pandas as pd
from dowhy.causal_estimator import CausalEstimate, CausalEstimator
from dowhy.causal_estimators.linear_regression_estimator import LinearRegressionEstimator
from dowhy.causal_estimators.propensity_score_estimator import Propens... |
py-why/dowhy | https://github.com/py-why/dowhy | null | null | null | null | 8,097 | null | null | mit | null | null | null | null | null | null | null | dowhy/causal_estimator.py | null | null | null | null | null | null | Python | 2026-05-04T02:14:01.857099 | import copy
import logging
from collections import namedtuple
from typing import Dict, List, Optional, Union
import numpy as np
import pandas as pd
import sympy as sp
from sklearn.utils import resample
import dowhy.interpreters as interpreters
from dowhy.causal_identifier.identified_estimand import IdentifiedEstimand... |
py-why/dowhy | https://github.com/py-why/dowhy | null | null | null | null | 8,097 | null | null | mit | null | null | null | null | null | null | null | dowhy/causal_estimators/generalized_linear_model_estimator.py | null | null | null | null | null | null | Python | 2026-05-04T02:14:02.329478 | import itertools
from typing import Any, List, Optional, Union
import pandas as pd
import statsmodels.api as sm
from dowhy.causal_estimator import CausalEstimator
from dowhy.causal_estimators.regression_estimator import RegressionEstimator
from dowhy.causal_identifier import IdentifiedEstimand
class GeneralizedLine... |
py-why/dowhy | https://github.com/py-why/dowhy | null | null | null | null | 8,097 | null | null | mit | null | null | null | null | null | null | null | dowhy/causal_estimators/linear_regression_estimator.py | null | null | null | null | null | null | Python | 2026-05-04T02:14:02.393590 | import itertools
from typing import List, Optional, Union
import pandas as pd
import statsmodels.api as sm
from dowhy.causal_estimator import CausalEstimator
from dowhy.causal_estimators.regression_estimator import RegressionEstimator
from dowhy.causal_identifier import IdentifiedEstimand
class LinearRegressionEsti... |
py-why/dowhy | https://github.com/py-why/dowhy | null | null | null | null | 8,097 | null | null | mit | null | null | null | null | null | null | null | dowhy/causal_estimators/regression_discontinuity_estimator.py | null | null | null | null | null | null | Python | 2026-05-04T02:14:02.404679 | from typing import Any, List, Optional, Union
import numpy as np
import pandas as pd
from dowhy.causal_estimator import CausalEstimator
from dowhy.causal_estimators.instrumental_variable_estimator import InstrumentalVariableEstimator
from dowhy.causal_identifier import IdentifiedEstimand
class RegressionDiscontinui... |
py-why/dowhy | https://github.com/py-why/dowhy | null | null | null | null | 8,097 | null | null | mit | null | null | null | null | null | null | null | dowhy/causal_estimators/instrumental_variable_estimator.py | null | null | null | null | null | null | Python | 2026-05-04T02:14:02.415303 | from typing import Any, Dict, List, Optional, Union
import numpy as np
import pandas as pd
import sympy as sp
import sympy.stats as spstats
from statsmodels.sandbox.regression.gmm import IV2SLS
from dowhy.causal_estimator import CausalEstimate, CausalEstimator, RealizedEstimand
from dowhy.causal_identifier import Ide... |
py-why/dowhy | https://github.com/py-why/dowhy | null | null | null | null | 8,097 | null | null | mit | null | null | null | null | null | null | null | dowhy/causal_estimators/propensity_score_estimator.py | null | null | null | null | null | null | Python | 2026-05-04T02:14:02.420194 | from typing import Any, List, Optional, Union
import numpy as np
import pandas as pd
from sklearn import linear_model
from sklearn.exceptions import NotFittedError
from dowhy.causal_estimator import CausalEstimator
from dowhy.causal_identifier import IdentifiedEstimand
class PropensityScoreEstimator(CausalEstimator... |
py-why/dowhy | https://github.com/py-why/dowhy | null | null | null | null | 8,097 | null | null | mit | null | null | null | null | null | null | null | dowhy/causal_estimators/propensity_score_stratification_estimator.py | null | null | null | null | null | null | Python | 2026-05-04T02:14:02.427923 | import math
from typing import Any, List, Optional, Union
import pandas as pd
from dowhy.causal_estimator import CausalEstimate, CausalEstimator
from dowhy.causal_estimators.propensity_score_estimator import PropensityScoreEstimator
from dowhy.causal_identifier import IdentifiedEstimand
class PropensityScoreStratif... |
py-why/dowhy | https://github.com/py-why/dowhy | null | null | null | null | 8,097 | null | null | mit | null | null | null | null | null | null | null | dowhy/causal_estimators/propensity_score_weighting_estimator.py | null | null | null | null | null | null | Python | 2026-05-04T02:14:02.435714 | from typing import Any, List, Optional, Union
import numpy as np
import pandas as pd
from dowhy.causal_estimator import CausalEstimate, CausalEstimator
from dowhy.causal_estimators.propensity_score_estimator import PropensityScoreEstimator
from dowhy.causal_identifier import IdentifiedEstimand
class PropensityScore... |
py-why/dowhy | https://github.com/py-why/dowhy | null | null | null | null | 8,097 | null | null | mit | null | null | null | null | null | null | null | dowhy/causal_estimators/regression_estimator.py | null | null | null | null | null | null | Python | 2026-05-04T02:14:02.437715 | from typing import Any, List, Optional, Union
import numpy as np
import pandas as pd
import statsmodels.api as sm
from dowhy.causal_estimator import CausalEstimate, CausalEstimator, IdentifiedEstimand
class RegressionEstimator(CausalEstimator):
"""Compute effect of treatment using some regression function.
... |
py-why/dowhy | https://github.com/py-why/dowhy | null | null | null | null | 8,097 | null | null | mit | null | null | null | null | null | null | null | dowhy/causal_estimators/two_stage_regression_estimator.py | null | null | null | null | null | null | Python | 2026-05-04T02:14:02.439165 | import copy
from typing import Any, List, Optional, Type, Union
import numpy as np
import pandas as pd
from dowhy.causal_estimator import CausalEstimate, CausalEstimator
from dowhy.causal_estimators.linear_regression_estimator import LinearRegressionEstimator
from dowhy.causal_identifier import EstimandType, Identifi... |
py-why/dowhy | https://github.com/py-why/dowhy | null | null | null | null | 8,097 | null | null | mit | null | null | null | null | null | null | null | dowhy/causal_estimators/propensity_score_matching_estimator.py | null | null | null | null | null | null | Python | 2026-05-04T02:14:02.462137 | from typing import Any, List, Optional, Union
import numpy as np
import pandas as pd
from sklearn.neighbors import NearestNeighbors
from dowhy.causal_estimator import CausalEstimate, CausalEstimator
from dowhy.causal_estimators.propensity_score_estimator import PropensityScoreEstimator
from dowhy.causal_identifier im... |
py-why/dowhy | https://github.com/py-why/dowhy | null | null | null | null | 8,097 | null | null | mit | null | null | null | null | null | null | null | dowhy/causal_graph.py | null | null | null | null | null | null | Python | 2026-05-04T02:14:03.256575 | import itertools
import logging
import re
import networkx as nx
# version compatibility for breaking change in networkx 3.5
try:
from networkx.algorithms.d_separation import is_d_separator as d_separated
except ImportError:
from networkx.algorithms.d_separation import d_separated
from dowhy.gcm.causal_models... |
py-why/dowhy | https://github.com/py-why/dowhy | null | null | null | null | 8,097 | null | null | mit | null | null | null | null | null | null | null | dowhy/causal_identifier/auto_identifier.py | null | null | null | null | null | null | Python | 2026-05-04T02:14:03.846547 | import itertools
import logging
import sys
from enum import Enum
from typing import Dict, List, Optional, Union
import networkx as nx
import sympy as sp
import sympy.stats as spstats
from dowhy.causal_identifier.adjustment_set import AdjustmentSet
from dowhy.causal_identifier.efficient_backdoor import EfficientBackdo... |
py-why/dowhy | https://github.com/py-why/dowhy | null | null | null | null | 8,097 | null | null | mit | null | null | null | null | null | null | null | dowhy/causal_identifier/__init__.py | null | null | null | null | null | null | Python | 2026-05-04T02:14:04.493872 | from dowhy.causal_identifier.auto_identifier import (
AutoIdentifier,
BackdoorAdjustment,
EstimandType,
GeneralizedAdjustment,
construct_adjustment_estimand,
construct_frontdoor_estimand,
construct_iv_estimand,
identify_effect_auto,
)
from dowhy.causal_identifier.id_identifier import IDI... |
py-why/dowhy | https://github.com/py-why/dowhy | null | null | null | null | 8,097 | null | null | mit | null | null | null | null | null | null | null | dowhy/causal_identifier/identify_effect.py | null | null | null | null | null | null | Python | 2026-05-04T02:14:04.648874 | from typing import List, Protocol, Union
import networkx as nx
from dowhy.causal_identifier.auto_identifier import BackdoorAdjustment, EstimandType, identify_effect_auto
from dowhy.causal_identifier.identified_estimand import IdentifiedEstimand
class CausalIdentifier(Protocol):
"""
Protocol to define a Caus... |
py-why/dowhy | https://github.com/py-why/dowhy | null | null | null | null | 8,097 | null | null | mit | null | null | null | null | null | null | null | dowhy/causal_identifier/backdoor.py | null | null | null | null | null | null | Python | 2026-05-04T02:14:04.650237 | import networkx as nx
from dowhy.causal_identifier.adjustment_set import AdjustmentSet
from dowhy.utils.graph_operations import adjacency_matrix_to_adjacency_list
class NodePair:
"""
Data structure to store backdoor variables between 2 nodes.
"""
def __init__(self, node1, node2):
self._node1... |
py-why/dowhy | https://github.com/py-why/dowhy | null | null | null | null | 8,097 | null | null | mit | null | null | null | null | null | null | null | dowhy/causal_identifier/identified_estimand.py | null | null | null | null | null | null | Python | 2026-05-04T02:14:04.652068 | import copy
from typing import List, Optional
import sympy as sp
from dowhy.utils.api import parse_state
class IdentifiedEstimand:
"""Class for storing a causal estimand, typically as a result of the identification step."""
def __init__(
self,
identifier, # This field will be deprecated in... |
py-why/dowhy | https://github.com/py-why/dowhy | null | null | null | null | 8,097 | null | null | mit | null | null | null | null | null | null | null | dowhy/causal_model.py | null | null | null | null | null | null | Python | 2026-05-04T02:14:04.682926 | """Module containing the main model class for the dowhy package."""
import logging
import typing
import warnings
from itertools import combinations
import dowhy.causal_estimators as causal_estimators
import dowhy.causal_refuters as causal_refuters
import dowhy.graph_learners as graph_learners
from dowhy.causal_estima... |
py-why/dowhy | https://github.com/py-why/dowhy | null | null | null | null | 8,097 | null | null | mit | null | null | null | null | null | null | null | dowhy/causal_identifier/id_identifier.py | null | null | null | null | null | null | Python | 2026-05-04T02:14:04.762189 | from typing import Dict, List, Optional, Set, Union
import networkx as nx
import numpy as np
from dowhy.graph import get_adjacency_matrix
from dowhy.utils.api import parse_state
from dowhy.utils.graph_operations import find_ancestor, find_c_components, induced_graph
from dowhy.utils.ordered_set import OrderedSet
cl... |
py-why/dowhy | https://github.com/py-why/dowhy | null | null | null | null | 8,097 | null | null | mit | null | null | null | null | null | null | null | dowhy/causal_identifier/adjustment_set.py | null | null | null | null | null | null | Python | 2026-05-04T02:14:04.763462 | class AdjustmentSet:
"""Class for storing an adjustment set."""
BACKDOOR = "backdoor"
# General adjustment sets generalize backdoor sets, but we will differentiate
# between the two given the ubiquity of the backdoor criterion.
GENERAL = "general"
def __init__(
self,
adjustment... |
py-why/dowhy | https://github.com/py-why/dowhy | null | null | null | null | 8,097 | null | null | mit | null | null | null | null | null | null | null | dowhy/causal_identifier/efficient_backdoor.py | null | null | null | null | null | null | Python | 2026-05-04T02:14:04.765321 | from typing import List
import networkx as nx
import numpy as np
EXCEPTION_NO_ADJ = "An adjustment set formed by observable variables does not exist"
EXCEPTION_COND_NO_OPT = "Conditions to guarantee the existence of an optimal adjustment set are not satisfied"
class EfficientBackdoor:
"""
Implements methods... |
py-why/dowhy | https://github.com/py-why/dowhy | null | null | null | null | 8,097 | null | null | mit | null | null | null | null | null | null | null | dowhy/causal_prediction/algorithms/base_algorithm.py | null | null | null | null | null | null | Python | 2026-05-04T02:14:05.089427 | import pytorch_lightning as pl
import torch
from torch.nn import functional as F
class PredictionAlgorithm(pl.LightningModule):
def __init__(self, model, optimizer, lr, weight_decay, betas, momentum):
"""
This class implements the default methods for a Pytorch lightning module `pl.LightningModule`... |
py-why/dowhy | https://github.com/py-why/dowhy | null | null | null | null | 8,097 | null | null | mit | null | null | null | null | null | null | null | dowhy/causal_prediction/algorithms/erm.py | null | null | null | null | null | null | Python | 2026-05-04T02:14:05.266746 | import torch
from torch.nn import functional as F
from dowhy.causal_prediction.algorithms.base_algorithm import PredictionAlgorithm
class ERM(PredictionAlgorithm):
def __init__(self, model, optimizer="Adam", lr=1e-3, weight_decay=0.0, betas=(0.9, 0.999), momentum=0.9):
super().__init__(model, optimizer, ... |
py-why/dowhy | https://github.com/py-why/dowhy | null | null | null | null | 8,097 | null | null | mit | null | null | null | null | null | null | null | dowhy/causal_prediction/algorithms/cacm.py | null | null | null | null | null | null | Python | 2026-05-04T02:14:05.273441 | import torch
from torch.nn import functional as F
from dowhy.causal_prediction.algorithms.base_algorithm import PredictionAlgorithm
from dowhy.causal_prediction.algorithms.regularization import Regularizer
class CACM(PredictionAlgorithm):
def __init__(
self,
model,
optimizer="Adam",
... |
py-why/dowhy | https://github.com/py-why/dowhy | null | null | null | null | 8,097 | null | null | mit | null | null | null | null | null | null | null | dowhy/causal_prediction/algorithms/utils.py | null | null | null | null | null | null | Python | 2026-05-04T02:14:05.284974 | # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
"""
The functions in this file are borrowed from DomainBed: https://github.com/facebookresearch/DomainBed
@inproceedings{gulrajani2021in,
title={In Search of Lost Domain Generalization},
author={Ishaan Gulrajani and David Lopez-Paz},
... |
py-why/dowhy | https://github.com/py-why/dowhy | null | null | null | null | 8,097 | null | null | mit | null | null | null | null | null | null | null | dowhy/causal_prediction/algorithms/regularization.py | null | null | null | null | null | null | Python | 2026-05-04T02:14:05.358775 | import numpy as np
import torch
from torch import nn
from torch.nn import functional as F
from dowhy.causal_prediction.algorithms.utils import mmd_compute
class Regularizer:
"""
Implements methods for applying unconditional and conditional regularization.
"""
def __init__(
self,
E_co... |
py-why/dowhy | https://github.com/py-why/dowhy | null | null | null | null | 8,097 | null | null | mit | null | null | null | null | null | null | null | dowhy/causal_prediction/dataloaders/get_data_loader.py | null | null | null | null | null | null | Python | 2026-05-04T02:14:05.359895 | from dowhy.causal_prediction.dataloaders import misc
from dowhy.causal_prediction.dataloaders.fast_data_loader import FastDataLoader, InfiniteDataLoader
def get_train_loader(dataset, envs, batch_size, class_balanced=False):
"""Return training dataloaders.
:param dataset: dataset class containing list of envi... |
py-why/dowhy | https://github.com/py-why/dowhy | null | null | null | null | 8,097 | null | null | mit | null | null | null | null | null | null | null | dowhy/causal_prediction/dataloaders/fast_data_loader.py | null | null | null | null | null | null | Python | 2026-05-04T02:14:05.379456 | # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
import torch
class _InfiniteSampler(torch.utils.data.Sampler):
"""Wraps another Sampler to yield an infinite stream."""
def __init__(self, sampler):
self.sampler = sampler
def __iter__(self):
while True:
... |
py-why/dowhy | https://github.com/py-why/dowhy | null | null | null | null | 8,097 | null | null | mit | null | null | null | null | null | null | null | dowhy/causal_prediction/dataloaders/misc.py | null | null | null | null | null | null | Python | 2026-05-04T02:14:05.678605 | # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
"""misc helper functions"""
import hashlib
from collections import Counter
import numpy as np
import torch
def make_weights_for_balanced_classes(dataset):
counts = Counter()
classes = []
for _, y in dataset:
y = int(y)
... |
py-why/dowhy | https://github.com/py-why/dowhy | null | null | null | null | 8,097 | null | null | mit | null | null | null | null | null | null | null | dowhy/causal_prediction/datasets/mnist.py | null | null | null | null | null | null | Python | 2026-05-04T02:14:05.890416 | # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
import torch
import torchvision
from PIL import Image
from torch.utils.data import TensorDataset
from torchvision import transforms
from torchvision.datasets import MNIST
from torchvision.transforms.functional import rotate
from dowhy.causal_predi... |
py-why/dowhy | https://github.com/py-why/dowhy | null | null | null | null | 8,097 | null | null | mit | null | null | null | null | null | null | null | dowhy/causal_prediction/datasets/base_dataset.py | null | null | null | null | null | null | Python | 2026-05-04T02:14:05.907060 | # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
"""
`MultipleDomainDataset` class in this file is borrowed from DomainBed: https://github.com/facebookresearch/DomainBed
@inproceedings{gulrajani2021in,
title={In Search of Lost Domain Generalization},
author={Ishaan Gulrajani and Dav... |
py-why/dowhy | https://github.com/py-why/dowhy | null | null | null | null | 8,097 | null | null | mit | null | null | null | null | null | null | null | dowhy/causal_prediction/models/networks.py | null | null | null | null | null | null | Python | 2026-05-04T02:14:05.983527 | # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
"""
The MNIST_MLP architecture is borrowed from OoD-Bench:
@inproceedings{ye2022ood,
title={OoD-Bench: Quantifying and Understanding Two Dimensions of Out-of-Distribution Generalization},
author={Ye, Nanyang and Li, Kaican and Bai, Ha... |
py-why/dowhy | https://github.com/py-why/dowhy | null | null | null | null | 8,097 | null | null | mit | null | null | null | null | null | null | null | dowhy/causal_refuters/__init__.py | null | null | null | null | null | null | Python | 2026-05-04T02:14:05.984628 | import string
from importlib import import_module
from dowhy.causal_refuter import CausalRefuter
from dowhy.causal_refuters.add_unobserved_common_cause import (
AddUnobservedCommonCause,
sensitivity_e_value,
sensitivity_simulation,
)
from dowhy.causal_refuters.bootstrap_refuter import BootstrapRefuter, ref... |
py-why/dowhy | https://github.com/py-why/dowhy | null | null | null | null | 8,097 | null | null | mit | null | null | null | null | null | null | null | dowhy/causal_refuter.py | null | null | null | null | null | null | Python | 2026-05-04T02:14:05.992313 | import logging
import random
from enum import Enum
from typing import List, Union
import numpy as np
import scipy.stats as st
from dowhy.utils.api import parse_state
class SignificanceTestType(Enum):
AUTO = "auto"
BOOTSTRAP = "bootstrap"
NORMAL = "normal_test"
logger = logging.getLogger(__name__)
c... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.