sample_id
stringlengths
21
196
text
stringlengths
105
936k
metadata
dict
category
stringclasses
6 values
marimo-team/marimo:marimo/_server/ai/ids.py
# Copyright 2026 Marimo. All rights reserved. from __future__ import annotations from dataclasses import dataclass from typing import NewType from marimo import _loggers LOGGER = _loggers.marimo_logger() AiProviderId = NewType("AiProviderId", str) QualifiedModelId = NewType("QualifiedModelId", str) ShortModelId = N...
{ "repo_id": "marimo-team/marimo", "file_path": "marimo/_server/ai/ids.py", "license": "Apache License 2.0", "lines": 50, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
marimo-team/marimo:tests/_server/ai/test_ai_ids.py
from unittest.mock import Mock, patch from marimo._server.ai.ids import ( AiModelId, AiProviderId, QualifiedModelId, ShortModelId, _guess_provider, ) class TestAiModelId: def test_init(self): """Test AiModelId initialization.""" model_id = AiModelId( provider=AiPro...
{ "repo_id": "marimo-team/marimo", "file_path": "tests/_server/ai/test_ai_ids.py", "license": "Apache License 2.0", "lines": 143, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
marimo-team/marimo:marimo/_smoke_tests/sql/ibis_backend_catalog.py
# /// script # requires-python = ">=3.12" # dependencies = [ # "altair==5.5.0", # "datafusion==48.0.0", # "ibis-framework[datafusion,duckdb]==10.8.0", # "marimo", # ] # /// import marimo __generated_with = "0.15.5" app = marimo.App(width="medium") @app.cell def _(): import ibis import marimo...
{ "repo_id": "marimo-team/marimo", "file_path": "marimo/_smoke_tests/sql/ibis_backend_catalog.py", "license": "Apache License 2.0", "lines": 117, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
marimo-team/marimo:marimo/_ast/cell_id.py
# Copyright 2026 Marimo. All rights reserved. from __future__ import annotations import random import string from uuid import UUID, uuid4 from marimo._types.ids import CellId_t class CellIdGenerator: def __init__(self, prefix: str = "") -> None: self.prefix = prefix self.random_seed = random.Ran...
{ "repo_id": "marimo-team/marimo", "file_path": "marimo/_ast/cell_id.py", "license": "Apache License 2.0", "lines": 59, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
marimo-team/marimo:tests/_save/external_decorators/app.py
# /// script # requires-python = ">=3.13" # dependencies = [ # "marimo", # ] # /// import marimo __generated_with = "0.14.16" app = marimo.App(width="medium") with app.setup: import marimo as mo @app.cell def decorator_wrap(): @mo.cache def cache(x): return x + 1 bar = cache(1) retu...
{ "repo_id": "marimo-team/marimo", "file_path": "tests/_save/external_decorators/app.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/utils.py
from __future__ import annotations import inspect import time from typing import TYPE_CHECKING, Any, Optional from marimo._messaging.msgspec_encoder import ( asdict, encode_json_bytes, ) from marimo._utils.parse_dataclass import parse_raw if TYPE_CHECKING: from typing import Callable import msgspec ...
{ "repo_id": "marimo-team/marimo", "file_path": "tests/utils.py", "license": "Apache License 2.0", "lines": 61, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
marimo-team/marimo:marimo/_plugins/stateless/inspect.py
# Copyright 2026 Marimo. All rights reserved. from __future__ import annotations import html import inspect as inspect_ from marimo._output.builder import h from marimo._output.formatting import as_html from marimo._output.hypertext import Html class inspect(Html): """Inspect a Python object. Displays obje...
{ "repo_id": "marimo-team/marimo", "file_path": "marimo/_plugins/stateless/inspect.py", "license": "Apache License 2.0", "lines": 423, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_complex
marimo-team/marimo:tests/_plugins/stateless/test_inspect.py
# Copyright 2026 Marimo. All rights reserved. from __future__ import annotations from dataclasses import dataclass from marimo._plugins.stateless.inspect import inspect class SimpleClass: """A simple test class.""" def __init__(self): self.value = 42 self._private = "hidden" self.__...
{ "repo_id": "marimo-team/marimo", "file_path": "tests/_plugins/stateless/test_inspect.py", "license": "Apache License 2.0", "lines": 172, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
marimo-team/marimo:tests/_save/stores/test_file.py
# Copyright 2026 Marimo. All rights reserved. from __future__ import annotations from marimo._save.stores.file import FileStore class TestFileStore: def test_init_doesnt_make_file(self, tmp_path) -> None: """Test that initializing FileStore does not create a file.""" _store = FileStore(tmp_path ...
{ "repo_id": "marimo-team/marimo", "file_path": "tests/_save/stores/test_file.py", "license": "Apache License 2.0", "lines": 35, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
marimo-team/marimo:marimo/_save/toplevel.py
# Copyright 2026 Marimo. All rights reserved. from __future__ import annotations from typing import Any, Callable from marimo import _loggers from marimo._ast.app import App, InternalApp from marimo._ast.names import ( SETUP_CELL_NAME, TOPLEVEL_CELL_PREFIX, ) from marimo._ast.toplevel import TopLevelExtractio...
{ "repo_id": "marimo-team/marimo", "file_path": "marimo/_save/toplevel.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:tests/_save/external_decorators/transitive_wrappers_1.py
import marimo __generated_with = "0.14.12" app = marimo.App() with app.setup: import functools from typing import Any import marimo as mo # This will be an impure decorator (contains non-primitive objects) impure_state = [object()] @app.function def my_impure_decorator(func): """An impure ...
{ "repo_id": "marimo-team/marimo", "file_path": "tests/_save/external_decorators/transitive_wrappers_1.py", "license": "Apache License 2.0", "lines": 45, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
marimo-team/marimo:tests/_save/external_decorators/transitive_wrappers_2.py
# NB! The only difference between this file and transitive_wrappers_1.py is that # impure_state is tweaked. import marimo __generated_with = "0.14.12" app = marimo.App() with app.setup: import functools from typing import Any import marimo as mo # This will be an impure decorator (contains non-primi...
{ "repo_id": "marimo-team/marimo", "file_path": "tests/_save/external_decorators/transitive_wrappers_2.py", "license": "Apache License 2.0", "lines": 48, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
marimo-team/marimo:tests/_save/test_external_decorators.py
# Copyright 2026 Marimo. All rights reserved. from __future__ import annotations import sys import textwrap from marimo._runtime.commands import ExecuteCellCommand from marimo._runtime.runtime import Kernel from tests.conftest import ExecReqProvider class TestDecoratorImports: @staticmethod def test_import_...
{ "repo_id": "marimo-team/marimo", "file_path": "tests/_save/test_external_decorators.py", "license": "Apache License 2.0", "lines": 347, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
marimo-team/marimo:marimo/_smoke_tests/ibis_formatting.py
# /// script # requires-python = ">=3.12" # dependencies = [ # "ibis-framework[duckdb,polars]==10.8.0", # "marimo", # "polars==1.32.0", # ] # /// import marimo __generated_with = "0.15.5" app = marimo.App(width="medium") @app.cell def _(): import ibis import polars as pl import marimo as mo ...
{ "repo_id": "marimo-team/marimo", "file_path": "marimo/_smoke_tests/ibis_formatting.py", "license": "Apache License 2.0", "lines": 154, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
marimo-team/marimo:tests/_output/formatters/test_ibis_formatters.py
from __future__ import annotations import pytest from marimo._dependencies.dependencies import DependencyManager from marimo._output.formatters.formatters import register_formatters from marimo._output.formatting import ( get_formatter, ) HAS_IBIS = DependencyManager.ibis.has() HAS_POLARS = DependencyManager.pol...
{ "repo_id": "marimo-team/marimo", "file_path": "tests/_output/formatters/test_ibis_formatters.py", "license": "Apache License 2.0", "lines": 163, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
marimo-team/marimo:tests/_output/test_formatter_registry.py
from __future__ import annotations from dataclasses import dataclass from marimo._messaging.mimetypes import KnownMimeType from marimo._output.formatting import Formatter, FormatterRegistry # Test classes for hierarchy testing @dataclass class BaseClass: value: str = "base" class ChildClass(BaseClass): de...
{ "repo_id": "marimo-team/marimo", "file_path": "tests/_output/test_formatter_registry.py", "license": "Apache License 2.0", "lines": 218, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
marimo-team/marimo:tests/_output/formatters/test_plotly_formatters.py
from __future__ import annotations import json import pytest from marimo._dependencies.dependencies import DependencyManager from marimo._output.formatters.formatters import register_formatters from marimo._output.formatters.plotly_formatters import PlotlyFormatter from marimo._output.formatting import get_formatter...
{ "repo_id": "marimo-team/marimo", "file_path": "tests/_output/formatters/test_plotly_formatters.py", "license": "Apache License 2.0", "lines": 48, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
marimo-team/marimo:tests/_runtime/test_primitives.py
"""Tests for marimo._runtime.primitives module.""" import functools from typing import Any from marimo._runtime.primitives import is_pure_function class TestWrappedFunctionHandling: """Test handling of wrapped functions (decorators) in is_pure_function.""" def test_wrapped_function_follows_wrapped_object(s...
{ "repo_id": "marimo-team/marimo", "file_path": "tests/_runtime/test_primitives.py", "license": "Apache License 2.0", "lines": 94, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
marimo-team/marimo:tests/_ast/app_data/notebook_filename.py
import marimo __generated_with = "0.14.15" app = marimo.App(width="medium") with app.setup: import marimo as mo @app.cell def _(): this_is_foo_path = mo.notebook_dir() this_is_foo_path return @app.cell def _(): this_is_foo_file = __file__ this_is_foo_file return if __name__ == "__ma...
{ "repo_id": "marimo-team/marimo", "file_path": "tests/_ast/app_data/notebook_filename.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:marimo/_ast/sql_utils.py
# Copyright 2026 Marimo. All rights reserved. from __future__ import annotations from typing import Literal, Optional, Union from marimo import _loggers from marimo._dependencies.dependencies import DependencyManager from marimo._sql.error_utils import log_sql_error LOGGER = _loggers.marimo_logger() # DCL: Data Con...
{ "repo_id": "marimo-team/marimo", "file_path": "marimo/_ast/sql_utils.py", "license": "Apache License 2.0", "lines": 52, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
marimo-team/marimo:tests/_ast/test_sql_utils.py
# Copyright 2026 Marimo. All rights reserved. import pytest from marimo._ast.sql_utils import classify_sql_statement from marimo._dependencies.dependencies import DependencyManager @pytest.mark.skipif( not DependencyManager.sqlglot.has(), reason="Missing sqlglot" ) class TestClassifySQLStatement: """Test ca...
{ "repo_id": "marimo-team/marimo", "file_path": "tests/_ast/test_sql_utils.py", "license": "Apache License 2.0", "lines": 221, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
marimo-team/marimo:marimo/_convert/non_marimo_python_script.py
# Copyright 2026 Marimo. All rights reserved. """Convert non-marimo Python scripts to marimo notebooks.""" from __future__ import annotations import json from marimo._convert.ipynb.to_ir import convert_from_ipynb_to_notebook_ir from marimo._schemas.serialization import ( AppInstantiation, Header, Noteboo...
{ "repo_id": "marimo-team/marimo", "file_path": "marimo/_convert/non_marimo_python_script.py", "license": "Apache License 2.0", "lines": 97, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_complex
marimo-team/marimo:tests/_ast/codegen_data/test_get_codes_non_marimo_python_script.py
# /// script # requires-python = ">=3.12" # dependencies = [ # "altair==5.4.1", # "duckdb==1.1.3", # "marimo", # ] # /// def hello(): print("hello, world")
{ "repo_id": "marimo-team/marimo", "file_path": "tests/_ast/codegen_data/test_get_codes_non_marimo_python_script.py", "license": "Apache License 2.0", "lines": 10, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
marimo-team/marimo:tests/_convert/test_convert_non_marimo_python_script.py
import pytest from marimo._convert.converters import MarimoConvert from marimo._convert.non_marimo_python_script import ( convert_non_marimo_python_script_to_notebook_ir, convert_non_marimo_script_to_notebook_ir, convert_python_block_to_notebook_ir, ) from marimo._dependencies.dependencies import Dependenc...
{ "repo_id": "marimo-team/marimo", "file_path": "tests/_convert/test_convert_non_marimo_python_script.py", "license": "Apache License 2.0", "lines": 198, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
marimo-team/marimo:marimo/_version.py
# Copyright 2026 Marimo. All rights reserved. from __future__ import annotations from importlib.metadata import PackageNotFoundError, version try: __version__ = version("marimo") except PackageNotFoundError: # package is not installed __version__ = "unknown"
{ "repo_id": "marimo-team/marimo", "file_path": "marimo/_version.py", "license": "Apache License 2.0", "lines": 8, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
marimo-team/marimo:scripts/modify_pyproject_for_marimo_base.py
#!/usr/bin/env uv run """ Python build tools generally only allow building one project per Python project. This modifies the pyproject.toml to build marimo-base, a slimmed down marimo distribution with no static artifacts. Adapted from https://github.com/cvxpy/cvxpy/blob/297278e2a88db3c0084750052a16e60672074da3/.gith...
{ "repo_id": "marimo-team/marimo", "file_path": "scripts/modify_pyproject_for_marimo_base.py", "license": "Apache License 2.0", "lines": 42, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
marimo-team/marimo:tests/_plugins/stateless/test_plain_text.py
# Copyright 2026 Marimo. All rights reserved. from __future__ import annotations from marimo._plugins.stateless.plain_text import plain_text def test_plain_text_basic() -> None: """Test basic plain_text functionality.""" result = plain_text("Hello, World!") assert "Hello, World!" in result.text asser...
{ "repo_id": "marimo-team/marimo", "file_path": "tests/_plugins/stateless/test_plain_text.py", "license": "Apache License 2.0", "lines": 34, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
marimo-team/marimo:tests/_server/ai/test_mcp.py
# Copyright 2026 Marimo. All rights reserved. import asyncio from unittest.mock import AsyncMock, patch import pytest from marimo._config.config import ( MCPConfig, MCPServerStdioConfig, MCPServerStreamableHttpConfig, ) from marimo._dependencies.dependencies import DependencyManager from marimo._server.ai...
{ "repo_id": "marimo-team/marimo", "file_path": "tests/_server/ai/test_mcp.py", "license": "Apache License 2.0", "lines": 1580, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
marimo-team/marimo:marimo/_smoke_tests/third_party/pandas/transform_edgecases.py
# /// script # requires-python = ">=3.12" # dependencies = [ # "geodatasets==2024.8.0", # "geopandas==1.1.1", # "mapclassify==2.10.0", # "marimo", # "matplotlib==3.10.3", # "pandas==2.3.1", # "polars==1.31.0", # ] # /// import marimo __generated_with = "0.15.5" app = marimo.App(width="medi...
{ "repo_id": "marimo-team/marimo", "file_path": "marimo/_smoke_tests/third_party/pandas/transform_edgecases.py", "license": "Apache License 2.0", "lines": 77, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
marimo-team/marimo:marimo/_utils/requests.py
# Copyright 2026 Marimo. All rights reserved. from __future__ import annotations import json import urllib.error import urllib.parse import urllib.request from typing import Any, Optional, Union from marimo._version import __version__ # Utility functions for making HTTP requests, # without using the requests library...
{ "repo_id": "marimo-team/marimo", "file_path": "marimo/_utils/requests.py", "license": "Apache License 2.0", "lines": 189, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_complex
marimo-team/marimo:tests/_utils/test_utils_request.py
from typing import Any, Optional, Union from unittest.mock import MagicMock, patch import pytest from marimo._utils.requests import ( RequestError, Response, _make_request, delete, get, post, put, ) def test_response_object(): response = Response( 200, b'{"key": "value"}', {"...
{ "repo_id": "marimo-team/marimo", "file_path": "tests/_utils/test_utils_request.py", "license": "Apache License 2.0", "lines": 285, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
marimo-team/marimo:scripts/generate_bash_focus.py
# /// script # requires-python = ">=3.13,<3.14" # dependencies = [ # "msgspec", # ] # # [tool.uv] # exclude-newer = "2025-06-27T12:38:25.742953-04:00" # /// """Get GitHub PRs labeled with 'bash-focus' since the last release.""" from __future__ import annotations import re import subprocess import sys import msgs...
{ "repo_id": "marimo-team/marimo", "file_path": "scripts/generate_bash_focus.py", "license": "Apache License 2.0", "lines": 124, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_complex
marimo-team/marimo:scripts/generate_release_notes.py
# /// script # requires-python = ">=3.13,<3.14" # dependencies = [ # "msgspec", # ] # # [tool.uv] # exclude-newer = "2025-06-27T12:38:25.742953-04:00" # /// """Generate release notes from commits on main branch.""" from __future__ import annotations import re import subprocess import sys import msgspec class A...
{ "repo_id": "marimo-team/marimo", "file_path": "scripts/generate_release_notes.py", "license": "Apache License 2.0", "lines": 256, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_complex
marimo-team/marimo:marimo/_server/api/dependency_tree.py
# Copyright 2026 Marimo. All rights reserved. from __future__ import annotations from marimo._utils.uv_tree import DependencyTag, DependencyTreeNode def parse_name_version(content: str) -> tuple[str, str | None]: if " v" in content: name, version = content.split(" v", 1) return name.strip(), vers...
{ "repo_id": "marimo-team/marimo", "file_path": "marimo/_server/api/dependency_tree.py", "license": "Apache License 2.0", "lines": 75, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_complex
marimo-team/marimo:marimo/_utils/uv_tree.py
# Copyright 2026 Marimo. All rights reserved. from __future__ import annotations from typing import Optional import msgspec class DependencyTag(msgspec.Struct, rename="camel"): kind: str value: str class DependencyTreeNode(msgspec.Struct, rename="camel"): name: str version: Optional[str] # Lis...
{ "repo_id": "marimo-team/marimo", "file_path": "marimo/_utils/uv_tree.py", "license": "Apache License 2.0", "lines": 86, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_complex
marimo-team/marimo:tests/_utils/test_uv_tree.py
from __future__ import annotations import json import os import pathlib import subprocess import sys import pytest from marimo._messaging.msgspec_encoder import asdict from marimo._server.models.packages import DependencyTreeNode from marimo._utils.uv_tree import parse_uv_tree from tests.mocks import snapshotter sk...
{ "repo_id": "marimo-team/marimo", "file_path": "tests/_utils/test_uv_tree.py", "license": "Apache License 2.0", "lines": 185, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
marimo-team/marimo:marimo/_utils/async_path.py
# Copyright 2026 Marimo. All rights reserved. """ Async version of pathlib.Path that uses asyncio.to_thread for filesystem operations. """ from __future__ import annotations import asyncio import os from pathlib import Path, PurePath, PurePosixPath, PureWindowsPath from typing import IO, TYPE_CHECKING, Any, Optional,...
{ "repo_id": "marimo-team/marimo", "file_path": "marimo/_utils/async_path.py", "license": "Apache License 2.0", "lines": 199, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_complex
marimo-team/marimo:tests/_utils/test_async_path.py
import asyncio import os import tempfile from pathlib import Path from unittest.mock import patch import pytest from marimo._utils.async_path import ( AsyncPath, AsyncPosixPath, AsyncWindowsPath, ) class TestAsyncPathConstruction: def test_new_creates_correct_platform_type(self): """Test tha...
{ "repo_id": "marimo-team/marimo", "file_path": "tests/_utils/test_async_path.py", "license": "Apache License 2.0", "lines": 421, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
marimo-team/marimo:marimo/_utils/files.py
# Copyright 2026 Marimo. All rights reserved. from __future__ import annotations import fnmatch import os import re from pathlib import Path from typing import TYPE_CHECKING, Union from marimo._utils import async_path if TYPE_CHECKING: from collections.abc import AsyncGenerator, Generator _SPLIT_NUMBERS = re.co...
{ "repo_id": "marimo-team/marimo", "file_path": "marimo/_utils/files.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/_utils/code.py
# Copyright 2026 Marimo. All rights reserved. from __future__ import annotations def hash_code(code: str) -> str: import hashlib return hashlib.md5(code.encode("utf-8"), usedforsecurity=False).hexdigest()
{ "repo_id": "marimo-team/marimo", "file_path": "marimo/_utils/code.py", "license": "Apache License 2.0", "lines": 5, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
marimo-team/marimo:marimo/_utils/theme.py
# Copyright 2026 Marimo. All rights reserved. from __future__ import annotations from marimo._config.config import Theme from marimo._config.manager import get_default_config_manager def get_current_theme() -> Theme: config_manager = get_default_config_manager(current_path=None) return config_manager.theme
{ "repo_id": "marimo-team/marimo", "file_path": "marimo/_utils/theme.py", "license": "Apache License 2.0", "lines": 7, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
marimo-team/marimo:marimo/_runtime/packages/import_error_extractors.py
# Copyright 2026 Marimo. All rights reserved. from __future__ import annotations import re def extract_missing_module_from_cause_chain( error: ImportError, ) -> str | None: """Traverse an `ImportError` cause chain maybe find a missing module name. This handles cases where a `ModuleNotFoundError` was rai...
{ "repo_id": "marimo-team/marimo", "file_path": "marimo/_runtime/packages/import_error_extractors.py", "license": "Apache License 2.0", "lines": 93, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_complex
marimo-team/marimo:tests/_runtime/packages/test_import_error_extractors.py
# Copyright 2026 Marimo. All rights reserved. import pytest from marimo._runtime.packages.import_error_extractors import ( extract_missing_module_from_cause_chain, extract_packages_from_pip_install_suggestion, extract_packages_special_cases, ) def test_extract_missing_module_from_cause_chain_direct(): ...
{ "repo_id": "marimo-team/marimo", "file_path": "tests/_runtime/packages/test_import_error_extractors.py", "license": "Apache License 2.0", "lines": 83, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
marimo-team/marimo:marimo/_utils/uv.py
# Copyright 2026 Marimo. All rights reserved. from __future__ import annotations import os # Could be replaced with `find_uv_bin` from uv Python package in the future def find_uv_bin() -> str: return os.environ.get("UV", "uv")
{ "repo_id": "marimo-team/marimo", "file_path": "marimo/_utils/uv.py", "license": "Apache License 2.0", "lines": 6, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
marimo-team/marimo:scripts/generate_ipynb_fixtures.py
# /// script # requires-python = ">=3.13" # dependencies = [ # "jupytext", # "nbformat", # ] # # [tool.uv] # exclude-newer = "2025-06-03T16:30:20.082913-04:00" # /// """ Generate `.ipynb` test fixtures for marimo's notebook conversion pipeline. Each fixture corresponds to a named Jupyter notebook containing on...
{ "repo_id": "marimo-team/marimo", "file_path": "scripts/generate_ipynb_fixtures.py", "license": "Apache License 2.0", "lines": 150, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
marimo-team/marimo:marimo/_convert/converters.py
# Copyright 2026 Marimo. All rights reserved. from __future__ import annotations from marimo._schemas.notebook import NotebookV1 from marimo._schemas.serialization import ( EMPTY_NOTEBOOK_SERIALIZATION, NotebookSerialization, ) class MarimoConverterIntermediate: """Intermediate representation that allows...
{ "repo_id": "marimo-team/marimo", "file_path": "marimo/_convert/converters.py", "license": "Apache License 2.0", "lines": 115, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
marimo-team/marimo:marimo/_convert/notebook.py
# Copyright 2026 Marimo. All rights reserved. from __future__ import annotations from marimo._schemas.notebook import ( NotebookCell, NotebookCellConfig, NotebookMetadata, NotebookV1, ) from marimo._schemas.serialization import ( AppInstantiation, CellDef, NotebookSerialization, Noteboo...
{ "repo_id": "marimo-team/marimo", "file_path": "marimo/_convert/notebook.py", "license": "Apache License 2.0", "lines": 75, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
marimo-team/marimo:marimo/_smoke_tests/sql/redshift_example.py
# /// script # requires-python = ">=3.12" # dependencies = [ # "marimo", # "pandas==2.2.3", # "polars[pyarrow]==1.30.0", # "redshift-connector[full]==2.1.7", # "sqlglot==26.23.0", # ] # /// import marimo __generated_with = "0.15.5" app = marimo.App(width="medium") @app.cell def _(): import m...
{ "repo_id": "marimo-team/marimo", "file_path": "marimo/_smoke_tests/sql/redshift_example.py", "license": "Apache License 2.0", "lines": 175, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
documentation
marimo-team/marimo:marimo/_sql/engines/redshift.py
# Copyright 2026 Marimo. All rights reserved. from __future__ import annotations import ast from typing import TYPE_CHECKING, Any, Literal, Optional, Union from marimo import _loggers from marimo._data.models import ( Database, DataTable, DataTableColumn, DataTableType, DataType, Schema, ) fro...
{ "repo_id": "marimo-team/marimo", "file_path": "marimo/_sql/engines/redshift.py", "license": "Apache License 2.0", "lines": 358, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_complex
marimo-team/marimo:tests/_sql/test_redshift.py
# Copyright 2026 Marimo. All rights reserved. from __future__ import annotations from typing import TYPE_CHECKING from unittest import mock import pytest from marimo._dependencies.dependencies import DependencyManager from marimo._sql.engines.redshift import RedshiftEngine from marimo._sql.engines.types import Engi...
{ "repo_id": "marimo-team/marimo", "file_path": "tests/_sql/test_redshift.py", "license": "Apache License 2.0", "lines": 61, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
marimo-team/marimo:examples/ui/image_comparison_demo.py
#!/usr/bin/env python3 # /// script # requires-python = ">=3.11" # dependencies = [ # "marimo", # ] # /// # Copyright 2026 Marimo. All rights reserved. import marimo __generated_with = "0.19.7" app = marimo.App() @app.cell(hide_code=True) def _(mo): mo.md(""" # Image Comparison Demo This demo showc...
{ "repo_id": "marimo-team/marimo", "file_path": "examples/ui/image_comparison_demo.py", "license": "Apache License 2.0", "lines": 69, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
marimo-team/marimo:marimo/_plugins/stateless/image_compare.py
# Copyright 2026 Marimo. All rights reserved. from __future__ import annotations import io import os from pathlib import Path from typing import Literal, Optional, Union import marimo._output.data.data as mo_data from marimo._output.hypertext import Html from marimo._output.rich_help import mddoc from marimo._output....
{ "repo_id": "marimo-team/marimo", "file_path": "marimo/_plugins/stateless/image_compare.py", "license": "Apache License 2.0", "lines": 113, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_complex
marimo-team/marimo:tests/_plugins/stateless/test_image_compare.py
# Copyright 2026 Marimo. All rights reserved. from __future__ import annotations import sys import pytest from marimo._dependencies.dependencies import DependencyManager from marimo._plugins.stateless.image_compare import image_compare from marimo._runtime.context import get_context from marimo._runtime.runtime impo...
{ "repo_id": "marimo-team/marimo", "file_path": "tests/_plugins/stateless/test_image_compare.py", "license": "Apache License 2.0", "lines": 247, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
marimo-team/marimo:marimo/_schemas/common.py
# Copyright 2026 Marimo. All rights reserved. from __future__ import annotations from typing import TypedDict # Base types for extensibility class BaseDict(TypedDict, total=False): """Base dictionary allowing additional fields""" pass
{ "repo_id": "marimo-team/marimo", "file_path": "marimo/_schemas/common.py", "license": "Apache License 2.0", "lines": 7, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
marimo-team/marimo:marimo/_schemas/notebook.py
# Copyright 2026 Marimo. All rights reserved. from __future__ import annotations from typing import Literal, Optional, TypedDict # This file contains the schema for the notebook. # It may be externally used and must be kept backwards compatible. # # We generate the OpenAPI schema using a marimo notebook: `python scri...
{ "repo_id": "marimo-team/marimo", "file_path": "marimo/_schemas/notebook.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:marimo/_smoke_tests/markdown/highlight.py
import marimo __generated_with = "0.15.5" app = marimo.App(width="medium") @app.cell def _(mo): mo.md( """ ``` >>> # pycon (omitted) >>> def foo(): >>> pass ``` ``` # python (omitted) def foo(): return range(1, 100) return x + y ``` ```pycon >>...
{ "repo_id": "marimo-team/marimo", "file_path": "marimo/_smoke_tests/markdown/highlight.py", "license": "Apache License 2.0", "lines": 53, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
documentation
marimo-team/marimo:marimo/_smoke_tests/issues/4744-fixed-loading-indicator.py
import marimo __generated_with = "0.15.5" app = marimo.App() @app.cell def _(): import marimo as mo return (mo,) @app.cell(hide_code=True) def _(mo): mo.md(r"""When viewing this notebook in run mode, the hourglass loading indicator should be stickied to the top left even when scrolling down.""") re...
{ "repo_id": "marimo-team/marimo", "file_path": "marimo/_smoke_tests/issues/4744-fixed-loading-indicator.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:marimo/_utils/hashable.py
# Copyright 2026 Marimo. All rights reserved. from __future__ import annotations from typing import Any def is_hashable(*values: Any) -> bool: """ Check if all values passed in are hashable. """ try: hash(values) return True except TypeError: return False
{ "repo_id": "marimo-team/marimo", "file_path": "marimo/_utils/hashable.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/_smoke_tests/issues/4970-unique-transform.py
import marimo __generated_with = "0.15.5" app = marimo.App(width="columns") @app.cell(column=0) def _(df_pandas, mo): mo.ui.dataframe(df_pandas) return @app.cell def _(df_polars, mo): mo.ui.dataframe(df_polars) return @app.cell def _(df_ibis, mo): mo.ui.dataframe(df_ibis) return @app.ce...
{ "repo_id": "marimo-team/marimo", "file_path": "marimo/_smoke_tests/issues/4970-unique-transform.py", "license": "Apache License 2.0", "lines": 48, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
marimo-team/marimo:tests/_ast/codegen_data/test_app_with_annotation_typing.py
import marimo __generated_with = "0.0.0" app = marimo.App(width="medium") with app.setup: CONSTANT: int = 42 @app.cell def _(): z: "int" = 0 return (z,) @app.cell def _(): x: int = CONSTANT + 2 y: float = 2.0 return x, y @app.cell def _(x: int, y: float, z: "int"): _ = x + y + z ...
{ "repo_id": "marimo-team/marimo", "file_path": "tests/_ast/codegen_data/test_app_with_annotation_typing.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:marimo/_smoke_tests/logs.py
# /// script # requires-python = ">=3.11" # dependencies = [ # "marimo", # ] # /// # Copyright 2026 Marimo. All rights reserved. import marimo __generated_with = "0.15.5" app = marimo.App() @app.cell def _(): import marimo as mo return (mo,) @app.cell def _(mo): level_dropdown = mo.ui.dropdown( ...
{ "repo_id": "marimo-team/marimo", "file_path": "marimo/_smoke_tests/logs.py", "license": "Apache License 2.0", "lines": 80, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
marimo-team/marimo:tests/test_loggers.py
from __future__ import annotations import logging import os from logging.handlers import TimedRotatingFileHandler from pathlib import Path from unittest.mock import patch import pytest from marimo._loggers import ( _LOG_LEVEL, _LOGGERS, WindowsSafeRotatingFileHandler, get_log_directory, get_logge...
{ "repo_id": "marimo-team/marimo", "file_path": "tests/test_loggers.py", "license": "Apache License 2.0", "lines": 139, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
marimo-team/marimo:marimo/_smoke_tests/packages/is_in_uv.py
import marimo __generated_with = "0.15.5" app = marimo.App(width="medium") @app.cell def _(): import os from pathlib import Path # Check we have a virtual environment venv_path = os.environ.get("VIRTUAL_ENV", None) # Check that the `UV` environment variable is set # This tells us that marimo...
{ "repo_id": "marimo-team/marimo", "file_path": "marimo/_smoke_tests/packages/is_in_uv.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/_smoke_tests/sql/dbapi_sqlite.py
import marimo __generated_with = "0.15.5" app = marimo.App(width="medium") @app.cell def _(): import marimo as mo return (mo,) @app.cell def _(): import sqlite3 return (sqlite3,) @app.cell def _(sqlite3): conn = sqlite3.connect(":memory:") conn.execute(""" CREATE TABLE test ( ...
{ "repo_id": "marimo-team/marimo", "file_path": "marimo/_smoke_tests/sql/dbapi_sqlite.py", "license": "Apache License 2.0", "lines": 39, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
documentation
marimo-team/marimo:marimo/_sql/engines/dbapi.py
# Copyright 2026 Marimo. All rights reserved. from __future__ import annotations from types import ModuleType from typing import TYPE_CHECKING, Any, Optional, Protocol from marimo import _loggers from marimo._sql.engines.types import QueryEngine from marimo._sql.utils import convert_to_output LOGGER = _loggers.marim...
{ "repo_id": "marimo-team/marimo", "file_path": "marimo/_sql/engines/dbapi.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/_sql/test_dbapi.py
# Copyright 2026 Marimo. All rights reserved. from __future__ import annotations import sqlite3 from unittest.mock import patch import pytest from marimo._sql.engines.dbapi import DBAPIEngine from marimo._sql.engines.types import EngineCatalog, QueryEngine @pytest.fixture def sqlite_connection() -> sqlite3.Connect...
{ "repo_id": "marimo-team/marimo", "file_path": "tests/_sql/test_dbapi.py", "license": "Apache License 2.0", "lines": 127, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
marimo-team/marimo:examples/ai/chat/bedrock_example.py
# /// script # requires-python = ">=3.11" # dependencies = [ # "boto3", # "litellm", # "marimo", # ] # /// import marimo __generated_with = "0.19.7" app = marimo.App(width="medium") @app.cell(hide_code=True) def _(): import marimo as mo return (mo,) @app.cell(hide_code=True) def _(mo): mo...
{ "repo_id": "marimo-team/marimo", "file_path": "examples/ai/chat/bedrock_example.py", "license": "Apache License 2.0", "lines": 201, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_complex
marimo-team/marimo:tests/_server/ai/test_providers.py
"""Tests for the LLM providers in marimo._server.ai.providers.""" from unittest.mock import AsyncMock, MagicMock, patch import pytest from marimo._config.config import AiConfig from marimo._dependencies.dependencies import Dependency, DependencyManager from marimo._server.ai.config import AnyProviderConfig from mari...
{ "repo_id": "marimo-team/marimo", "file_path": "tests/_server/ai/test_providers.py", "license": "Apache License 2.0", "lines": 342, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
marimo-team/marimo:marimo/_smoke_tests/primitives/_decimal.py
import marimo __generated_with = "0.15.5" app = marimo.App(width="medium") @app.cell def _(): import marimo as mo return (mo,) @app.cell def _(alt, df): _chart = ( alt.Chart(df) .mark_bar() .encode( x=alt.X("CAST(10 AS DECIMAL(18,3))", type="quantitative", bin=True),...
{ "repo_id": "marimo-team/marimo", "file_path": "marimo/_smoke_tests/primitives/_decimal.py", "license": "Apache License 2.0", "lines": 35, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
marimo-team/marimo:marimo/_plugins/ui/_impl/anywidget/types.py
# Copyright 2026 Marimo. All rights reserved. from __future__ import annotations from typing import Any, NewType, Union # AnyWidget model id WidgetModelId = NewType("WidgetModelId", str) # Buffer paths BufferPaths = list[list[Union[str, int]]] # Widget model state WidgetModelState = dict[str, Any] # Widget model s...
{ "repo_id": "marimo-team/marimo", "file_path": "marimo/_plugins/ui/_impl/anywidget/types.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/_plugins/ui/_impl/anywidget/utils.py
# Copyright 2026 Marimo. All rights reserved. from __future__ import annotations from marimo._dependencies.dependencies import DependencyManager from marimo._plugins.ui._impl.anywidget.types import ( BufferPaths, WidgetModelState, WidgetModelStateWithoutBuffers, ) def extract_buffer_paths( message: W...
{ "repo_id": "marimo-team/marimo", "file_path": "marimo/_plugins/ui/_impl/anywidget/utils.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/_smoke_tests/anywidget_examples/lonboard_example.py
# /// script # requires-python = ">=3.13" # dependencies = [ # "geopandas==1.0.1", # "lonboard==0.10.4", # "marimo", # "matplotlib==3.10.3", # "palettable==3.3.3", # "pandas==2.2.3", # "pyarrow==20.0.0", # "shapely==2.1.1", # ] # /// import marimo __generated_with = "0.19.7" app = mari...
{ "repo_id": "marimo-team/marimo", "file_path": "marimo/_smoke_tests/anywidget_examples/lonboard_example.py", "license": "Apache License 2.0", "lines": 80, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
marimo-team/marimo:marimo/_smoke_tests/anywidget_smoke_tests/multiple_models.py
import marimo __generated_with = "0.19.7" app = marimo.App(width="medium") @app.cell def _(): import marimo as mo import anywidget import ipywidgets import traitlets class ModelOnlyWidget(ipywidgets.Widget): value = traitlets.Int(42).tag(sync=True) class Widget(anywidget.AnyWidge...
{ "repo_id": "marimo-team/marimo", "file_path": "marimo/_smoke_tests/anywidget_smoke_tests/multiple_models.py", "license": "Apache License 2.0", "lines": 43, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
documentation
marimo-team/marimo:marimo/_smoke_tests/third_party/lonboard_example.py
# /// script # requires-python = ">=3.11" # dependencies = [ # "duckdb==1.2.0", # "lonboard==0.10.4", # "marimo", # "polars==1.23.0", # "pyarrow==19.0.1", # "shapely==2.0.7", # "sqlglot==26.6.0", # ] # /// import marimo __generated_with = "0.15.5" app = marimo.App(width="full") @app.cell...
{ "repo_id": "marimo-team/marimo", "file_path": "marimo/_smoke_tests/third_party/lonboard_example.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:tests/_plugins/ui/_impl/anywidget/test_anywidget_utils.py
# Copyright 2026 Marimo. All rights reserved. from __future__ import annotations import pytest from marimo._dependencies.dependencies import DependencyManager from marimo._plugins.ui._impl.anywidget.utils import extract_buffer_paths HAS_DEPS = DependencyManager.ipywidgets.has() @pytest.mark.skipif(not HAS_DEPS, re...
{ "repo_id": "marimo-team/marimo", "file_path": "tests/_plugins/ui/_impl/anywidget/test_anywidget_utils.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/_plugins/ui/_impl/test_comm.py
from __future__ import annotations import sys from unittest.mock import MagicMock, patch import pytest from marimo._plugins.ui._impl.anywidget.init import CommLifecycleItem from marimo._plugins.ui._impl.comm import ( MarimoComm, MarimoCommManager, ) from marimo._runtime.commands import ( ModelCommand, ...
{ "repo_id": "marimo-team/marimo", "file_path": "tests/_plugins/ui/_impl/test_comm.py", "license": "Apache License 2.0", "lines": 235, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
marimo-team/marimo:marimo/_smoke_tests/scripts/logging_in_scripts.py
import marimo __generated_with = "0.15.5" app = marimo.App(width="medium") @app.cell def _(): import marimo as mo import sys import time return mo, sys, time @app.cell def _(mo, sys, time): for i in mo.status.progress_bar(range(10)): if i % 2 == 0: print(f"Step {i}", file=sy...
{ "repo_id": "marimo-team/marimo", "file_path": "marimo/_smoke_tests/scripts/logging_in_scripts.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:examples/running_as_a_script/textual_app.py
# /// script # requires-python = ">=3.13" # dependencies = [ # "marimo", # "textual==3.2.0", # ] # /// """ Marimo wrapper for the base Textual app example. Provides a basic clock widget to show the current time. run with `python textual_app.py` """ import marimo __generated_with = "0.15.5" app = marimo.App() ...
{ "repo_id": "marimo-team/marimo", "file_path": "examples/running_as_a_script/textual_app.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:marimo/_save/stores/tiered.py
# Copyright 2026 Marimo. All rights reserved. from __future__ import annotations from typing import Optional from marimo import _loggers from marimo._save.stores.store import Store LOGGER = _loggers.marimo_logger() class TieredStore(Store): """A composite store that tries multiple stores in order. Reads w...
{ "repo_id": "marimo-team/marimo", "file_path": "marimo/_save/stores/tiered.py", "license": "Apache License 2.0", "lines": 59, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_complex
marimo-team/marimo:tests/_save/stores/test_store_config.py
# Copyright 2026 Marimo. All rights reserved. from __future__ import annotations from marimo._save.stores import ( DEFAULT_STORE, FileStore, TieredStore, _get_store_from_config, ) class TestGetStoreFromConfig: def test_none_config(self) -> None: """Test that None config returns the defau...
{ "repo_id": "marimo-team/marimo", "file_path": "tests/_save/stores/test_store_config.py", "license": "Apache License 2.0", "lines": 60, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
marimo-team/marimo:tests/_save/stores/test_tiered.py
# Copyright 2026 Marimo. All rights reserved. from __future__ import annotations from typing import Any from unittest.mock import patch import pytest from marimo._save.stores.tiered import TieredStore from tests._save.store.mocks import MockStore def throw_exception(*args: Any, **kwargs: Any) -> None: del arg...
{ "repo_id": "marimo-team/marimo", "file_path": "tests/_save/stores/test_tiered.py", "license": "Apache License 2.0", "lines": 136, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
marimo-team/marimo:marimo/_smoke_tests/ipython/progress.py
import marimo __generated_with = "0.15.5" app = marimo.App(width="medium") @app.cell def __1(): import time from transformers.utils.notebook import NotebookProgressCallback from transformers.training_args import IntervalStrategy return IntervalStrategy, NotebookProgressCallback, time @app.cell def ...
{ "repo_id": "marimo-team/marimo", "file_path": "marimo/_smoke_tests/ipython/progress.py", "license": "Apache License 2.0", "lines": 65, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
marimo-team/marimo:marimo/_runtime/watch/_directory.py
# Copyright 2026 Marimo. All rights reserved. from __future__ import annotations import hashlib import os import sys import time from pathlib import Path from typing import TYPE_CHECKING, Callable, cast from marimo._output.rich_help import mddoc from marimo._runtime.watch._path import ( WATCHER_SLEEP_INTERVAL, ...
{ "repo_id": "marimo-team/marimo", "file_path": "marimo/_runtime/watch/_directory.py", "license": "Apache License 2.0", "lines": 119, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_complex
marimo-team/marimo:marimo/_runtime/watch/_file.py
# Copyright 2026 Marimo. All rights reserved. from __future__ import annotations import hashlib import sys import threading import time from pathlib import Path from typing import Any, Callable from marimo._output.rich_help import mddoc from marimo._runtime.watch._path import ( WATCHER_SLEEP_INTERVAL, PathSta...
{ "repo_id": "marimo-team/marimo", "file_path": "marimo/_runtime/watch/_file.py", "license": "Apache License 2.0", "lines": 124, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_complex
marimo-team/marimo:marimo/_runtime/watch/_path.py
# Copyright 2026 Marimo. All rights reserved. from __future__ import annotations import sys import threading from pathlib import Path from typing import Any, Callable, TypeVar from marimo import _loggers from marimo._runtime.context import ( ContextNotInitializedError, get_context, runtime_context_install...
{ "repo_id": "marimo-team/marimo", "file_path": "marimo/_runtime/watch/_path.py", "license": "Apache License 2.0", "lines": 111, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_complex
marimo-team/marimo:tests/_runtime/watch/test_watch.py
# Copyright 2026 Marimo. All rights reserved. import asyncio from pathlib import Path import pytest from marimo._runtime.runtime import Kernel from tests.conftest import ExecReqProvider @pytest.mark.xfail( True, reason="Flaky in CI, can't repro locally", strict=False ) async def test_read_and_write_path( ex...
{ "repo_id": "marimo-team/marimo", "file_path": "tests/_runtime/watch/test_watch.py", "license": "Apache License 2.0", "lines": 145, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
marimo-team/marimo:tests/_server/rtc/test_rtc_doc.py
from __future__ import annotations import asyncio import sys from typing import TYPE_CHECKING, cast import pytest from marimo._server.file_router import MarimoFileKey from marimo._server.rtc.doc import LoroDocManager from marimo._types.ids import CellId_t if sys.version_info >= (3, 11) and sys.version_info < (3, 14...
{ "repo_id": "marimo-team/marimo", "file_path": "tests/_server/rtc/test_rtc_doc.py", "license": "Apache License 2.0", "lines": 282, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
marimo-team/marimo:marimo/_smoke_tests/async/background_tasks.py
import marimo __generated_with = "0.15.5" app = marimo.App(width="medium") @app.cell(hide_code=True) def _(): import time import asyncio async def background_task(name, seconds): """A simple task that prints messages at intervals.""" print(f"Task {name} started") for i in range(...
{ "repo_id": "marimo-team/marimo", "file_path": "marimo/_smoke_tests/async/background_tasks.py", "license": "Apache License 2.0", "lines": 35, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
marimo-team/marimo:marimo/_runtime/side_effect.py
# Copyright 2026 Marimo. All rights reserved. from __future__ import annotations import hashlib from typing import TYPE_CHECKING from marimo._runtime.cell_lifecycle_item import CellLifecycleItem if TYPE_CHECKING: from marimo._runtime.context.types import RuntimeContext class SideEffect(CellLifecycleItem): ...
{ "repo_id": "marimo-team/marimo", "file_path": "marimo/_runtime/side_effect.py", "license": "Apache License 2.0", "lines": 59, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
marimo-team/marimo:marimo/_server/rtc/doc.py
# Copyright 2026 Marimo. All rights reserved. from __future__ import annotations import asyncio from typing import TYPE_CHECKING, Optional from marimo import _loggers from marimo._server.file_router import MarimoFileKey from marimo._types.ids import CellId_t if TYPE_CHECKING: from loro import LoroDoc LOGGER = _...
{ "repo_id": "marimo-team/marimo", "file_path": "marimo/_server/rtc/doc.py", "license": "Apache License 2.0", "lines": 144, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_complex
marimo-team/marimo:marimo/_entrypoints/ids.py
# Copyright 2026 Marimo. All rights reserved. from __future__ import annotations from typing import Literal # Internal entrypoints. Not user-facing as the API is not stable. KnownEntryPoint = Literal[ "marimo.cell.executor", "marimo.cache.store", "marimo.kernel.lifespan", "marimo.server.asgi.lifespan"...
{ "repo_id": "marimo-team/marimo", "file_path": "marimo/_entrypoints/ids.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/_entrypoints/registry.py
# Copyright 2026 Marimo. All rights reserved. from __future__ import annotations import os from importlib.metadata import entry_points from typing import TYPE_CHECKING, Generic, Optional, TypeVar, cast from marimo import _loggers from marimo._entrypoints.ids import KnownEntryPoint if TYPE_CHECKING: from importli...
{ "repo_id": "marimo-team/marimo", "file_path": "marimo/_entrypoints/registry.py", "license": "Apache License 2.0", "lines": 123, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
documentation
marimo-team/marimo:marimo/_server/registry.py
# Copyright 2026 Marimo. All rights reserved. from __future__ import annotations from typing import TYPE_CHECKING from marimo._entrypoints.registry import EntryPointRegistry if TYPE_CHECKING: from starlette.applications import Starlette from starlette.middleware import Middleware from starlette.types imp...
{ "repo_id": "marimo-team/marimo", "file_path": "marimo/_server/registry.py", "license": "Apache License 2.0", "lines": 14, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
marimo-team/marimo:marimo/_types/lifespan.py
# Copyright 2026 Marimo. All rights reserved. from __future__ import annotations from collections.abc import ( Callable, Mapping, ) from contextlib import AbstractAsyncContextManager from typing import Any, TypeVar, Union AppType = TypeVar("AppType") StatelessLifespan = Callable[[AppType], AbstractAsyncConte...
{ "repo_id": "marimo-team/marimo", "file_path": "marimo/_types/lifespan.py", "license": "Apache License 2.0", "lines": 14, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
marimo-team/marimo:marimo/_utils/lifespans.py
# Copyright 2026 Marimo. All rights reserved. from __future__ import annotations import asyncio import contextlib from collections.abc import AsyncIterator, Sequence from contextlib import AbstractAsyncContextManager from typing import Any, Generic, TypeAlias, TypeVar from marimo import _loggers from marimo._types.li...
{ "repo_id": "marimo-team/marimo", "file_path": "marimo/_utils/lifespans.py", "license": "Apache License 2.0", "lines": 42, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
marimo-team/marimo:tests/_utils/test_lifespans.py
import asyncio from collections.abc import AsyncIterator from contextlib import asynccontextmanager from typing import Callable import pytest from marimo._types.lifespan import Lifespan from marimo._utils.lifespans import Lifespans class MockApp: def __init__(self) -> None: self.setup_calls: list[str] =...
{ "repo_id": "marimo-team/marimo", "file_path": "tests/_utils/test_lifespans.py", "license": "Apache License 2.0", "lines": 97, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
marimo-team/marimo:tests/test_entrypoints.py
import os from typing import cast from unittest.mock import MagicMock, patch import pytest from marimo._entrypoints.ids import KnownEntryPoint from marimo._entrypoints.registry import EntryPointRegistry, get_entry_points from marimo._runtime.executor import ExecutionConfig, Executor, get_executor class TestEntryPoi...
{ "repo_id": "marimo-team/marimo", "file_path": "tests/test_entrypoints.py", "license": "Apache License 2.0", "lines": 162, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
marimo-team/marimo:marimo/_pyodide/restartable_task.py
# Copyright 2026 Marimo. All rights reserved. from __future__ import annotations import asyncio from typing import Any, Callable, Optional class RestartableTask: def __init__(self, coro: Callable[[], Any]): self.coro = coro self.task: Optional[asyncio.Task[Any]] = None self.stopped = Fals...
{ "repo_id": "marimo-team/marimo", "file_path": "marimo/_pyodide/restartable_task.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:marimo/_utils/inline_script_metadata.py
# Copyright 2026 Marimo. All rights reserved. from __future__ import annotations import json import re from pathlib import Path from typing import Any, cast from marimo import _loggers from marimo._cli.files.file_path import FileContentReader from marimo._utils.code import hash_code from marimo._utils.paths import no...
{ "repo_id": "marimo-team/marimo", "file_path": "marimo/_utils/inline_script_metadata.py", "license": "Apache License 2.0", "lines": 217, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_complex
marimo-team/marimo:tests/_pyodide/test_bootstrap.py
# Copyright 2026 Marimo. All rights reserved. from __future__ import annotations import json from typing import TYPE_CHECKING, Any, Callable import pytest from marimo._config.config import DEFAULT_CONFIG from marimo._messaging.msgspec_encoder import encode_json_str from marimo._pyodide.bootstrap import create_sessio...
{ "repo_id": "marimo-team/marimo", "file_path": "tests/_pyodide/test_bootstrap.py", "license": "Apache License 2.0", "lines": 155, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test