These classes allow you to define a DB connection that marimo understands.
import pyarrow as pa
from typing import Any, Dict, List, Optional, Tuple, Union
class LogfireDBError(Exception):
"""Base exception for Logfire DB API errors"""
passThese classes allow you to define a DB connection that marimo understands.
import pyarrow as pa
from typing import Any, Dict, List, Optional, Tuple, Union
class LogfireDBError(Exception):
"""Base exception for Logfire DB API errors"""
pass| # /// script | |
| # requires-python = ">=3.12" | |
| # dependencies = [ | |
| # "marimo", | |
| # "polars[pyarrow]==1.33.1", | |
| # "python-dotenv==1.1.1", | |
| # "requests==2.32.5", | |
| # "sqlglot==27.17.0", | |
| # ] | |
| # /// |
I am a specialized AI assistant designed to help create data science notebooks using marimo. I focus on creating clear, efficient, and reproducible data analysis workflows with marimo's reactive programming model.
<assistant_info>
| /* Custom CSS for Marimo - Font customization */ | |
| /* Import Press Start 2P font from Google Fonts */ | |
| @import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap'); | |
| :root { | |
| --marimo-monospace-font: 'Press Start 2P', 'Courier New', monospace; | |
| --marimo-text-font: 'Press Start 2P', 'Courier New', monospace; | |
| --marimo-heading-font: 'Press Start 2P', 'Courier New', monospace; | |
| } |
| import curses | |
| import time | |
| import random | |
| MAX_STARS = 50 | |
| STAR_CHARS = ['.', '*'] | |
| EXPLOSION_DURATION = 3 # Frames | |
| EXPLOSION_ART_PARTS = [ # New name, list of lists of (char, color_key) tuples | |
| [(' ', None), (' ', None), ('`', "exp_yellow"), ('*', "exp_yellow"), ('`', "exp_yellow"), (' ', None), (' ', None)], | |
| [(' ', None), ('*', "exp_dark_red"), ('X', "exp_yellow"), ('X', "exp_yellow"), ('X', "exp_yellow"), ('*', "exp_dark_red"), (' ', None)], |
| import anywidget | |
| import traitlets | |
| class TangleWidget(anywidget.AnyWidget): | |
| _esm = """ | |
| export default { render }; | |
| function render({ model, el }) { | |
| const input = document.createElement('span'); | |
| input.style.borderBottom = '1px dashed #3498db'; |
| pork chop noodle soup | |
| 5 ingredient almond cake with fresh berries | |
| shrimp cakes | |
| chili roasted okra | |
| slow cooker chicken chili | |
| fall superfood beef stew | |
| rotisserie turkey breast tenderloin with pesto | |
| j . alexander's mac and cheese | |
| spinach stuffed pork roast | |
| lasagna soup |
| { | |
| "name": "NuPhy Air60 V2", | |
| "vendorProductId": 435499605, | |
| "macros": [ | |
| "{+KC_LSFT}{+KC_LGUI} {-KC_LSFT}{-KC_LGUI}", | |
| "{KC_LGUI} ", | |
| "{+KC_LSFT} ", | |
| "", | |
| "", | |
| "", |
| import prodigy | |
| from typing import List, Optional, Union, Iterable | |
| from prodigy.components.loaders import get_stream | |
| from prodigy.components.preprocess import fetch_media as fetch_media_preprocessor | |
| from prodigy.util import log, msg, get_labels, split_string | |
| from prodigy.types import TaskType, RecipeSettingsType | |
| def remove_base64(examples: List[TaskType]) -> List[TaskType]: |
| import timeit | |
| import requests | |
| import html_text | |
| import justext | |
| from selectolax.parser import HTMLParser | |
| # There's a difference between these two | |
| html_long = requests.get("http://planet.python.org/").content.decode("utf-8") | |
| html_short = "<p><b>This</b> is just a small example.</p>" |