MCPcopy Index your code
hub / github.com/python/cpython / get_combined_css

Function get_combined_css

Lib/profiling/sampling/_css_utils.py:4–22  ·  view source on GitHub ↗
(component: str)

Source from the content-addressed store, hash-verified

2
3
4def get_combined_css(component: str) -> str:
5 template_dir = importlib.resources.files(__package__)
6
7 base_css = (template_dir / "_shared_assets" / "base.css").read_text(encoding="utf-8")
8
9 if component == "flamegraph":
10 component_css = (
11 template_dir / "_flamegraph_assets" / "flamegraph.css"
12 ).read_text(encoding="utf-8")
13 elif component == "heatmap":
14 component_css = (template_dir / "_heatmap_assets" / "heatmap.css").read_text(
15 encoding="utf-8"
16 )
17 else:
18 raise ValueError(
19 f"Unknown component: {component}. Expected 'flamegraph' or 'heatmap'."
20 )
21
22 return f"{base_css}\n\n{component_css}"

Callers 2

_load_templatesMethod · 0.85

Calls 2

filesMethod · 0.45
read_textMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…