sample_id
stringlengths
21
196
text
stringlengths
105
936k
metadata
dict
category
stringclasses
6 values
marimo-team/marimo:marimo/_internal/notifications.py
# Copyright 2026 Marimo. All rights reserved. """Internal API for notifications.""" from marimo._messaging.notification import ( AlertNotification, BannerNotification, CacheClearedNotification, CacheInfoNotification, CellNotification, ColumnPreview, CompletedRunNotification, CompletionR...
{ "repo_id": "marimo-team/marimo", "file_path": "marimo/_internal/notifications.py", "license": "Apache License 2.0", "lines": 92, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
marimo-team/marimo:marimo/_internal/packages.py
# Copyright 2026 Marimo. All rights reserved. """Internal API for package management.""" from marimo._runtime.packages.package_manager import ( PackageDescription, PackageManager, ) from marimo._runtime.packages.package_managers import create_package_manager __all__ = [ "PackageDescription", "PackageM...
{ "repo_id": "marimo-team/marimo", "file_path": "marimo/_internal/packages.py", "license": "Apache License 2.0", "lines": 12, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
marimo-team/marimo:marimo/_internal/schemas.py
# Copyright 2026 Marimo. All rights reserved. """Internal API for notebook schemas.""" import marimo._schemas.notebook as notebook import marimo._schemas.serialization as serialization import marimo._schemas.session as session __all__ = [ "notebook", "serialization", "session", ]
{ "repo_id": "marimo-team/marimo", "file_path": "marimo/_internal/schemas.py", "license": "Apache License 2.0", "lines": 10, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
marimo-team/marimo:marimo/_internal/server/requests.py
# Copyright 2026 Marimo. All rights reserved. """Internal API for server request types.""" from marimo._server.models.export import ( ExportAsHTMLRequest, ExportAsIPYNBRequest, ExportAsMarkdownRequest, ExportAsScriptRequest, ) from marimo._server.models.models import InstantiateNotebookRequest __all__...
{ "repo_id": "marimo-team/marimo", "file_path": "marimo/_internal/server/requests.py", "license": "Apache License 2.0", "lines": 16, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
marimo-team/marimo:marimo/_internal/session/extensions.py
# Copyright 2026 Marimo. All rights reserved. """Internal API for session extensions.""" from marimo._session.extensions.extensions import ( CachingExtension, HeartbeatExtension, LoggingExtension, NotificationListenerExtension, QueueExtension, ReplayExtension, SessionViewExtension, ) from m...
{ "repo_id": "marimo-team/marimo", "file_path": "marimo/_internal/session/extensions.py", "license": "Apache License 2.0", "lines": 22, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
marimo-team/marimo:tests/fixtures/notebook.py
import marimo app = marimo.App() @app.cell def __(): import marimo as mo return (mo,) @app.cell def __(mo): slider = mo.ui.slider(0, 10) return (slider,) if __name__ == "__main__": app.run()
{ "repo_id": "marimo-team/marimo", "file_path": "tests/fixtures/notebook.py", "license": "Apache License 2.0", "lines": 12, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
marimo-team/marimo:tests/fixtures/notebook_async.py
import marimo app = marimo.App() @app.cell async def __(): import asyncio await asyncio.sleep(0.1) return (asyncio,) if __name__ == "__main__": app.run()
{ "repo_id": "marimo-team/marimo", "file_path": "tests/fixtures/notebook_async.py", "license": "Apache License 2.0", "lines": 9, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
marimo-team/marimo:tests/fixtures/notebook_sandboxed.py
# Copyright 2026 Marimo. All rights reserved. # /// script # requires-python = ">=3.11" # dependencies = [ # "polars", # "marimo>=0.8.0", # "quak", # "vega-datasets", # ] # /// import marimo app = marimo.App() @app.cell def __(): import marimo as mo return (mo,) @app.cell def __(mo): s...
{ "repo_id": "marimo-team/marimo", "file_path": "tests/fixtures/notebook_sandboxed.py", "license": "Apache License 2.0", "lines": 22, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
marimo-team/marimo:tests/fixtures/notebook_unparsable.py
import marimo app = marimo.App() app._unparsable_cell( r""" return """, name="__", ) app._unparsable_cell( r""" partial_statement = """, name="__", ) @app.cell def __(): valid_statement = 1 return (valid_statement,) if __name__ == "__main__": app.run()
{ "repo_id": "marimo-team/marimo", "file_path": "tests/fixtures/notebook_unparsable.py", "license": "Apache License 2.0", "lines": 20, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
marimo-team/marimo:tests/fixtures/notebook_with_errors.py
import marimo app = marimo.App() @app.cell def __(): import marimo as mo return (mo,) @app.cell def __(mo): slider = mo.ui.slider(0, 10) return (slider,) @app.cell def __(): 1 / 0 return if __name__ == "__main__": app.run()
{ "repo_id": "marimo-team/marimo", "file_path": "tests/fixtures/notebook_with_errors.py", "license": "Apache License 2.0", "lines": 16, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
marimo-team/marimo:tests/fixtures/notebook_with_md.py
import marimo app = marimo.App() @app.cell def __(mo): control_dep = None mo.md("markdown") return control_dep @app.cell def __(mo, control_dep): control_dep mo.md(f"parameterized markdown {123}") return @app.cell def __(): mo.md("plain markdown") return (mo,) @app.cell def __()...
{ "repo_id": "marimo-team/marimo", "file_path": "tests/fixtures/notebook_with_md.py", "license": "Apache License 2.0", "lines": 22, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
marimo-team/marimo:tests/fixtures/notebook_with_media.py
# /// script # requires-python = ">=3.13" # dependencies = [ # "altair==6.0.0", # "marimo", # "matplotlib==3.10.8", # "numpy==2.4.1", # "pandas==2.3.3", # "plotly==6.5.2", # "pyarrow==22.0.0", # ] # /// import marimo __generated_with = "0.19.4" app = marimo.App(width="medium") @app.cell ...
{ "repo_id": "marimo-team/marimo", "file_path": "tests/fixtures/notebook_with_media.py", "license": "Apache License 2.0", "lines": 95, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
marimo-team/marimo:tests/fixtures/notebook_with_multiple_definitions.py
import marimo app = marimo.App() @app.cell def __(): x = 1 return (x,) @app.cell def __(): x = 2 return (x,) if __name__ == "__main__": app.run()
{ "repo_id": "marimo-team/marimo", "file_path": "tests/fixtures/notebook_with_multiple_definitions.py", "license": "Apache License 2.0", "lines": 12, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
marimo-team/marimo:marimo/_smoke_tests/appcomp/resetting_sliders/embed_test_a.py
import marimo __generated_with = "0.19.2" app = marimo.App() @app.cell def _(): import marimo as mo return @app.cell def _(): import embed_test_b return (embed_test_b,) @app.cell def _(embed_test_b): clone_a = embed_test_b.app.clone() return (clone_a,) @app.cell async def _(clone_a): ...
{ "repo_id": "marimo-team/marimo", "file_path": "marimo/_smoke_tests/appcomp/resetting_sliders/embed_test_a.py", "license": "Apache License 2.0", "lines": 39, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
marimo-team/marimo:marimo/_smoke_tests/appcomp/resetting_sliders/embed_test_b.py
import marimo __generated_with = "0.19.2" app = marimo.App(width="full") @app.cell def _(): import marimo as mo import time return (mo,) @app.cell def _(): state = None return (state,) @app.cell def _(mo): print("Creating slider") slider = mo.ui.slider(0, 10, 1, 3, label="A slider") ...
{ "repo_id": "marimo-team/marimo", "file_path": "marimo/_smoke_tests/appcomp/resetting_sliders/embed_test_b.py", "license": "Apache License 2.0", "lines": 43, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
marimo-team/marimo:marimo/_smoke_tests/appcomp/ui_elements_with_overrides/embed_test_a.py
import marimo __generated_with = "0.19.2" app = marimo.App(width="full") @app.cell def _(): # https://github.com/marimo-team/marimo/issues/7685 import marimo as mo return @app.cell def _(): import embed_test_b return (embed_test_b,) @app.cell def _(embed_test_b): clone_a = embed_test_b.ap...
{ "repo_id": "marimo-team/marimo", "file_path": "marimo/_smoke_tests/appcomp/ui_elements_with_overrides/embed_test_a.py", "license": "Apache License 2.0", "lines": 38, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
marimo-team/marimo:marimo/_smoke_tests/appcomp/ui_elements_with_overrides/embed_test_b.py
import marimo __generated_with = "0.18.4" app = marimo.App(width="full") @app.cell def _(): import marimo as mo return (mo,) @app.cell def _(mo): slider = mo.ui.slider(0, 10, 1, 3, label="A slider") slider return (slider,) @app.cell def _(slider): value = slider.value label = "our" ...
{ "repo_id": "marimo-team/marimo", "file_path": "marimo/_smoke_tests/appcomp/ui_elements_with_overrides/embed_test_b.py", "license": "Apache License 2.0", "lines": 34, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
marimo-team/marimo:frontend/e2e-tests/py/slides.py
# /// script # [tool.marimo.runtime] # auto_instantiate = true # /// import marimo __generated_with = "0.19.4" app = marimo.App(layout_file="layouts/slides.slides.json") @app.cell def _(): import marimo as mo return (mo,) @app.cell def _(mo): mo.md(""" # Slides! """) return @app.cell(hid...
{ "repo_id": "marimo-team/marimo", "file_path": "frontend/e2e-tests/py/slides.py", "license": "Apache License 2.0", "lines": 25, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
marimo-team/marimo:marimo/_ast/fast_stack.py
# Copyright 2026 Marimo. All rights reserved. # Source - https://stackoverflow.com/a # Posted by Kache, modified by community. See post 'Timeline' for change history # Retrieved 2026-01-17, License - CC BY-SA 4.0 from __future__ import annotations import inspect import itertools from typing import TYPE_CHECKING if TY...
{ "repo_id": "marimo-team/marimo", "file_path": "marimo/_ast/fast_stack.py", "license": "Apache License 2.0", "lines": 44, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
marimo-team/marimo:tests/_ast/test_fast_stack.py
# Copyright 2026 Marimo. All rights reserved. from __future__ import annotations import inspect from marimo._ast.fast_stack import fast_stack class TestFastStack: @staticmethod def test_returns_list_of_frame_info() -> None: result = fast_stack() assert isinstance(result, list) assert...
{ "repo_id": "marimo-team/marimo", "file_path": "tests/_ast/test_fast_stack.py", "license": "Apache License 2.0", "lines": 68, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
marimo-team/marimo:tests/_convert/ipynb/test_from_ir.py
from __future__ import annotations import json import pathlib from typing import Any import pytest from marimo._ast.app import App, InternalApp from marimo._ast.load import load_app from marimo._convert.ipynb import convert_from_ir_to_ipynb from marimo._convert.ipynb.from_ir import ( _clean_ansi_for_export, ...
{ "repo_id": "marimo-team/marimo", "file_path": "tests/_convert/ipynb/test_from_ir.py", "license": "Apache License 2.0", "lines": 946, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
marimo-team/marimo:tests/_server/export/fixtures/apps/basic.py
import marimo __generated_with = "0.19.2" app = marimo.App() @app.cell def _(): x = 10 return (x,) @app.cell def _(x, y): z = y + x return (z,) @app.cell def _(x): y = x + 1 return (y,) if __name__ == "__main__": app.run()
{ "repo_id": "marimo-team/marimo", "file_path": "tests/_server/export/fixtures/apps/basic.py", "license": "Apache License 2.0", "lines": 17, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
marimo-team/marimo:tests/_server/export/fixtures/apps/empty_notebook.py
import marimo __generated_with = "0.19.2" app = marimo.App() if __name__ == "__main__": app.run()
{ "repo_id": "marimo-team/marimo", "file_path": "tests/_server/export/fixtures/apps/empty_notebook.py", "license": "Apache License 2.0", "lines": 5, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
marimo-team/marimo:tests/_server/export/fixtures/apps/error_ancestor.py
import marimo __generated_with = "0.19.2" app = marimo.App() @app.cell def _(): raise ValueError("ancestor error") @app.cell def _(x): y = x + 1 return (y,) if __name__ == "__main__": app.run()
{ "repo_id": "marimo-team/marimo", "file_path": "tests/_server/export/fixtures/apps/error_ancestor.py", "license": "Apache License 2.0", "lines": 12, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
marimo-team/marimo:tests/_server/export/fixtures/apps/error_complex.py
import marimo __generated_with = "0.19.2" app = marimo.App() @app.cell def _(y): # noqa: F811 x = y return (x,) @app.cell def _(): Y = 0 # noqa: N806 return (Y,) @app.cell def _(z): Z = z # noqa: N806 return (Z,) @app.cell def _(): z = 1 / 0 return (z,) @app.cell def _(x, Y...
{ "repo_id": "marimo-team/marimo", "file_path": "tests/_server/export/fixtures/apps/error_complex.py", "license": "Apache License 2.0", "lines": 26, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
marimo-team/marimo:tests/_server/export/fixtures/apps/error_cycle.py
import marimo __generated_with = "0.19.2" app = marimo.App() @app.cell def _(y): x = y return (x,) @app.cell def _(x): y = x return (y,) if __name__ == "__main__": app.run()
{ "repo_id": "marimo-team/marimo", "file_path": "tests/_server/export/fixtures/apps/error_cycle.py", "license": "Apache License 2.0", "lines": 13, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
marimo-team/marimo:tests/_server/export/fixtures/apps/error_redefinition.py
import marimo __generated_with = "0.19.2" app = marimo.App() @app.cell def _(): x = 1 return (x,) @app.cell def _(): x = 2 # Redefines x return (x,) if __name__ == "__main__": app.run()
{ "repo_id": "marimo-team/marimo", "file_path": "tests/_server/export/fixtures/apps/error_redefinition.py", "license": "Apache License 2.0", "lines": 13, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
marimo-team/marimo:tests/_server/export/fixtures/apps/error_undefined.py
import marimo __generated_with = "0.19.2" app = marimo.App() @app.cell def _(): x = undefined_variable # noqa: F821 return (x,) if __name__ == "__main__": app.run()
{ "repo_id": "marimo-team/marimo", "file_path": "tests/_server/export/fixtures/apps/error_undefined.py", "license": "Apache License 2.0", "lines": 9, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
marimo-team/marimo:tests/_server/export/fixtures/apps/error_value_with_stdout.py
import marimo __generated_with = "0.19.2" app = marimo.App() @app.cell def _(): print("hello before error") raise ValueError("test error") if __name__ == "__main__": app.run()
{ "repo_id": "marimo-team/marimo", "file_path": "tests/_server/export/fixtures/apps/error_value_with_stdout.py", "license": "Apache License 2.0", "lines": 9, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
marimo-team/marimo:tests/_server/export/fixtures/apps/with_console_output.py
import marimo __generated_with = "0.19.2" app = marimo.App() @app.cell def _(): import sys sys.stdout.write("hello stdout") return (sys,) @app.cell def _(sys): sys.stderr.write("hello stderr") return if __name__ == "__main__": app.run()
{ "repo_id": "marimo-team/marimo", "file_path": "tests/_server/export/fixtures/apps/with_console_output.py", "license": "Apache License 2.0", "lines": 14, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
marimo-team/marimo:tests/_server/export/fixtures/apps/with_dependencies.py
import marimo __generated_with = "0.19.2" app = marimo.App() @app.cell def _(): x = 1 return (x,) @app.cell def _(x): y = x + 1 return (y,) @app.cell def _(y): z = y + 1 return (z,) if __name__ == "__main__": app.run()
{ "repo_id": "marimo-team/marimo", "file_path": "tests/_server/export/fixtures/apps/with_dependencies.py", "license": "Apache License 2.0", "lines": 17, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
marimo-team/marimo:tests/_server/export/fixtures/apps/with_layout.py
import marimo __generated_with = "0.19.2" app = marimo.App(layout_file="layouts/layout.json") @app.cell def _(): x = 1 return if __name__ == "__main__": app.run()
{ "repo_id": "marimo-team/marimo", "file_path": "tests/_server/export/fixtures/apps/with_layout.py", "license": "Apache License 2.0", "lines": 9, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
marimo-team/marimo:tests/_server/export/fixtures/apps/with_outputs.py
import marimo __generated_with = "0.19.2" app = marimo.App() @app.cell def _(): import marimo as mo return (mo,) @app.cell def _(mo): import altair as alt import polars as pl df = pl.DataFrame({"x": [1, 2, 3], "y": [4, 5, 6]}) chart = alt.Chart(df).mark_point().encode(x="x", y="y") mo...
{ "repo_id": "marimo-team/marimo", "file_path": "tests/_server/export/fixtures/apps/with_outputs.py", "license": "Apache License 2.0", "lines": 32, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
marimo-team/marimo:tests/_server/export/fixtures/apps/with_stop.py
import marimo __generated_with = "0.19.2" app = marimo.App() @app.cell def _(): import marimo as mo mo.stop(True, "Stopped early") return (mo,) @app.cell def _(): x = 10 return (x,) @app.cell def _(x): y = x + 1 return (y,) if __name__ == "__main__": app.run()
{ "repo_id": "marimo-team/marimo", "file_path": "tests/_server/export/fixtures/apps/with_stop.py", "license": "Apache License 2.0", "lines": 18, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
marimo-team/marimo:tests/_server/export/test_export_ipynb.py
"""Snapshot tests for ipynb export functionality.""" from __future__ import annotations import pathlib import sys from pathlib import Path import pytest from marimo._ast.app import InternalApp from marimo._ast.load import load_app from marimo._convert.ipynb.from_ir import convert_from_ir_to_ipynb from marimo._depen...
{ "repo_id": "marimo-team/marimo", "file_path": "tests/_server/export/test_export_ipynb.py", "license": "Apache License 2.0", "lines": 63, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
marimo-team/marimo:marimo/_convert/ipynb/from_ir.py
# Copyright 2026 Marimo. All rights reserved. """Export marimo notebooks to Jupyter ipynb format.""" from __future__ import annotations import base64 import io import json import re from html.parser import HTMLParser from typing import TYPE_CHECKING, Any, Literal, Optional, Union, cast from marimo._ast.cell import C...
{ "repo_id": "marimo-team/marimo", "file_path": "marimo/_convert/ipynb/from_ir.py", "license": "Apache License 2.0", "lines": 406, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_complex
marimo-team/marimo:marimo/_convert/markdown/from_ir.py
# Copyright 2026 Marimo. All rights reserved. from __future__ import annotations import ast import os import re import textwrap from typing import TYPE_CHECKING from marimo import _loggers from marimo._ast import codegen from marimo._ast.compiler import const_or_id from marimo._ast.names import is_internal_cell_name ...
{ "repo_id": "marimo-team/marimo", "file_path": "marimo/_convert/markdown/from_ir.py", "license": "Apache License 2.0", "lines": 185, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_complex
marimo-team/marimo:tests/_convert/ipynb/fixtures/py/complex_file_format.py
# /// script # description = "Complex file format with setup cell" # requires-python = ">=3.12" # dependencies = [ # "marimo", # "pandas>=2.1.0", # "numpy>=2.1.0", # ] # /// import marimo __generated_with = "0.19.2" app = marimo.App(width="medium", auto_download=["html"], sql_output="native") with app.se...
{ "repo_id": "marimo-team/marimo", "file_path": "tests/_convert/ipynb/fixtures/py/complex_file_format.py", "license": "Apache License 2.0", "lines": 78, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
marimo-team/marimo:tests/_convert/ipynb/fixtures/py/complex_outputs.py
import marimo __generated_with = "0.19.2" app = marimo.App() @app.cell def _(): import marimo as mo return (mo,) @app.cell def _(mo): mo.md(""" # Testing Various Output Types This notebook tests various output scenarios. """) return @app.cell def _(): """Cell with print statement...
{ "repo_id": "marimo-team/marimo", "file_path": "tests/_convert/ipynb/fixtures/py/complex_outputs.py", "license": "Apache License 2.0", "lines": 51, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
marimo-team/marimo:tests/_convert/ipynb/fixtures/py/simple.py
import marimo __generated_with = "0.19.2" app = marimo.App() @app.cell def _(): import marimo as mo return (mo,) @app.cell def _(mo): mo.md(""" # Hello, World! """) return @app.cell def _(): x = 1 y = 2 z = x + y return (z,) @app.cell def _(z): print(z) return ...
{ "repo_id": "marimo-team/marimo", "file_path": "tests/_convert/ipynb/fixtures/py/simple.py", "license": "Apache License 2.0", "lines": 25, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
marimo-team/marimo:tests/_utils/test_deep_merge.py
# Copyright 2026 Marimo. All rights reserved. from __future__ import annotations from marimo._utils.deep_merge import deep_merge def test_deep_merge_basic() -> None: """Test basic deep merge functionality.""" original = {"a": 1, "b": {"c": 2, "d": 3}} update = {"b": {"c": 10, "e": 4}, "f": 5} result...
{ "repo_id": "marimo-team/marimo", "file_path": "tests/_utils/test_deep_merge.py", "license": "Apache License 2.0", "lines": 204, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
marimo-team/marimo:marimo/_smoke_tests/ai/chat-variations.py
import marimo __generated_with = "0.19.2" app = marimo.App(width="medium", auto_download=["html"]) @app.cell def _(): import uuid import time import asyncio import pydantic_ai.ui.vercel_ai.response_types as vercel return asyncio, time, uuid, vercel @app.cell def _( async_no_streaming_text, ...
{ "repo_id": "marimo-team/marimo", "file_path": "marimo/_smoke_tests/ai/chat-variations.py", "license": "Apache License 2.0", "lines": 147, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_complex
marimo-team/marimo:marimo/_session/_venv.py
# Copyright 2026 Marimo. All rights reserved. """Virtual environment configuration utilities. This module provides utilities for working with configured virtual environments in marimo's sandbox mode. It handles: - Finding Python interpreters in virtual environments - Checking marimo installation status in venvs - PYTH...
{ "repo_id": "marimo-team/marimo", "file_path": "marimo/_session/_venv.py", "license": "Apache License 2.0", "lines": 173, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_complex
marimo-team/marimo:tests/_session/test_venv.py
from __future__ import annotations import os import sys from typing import TYPE_CHECKING, Any if TYPE_CHECKING: from pathlib import Path import pytest from marimo._session._venv import ( check_python_version_compatibility, get_configured_venv_python, get_kernel_pythonpath, has_marimo_installed, ...
{ "repo_id": "marimo-team/marimo", "file_path": "tests/_session/test_venv.py", "license": "Apache License 2.0", "lines": 223, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
marimo-team/marimo:tests/_utils/test_versions.py
# Copyright 2026 Marimo. All rights reserved. from __future__ import annotations import pytest from marimo._utils.versions import ( extract_extras, has_version_specifier, without_extras, without_version_specifier, ) class TestWithoutVersionSpecifier: """Tests for without_version_specifier functi...
{ "repo_id": "marimo-team/marimo", "file_path": "tests/_utils/test_versions.py", "license": "Apache License 2.0", "lines": 130, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
marimo-team/marimo:tests/_plugins/ui/_impl/test_tabs.py
# Copyright 2026 Marimo. All rights reserved. from __future__ import annotations from marimo._plugins import ui def test_tabs_basic() -> None: tab = ui.tabs({"Tab 1": "Content 1", "Tab 2": "Content 2"}) # Default value should be the first tab assert tab.value == "Tab 1" def test_tabs_with_initial_value...
{ "repo_id": "marimo-team/marimo", "file_path": "tests/_plugins/ui/_impl/test_tabs.py", "license": "Apache License 2.0", "lines": 31, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
marimo-team/marimo:marimo/_server/api/endpoints/ws/ws_formatter.py
# Copyright 2026 Marimo. All rights reserved. """WebSocket message formatting utilities. This module handles the wire format for WebSocket transport: wrapping serialized notification data with operation metadata. """ from __future__ import annotations from typing import TYPE_CHECKING from marimo._messaging.serde im...
{ "repo_id": "marimo-team/marimo", "file_path": "marimo/_server/api/endpoints/ws/ws_formatter.py", "license": "Apache License 2.0", "lines": 35, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
documentation
marimo-team/marimo:marimo/_session/managers/ipc.py
# Copyright 2026 Marimo. All rights reserved. """IPC-based managers using ZeroMQ. These implementations launch the kernel as a subprocess and communicate via ZeroMQ channels. Each notebook gets its own sandboxed virtual environment. """ from __future__ import annotations import os import signal import subprocess imp...
{ "repo_id": "marimo-team/marimo", "file_path": "marimo/_session/managers/ipc.py", "license": "Apache License 2.0", "lines": 333, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_complex
marimo-team/marimo:marimo/_session/managers/queue.py
# Copyright 2026 Marimo. All rights reserved. """Queue manager implementation using multiprocessing or threading queues.""" from __future__ import annotations import queue import sys from multiprocessing import get_context from multiprocessing.queues import Queue as MPQueue from typing import Optional, Union from ma...
{ "repo_id": "marimo-team/marimo", "file_path": "marimo/_session/managers/queue.py", "license": "Apache License 2.0", "lines": 95, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_complex
marimo-team/marimo:tests/_server/api/endpoints/ws/test_ws_formatter.py
# Copyright 2026 Marimo. All rights reserved. from __future__ import annotations import json from marimo._messaging.notification import ( AlertNotification, KernelStartupErrorNotification, ) from marimo._server.api.endpoints.ws.ws_formatter import ( format_wire_message, serialize_notification_for_webs...
{ "repo_id": "marimo-team/marimo", "file_path": "tests/_server/api/endpoints/ws/test_ws_formatter.py", "license": "Apache License 2.0", "lines": 117, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
marimo-team/marimo:tests/_session/managers/test_ipc.py
# Copyright 2026 Marimo. All rights reserved. from __future__ import annotations import time import pytest @pytest.mark.requires("zmq") class TestIPCConnection: def test_input_channel_direction(self) -> None: """Test that input flows from host to kernel (not vice versa). Regression test for #79...
{ "repo_id": "marimo-team/marimo", "file_path": "tests/_session/managers/test_ipc.py", "license": "Apache License 2.0", "lines": 115, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
marimo-team/marimo:examples/third_party/plotly/area_chart.py
# /// script # requires-python = ">=3.9" # dependencies = [ # "marimo", # "pandas==2.3.3", # "plotly==6.5.1", # ] # /// import marimo __generated_with = "0.19.7" app = marimo.App(width="medium") @app.cell def _(): import marimo as mo return (mo,) @app.cell def _(mo): mo.md(""" # React...
{ "repo_id": "marimo-team/marimo", "file_path": "examples/third_party/plotly/area_chart.py", "license": "Apache License 2.0", "lines": 126, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
marimo-team/marimo:examples/third_party/plotly/line_chart.py
# /// script # requires-python = ">=3.9" # dependencies = [ # "marimo", # "pandas==2.3.3", # "plotly==6.5.1", # ] # /// import marimo __generated_with = "0.19.7" app = marimo.App(width="medium") @app.cell def _(): import marimo as mo return (mo,) @app.cell def _(mo): mo.md(""" # React...
{ "repo_id": "marimo-team/marimo", "file_path": "examples/third_party/plotly/line_chart.py", "license": "Apache License 2.0", "lines": 145, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
marimo-team/marimo:examples/third_party/plotly/bar_chart.py
# /// script # requires-python = ">=3.9" # dependencies = [ # "marimo", # "plotly==6.5.1", # ] # /// import marimo __generated_with = "0.19.7" app = marimo.App(width="medium") @app.cell def _(): import marimo as mo import plotly.graph_objects as go return go, mo @app.cell def _(mo): mo.md...
{ "repo_id": "marimo-team/marimo", "file_path": "examples/third_party/plotly/bar_chart.py", "license": "Apache License 2.0", "lines": 180, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
marimo-team/marimo:marimo/_sql/engines/adbc.py
# Copyright 2026 Marimo. All rights reserved. from __future__ import annotations from types import ModuleType from typing import TYPE_CHECKING, Any, Literal, Optional, Protocol, Union, cast from marimo import _loggers from marimo._data.models import ( Database, DataTable, DataTableColumn, DataTableTyp...
{ "repo_id": "marimo-team/marimo", "file_path": "marimo/_sql/engines/adbc.py", "license": "Apache License 2.0", "lines": 459, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_complex
marimo-team/marimo:tests/_sql/test_adbc.py
# Copyright 2026 Marimo. All rights reserved. from __future__ import annotations from dataclasses import dataclass from typing import TYPE_CHECKING, Any, cast import pytest from marimo._data.models import Database, DataTable, Schema from marimo._sql.engines.adbc import ( AdbcConnectionCatalog, AdbcDBAPIEngin...
{ "repo_id": "marimo-team/marimo", "file_path": "tests/_sql/test_adbc.py", "license": "Apache License 2.0", "lines": 750, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
marimo-team/marimo:marimo/_smoke_tests/issues/7345-dataframe-pivot-transform.py
import marimo __generated_with = "0.18.4" app = marimo.App(width="columns") @app.cell(column=0) def _(): import marimo as mo import polars as pl import pandas as pd import ibis as ib from vega_datasets import data return data, ib, mo, pd, pl @app.cell def _(data, ib, pd, pl): cars = da...
{ "repo_id": "marimo-team/marimo", "file_path": "marimo/_smoke_tests/issues/7345-dataframe-pivot-transform.py", "license": "Apache License 2.0", "lines": 88, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
marimo-team/marimo:examples/ai/chat/pydantic-ai-chat.py
import marimo __generated_with = "0.19.2" app = marimo.App(width="medium") with app.setup(hide_code=True): import marimo as mo import os import httpx from pydantic_ai import Agent, RunContext, BinaryImage from pydantic_ai.models.google import GoogleModel, GoogleModelSettings from pydantic_ai....
{ "repo_id": "marimo-team/marimo", "file_path": "examples/ai/chat/pydantic-ai-chat.py", "license": "Apache License 2.0", "lines": 231, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_complex
marimo-team/marimo:tests/_ai/test_ai_types.py
# Copyright 2026 Marimo. All rights reserved. from __future__ import annotations from dataclasses import dataclass from typing import Any, Literal, cast import pytest from marimo._ai._types import ( ChatAttachment, ChatMessage, ChatPart, FilePart, ReasoningPart, TextPart, ToolInvocationPa...
{ "repo_id": "marimo-team/marimo", "file_path": "tests/_ai/test_ai_types.py", "license": "Apache License 2.0", "lines": 468, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
marimo-team/marimo:tests/_utils/test_paths.py
# Copyright 2026 Marimo. All rights reserved. from __future__ import annotations import os import tempfile from pathlib import Path import pytest from marimo._utils.paths import normalize_path, pretty_path def test_normalize_path_makes_absolute() -> None: """Test that relative paths are converted to absolute p...
{ "repo_id": "marimo-team/marimo", "file_path": "tests/_utils/test_paths.py", "license": "Apache License 2.0", "lines": 158, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
marimo-team/marimo:marimo/_smoke_tests/ipython/mpl_plot.py
import marimo __generated_with = "0.18.4" app = marimo.App() @app.cell def _(): import matplotlib.pyplot as plt plt.plot([1, 2]) plt.gca() return if __name__ == "__main__": app.run()
{ "repo_id": "marimo-team/marimo", "file_path": "marimo/_smoke_tests/ipython/mpl_plot.py", "license": "Apache License 2.0", "lines": 11, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
marimo-team/marimo:marimo/_smoke_tests/pdf_export/basic_example.py
import marimo __generated_with = "0.19.6" app = marimo.App(auto_download=["ipynb"]) @app.cell def _(): import marimo as mo import matplotlib.pyplot as plt import plotly.express as px return mo, plt, px @app.cell(hide_code=True) def _(mo): mo.md(r""" This notebook contains: - Markdown ...
{ "repo_id": "marimo-team/marimo", "file_path": "marimo/_smoke_tests/pdf_export/basic_example.py", "license": "Apache License 2.0", "lines": 93, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
marimo-team/marimo:examples/third_party/plotly/heatmap.py
import marimo __generated_with = "0.18.4" app = marimo.App(width="medium") @app.cell def _(): import marimo as mo import plotly.graph_objects as go import numpy as np # 1. Create your heatmap data z = np.random.rand(10, 10) * 100 # 2. Create the plotly figure fig = go.Figure( da...
{ "repo_id": "marimo-team/marimo", "file_path": "examples/third_party/plotly/heatmap.py", "license": "Apache License 2.0", "lines": 46, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
marimo-team/marimo:marimo/_smoke_tests/issues/7668_altair_concat_interactions.py
import marimo __generated_with = "0.18.4" app = marimo.App(width="medium") @app.cell def _(): import marimo as mo import altair as alt import numpy as np import pyarrow import pandas as pd return alt, mo, np, pd @app.cell def _(alt, np, pd): source = pd.DataFrame({"x": np.random.rand(10...
{ "repo_id": "marimo-team/marimo", "file_path": "marimo/_smoke_tests/issues/7668_altair_concat_interactions.py", "license": "Apache License 2.0", "lines": 37, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
marimo-team/marimo:marimo/_smoke_tests/issues/7661_point_selection.py
import marimo __generated_with = "0.18.4" app = marimo.App() @app.cell def _(): import marimo as mo import pandas as pd import numpy as np import altair as alt return alt, mo, np, pd @app.cell def _(np, pd): # Create mock data for the heatmap np.random.seed(42) rows = 10 cols = ...
{ "repo_id": "marimo-team/marimo", "file_path": "marimo/_smoke_tests/issues/7661_point_selection.py", "license": "Apache License 2.0", "lines": 54, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
marimo-team/marimo:marimo/_smoke_tests/appcomp/setup_embed_setup/main.py
# Copyright 2026 Marimo. All rights reserved. """ Smoke test for setup cell embedding. This tests the scenario where: - Main app has a setup cell - Inner app has a setup cell - Main app embeds the inner app Bug: The main app's setup cell should NOT rerun when the inner app is embedded. """ import marimo __generated...
{ "repo_id": "marimo-team/marimo", "file_path": "marimo/_smoke_tests/appcomp/setup_embed_setup/main.py", "license": "Apache License 2.0", "lines": 59, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
documentation
marimo-team/marimo:marimo/_runtime/virtual_file/storage.py
# Copyright 2026 Marimo. All rights reserved. from __future__ import annotations import sys from typing import TYPE_CHECKING, Protocol from marimo._utils.platform import is_pyodide if TYPE_CHECKING: from collections.abc import Iterable, Iterator DEFAULT_CHUNK_SIZE = 256 * 1024 # 256KB if not is_pyodide(): ...
{ "repo_id": "marimo-team/marimo", "file_path": "marimo/_runtime/virtual_file/storage.py", "license": "Apache License 2.0", "lines": 248, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_complex
marimo-team/marimo:tests/_runtime/test_storage.py
# Copyright 2026 Marimo. All rights reserved. from __future__ import annotations import pytest from marimo._runtime.virtual_file.storage import ( InMemoryStorage, SharedMemoryStorage, VirtualFileStorageManager, ) class TestInMemoryStorageReadChunked: def test_read_chunked_basic(self) -> None: ...
{ "repo_id": "marimo-team/marimo", "file_path": "tests/_runtime/test_storage.py", "license": "Apache License 2.0", "lines": 302, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
marimo-team/marimo:marimo/_server/app_defaults.py
# Copyright 2024 Marimo. All rights reserved. from __future__ import annotations from dataclasses import dataclass from typing import TYPE_CHECKING, Optional from marimo._config.config import ExportType, SqlOutputType, WidthType if TYPE_CHECKING: from marimo._config.manager import MarimoConfigManager @dataclas...
{ "repo_id": "marimo-team/marimo", "file_path": "marimo/_server/app_defaults.py", "license": "Apache License 2.0", "lines": 20, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
marimo-team/marimo:marimo/_server/files/directory_scanner.py
# Copyright 2024 Marimo. All rights reserved. from __future__ import annotations import os import time from pathlib import Path from typing import Optional from marimo import _loggers from marimo._server.files.os_file_system import natural_sort_file from marimo._server.models.files import FileInfo from marimo._utils....
{ "repo_id": "marimo-team/marimo", "file_path": "marimo/_server/files/directory_scanner.py", "license": "Apache License 2.0", "lines": 198, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_complex
marimo-team/marimo:marimo/_server/files/path_validator.py
# Copyright 2024 Marimo. All rights reserved. from __future__ import annotations from pathlib import Path from typing import Optional from marimo import _loggers from marimo._utils.http import HTTPException, HTTPStatus LOGGER = _loggers.marimo_logger() class PathValidator: """Validates file paths for security ...
{ "repo_id": "marimo-team/marimo", "file_path": "marimo/_server/files/path_validator.py", "license": "Apache License 2.0", "lines": 212, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_complex
marimo-team/marimo:tests/_server/test_directory_scanner.py
# Copyright 2024 Marimo. All rights reserved. from __future__ import annotations import os import shutil import tempfile import unittest from marimo._server.files.directory_scanner import ( DirectoryScanner, is_marimo_app, ) def test_python_app_detected(): """Test that Python marimo apps are detected.""...
{ "repo_id": "marimo-team/marimo", "file_path": "tests/_server/test_directory_scanner.py", "license": "Apache License 2.0", "lines": 132, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
marimo-team/marimo:tests/_server/test_path_validator.py
# Copyright 2024 Marimo. All rights reserved. from __future__ import annotations import os import shutil import tempfile import unittest from pathlib import Path import pytest from marimo._server.files.path_validator import PathValidator from marimo._utils.http import HTTPException, HTTPStatus class TestPathValida...
{ "repo_id": "marimo-team/marimo", "file_path": "tests/_server/test_path_validator.py", "license": "Apache License 2.0", "lines": 327, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
marimo-team/marimo:marimo/_utils/net.py
# Copyright 2026 Marimo. All rights reserved. from __future__ import annotations import errno import os import socket import sys from typing import TYPE_CHECKING from marimo import _loggers if TYPE_CHECKING: from typing import Optional LOGGER = _loggers.marimo_logger() _DEFAULT_BACKLOG = 128 # From Tornado (...
{ "repo_id": "marimo-team/marimo", "file_path": "marimo/_utils/net.py", "license": "Apache License 2.0", "lines": 180, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_complex
marimo-team/marimo:marimo/_server/config.py
# Copyright 2026 Marimo. All rights reserved. from __future__ import annotations from dataclasses import dataclass from typing import TYPE_CHECKING if TYPE_CHECKING: from starlette.datastructures import State from uvicorn import Server from marimo._config.manager import MarimoConfigManager from marim...
{ "repo_id": "marimo-team/marimo", "file_path": "marimo/_server/config.py", "license": "Apache License 2.0", "lines": 32, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
marimo-team/marimo:marimo/_utils/print.py
# Copyright 2026 Marimo. All rights reserved. from __future__ import annotations from typing import Any # use spaces instead of a tab to play well with carriage returns; # \r\t doesn't appear to overwrite characters at the start of a line, # but \r{TAB} does ... TAB = " " def print_tabbed(string: str, n_tabs...
{ "repo_id": "marimo-team/marimo", "file_path": "marimo/_utils/print.py", "license": "Apache License 2.0", "lines": 15, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
marimo-team/marimo:marimo/_ai/_pydantic_ai_utils.py
# Copyright 2025 Marimo. All rights reserved. from __future__ import annotations import uuid from typing import TYPE_CHECKING, Any, Callable from marimo import _loggers from marimo._messaging.msgspec_encoder import asdict from marimo._server.ai.tools.types import ToolDefinition from marimo._server.models.completion i...
{ "repo_id": "marimo-team/marimo", "file_path": "marimo/_ai/_pydantic_ai_utils.py", "license": "Apache License 2.0", "lines": 97, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
marimo-team/marimo:tests/_ai/test_pydantic_utils.py
# Copyright 2025 Marimo. All rights reserved. from __future__ import annotations from dataclasses import dataclass from unittest.mock import AsyncMock import pytest pytest.importorskip("pydantic_ai", reason="pydantic_ai not installed") from marimo._ai._pydantic_ai_utils import ( convert_to_pydantic_messages, ...
{ "repo_id": "marimo-team/marimo", "file_path": "tests/_ai/test_pydantic_utils.py", "license": "Apache License 2.0", "lines": 430, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
marimo-team/marimo:tests/_server/api/endpoints/test_auto_instantiate.py
# Copyright 2024 Marimo. All rights reserved. """Tests for auto-instantiate behavior in run mode vs edit mode.""" from __future__ import annotations from typing import TYPE_CHECKING from unittest.mock import MagicMock, patch from marimo._messaging.notification import KernelReadyNotification from marimo._session.mode...
{ "repo_id": "marimo-team/marimo", "file_path": "tests/_server/api/endpoints/test_auto_instantiate.py", "license": "Apache License 2.0", "lines": 186, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
marimo-team/marimo:marimo/_convert/script.py
# Copyright 2026 Marimo. All rights reserved. from __future__ import annotations from marimo._ast import codegen from marimo._ast.app import InternalApp from marimo._ast.load import load_notebook_ir from marimo._runtime.dataflow import topological_sort from marimo._schemas.serialization import NotebookSerialization fr...
{ "repo_id": "marimo-team/marimo", "file_path": "marimo/_convert/script.py", "license": "Apache License 2.0", "lines": 31, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
marimo-team/marimo:tests/_ast/codegen_data/test_unparsable_cell_with_triple_quotes.py
import marimo __generated_with = "0.0.0" app = marimo.App() @app.cell def _(): x = 1 return app._unparsable_cell( """ \"\"\" ```python {.marimo} print(\"Hello, World!\") """, name="_" ) app._unparsable_cell( r""" it's an unparsable cell """, name="_" ) if __name_...
{ "repo_id": "marimo-team/marimo", "file_path": "tests/_ast/codegen_data/test_unparsable_cell_with_triple_quotes.py", "license": "Apache License 2.0", "lines": 23, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
marimo-team/marimo:tests/_server/api/endpoints/test_cache_endpoints.py
# Copyright 2026 Marimo. All rights reserved. from __future__ import annotations from typing import TYPE_CHECKING from marimo._types.ids import SessionId from tests._server.mocks import token_header, with_read_session, with_session if TYPE_CHECKING: from starlette.testclient import TestClient SESSION_ID = Sessi...
{ "repo_id": "marimo-team/marimo", "file_path": "tests/_server/api/endpoints/test_cache_endpoints.py", "license": "Apache License 2.0", "lines": 31, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
marimo-team/marimo:tests/_server/api/endpoints/test_mpl_endpoints.py
# Copyright 2026 Marimo. All rights reserved. from __future__ import annotations from typing import TYPE_CHECKING from unittest.mock import AsyncMock, MagicMock, patch from marimo._server.api.endpoints.mpl import WS_MAX_SIZE, figure_endpoints if TYPE_CHECKING: from starlette.testclient import TestClient class ...
{ "repo_id": "marimo-team/marimo", "file_path": "tests/_server/api/endpoints/test_mpl_endpoints.py", "license": "Apache License 2.0", "lines": 151, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
marimo-team/marimo:tests/_server/api/endpoints/test_secrets_endpoints.py
# Copyright 2026 Marimo. All rights reserved. from __future__ import annotations from typing import TYPE_CHECKING from unittest.mock import patch import pytest from marimo._types.ids import SessionId from tests._server.mocks import token_header, with_read_session, with_session if TYPE_CHECKING: from starlette.t...
{ "repo_id": "marimo-team/marimo", "file_path": "tests/_server/api/endpoints/test_secrets_endpoints.py", "license": "Apache License 2.0", "lines": 88, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
marimo-team/marimo:tests/_runtime/test_commands.py
# Copyright 2026 Marimo. All rights reserved. from __future__ import annotations from marimo._runtime.commands import kebab_case def test_kebab_case() -> None: assert kebab_case("SomeSQLCommand") == "some-sql" assert kebab_case("SomeSQL") == "some-sql" assert kebab_case("MyNotificationCommand") == "my-no...
{ "repo_id": "marimo-team/marimo", "file_path": "tests/_runtime/test_commands.py", "license": "Apache License 2.0", "lines": 7, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
marimo-team/marimo:marimo/_server/api/endpoints/ws/ws_connection_validator.py
# Copyright 2026 Marimo. All rights reserved. from __future__ import annotations from dataclasses import dataclass from typing import TYPE_CHECKING, Optional if TYPE_CHECKING: from starlette.websockets import WebSocket from marimo import _loggers from marimo._server.api.auth import validate_auth from marimo._ser...
{ "repo_id": "marimo-team/marimo", "file_path": "marimo/_server/api/endpoints/ws/ws_connection_validator.py", "license": "Apache License 2.0", "lines": 94, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
marimo-team/marimo:marimo/_server/api/endpoints/ws/ws_kernel_ready.py
# Copyright 2026 Marimo. All rights reserved. from __future__ import annotations import asyncio import sys from typing import TYPE_CHECKING from marimo import _loggers from marimo._ast.cell import CellConfig from marimo._dependencies.dependencies import DependencyManager from marimo._messaging.notification import ( ...
{ "repo_id": "marimo-team/marimo", "file_path": "marimo/_server/api/endpoints/ws/ws_kernel_ready.py", "license": "Apache License 2.0", "lines": 156, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_complex
marimo-team/marimo:marimo/_server/api/endpoints/ws/ws_message_loop.py
# Copyright 2026 Marimo. All rights reserved. from __future__ import annotations import asyncio from typing import TYPE_CHECKING, Any, Callable from starlette.websockets import WebSocketDisconnect, WebSocketState from marimo import _loggers from marimo._messaging.notification import ( CompletionResultNotificatio...
{ "repo_id": "marimo-team/marimo", "file_path": "marimo/_server/api/endpoints/ws/ws_message_loop.py", "license": "Apache License 2.0", "lines": 140, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_complex
marimo-team/marimo:marimo/_server/api/endpoints/ws/ws_rtc_handler.py
# Copyright 2026 Marimo. All rights reserved. from __future__ import annotations import asyncio from typing import TYPE_CHECKING from starlette.websockets import WebSocketDisconnect from marimo import _loggers if TYPE_CHECKING: from loro import DiffEvent, ExportMode, LoroDoc from starlette.websockets import...
{ "repo_id": "marimo-team/marimo", "file_path": "marimo/_server/api/endpoints/ws/ws_rtc_handler.py", "license": "Apache License 2.0", "lines": 116, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_complex
marimo-team/marimo:marimo/_server/api/endpoints/ws/ws_session_connector.py
# Copyright 2026 Marimo. All rights reserved. from __future__ import annotations from enum import Enum from typing import TYPE_CHECKING if TYPE_CHECKING: from starlette.websockets import WebSocket from marimo._server.api.endpoints.ws.ws_connection_validator import ( ConnectionParams, ) from m...
{ "repo_id": "marimo-team/marimo", "file_path": "marimo/_server/api/endpoints/ws/ws_session_connector.py", "license": "Apache License 2.0", "lines": 191, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_complex
marimo-team/marimo:marimo/_server/api/endpoints/ws_endpoint.py
# Copyright 2026 Marimo. All rights reserved. from __future__ import annotations import asyncio import sys from typing import Any, Callable, Optional from starlette.websockets import WebSocket, WebSocketState from marimo import _loggers from marimo._cli.upgrade import check_for_updates from marimo._config.cli_state ...
{ "repo_id": "marimo-team/marimo", "file_path": "marimo/_server/api/endpoints/ws_endpoint.py", "license": "Apache License 2.0", "lines": 468, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_complex
marimo-team/marimo:marimo/_messaging/notification_utils.py
# Copyright 2026 Marimo. All rights reserved. """Notification utilities for kernel messages. CellNotificationUtils for cell-related broadcasts. """ from __future__ import annotations import sys from typing import TYPE_CHECKING, Optional from uuid import uuid4 from marimo import _loggers as loggers from marimo._mess...
{ "repo_id": "marimo-team/marimo", "file_path": "marimo/_messaging/notification_utils.py", "license": "Apache License 2.0", "lines": 240, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_complex
marimo-team/marimo:marimo/_messaging/serde.py
# Copyright 2026 Marimo. All rights reserved. """Serialization and deserialization utilities for kernel messages.""" from __future__ import annotations from typing import TYPE_CHECKING import msgspec from marimo._messaging.msgspec_encoder import encode_json_bytes from marimo._messaging.types import KernelMessage i...
{ "repo_id": "marimo-team/marimo", "file_path": "marimo/_messaging/serde.py", "license": "Apache License 2.0", "lines": 29, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
marimo-team/marimo:tests/_ai/tools/test_utils.py
# Copyright 2026 Marimo. All rights reserved. """Shared fixtures and mocks for AI tools tests.""" from __future__ import annotations from dataclasses import dataclass from typing import Any @dataclass class MockSessionView: """Mock session view for testing.""" cell_notifications: dict | None = None las...
{ "repo_id": "marimo-team/marimo", "file_path": "tests/_ai/tools/test_utils.py", "license": "Apache License 2.0", "lines": 26, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
marimo-team/marimo:marimo/_internal/templates.py
# Copyright 2026 Marimo. All rights reserved. """Internal API for rendering marimo notebooks as HTML.""" from marimo._server.templates.api import ( render_notebook, render_static_notebook, ) __all__ = [ "render_notebook", "render_static_notebook", ]
{ "repo_id": "marimo-team/marimo", "file_path": "marimo/_internal/templates.py", "license": "Apache License 2.0", "lines": 10, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
marimo-team/marimo:marimo/_server/templates/api.py
# Copyright 2026 Marimo. All rights reserved. """Public API for rendering marimo notebooks as HTML. This module provides a clean, public API for rendering marimo notebooks to HTML without needing to use internal template functions directly. """ from __future__ import annotations from pathlib import Path from typing ...
{ "repo_id": "marimo-team/marimo", "file_path": "marimo/_server/templates/api.py", "license": "Apache License 2.0", "lines": 205, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_complex
marimo-team/marimo:tests/_internal/test_internal_api.py
from __future__ import annotations import importlib from pathlib import Path from tests.mocks import snapshotter from tests.utils import explore_module snapshot = snapshotter(__file__) def test_internal_api(): # Get all Python files and folders in marimo/_internal internal_path = ( Path(__file__).p...
{ "repo_id": "marimo-team/marimo", "file_path": "tests/_internal/test_internal_api.py", "license": "Apache License 2.0", "lines": 32, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
marimo-team/marimo:tests/_server/templates/test_templates_api.py
# Copyright 2026 Marimo. All rights reserved. from __future__ import annotations import unittest from marimo._schemas.session import ( VERSION, Cell, DataOutput, NotebookSessionMetadata, NotebookSessionV1, ) from marimo._server.templates.api import ( render_notebook, render_static_notebook...
{ "repo_id": "marimo-team/marimo", "file_path": "tests/_server/templates/test_templates_api.py", "license": "Apache License 2.0", "lines": 120, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
marimo-team/marimo:marimo/_runtime/dataflow/cycles.py
# Copyright 2026 Marimo. All rights reserved. """Cycle detection and tracking for cell dependencies.""" from __future__ import annotations from dataclasses import dataclass, field from typing import TYPE_CHECKING from marimo._runtime.dataflow.types import Edge if TYPE_CHECKING: from collections.abc import Colle...
{ "repo_id": "marimo-team/marimo", "file_path": "marimo/_runtime/dataflow/cycles.py", "license": "Apache License 2.0", "lines": 73, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_complex
marimo-team/marimo:marimo/_runtime/dataflow/definitions.py
# Copyright 2026 Marimo. All rights reserved. """Variable definition tracking for cells.""" from __future__ import annotations from dataclasses import dataclass, field from typing import TYPE_CHECKING if TYPE_CHECKING: from marimo._ast.sql_visitor import SQLRef from marimo._ast.visitor import Name, VariableD...
{ "repo_id": "marimo-team/marimo", "file_path": "marimo/_runtime/dataflow/definitions.py", "license": "Apache License 2.0", "lines": 122, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_complex