MCPcopy
hub / github.com/marimo-team/marimo / find

Method find

marimo/_code_mode/_context.py:601–612  ·  view source on GitHub ↗

Return cells whose code contains *substring*. Performs a case-sensitive substring search on each cell's code. Example:: ctx.cells.find("import marimo")

(self, substring: str)

Source from the content-addressed store, hash-verified

599 # ------------------------------------------------------------------
600
601 def find(self, substring: str) -> Sequence[NotebookCell]:
602 """Return cells whose code contains *substring*.
603
604 Performs a case-sensitive substring search on each cell's code.
605
606 Example::
607
608 ctx.cells.find("import marimo")
609 """
610 return [
611 self._cell_view(c) for c in self._doc.cells if substring in c.code
612 ]
613
614 def grep(self, pattern: str) -> Sequence[NotebookCell]:
615 """Return cells whose code matches the regex *pattern*.

Callers 15

_query_includes_limitFunction · 0.45
parse_uv_treeFunction · 0.45
_split_by_inline_codeMethod · 0.45
parse_uv_treeFunction · 0.45
_parse_rocm_smi_statsFunction · 0.45
get_title_from_codeFunction · 0.45
token_strMethod · 0.45
find_sql_refsFunction · 0.45
_find_body_startFunction · 0.45

Calls 1

_cell_viewMethod · 0.95