403Webshell
Server IP : 121.121.20.254  /  Your IP : 216.73.216.70
Web Server : Microsoft-IIS/10.0
System : Windows NT WEB-SERVER 10.0 build 20348 (Windows Server 2022) AMD64
User : IUSR ( 0)
PHP Version : 8.3.28
Disable Function : NONE
MySQL : ON  |  cURL : ON  |  WGET : OFF  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /Python315/Lib/profiling/sampling/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /Python315/Lib/profiling/sampling/__pycache__/heatmap_collector.cpython-315.pyc
R
>lqj!�c�v�Qs]PHs]PHs]PHs]PHs]PHs]PHs]PH s]PH$s	]PH(s
]PH,s]PH0s]QH4GsGs]QH@Gs]QHHGsGsGs]QHXGs]QH`Gs]QHhGsGs]QHtGsGs]QH�G!s!]Q	H�G#s#G$s$\Q
Q22s%\QQ
22s&QQ2s'QQ2s(QQ2s)QQ\!2s*P!)zTHeatmap collector for Python profiling with line-level execution heat visualization.)�	dataclass�field)�Path)�Dict�List�Tuple)�get_combined_css)�fmt)�normalize_location�extract_lineno)�get_opcode_info�
format_opcode)�StackTraceCollector)�extract_module_name�get_python_path_infoc�6`�\sQs]snQsQsU1QksQsUsP!)�	FileStatsz&Statistics for a single profiled file.�c�:�U]6�cPg-RZ9Q$RZ9Q$RZ9Q$RZ9Q$RZ9Q$RZ9Q$RZ9Q$RZ9Q$RZ9Q	$!)
��filename�module_name�module_type�
total_samples�total_self_samples�	num_lines�max_samples�max_self_samples�
percentage)�str�int�float)�format�
__classdict__s"��9C:\Python315\\Lib\profiling\sampling\heatmap_collector.py�__annotate__�FileStats.__annotate__sx�����M����	�
�����
�����N������������)	�__name__�
__module__�__qualname__�__firstlineno__�__doc__r�__annotate_func__�__static_attributes__�__classdictcell__�r"s@r#rrs����0��J��r&rc�^`�\sQs],snQs\\Q5s]s]s	\\
Q5sU1QksQs
UsP!)�TreeNodez-Node in the hierarchical file tree structure.)�default_factoryc�p:�U]6�cPg-RZRZ*9Q$RZ9Q$RZ9Q$RZRZQ1*9Q$!)r�files�samples�countr2�children)rrrrr)r!r"s"�r#r$�TreeNode.__annotate__,sE�����	�?�8����	�
�N���3�
�?�#�A�
r&r')r(r)r*r+r,r�listr5r6r7�dictr8r-r.r/r0s@r#r2r2,s-����7�"�4�8�E��G��E�&+�D�&A�H�
�r&r2c�2`�\sQs]9snQsQsQsQsUsP!)�_TemplateLoaderz>Loads and caches HTML/CSS/JS templates for heatmap generation.c��PUmPUmPUmPUmPUmPUmPUmUO2P!)z#Load all templates and assets once.)�index_template�
file_template�	index_css�index_js�file_css�file_js�	logo_html�_load_templates)�selfs&r#�__init__�_TemplateLoader.__init__<sA��"���!��������
���
����������r&c�n�[OO[2oUQ*oUQ*O	QQ5UmUQ*O	QQ5Um[Q2oV0mV0m	UQ*Q*O	QQ5oUQ	*O	QQ5oUQ
U0oUQ
UQ*O	QQ50Um
UQ
UQ*O	QQ50UmUQ
*oUQ*o[OUO22OQ2o	QU	Q0UmP!["[$1c!o
QSm['QS
02Po
=
P!Po
=
hh9h["[$1co
[)QS
02S
gPo
=
hh9h)z-Load all template files from _heatmap_assets.�_heatmap_assetszheatmap_index_template.html�utf-8��encodingzheatmap_pyfile_template.html�heatmap�_shared_assetszbase.jszheatmap_shared.js�
zheatmap_index.jsz
heatmap.js�_assetsztachyon-logo.png�asciiz <img src="data:image/png;base64,z*" alt="Tachyon logo" class="python-logo"/>z+<div class="python-logo-placeholder"></div>z&Warning: Could not load Tachyon logo: z'Failed to load heatmap template files: )�	importlib�	resourcesr5�__package__�	read_textr?r@rrArCrBrD�base64�	b64encode�
read_bytes�decoderE�FileNotFoundError�IOError�print�RuntimeError)rG�template_dir�
assets_dir�css_content�base_js�heatmap_shared_js�	shared_js�logo_dir�png_path�b64_logo�es&          r#rF�_TemplateLoader._load_templatesHs���	U�$�.�.�4�4�[�A�L�%�(9�9�J�$.�0M�#M�"X�"X�bi�"X�"j�D��",�/M�"M�!X�!X�bi�!X�!j�D��+�9�5�K�(�N�'�M�$�&6�6��B�M�M�W^�M�_�G�!+�.A�!A� L� L�V]� L� ^��"�)�2�&7�%8�9�I�(�k��Z�:L�-L�,W�,W�ah�,W�,i�+j�k�D�M�'�[��J��,E�+P�+P�Za�+P�+b�*c�d�D�L�$�i�/�H�
D�#�&8�8��!�+�+�H�,?�,?�,A�B�I�I�'�R��#C�H�:�Mw�!x����%�w�/�
D�!N����>�q�c�B�C�C��
D��"�7�+�	U��!H���L�M�ST�T��	U�sI�DF�AE�F�+F�,F�F�F�F�F4�F4� F/�/F4)rCrDr@rArBr?rE)	r(r)r*r+r,rHrFr.r/r0s@r#r=r=9s����H�
�!U�!Ur&r=c�^`�\sQs]lsnQs\U1QkQk2s\U1QkQk2sQsUs	P!)�_TreeBuilderz8Builds hierarchical tree structure from file statistics.c�N:�U]6�cPgQRZRZ*QRZRZRZ1*-!)r�
file_stats�return)rrrrr2)r!r"s"�r#r$�)_TreeBuilder.build_file_tree.__annotate__ps(���*�*�D��O�*��S�(�]�8K�*r&c
�\�Q,Q,Q,Q,-oSFD$oVO*OU2J&	-oUO2FD�vqEU%fJ[2oSFD�oUOoUOQ2oSo	[
U2FDsvq�U
[U2]*
6XcU	OOU2J9V�O7c[2U	OU$U	OU*o	Ju	J�	[OU2VcU$J�	U!)z�Build hierarchical tree grouped by module type, then by module structure.

Args:
    file_stats: List of FileStats objects

Returns:
    Dictionary mapping module types to their tree roots
�stdlib�
site-packages�project�other�.)r�append�itemsr2r�split�	enumerate�lenr5r8rl�_calculate_node_stats)rn�type_groups�stat�treesr�stats�	root_noder�parts�current_node�i�parts&           r#�build_file_tree�_TreeBuilder.build_file_treeos�� ��_�b�)�R��RT�U���D��(�(�)�0�0��6����"-�"3�"3�"5��K��� �
�I���"�.�.��#�)�)�#�.�� )��(��/�G�A��C��J��N�*�$�*�*�1�1�$�7� �'<�'<�<�:B�*�L�1�1�$�7�'3�'<�'<�T�'B�� 0�
�"
�.�.�y�9�!*�+��1#6�4�r&c�>:�U]6�cPgQRZQRZRZRZ1*-!)r�nodero)r2rr)r!r"s"�r#r$�/_TreeBuilder._calculate_node_stats.__annotate__�s#���)�)�H�)��s�C�x��)r&c��]o]oUOFDoVO*
oU]*
oJ 	UOO2FD*o[OU2vqVV*
oV&*
oJ,	VmV mV1!)z�Recursively calculate aggregate statistics for tree nodes.

Args:
    node: TreeNode to calculate stats for

Returns:
    Tuple of (total_samples, file_count)
)r5rr8�valuesrlr|r6r7)r�r�
file_count�	file_stat�child�
child_samples�child_counts&      r#r|�"_TreeBuilder._calculate_node_stats�s����
��
����I��4�4�4�M��!�O�J�$�
�]�]�)�)�+�E�)5�)K�)K�E�)R�&�M��*�M��%�J�,�
%���
��(�(r&r')
r(r)r*r+r,�staticmethodr�r|r.r/r0s@r#rlrlls/����B��*��*�X�)��)r&rlc�v`�\sQs]�snQsU1QkQksU1QkQksQU1QkQkksQU1QkQ	kksQ
s	Us
P!)
�
_HtmlRendererz-Renders hierarchical tree structures as HTML.c�8:�U]6�cPgQRZRZRZ1*-!)r�
file_index)rr)r!r"s"�r#r$�#_HtmlRenderer.__init__.__annotate__�s���%�%�4��S��>�%r&c�"�Vm]UmP!)zfInitialize renderer with file index.

Args:
    file_index: Mapping from filenames to HTML file names
�r��heatmap_bar_height)rGr�s&&r#rH�_HtmlRenderer.__init__�s��%��"$��r&c�>:�U]6�cPgQRZRZRZ1*QRZ-!)rrro)rrr2)r!r"s"�r#r$�3_HtmlRenderer.render_hierarchical_html.__annotate__�s$���:#�:#�d�3��=�.A�:#�c�:#r&c��QQQQQQQQ-o,oQ"FCDToVA7cJV*oUQ#7oU%cQ	LQ
oU%cQLPoUO]6XcQLQ
o	UO]6XcQLQo
QUQV$*QUOQU	QUOQ
QU
QUQ0o[UOO	2QP	Q5oSFDvq�V�OV�]Q5*
oJ 	UO%cO[UOQP	Q5oUQ*
oSFDoV�OUQQ5*
oJ	UQ*
oUQ *
oUOU2CJW	Q!OU2!)$z�Build hierarchical HTML with type sections and collapsible module folders.

Args:
    trees: Dictionary mapping module types to tree roots

Returns:
    Complete HTML string for all sections
rru📚 Standard Libraryrsu📦 Site Packagesrtu🏗️ Project Filesruu📄 Other Filesu▶�▼z style="display: none;"�filer5�sampler6zv
<div class="type-section">
  <div class="type-header" onclick="toggleTypeSection(this)">
    <span class="type-icon">z%</span>
    <span class="type-title">z&</span>
    <span class="type-stats">(� �, �nz-)</span>
  </div>
  <div class="type-content"z>
c�*�U]*O!���r6��xs&r#�<lambda>�8_HtmlRenderer.render_hierarchical_html.<locals>.<lambda>�s��a��d�l�lr&��key�reverse)�levelc��UO!�N�rr�s&r#r�r��s����r&z    <div class="files-list">
�      ��indentz    </div>
z  </div>
</div>
rQ)rtrrrsru>rurrrs)
r7r6�sortedr8rx�_render_folderr5�_render_file_itemrw�join)rGr�
type_names�sectionsr�tree�is_collapsed�icon�
content_style�	file_word�sample_word�section_html�root_folders�folder_name�folder_node�sorted_filesr~s&&               r#�render_hierarchical_html�&_HtmlRenderer.render_hierarchical_html�s���
�-��1��.��'�	
�
���J�K��'���%�D�'�*N�N�L�(�5�e�D�9E�5�2�M�"&�*�*��/��w�I�&*�l�l�a�&7�(�Y�K� �"�F�#�(�5�6�7�#�z�z�l�!�I�;�b����a�8H��+��W�)�?�+��L�"�$�-�-�"5�"5�"7�$:�D�J�L�-9�(��� 3� 3�K�TU� 3� V�V��-9��z�z�z�%�d�j�j�6O�Y]�^��� @�@��(�D� �$:�$:�4��$:�$Q�Q�L�)���.���0�0�L��O�O�L�)�OK�R�y�y��"�"r&c�4:�U]6�cPgQRZQRZQRZQRZ-!)rr��namer�ro)r2rr)r!r"s"�r#r$�)_HtmlRenderer._render_folder.__annotate__s)���, �, �8�, �3�, �s�, �3�, r&c�&�QU*o,oUO]6XcQLQoUO]6XcQLQoUOUQUQ02UOUQ02UOUQ	02UOUQ
[OU2Q02UOUQUOQ
UQUOQ
Q
UQ0
2UOUQ02UOUQ02[UOO2QP	Q5oSFD-vq�UOUOV�U]*22J/	UO%cp[UOQP	Q5oUOUQ02SFD'oUOUOV�Q0Q52J)	UOUQ02UOUQ02UOUQ02QOU2!)z�Render a single folder node recursively.

Args:
    node: TreeNode to render
    name: Display name for the folder
    level: Nesting level for indentation

Returns:
    HTML string for this folder and its contents
z  r�r5r�r6z/<div class="folder-node collapsed" data-level="�">z:  <div class="folder-header" onclick="toggleFolder(this)">u(    <span class="folder-icon">▶</span>u#    <span class="folder-name">📁 �</span>z     <span class="folder-stats">(r�r�r�z)</span>z  </div>z5  <div class="folder-content" style="display: none;">c�*�U]*O!r�r�r�s&r#r��._HtmlRenderer._render_folder.<locals>.<lambda>s���!���r&r�c��UO!r�r�r�s&r#r�r�$s��A�O�Or&z    <div class="files-list">r�r�z
    </div>�</div>rQ)r7r6rw�html�escaper�r8rxr�r5r�r�)
rGr�r�r�r�r�r�r��
subfolders�subfolder_name�subfolder_noder�r~s
&&&&         r#r��_HtmlRenderer._render_folders���������#�j�j�A�o�F�7�	�"&�,�,�!�"3�h���
����x�N�u�g�UW�X�Y�
����x�Y�Z�[�
����x�G�H�I�
����x�B�4�;�;�t�CT�BU�U\�]�^�
����x� �����A�i�[��4�<�<��2B�!�K�=�PX�Z�	[�
����x�x�(�)�
����x�T�U�V��D�M�M�/�/�1�4�d�D�
�/9�*�N��L�L��,�,�^�U�UV�Y�W�X�/9��:�:�:�!�$�*�*�2K�UY�Z�L��L�L�F�8�#?�@�A�$�����T�3�3�D�8�6�AR�3�S�T�%��L�L�F�8�:�.�/�
����x�x�(�)�
����x�v�&�'��y�y���r&c�.:�U]6�cPgQRZQRZQRZ-!)rr~r�ro)rr)r!r"s"�r#r$�,_HtmlRenderer._render_file_item.__annotate__/s"���%�%�i�%��%�c�%r&c��[OUO2o[OUO2oUOQ*o[UO]d2oUOUO*oUO]6XcPLQoUQUQUQUQUQUQUOQ	
Q
UQUQUQ
UOQUQ
QUQ0!)z�Render a single file item with heatmap bar.

Args:
    stat: FileStats object
    indent: Indentation string

Returns:
    HTML string for file item
�Y@�sz<div class="file-item">
z  <a href="z" class="file-link" title="u">📄 z</a>
z  <span class="file-samples">r�z samplez</span>
zL  <div class="heatmap-bar-container"><div class="heatmap-bar" style="width: zpx; height: zpx;" data-intensity="�.3fz"></div></div>
z</div>
)	r�r�rrr�minr�rr�)	rGr~r��	full_pathr�	intensity�	bar_width�	html_filer�s	&&&      r#r��_HtmlRenderer._render_file_item/s���K�K��
�
�.�	��k�k�$�"2�"2�3���O�O�e�+�	������-�	��O�O�D�M�M�2�	��$�$��)�B�s���(�3��(�+�i�[�0K�I�;�V]�^i�]j�jp��(�7��8J�8J�1�7M�W�UV�TW�W`��(�f�gp�fq�q}�C�V�V�~W�Wl�mv�wz�l{�{K��(�(�	$�	%r&r�r�)�)r(r)r*r+r,rHr�r�r�r.r/r0s@r#r�r��s7����7�%�%�:#�:#�x, �, �\%�%�%r&r�c�p``�\sQsQsnQsQsU1QksQ)QksQ*QksQs	Q+Qks
Q,Q	ksQ
sQ*Qks
QsQ
sU1QkQksU1QkQksU1QkQksU1QkQksU1QkQksU1QkQksU1QkQksU1QkQksU1QkQksU1Q kQ!ksU1Q"kQ#ksU1Q$kQ%ksU1Q&kQ'ksQ(sUsU9s!)-�HeatmapCollector�MaCollector that generates coverage.py-style heatmap HTML output with line intensity.

This collector creates detailed HTML reports showing which lines of code
were executed most frequently during profiling, similar to coverage.py
but showing execution "heat" rather than just coverage.
zfile_{:04d}.htmlc��:�[RU_U-U@[O2Um[O
[O2Um[O2Um[O
[O2Um[O
[2Um
[O
[2Um-Um-Um
[O2Um[O
[2Um]Um[%2Um-UmP
Um[-2Um-Um[2UmP!)zCInitialize the heatmap collector with data structures for analysis.)�superrH�collections�Counter�line_samples�defaultdict�file_samples�line_self_samples�file_self_samples�set�
call_graph�
callers_graph�function_definitions�line_to_function�edge_samplesr;�line_opcodes�_total_samplesr�
_path_infor��opcodes_enabledr=�_template_loaderr��_seen_lines)rG�args�kwargs�	__class__s&*,�r#rH�HeatmapCollector.__init__Xs���
���$�)�&�)�(�/�/�1���'�3�3�K�4G�4G�H���!,�!4�!4�!6���!,�!8�!8��9L�9L�!M���&�1�1�#�6���(�4�4�S�9���$&��!�!#���(�/�/�1���
(�3�3�D�9��� ���.�0�����
� %���!0� 1�������5��r&c���QUQUQUQUQUQ[OQ[O2Q[O2-UmUOOU2P!)	awSet profiling statistics to include in heatmap output.

Args:
    sample_interval_usec: Sampling interval in microseconds
    duration_sec: Total profiling duration in seconds
    sample_rate: Effective sampling rate
    error_rate: Optional error rate during profiling
    missed_samples: Optional percentage of missed samples
    **kwargs: Additional statistics to include
�sample_interval_usec�duration_sec�sample_rate�
error_rate�missed_samples�python_version�python_implementation�platform)�sys�versionrrr��update)rGrrrrr	rs&&&&&&,r#�	set_stats�HeatmapCollector.set_stats�s`��
#�$8��L��;��*��n��c�k�k�#�X�%C�%C�%E���)�)�+�	
��
�	
�
�
���&�!r&c��U9OU*
tmUOO2[U2FCDvovqVqx[	U2vq�q�UOVY2%fJ1U]6Ho
VY1oV�O7oU%cUOO
U2UOVYV}V�Q5UdP	UmUOVYUV�UUQ5U]*[U26fJ�V]**o[U]*2oUOVYU1U]*UU]*1UQ5CJ	P!)a{Process stack frames and count samples per line.

Args:
    frames: List of (filename, location, funcname, opcode) tuples in
            leaf-to-root order. location is (lineno, end_lineno, col_offset, end_col_offset).
            opcode is None if not gathered.
    thread_id: Thread ID for this stack trace
    weight: Number of samples this stack represents (for batched RLE)
)�is_leaf�count_cumulative�weight)r)
r�r��clearrzr	�_is_valid_frame�add�_record_line_sampler��_record_bytecode_sampler{r
�_record_call_relationship)rG�frames�	thread_idrr�r�location�funcname�opcode�lineno�
end_lineno�
col_offset�end_col_offsetr�line_keyr�
next_frame�next_linenos&&&&              r#�process_frames�HeatmapCollector.process_frames�sF��	
���v�%������� �9B�6�9J�9J�5�A�5��H�=O�PX�=Y�:�F�
��'�'��9�9���A�v�G� �)�H�'�/?�/?�?���� � �$�$�X�.��$�$�X�x�6F�
%�
W��!�'+��$��,�,�X�v�-7�^�4:�-�<�
�1�u�s�6�{�"�#��E�]�
�,�Z��]�;���.�.��x�0���]�K��A��?�!�/��9:Kr&c��U%c/UOQ2%fUOQ2%cP
!UQ6Xc
U]6XcP
!P	!)z3Check if a frame should be included in the heatmap.�<�[rH)�
startswith)rGrr!s&&&r#r� HeatmapCollector._is_valid_frame�s@���8�.�.�s�3�3�x�7J�7J�3�7O�7O���z�!�f��k��r&c���U%cGUOV199*U*
tt$UOU*U99*U*
tt$U%cGUOV199*U*
tt$UOU*U99*U*
tt$U%c"V1UO7cV OV1$U%cV0O
V1$P!P!)z$Record a sample for a specific line.)r�r�r�r�r�r�)rGrr!rrrrs&&&&&&&r#r�$HeatmapCollector._record_line_sample�s�������x�0�1�V�;�1����h�'��/�6�9�/���"�"�H�#5�6�&�@�6��"�"�8�,�V�4��>�4���,�D�4M�4M�M�>D�%�%�x�&:�;��8@�!�!�8�"4�5�r&c�`�V1oV0OU*7c#Q]Q[2-UOU*U$UOU*U*Q99*U*
tt$Ud@U]6�c7VEU1o	UOU*U*Q*OU	2P!P!P!)a�Record a sample for a specific bytecode instruction.

Args:
    filename: Source filename
    lineno: Line number
    opcode: Opcode number being executed
    end_lineno: End line number (may be -1 if not available)
    col_offset: Column offset in UTF-8 bytes (may be -1 if not available)
    end_col_offset: End column offset in UTF-8 bytes (may be -1 if not available)
    weight: Number of samples this represents (for batched RLE)
r7�	locations)r�r�r)
rGrr!r r"r#r$rr��loc_keys
&&&&&&&&  r#r�(HeatmapCollector._record_bytecode_sample�s���� ���*�*�3�/�/�.5�q�+�s�u�-M�D���c�"�6�*����#��v�&�w�/�6�9�/��!�j�A�o�!�~�>�G����c�"�6�*�;�7�;�;�G�D�'6�!r&c�F�V1oUOOU-2o,oUO2FD�vqg[U2o[	U[
2%ctUOQ]2o	UOQ[
22o
[	U
[2%c/S
Tt,tFD oQU]*QU]*QU]*-MJ"	ooLS
oLSo	,oUOQUQ[U2QUQ*Q	UQ	*Q
U	QU-2J�	UOQQ5U!ttoh)
z�Get bytecode disassembly data for instructions on a specific line.

Args:
    filename: Source filename
    lineno: Line number

Returns:
    List of dicts with instruction info, sorted by samples descending
r7r2r"r#r$r �opname�base_opname�is_specializedr6c�*�UQ*'UQ*1!)r6r r'r�s&r#r��>HeatmapCollector._get_bytecode_data_for_line.<locals>.<lambda>2s��A�i�L�=�!�H�+�">r&)r�)
r��getrxr�
isinstancer;r�rwr�sort)
rGrr!r��opcode_data�resultr �data�infor7�
raw_locations�locr2s
&&&          r#�_get_bytecode_data_for_line�,HeatmapCollector._get_bytecode_data_for_lines0��� ���'�'�+�+�C��4����'�-�-�/�L�F�"�6�*�D��$��%�%�����!�,�� $����c�e� <�
��m�S�1�1�$1�!�#0�C�&�s�1�v�|�S��V�EU�WZ�[\�W]�^�#0��!�I�
!.�I����	��M�M��&��-��/��t�M�2� �$�'7�"8��5��Y�
�
�%0�8	���>��?��
��+!s�(Dc��UvqEoUvqxo	UOQ2%fUOQ2%cP!UOOVF1U2o
Vx1oVJU1oUOU*O	U2VJ1o
VxU	1oUO
U
*O	U2V�1oUOU99*U*
tt$P!)z:Record caller/callee relationship between adjacent frames.r+r,)r-r�r;r�rr�r�)rG�callee_frame�caller_framer�callee_filename�
callee_lineno�callee_funcname�caller_filename�
caller_lineno�caller_funcname�callee_def_line�
caller_key�callee_info�
callee_key�caller_info�edge_keys&&&&            r#r�*HeatmapCollector._record_call_relationship5s���:F�7���:F�7����%�%�c�*�*�o�.H�.H��.M�.M���3�3�7�7�
�.�
�
��
&�5�
�&��I�����
�#�'�'��4�&�7�
�&��G�����:�&�*�*�;�7��+�����(�#�v�-�#r&c�f�UO%f[Q2P
!UOU2oUO2oUO	U2UOV#2UO
UQ*U2UOV#2P	![co[QS02gPo=hh9h)z|Export heatmap data as HTML files in a directory.

Args:
    output_path: Path where to create the heatmap output directory
z"Warning: No heatmap data to export�
index.htmlz!Error: Failed to export heatmap: )	r�r^�_prepare_output_directory�_calculate_file_stats�_create_file_index�_generate_file_reports�_generate_index_html�_print_export_summary�	Exception)rG�output_path�
output_dirrnris&&   r#�export�HeatmapCollector.exportQs���� � � ��6�7��	��7�7��D�J��3�3�5�J��#�#�J�/�
�'�'�
�?�
�%�%�j�<�&?��L��&�&�z�>����	��5�a�S�9�:���	�s�A-B�	B0�B0�B+�+B0c���[U2oUOQ6XcUOP2oUOP	P	Q5U![[
1co[
QSQS02SgPo=hh9h)z*Create output directory for heatmap files.z.html)�exist_ok�parentsz"Failed to create output directory �: )r�suffix�with_suffix�mkdirr]�OSErrorr_)rGr_r`ris&&  r#rX�*HeatmapCollector._prepare_output_directoryms����+�&�
�����'�#�/�/��3�J�	^����d�D��9������!�	^��!C�J�<�r�RS�QT�U�V�\]�]��	^�s�A�A-�A-�A(�(A-c�2:�U]6�cPgQRZRZ*-!�rrn�rr)r!r"s"�r#r$�0HeatmapCollector._create_file_index.__annotate__zs���
�
�T�)�_�
r&c	��[U2TTt-tFD+vq#UOUOOU2aJ-	tooUmP!ttooh)z1Create mapping from filenames to HTML file names.)rzr�FILE_INDEX_FORMATr!r�)rGrnr�r~s&&  r#rZ�#HeatmapCollector._create_file_indexzsI��%�Z�0�
�0���
�M�M�4�1�1�8�8��;�;�0�
����
s�3A
c�2:�U]6�cPgQRZRZ*-!rmrn)r!r"s"�r#r$�4HeatmapCollector._generate_file_reports.__annotate__�s�����T�)�_�r&c	���SFD�oVOUO**oUOUO*oUO2TTt-tFDvqgU]6�fJVgaJ	oooUOOUO-2o	U	O2TTt-tFDvqgU]6�fJVgaJ	o
ooUO
UUOUU
U2J�	P!ttoohttooh)z*Generate HTML report for each source file.)r�rr�rxr�r;�_generate_file_html)rGr`rnr~�	file_path�line_counts�liner7�valid_line_counts�self_counts�valid_self_countss&&&        r#r[�'HeatmapCollector._generate_file_reports�s����D�"�_�_�T�]�]�%C�C�I��+�+�D�M�M�:�K�@K�@Q�@Q�@S� a�@S���W[�_`�W`����@S�� a��0�0�4�4�T�]�]�B�G�K�@K�@Q�@Q�@S� a�@S���W[�_`�W`����@S�� a��$�$���
�
�!�!��
���!b��!bs�
C-
�,C-
�-
C3
�?C3
c�2:�U]6�cPgQRZRZ*-!rmrn)r!r"s"�r#r$�3HeatmapCollector._print_export_summary.__annotate__�s���@�@�D��O�@r&c��[QUQ02[QUQ*02[U2]6XcPLQo[Q[U2QUQ02P!)	z"Print summary of exported heatmap.zHeatmap output written to �/z  - Index: rWr�z  - z source filez	 analyzed)r^r{)rGr`rnr�s&&& r#r]�&HeatmapCollector._print_export_summary�sW��
�*�:�,�a�8�9�
��J��5�6�7�8��j�/�Q�&�B�C��
��S��_�%�\�!��I�>�?r&c�2:�U]6�cPgQRZRZ*-!�rrorn)r!r"s"�r#r$�3HeatmapCollector._calculate_file_stats.__annotate__�s���/�/�t�I��/r&c��,oUOO2FCDpvq#UQ7f/UOQ2%fUOQ2%cJ=UO2TTt-tFDvqEU]6�fJVEaJ	oooU%fJtUOO	U-2oUO2TTt-tFDvqEU]6�fJVEaJ	ooo[UO
22o	[UO
22o
[U2o[UO
22oU%c[UO
22L]o
[V O2vq�UO[UUUU	U
UUU
QQ5	2CJs	UOQP	Q5U%cFU]*OoSFD+oU]6�cUOU*]d*L]UmJ-	U!ttoohttooh)zdCalculate statistics for each file.

Returns:
    List of FileStats objects sorted by total samples
r+r,r)	rrrrrrrrrc��UO!r�r�r�s&r#r��8HeatmapCollector._calculate_file_stats.<locals>.<lambda>�s��a�o�or&r���~z...rv)r�rxr-r�r;�sumr�r{�maxrr�rwrr=rr)rGrnrrxryr7rz�self_line_countsr|rrrrrrr�	max_totalr~s&                 r#rY�&HeatmapCollector._calculate_file_stats�s����
�%)�%6�%6�%<�%<�%>�%>�!�H��,�,��0C�0C�C�0H�0H�H�L_�L_�`c�Ld�Ld��AL�@Q�@Q�@S� a�@S���W[�_`�W`����@S�� a�$�� $�5�5�9�9�(�B�G��@P�@V�@V�@X� f�@X���\`�de�\e����@X�� f�� 1� 8� 8� :�;�M�!$�%6�%=�%=�%?�!@���-�.�I��/�6�6�8�9�K�BS�s�#4�#;�#;�#=�>�YZ��':�8�_�_�'U�$�K����i�!�'�'�+�#5�#�'�!1��
�

�+&?�D	���5�t��D��"�1�
�3�3�I�"��LU�XY�M�4�#5�#5�	�#A�C�#G�_`���#����E!b��!gs�.
G7
�G7
�
G=
�G=
c�8:�U]6�cPgQRZQRZRZ*-!)r�
index_pathrn)rrr)r!r"s"�r#r$�2HeatmapCollector._generate_index_html.__annotate__�s'���CW�CW�t�CW��i��CWr&c���[OU2o[UO2oUO	U2oUO
O
Q2oUd2[U2Q0o[U]d2oU]6cQo	LU]6cQo	L	Qo	LQo]oQo	UO
O
Q2o
U
d2[U
2Q0o[U
]d2oU
]6cQo
LU
]6cQo
L	Qo
LQo]oQo
QQ	UOOQ
0QQUOOQ
0QUOOQ[OOQ[OO 0Q[#U2Q
QUO$Q
Q[UO
O
Q]22Q[UO
O
Q]22QUQ['U2QU	QUQ['U2QU
QU-oUOO(oUO+2FDvooUO-UU2oJ	UO/UQQ 5P![0[21co[5Q!SQ"S02SgPo=hh9h)#z4Generate index.html with list of all profiled files.r�%�good�warning�errorzN/Ar	�<!-- INLINE_CSS -->�<style>
�	
</style>�<!-- INLINE_JS -->�	<script>
�

</script>�<!-- PYTHON_LOGO -->�<!-- PYTHON_VERSION -->rvz<!-- NUM_FILES -->r��<!-- TOTAL_SAMPLES -->z<!-- DURATION -->rz<!-- SAMPLE_RATE -->rz<!-- ERROR_RATE -->z<!-- ERROR_RATE_WIDTH -->z<!-- ERROR_RATE_CLASS -->z<!-- MISSED_SAMPLES -->z<!-- MISSED_SAMPLES_WIDTH -->z<!-- MISSED_SAMPLES_CLASS -->z<!-- SECTIONS_HTML -->rLrMzFailed to write index file rf)rlr�r�r�r�r�r;rr�r�rArBrEr
�version_info�major�minorr{r�rr?rx�replace�
write_textr]rjr_)rGr�rnr��renderer�
sections_htmlr�error_rate_str�error_rate_width�error_rate_classr	�missed_samples_str�missed_samples_width�missed_samples_class�replacements�html_content�placeholder�valueris&&&                r#r\�%HeatmapCollector._generate_index_html�s����+�+�J�7��!����1�� �9�9�$�?�
��Z�Z�^�^�L�1�
��!� #�J��0��2�N�"�:�s�3���A�~�#)� ��b��#,� �#*� �"�N� ��%�������(8�9���%�$'��$7�#8��!:��#&�~�s�#;� ���!�'-�$��"�$�'0�$�'.�$�!&��#$� �#)� �
"�Y�t�/D�/D�/N�/N�.O�z�#Z� �J�t�/D�/D�/M�/M�.N�k�"Z�"�D�$9�$9�$C�$C�%�#�*:�*:�*@�*@�)A��3�CS�CS�CY�CY�BZ�'[� �S��_�Q�$7�$��)<�)<�Q�(?���T�Z�Z�^�^�N�A�%F�!G�"�C��
�
���}�a�(H�$I�!�>�'��-=�)>�'�)9�%�'9�+�S�1E�-F�+�-A�$�m�
��$�,�,�;�;��".�"4�"4�"6��K��'�/�/��U�C�L�#7�	W��!�!�,��!�A����!�	W��!<�Z�L��1�#�N�O�UV�V��	W�s�5I
�
I2�I2�I-�-I2c
�f:�U]6�cPgQRZQRZQRZRZRZ1*QRZRZRZ1*QRZ-!)rr_rrxr{r�)rrrrr)r!r"s"�r#r$�1HeatmapCollector._generate_file_html.__annotate__sJ���-R�-R�t�-R�s�-R�'+�C��H�~�-R�DH��c��N�-R�%.�-Rr&c�b�[U2OQQQ5O2oU%c[UO22L]oU%c[UO22L]o	[U]Q
5T
Tt,tFDvq�UOV�V4V�U2MJ	oo
oQ[OU2QUOQ

QUOQ

QUO Q

Q[#UO$]2QUO&Q

QUO(Q

QPO+U2QQUO,O.Q0QQUO,O0Q0QUO,O2Q6O8Q[4O6O:0-o
UO,O<oU
O?2FDvooUOAUU2oJ	UOCUQQ5P![[1choSOQ2%f@SOQ2%f)SQ7f"[
S2]6f[QSQS02Q	S0,oPo=CKKPo=hh9httoo
h[[1co[EQSQS02SgPo=hh9h)z=Generate HTML for a single source file with heatmap coloring.rLr�)rN�errorsr+r,rvz$Warning: Could not read source file rfz# Source file not available: )�startz<!-- FILENAME -->r�r�z<!-- TOTAL_SELF_SAMPLES -->z<!-- NUM_LINES -->z<!-- PERCENTAGE -->z<!-- MAX_SAMPLES -->z<!-- MAX_SELF_SAMPLES -->z<!-- CODE_LINES -->r�r�r�r�r�r�r�r�rMzFailed to write file r�)#rrW�
splitlinesr]rjr-r{r^r�r�rz�_build_line_htmlr�r�rrrrrrrr�r�rCrDrEr
r�r�r�r@rxr�r�r_)rGr_rrxr{r��source_linesrirr�line_num�line_content�code_lines_htmlr�r�r�r�s&&&&&&           r#rv�$HeatmapCollector._generate_file_htmls���
	H���>�3�3�W�Y�3�W�b�b�d�L�4?�c�+�,�,�.�/�A��8C�3�{�1�1�3�4���+4�L��*J�
�+K�&��
�!�!�(�+� +�x�
I�*J�	�
�
 ����X�!6�$��)@�)@��(C�)�i�.J�.J�1�-M� �Y�%8�%8��$;�!�3�y�';�';�Q�#?�"�y�'<�'<�Q�&?�'�I�,F�,F�q�+I�!�2�7�7�?�#;�!�Y�t�/D�/D�/M�/M�.N�j�#Y� �J�t�/D�/D�/L�/L�.M�[�"Y�"�D�$9�$9�$C�$C�%�#�*:�*:�*@�*@�)A��3�CS�CS�CY�CY�BZ�'[�

���,�,�:�:��".�"4�"4�"6��K��'�/�/��U�C�L�#7�	R��"�"�<�'�"�B��I��!�	H��'�'��,�,��0C�0C�C�0H�0H�� 1�1�S��]�Q�5F��<�X�J�b���L�M�;�H�:�F�G�L��		H��
��8��!�	R��!6�{�m�2�a�S�I�J�PQ�Q��	R�sY�*H�!J�0J�I=�I=�I8�-I8�I8�I8�I8�8I=�J.�J.�J)�)J.c�x:�U]6�cPgQRZQRZQRZRZRZ1*QRZRZRZ1*QRZQRZQRZQRZ-!)	rr�r�rxr{rrrro)rrr)r!r"s"�r#r$�.HeatmapCollector._build_line_html.__annotate__?se���]
�]
��]
�C�]
�%)�#�s�(�^�]
�BF�s�C�x�.�]
�%(�]
�<?�]
�KN�]
�SV�]
r&c��UOU]2oUOU]2o	U]6�c�[OU]*2o
[OU]*2oU]6�c	V�*L]oU	]6�cTU]6�cM[OU	]*2o
[OU]*2oU]6�c	V�*L]oL]oU	]6�cU	Q
LPoUQ
oQU	Q
QUQ
0oL
]o]oPoPoPoUOVq2o[	U2]6�9%cU]6�oPoPoU%c�[
O[OU22o[QU22o[QU22oU]6�c[]dU*U*2L]oQUQUQ0oQ	UQ
UQ0oLUO%cQoUOVq2oUOV!UU2oU%cQ
[
OU2Q0LPoPoU%cUOW2oQUQ0oQUQ
QUQ
QUQUQUQUQUQUQUQUQUQU0!)z,Build HTML for a single line of source code.r�zSelf: z	, Total: c3�>�SF �DpQ*w�	J	P!3hr�r'��.0�ds& r#�	<genexpr>�4HeatmapCollector._build_line_html.<locals>.<genexpr>hs��m���m��)���m���c3�`�SF �DpQ*%fJUQ*w�	J!	P!3h)r8r6r'r�s& r#r�r�is!��M���M�q�O_�M`�M`�l�a�	�l�l�M�s�.�.z/<button class="bytecode-toggle" data-bytecode='z' data-spec-pct="zG" onclick="toggleBytecode(this)" title="Show bytecode">&#9654;</button>z;        <div class="bytecode-wrapper" id="bytecode-wrapper-z�">
            <div class="bytecode-columns"><div class="line-number"></div><div class="line-samples-self"></div><div class="line-samples-cumulative"></div></div>
            <div class="bytecode-panel" id="bytecode-z"></div>
        </div>
z#<div class="bytecode-spacer"></div>z title="�"zdata-spec-color="z" z4        <div class="code-line" data-self-intensity="r�z" data-cumulative-intensity="z	id="line-z'>
            <div class="line-number">z2</div>
            <div class="line-samples-self">z8</div>
            <div class="line-samples-cumulative">z</div>
            z'
            <div class="line-content">z
        </div>
)r;�math�logrDr{r�r��json�dumpsr�rr��_build_navigation_buttons�_render_source_with_highlights�_format_specialization_color) rGr�r�rxr{rrr�cumulative_samples�self_samples�log_cumulative�log_max�cumulative_intensity�log_self�log_max_self�self_intensity�self_display�cumulative_display�tooltip�
bytecode_data�has_bytecode�bytecode_btn_html�bytecode_panel_html�
bytecode_jsonr�specialized_samples�spec_pct�nav_buttons_html�	line_html�
title_attr�spec_color_attr�
spec_colors &&&&&&&&                        r#r��!HeatmapCollector._build_line_html?s���)�_�_�X�q�9��"���x��3����!�!�X�X�&8�1�&<�=�N��h�h�{�Q��/�G�?F��{�>�#;�PQ� ��a��$4�q�$8��8�8�L�1�$4�5��#�x�x�(8�1�(<�=��<H�1�<L��!8�RS��!"��2>��2B�l�1�-��L�$6�q�#9���|�A�.�i�8J�1�7M�N�G�#$� ��N��L�!#���G��8�8��L�
��=�)�A�-�H�H�2D�q�2H���� ��� �K�K��
�
�=�(A�B�M� �D�m�D�D�M�"%�%a�M�%a�"a��IV�YZ�IZ�s�3�!4�4�}�D�E�`a�H�C�=�/�R"�"*��,X�Y�
�N�h�Z�XH�IQ�z�R#�
$�
 ��
!�
!�
!� E�� �9�9�(�M���7�7��9A�=�R�	�;B�x����G� 4�5�Q�7��
�����:�:�8�D�J� 1�*��R�@�O�$�$2�3�#7�8*�*>�s�)C�2�����z��:�,�/4�4<�:�>:�:F��H@�@R�?S�T�,�-�.5�5>�K�@�+�,�-�"�#�
%�	
r&c
�::�U]6�cPgQRZQRZQRZQRZQRZ-!)rr�r�rr�ro)rrr:)r!r"s"�r#r$�<HeatmapCollector._render_source_with_highlights.__annotate__�s:���Z�Z�3�Z�#�Z�25�Z�FJ�Z�OR�Zr&c	�2``````�UOQ2oU%fP!-nSFD�oUOQ]2oUOQP2oUOQ,2FD�o	U	OQU2U6XfJU	OQP2U	OQP2q�U
]6�fJHU]6�fJQV�1oUR7c
Q]Q,-RU$RU*Q99*U*
tt$U%fJ�URU*Q*7fJ�RU*Q*OU2J�	CJ	R%f[OU2!-o
RO2FDKvq�[
V�2FD6oV�7cV�1V�$JV�*vooV�*
UU*
6fJ1V�1V�$J8	JM	[Q	RO222nR%c [Q
RO222L]n,n]o]oPn,nUUUUUU1QkoU[U26cjUU*o[UOQ22oU
OU2oUR6wc
U2UnROU2UU*
oU]*
oJyU2POR2!)
z�Render source line with instruction highlight spans.

Simple: collect ranges with sample counts, assign each byte position to
smallest covering range, then emit spans for contiguous runs with sample data.
rQr6r6r2r"r#r$�opcodesc3�>�SF �DpQ*w�	J	P!3hr�r'r�s& r#r��BHeatmapCollector._render_source_with_highlights.<locals>.<genexpr>�s��7J���7J�!�9���7J�r�c3�>�SF �DpQ*w�	J	P!3hr�r'r�s& r#r�r��s��6I���6I��)���6I�r�c�j:�R	%Cc([OPOR	22oR%c�RORQ]Q,-2oUQ*oQOUQ*Q*2o[	UQ*2]6�c%UQ[	UQ*2]*
Q0*
oR
]6�c[]dU*R
*2L]oRO
QR]*QR]*Q	UQ
RQUQ[OU2Q
UQ02LRO
U2,n	P!P!)r�r6r�r�:N�Nz +z morez)<span class="instr-span" data-col-start="z" data-col-end="z" data-samples="z" data-max-samples="z" data-pct="z" data-opcodes="r�r�)r�r�r�r;r{rrw)�textr@r6r��pct�
current_range�max_range_samples�
range_datar?�
span_chars�total_line_sampless     ������r#�
flush_span�CHeatmapCollector._render_source_with_highlights.<locals>.flush_span�s8����z��{�{�2�7�7�:�#6�7�� �%�>�>�-�)�Q�	�SU�9V�W�D�"�9�o�G�"�i�i��Y���(;�<�G��4�	�?�+�a�/��R��D��O�(<�q�(@�'A��#G�G��EW�Z[�E[�#�c�G�m�.@�@�A�ab�C��M�M�%5�5B�1�5E�4F�G3�3@��3C�2D�E3�3:�)�<7�7H�6I�J/�/2�e�43�37�;�;�w�3G�2H��4�&�PW�
#Y�Z��M�M�$�'��
�%r&rL)
�rstripr;rwr�r��keys�ranger�r�r�r{�encoder�)rGr�r�rr��content�instrr6r6rCr��endr��
byte_to_range�pos�	old_start�old_end�byte_offset�char_idxr��char�
char_bytes�
char_ranger�r�r�r?r�r�s&&&&&                  @@@@@@r#r��/HeatmapCollector._render_source_with_highlights�sW����%�%�d�+�����
�"�E��i�i�	�1�-�G��Y�Y�x��,�F��y�y��b�1���7�7�<��2�h�>�!$����r�!:�C�G�G�DT�VX�<Y�3���z�c�Q�h�$�l���j�0�/8�!�Y��.K�J�s�O�"�3��	�2�g�=�2�!�6�f�J�s�O�I�4N�&N�&�s�O�I�6�=�=�f�E�2�#���;�;�w�'�'��
�&�O�O�-�L�U��U�(���+�*/��M�&�*7�);�&�I�w����)�(;�<�.3�\�
�*�)�.�!� K�z�7H�7H�7J� K�K��NX�C�J�j�6G�6G�6I�J�J�^_���������
��
�	 �	 �,��W��%��8�$�D��T�[�[��1�2�J�&�*�*�;�7�J��]�*��� *�
����d�#��:�%�K���M�H����w�w�v��r&c�(:�U]6�cPgQRZQRZ-!)rr�ro)rr)r!r"s"�r#r$�:HeatmapCollector._format_specialization_color.__annotate__�s���/�/�S�/�S�/r&c	���UQ*oUQ6�c]UQ*
]*o[]�]U*
*2o[]�]KU**2o[]2]U*
*2oLTU]*o[]�]aU**2o[]�]U**2o[]�]lU**
2oQQU**oQUQUQUQUQ0	!)zwFormat specialization color based on percentage.

Uses a gradient from gray (0%) through orange (50%) to green (100%).
r�g�?g333333�?g�?zrgba(r��))r)rGr��ratio�t�r�g�b�alphas&&      r#r��-HeatmapCollector._format_specialization_color�s����5� ���C�<�����!�A��C�1�q�5�M�"�A��C�"�q�&�L�!�A��B�!�a�%�L�!�A���	�A��C�"�q�&�L�!�A��C�"�q�&�L�!�A��C�#��'�M�"�A��t�e�|�#���q�c��A�3�b���2�e�W�A�.�.r&c�.:�U]6�cPgQRZQRZQRZ-!)rrr�ro)rr)r!r"s"�r#r$�7HeatmapCollector._build_navigation_buttons.__annotate__s"���'�'�#�'��'��'r&c���V1oUOOU2oU%cUUOOV1U2oV1oUOUOOU[222oL3UOUOOU[222oUOUOOU[222oU%c"UOOV1U2oV1o	LSo	UOV�P	Q5o
UOV8P
Q5oUOU
QQ2oUOUQQ2o
U%f	U
%c	QUU
Q0!P!)z�Build navigation buttons for callers/callees.

- Callers: All lines in a function show who calls this function
- Callees: Only actual call site lines show what they call
)�	is_caller�calleru▲�calleer�z<div class="line-nav-buttons">r�)	r�r;r��_deduplicate_by_functionr�r�r��_get_edge_counts�_create_navigation_button)rGrr�r%r�
func_def_line�func_def_key�caller_list�callee_list�caller_edge_key�callers_with_counts�callees_with_counts�
caller_btn�
callee_btns&&&           r#r��*HeatmapCollector._build_navigation_buttonsse���'���(�(�,�,�X�6��� �5�5�9�9�8�:N�PX�Y�M�$�4�L��7�7��8J�8J�8N�8N�|�]`�]b�8c�d�K��7�7��8J�8J�8N�8N�x�Y\�Y^�8_�`�K��3�3�D�O�O�4G�4G��RU�RW�4X�Y��� �5�5�9�9�8�:N�PX�Y�M�'�7�O�&�O�"�3�3�O�\`�3�a��"�3�3�H�UZ�3�[���3�3�4G��SX�Y�
��3�3�4G��SX�Y�
���3�J�<�
�|�6�R�R�r&c
�:�U]6�cPgQRZRZRZ1*QRZRZRZRZRZ1**QRZQRZRZRZRZRZRZ1**-!)rr%rxrro)rrrr�bool)r!r"s"�r#r$�.HeatmapCollector._get_edge_counts.__annotate__;sW������s�C�x���#�E�#�s�C�-�$8�9��#'��,0��s�C��c�7I�1J�,K�r&c���,oSFDGvqVoVV1oU%cV�1o	LV1o	UOOU	]2o
UOVVVz12JI	UOQP	Q5U!)z.Get sample counts for each caller/callee edge.c��U]*!)r�r'r�s&r#r��3HeatmapCollector._get_edge_counts.<locals>.<lambda>Js��!�A�$r&r�)r�r;rwr=)rGr%rxrr?r�ry�func�
edge_line_keyrTr7s&&&&       r#r�!HeatmapCollector._get_edge_counts;sr���� %��D��!�L�M��)�4��$�4���%�%�)�)�(�A�6�E��M�M�4�t�3�4�!&�	������5��
r&c�L:�U]6�cPgQRZRZRZRZRZ1**-!r��rrrr)r!r"s"�r#r$�6HeatmapCollector._deduplicate_by_function.__annotate__Ms$���
�
��e�C��c�M�6J�1K�
r&c�n�-o,oSFD(vqEoVF1oVr7fJP	V'$UOVEU12J*	U!)z~Remove duplicate entries based on (file, function) key.

Args:
    items: Iterable of (file, line, func) tuples (set or list)
)rw)rGrx�seenr?r�ryr1r�s&&      r#r�)HeatmapCollector._deduplicate_by_functionMsH������ %��D���,�C��� ��	��
�
�t�4�0�1�	!&�
�
r&c�b:�U]6�cPgQRZRZRZRZRZRZ1**QRZQRZQRZ-!)r�items_with_counts�	btn_class�arrowror5)r!r"s"�r#r$�7HeatmapCollector._create_navigation_button.__annotate__\sG���w�w�4��c�3�PS�UX�FX�@Y�;Z�w�,/�w�8;�w�@C�wr&c�6�STTTTt,tFD%vqEqgV@O7fJU]6�fJ!VEVg1MJ'	oooooU%fP![U2]6Xc�U]*vq�q�UOU	*o
[OQU
QU
0QU-2oQUQ[O
U2QUQ
Q0oQ	UQ
[O
U2QUQUQ
0	![
QU22oST	T
TTt,tFDCvq�q�Q[OOU	2QUQUQUOU	*QU
0-MJE	ooo
o	o[O
[OU22o[U2QUQUQ
Q0oQ	UQUQUQUQ
0	!ttoooohttooo
o	h)z7Create HTML for a navigation button with sample counts.�linkz#line-r1zGo to rfz (r�z	 samples)z<button class="nav-btn z" data-nav='z	' title="r�z	</button>c3�:�SF �DvqUw�	J	P!3hr�r')r��_�cnts&  r#r��=HeatmapCollector._create_navigation_button.<locals>.<genexpr>ms��K���K�L�A�q�!�C�K�s�r�r7r�zs (z" data-nav-multi=')
r�r{r�r�r�r�r��os�path�basename)rGr;r<r=�f�l�fnrC�valid_itemsr�ryr1r7�target_html�nav_data�titler�
items_data�
items_jsons&&&&               r#r �*HeatmapCollector._create_navigation_button\s���=N�9�<M�=�1���o�o�-�'�23�a�%�'��b��<M��9����{��q� �&1�!�n�#�D���/�/�$�/�K��z�z�6�k�]�&���+G��QU�"V�W�H��Y�K�r�$�+�+�d�*;�)<�B�u�Q�i�y�Q�E�,�Y�K�}�T�[�[�QY�EZ�D[�[e�fk�el�ln�ot�nu�u~����@�K�@�@�
�,7�
�,7�'��D�����(�(��.������4�?�?�4�0�1���v�>�	
�,7�	�
��[�[����J�!7�8�
��z�?�#�1�Y�K�s�=��2C�9�M��(���3F�z�l�R\�]b�\c�ce�fk�el�lu�v�v��39��
s�F
�F
�F
�-AF
)r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�)NNr�)FTr�)NNNr�) r(r)r*r+r,rqrHrr(rrrrDrrarXrZr[r]rYr\rvr�r�r�r�rrr r.r/�
__classcell__)rr"s@@r#r�r�Ms������+��+!�Z"�.-�^
�A�*E�8+�Z.�8�8�
�
���$@�@�/�/�bCW�CW�J-R�-R�^]
�]
�~Z�Z�x/�/�0'�'�R��$
�
�w�w�wr&r�)+r,rXr�r��importlib.resourcesrTr��localer�rEr�siter
�dataclassesrr�pathlibr�typingrrr�
_css_utilsr�
_format_utilsr�	collectorr	r
�opcode_utilsrr�stack_collectorr
�module_utilsrrrr2r=rlr�r�r'r&r#�<module>r_s���Z�
�����
��	���
�(��$�$�(��9�8�0�C��
�
��
��B�B��B�0U�0U�fJ)�J)�ZM%�M%�hlw�*�lwr&

Youez - 2016 - github.com/yon3zu
LinuXploit