repo
stringclasses
454 values
file_path
stringlengths
5
201
extension
stringclasses
1 value
content
stringlengths
8
509k
num_lines
int64
3
16.9k
size_bytes
int64
8
511k
Qwen3
examples/demo/cli_demo.py
.py
# Copyright (c) Alibaba Cloud. # # This source code is licensed under the license found in the # LICENSE file in the root directory of this source tree. """A simple command-line interactive chat demo.""" import argparse import os import platform import shutil from copy import deepcopy from threading import Thread im...
298
9,498
Qwen3
examples/gcu-support/gcu_demo.py
.py
try: import torch_gcu # 导入 torch_gcu from torch_gcu import transfer_to_gcu # transfer_to_gcu except Exception as e: print(e) from transformers import AutoModelForCausalLM, AutoTokenizer model_name = "Qwen/Qwen2.5-7B-Instruct" device = "gcu" # the device to load the model onto model = AutoModelForCausalL...
40
1,101
Qwen3
examples/speed-benchmark/speed_benchmark_transformers.py
.py
# Copyright (c) Alibaba Cloud. # # This source code is licensed under the license found in the # LICENSE file in the root directory of this source tree. """ Qwen2.5 Speed Benchmark for transformers(pt) inference. """ import os import time import json import csv import torch from transformers.trainer_utils import set...
171
7,189
Qwen3
examples/speed-benchmark/speed_benchmark_vllm.py
.py
# Copyright (c) Alibaba Cloud. # # This source code is licensed under the license found in the # LICENSE file in the root directory of this source tree. """ Speed benchmark for vLLM deployment. """ import os import time import json import reprlib import statistics import logging import csv from datetime import dateti...
259
10,686
ungoogled-chromium
devutils/check_gn_flags.py
.py
#!/usr/bin/env python3 # -*- coding: UTF-8 -*- # Copyright (c) 2019 The ungoogled-chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Run sanity checking algorithms over GN flags It checks the following: * GN flags in fla...
81
2,260
ungoogled-chromium
devutils/check_patch_files.py
.py
#!/usr/bin/env python3 # -*- coding: UTF-8 -*- # Copyright (c) 2019 The ungoogled-chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Run sanity checking algorithms over ungoogled-chromium's patch files It checks the following...
141
4,487
ungoogled-chromium
devutils/validate_patches.py
.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # Copyright (c) 2020 The ungoogled-chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """ Validates that all patches apply cleanly against the source tree. The required source tree ...
709
29,652
ungoogled-chromium
devutils/check_downloads_ini.py
.py
#!/usr/bin/env python3 # -*- coding: UTF-8 -*- # Copyright (c) 2019 The ungoogled-chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Run sanity checking algorithms over downloads.ini files It checks the following: * down...
65
1,706
ungoogled-chromium
devutils/check_files_exist.py
.py
#!/usr/bin/env python3 # Copyright (c) 2019 The ungoogled-chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """ Checks if files in a list exist. Used for quick validation of lists in CI checks. """ import argparse import sys f...
37
1,127
ungoogled-chromium
devutils/run_utils_pylint.py
.py
#!/usr/bin/env python3 # Copyright (c) 2019 The ungoogled-chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Run Pylint over utils""" import argparse import sys from pathlib import Path from run_other_pylint import ChangeDir...
57
1,600
ungoogled-chromium
devutils/update_lists.py
.py
#!/usr/bin/env python3 # Copyright (c) 2019 The ungoogled-chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """ Update binary pruning and domain substitution lists automatically. It will download and unpack into the source tree...
410
16,435
ungoogled-chromium
devutils/validate_config.py
.py
#!/usr/bin/env python3 # -*- coding: UTF-8 -*- # Copyright (c) 2019 The ungoogled-chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Run sanity checking algorithms over ungoogled-chromium's config files NOTE: This script is h...
62
1,721
ungoogled-chromium
devutils/run_other_pylint.py
.py
#!/usr/bin/env python3 # Copyright (c) 2019 The ungoogled-chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Run Pylint over any module""" import argparse import os import shutil import sys from pathlib import Path from pyli...
105
2,963
ungoogled-chromium
devutils/run_devutils_pylint.py
.py
#!/usr/bin/env python3 # Copyright (c) 2019 The ungoogled-chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Run Pylint over devutils""" import argparse import sys from pathlib import Path from run_other_pylint import Change...
62
1,659
ungoogled-chromium
devutils/update_platform_patches.py
.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # Copyright (c) 2019 The ungoogled-chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """ Utility to ease the updating of platform patches against ungoogled-chromium's patches """ i...
189
6,980
ungoogled-chromium
devutils/third_party/unidiff/__init__.py
.py
# -*- coding: utf-8 -*- # The MIT License (MIT) # Copyright (c) 2014-2017 Matias Bordese # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation t...
42
1,459
ungoogled-chromium
devutils/third_party/unidiff/constants.py
.py
# -*- coding: utf-8 -*- # The MIT License (MIT) # Copyright (c) 2014-2017 Matias Bordese # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation t...
61
2,202
ungoogled-chromium
devutils/third_party/unidiff/patch.py
.py
# -*- coding: utf-8 -*- # The MIT License (MIT) # Copyright (c) 2014-2017 Matias Bordese # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation t...
464
16,415
ungoogled-chromium
devutils/tests/test_check_patch_files.py
.py
# -*- coding: UTF-8 -*- # Copyright (c) 2020 The ungoogled-chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Test check_patch_files.py""" import logging import tempfile import sys from pathlib import Path sys.path.insert(0,...
54
1,463
ungoogled-chromium
devutils/tests/test_validate_patches.py
.py
# -*- coding: UTF-8 -*- # Copyright (c) 2020 The ungoogled-chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Test validate_patches.py""" import logging import tempfile import sys from pathlib import Path sys.path.insert(0, ...
80
2,330
ungoogled-chromium
utils/clone.py
.py
#!/usr/bin/env python3 # -*- coding: UTF-8 -*- # Copyright (c) 2023 The ungoogled-chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """ Module for cloning the source tree. """ import re import sys from argparse import ArgumentP...
289
11,692
ungoogled-chromium
utils/filescfg.py
.py
#!/usr/bin/env python3 # -*- coding: UTF-8 -*- # Copyright (c) 2019 The ungoogled-chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """ Operations with FILES.cfg (for portable packages) """ import argparse import datetime impor...
225
8,896
ungoogled-chromium
utils/_common.py
.py
# -*- coding: UTF-8 -*- # Copyright (c) 2020 The ungoogled-chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Common code and constants""" import argparse import enum import logging import platform from pathlib import Path # ...
162
4,800
ungoogled-chromium
utils/domain_substitution.py
.py
#!/usr/bin/env python3 # -*- coding: UTF-8 -*- # Copyright (c) 2019 The ungoogled-chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """ Substitute domain names in the source tree with blockable strings. """ from pathlib import ...
377
15,401
ungoogled-chromium
utils/_extraction.py
.py
# -*- coding: UTF-8 -*- # Copyright (c) 2019 The ungoogled-chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """ Archive extraction utilities """ import os import shutil import subprocess import tarfile from pathlib import Path...
317
13,740
ungoogled-chromium
utils/make_domsub_script.py
.py
#!/usr/bin/env python3 # -*- coding: UTF-8 -*- # Copyright (c) 2023 The ungoogled-chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """ Generate standalone script that performs the domain substitution. """ from pathlib import P...
130
4,025
ungoogled-chromium
utils/patches.py
.py
#!/usr/bin/env python3 # -*- coding: UTF-8 -*- # Copyright (c) 2020 The ungoogled-chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Applies unified diff patches""" import argparse import os import shutil import subprocess fr...
256
9,830
ungoogled-chromium
utils/prune_binaries.py
.py
#!/usr/bin/env python3 # -*- coding: UTF-8 -*- # Copyright (c) 2019 The ungoogled-chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Prune binaries from the source tree""" import argparse import itertools import sys import os...
268
10,642
ungoogled-chromium
utils/downloads.py
.py
#!/usr/bin/env python3 # -*- coding: UTF-8 -*- # Copyright (c) 2019 The ungoogled-chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """ Module for the downloading, checking, and unpacking of necessary files into the source tree....
488
20,473
ungoogled-chromium
utils/third_party/schema.py
.py
"""schema is a library for validating Python data structures, such as those obtained from config-files, forms, external services or command-line parsing, converted from JSON/YAML (or something else) to Python data-types.""" import re __version__ = '0.6.7' __all__ = ['Schema', 'And', 'Or', 'Regex', 'Optiona...
384
14,147
ungoogled-chromium
utils/tests/test_domain_substitution.py
.py
# -*- coding: UTF-8 -*- # Copyright (c) 2019 The ungoogled-chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import os import tempfile from pathlib import Path from .. import domain_substitution def test_update_timestamp(): ...
37
1,230
ungoogled-chromium
utils/tests/test_patches.py
.py
# -*- coding: UTF-8 -*- # Copyright (c) 2020 The ungoogled-chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. from pathlib import Path import os import shutil import pytest from .. import patches def test_find_and_check_patc...
41
1,155
mkdocs-material
includes/debug/cairo-lookup-linux.py
.py
import inspect import os import shutil import subprocess from ctypes import util class CustomPopen(subprocess.Popen): def __init__(self, *args, **kwargs): print(f"Subprocess command:\n {' '.join(args[0])}") super().__init__(*args, **kwargs) def communicate(self, *args, **kwargs): ou...
112
3,491
mkdocs-material
includes/debug/cairo-lookup-macos.py
.py
import os from ctypes.macholib import dyld from itertools import chain library_names = ("cairo-2", "cairo", "libcairo-2") filenames = ("libcairo.so.2", "libcairo.2.dylib", "libcairo-2.dll") first_found = "" names = [] for name in library_names: names += [ "lib%s.dylib" % name, "%s.dylib" % name, ...
50
1,303
mkdocs-material
includes/debug/cairo-lookup-windows.py
.py
import os library_names = ("cairo-2", "cairo", "libcairo-2") filenames = ("libcairo.so.2", "libcairo.2.dylib", "libcairo-2.dll") first_found = "" names = [] for name in library_names: if name.lower().endswith(".dll"): names += [name] else: names += [name, name + ".dll"] for name in names: ...
32
884
mkdocs-material
material/extensions/emoji.py
.py
# Copyright (c) 2016-2025 Martin Donath <martin.donath@squidfunk.com> # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the # rights to use, c...
98
3,612
mkdocs-material
material/extensions/preview.py
.py
# Copyright (c) 2016-2025 Martin Donath <martin.donath@squidfunk.com> # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the # rights to use, c...
224
8,285
mkdocs-material
material/overrides/hooks/translations.py
.py
# Copyright (c) 2016-2025 Martin Donath <martin.donath@squidfunk.com> # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the # rights to use, c...
198
6,234
mkdocs-material
material/overrides/hooks/shortcodes.py
.py
# Copyright (c) 2016-2025 Martin Donath <martin.donath@squidfunk.com> # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the # rights to use, c...
295
11,290
mkdocs-material
material/utilities/filter/__init__.py
.py
# Copyright (c) 2016-2025 Martin Donath <martin.donath@squidfunk.com> # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the # rights to use, c...
125
3,963
mkdocs-material
material/utilities/filter/config.py
.py
# Copyright (c) 2016-2025 Martin Donath <martin.donath@squidfunk.com> # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the # rights to use, c...
48
1,947
mkdocs-material
material/templates/__init__.py
.py
# Copyright (c) 2016-2025 Martin Donath <martin.donath@squidfunk.com> # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the # rights to use, c...
60
3,102
mkdocs-material
material/plugins/social/layout.py
.py
# Copyright (c) 2016-2025 Martin Donath <martin.donath@squidfunk.com> # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the # rights to use, c...
154
5,020
mkdocs-material
material/plugins/social/config.py
.py
# Copyright (c) 2016-2025 Martin Donath <martin.donath@squidfunk.com> # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the # rights to use, c...
69
2,845
mkdocs-material
material/plugins/social/plugin.py
.py
# Copyright (c) 2016-2025 Martin Donath <martin.donath@squidfunk.com> # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the # rights to use, c...
1,128
46,725
mkdocs-material
material/plugins/tags/config.py
.py
# Copyright (c) 2016-2025 Martin Donath <martin.donath@squidfunk.com> # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the # rights to use, c...
89
3,859
mkdocs-material
material/plugins/tags/plugin.py
.py
# Copyright (c) 2016-2025 Martin Donath <martin.donath@squidfunk.com> # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the # rights to use, c...
314
10,602
mkdocs-material
material/plugins/tags/renderer/__init__.py
.py
# Copyright (c) 2016-2025 Martin Donath <martin.donath@squidfunk.com> # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the # rights to use, c...
100
3,570
mkdocs-material
material/plugins/tags/structure/mapping/__init__.py
.py
# Copyright (c) 2016-2025 Martin Donath <martin.donath@squidfunk.com> # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the # rights to use, c...
99
3,532
mkdocs-material
material/plugins/tags/structure/mapping/storage/__init__.py
.py
# Copyright (c) 2016-2025 Martin Donath <martin.donath@squidfunk.com> # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the # rights to use, c...
212
6,407
mkdocs-material
material/plugins/tags/structure/mapping/manager/__init__.py
.py
# Copyright (c) 2016-2025 Martin Donath <martin.donath@squidfunk.com> # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the # rights to use, c...
255
8,402
mkdocs-material
material/plugins/tags/structure/listing/__init__.py
.py
# Copyright (c) 2016-2025 Martin Donath <martin.donath@squidfunk.com> # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the # rights to use, c...
224
7,935
mkdocs-material
material/plugins/tags/structure/listing/config.py
.py
# Copyright (c) 2016-2025 Martin Donath <martin.donath@squidfunk.com> # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the # rights to use, c...
116
4,226
mkdocs-material
material/plugins/tags/structure/listing/manager/__init__.py
.py
# Copyright (c) 2016-2025 Martin Donath <martin.donath@squidfunk.com> # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the # rights to use, c...
522
18,572
mkdocs-material
material/plugins/tags/structure/listing/manager/toc.py
.py
# Copyright (c) 2016-2025 Martin Donath <martin.donath@squidfunk.com> # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the # rights to use, c...
135
4,429
mkdocs-material
material/plugins/tags/structure/listing/tree/__init__.py
.py
# Copyright (c) 2016-2025 Martin Donath <martin.donath@squidfunk.com> # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the # rights to use, c...
166
5,088
mkdocs-material
material/plugins/tags/structure/tag/options.py
.py
# Copyright (c) 2016-2025 Martin Donath <martin.donath@squidfunk.com> # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the # rights to use, c...
109
3,916
mkdocs-material
material/plugins/tags/structure/tag/__init__.py
.py
# Copyright (c) 2016-2025 Martin Donath <martin.donath@squidfunk.com> # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the # rights to use, c...
179
4,963
mkdocs-material
material/plugins/tags/structure/tag/reference/__init__.py
.py
# Copyright (c) 2016-2025 Martin Donath <martin.donath@squidfunk.com> # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the # rights to use, c...
81
2,829
mkdocs-material
material/plugins/offline/plugin.py
.py
# Copyright (c) 2016-2025 Martin Donath <martin.donath@squidfunk.com> # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the # rights to use, c...
70
2,884
mkdocs-material
material/plugins/blog/config.py
.py
# Copyright (c) 2016-2025 Martin Donath <martin.donath@squidfunk.com> # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the # rights to use, c...
103
4,698
mkdocs-material
material/plugins/blog/plugin.py
.py
# Copyright (c) 2016-2025 Martin Donath <martin.donath@squidfunk.com> # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the # rights to use, c...
1,084
45,378
mkdocs-material
material/plugins/blog/readtime/parser.py
.py
# Copyright (c) 2016-2025 Martin Donath <martin.donath@squidfunk.com> # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the # rights to use, c...
75
2,760
mkdocs-material
material/plugins/blog/structure/options.py
.py
# Copyright (c) 2016-2025 Martin Donath <martin.donath@squidfunk.com> # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the # rights to use, c...
129
5,081
mkdocs-material
material/plugins/blog/structure/__init__.py
.py
# Copyright (c) 2016-2025 Martin Donath <martin.donath@squidfunk.com> # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the # rights to use, c...
338
13,811
mkdocs-material
material/plugins/blog/structure/markdown.py
.py
# Copyright (c) 2016-2025 Martin Donath <martin.donath@squidfunk.com> # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the # rights to use, c...
62
2,528
mkdocs-material
material/plugins/privacy/config.py
.py
# Copyright (c) 2016-2025 Martin Donath <martin.donath@squidfunk.com> # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the # rights to use, c...
79
3,227
mkdocs-material
material/plugins/privacy/plugin.py
.py
# Copyright (c) 2016-2025 Martin Donath <martin.donath@squidfunk.com> # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the # rights to use, c...
681
28,438
mkdocs-material
material/plugins/info/patterns.py
.py
def get_exclusion_patterns(): """ Regex patterns, which will be compared against directory and file names case-sensitively. https://docs.python.org/3/library/re.html#re.search is the matching function and scans the whole string to find any pattern match. Used with the https://pypi.org/project/regex/...
28
1,073
mkdocs-material
material/plugins/info/plugin.py
.py
# Copyright (c) 2016-2025 Martin Donath <martin.donath@squidfunk.com> # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the # rights to use, c...
564
23,793
mkdocs-material
material/plugins/typeset/plugin.py
.py
# Copyright (c) 2016-2025 Martin Donath <martin.donath@squidfunk.com> # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the # rights to use, c...
124
4,955
mkdocs-material
material/plugins/search/config.py
.py
# Copyright (c) 2016-2025 Martin Donath <martin.donath@squidfunk.com> # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the # rights to use, c...
64
2,524
mkdocs-material
material/plugins/search/plugin.py
.py
# Copyright (c) 2016-2025 Martin Donath <martin.donath@squidfunk.com> # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the # rights to use, c...
595
20,512
mkdocs-material
material/plugins/optimize/config.py
.py
# Copyright (c) 2016-2025 Martin Donath <martin.donath@squidfunk.com> # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the # rights to use, c...
53
2,326
mkdocs-material
material/plugins/optimize/plugin.py
.py
# Copyright (c) 2016-2025 Martin Donath <martin.donath@squidfunk.com> # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the # rights to use, c...
389
14,982
mkdocs-material
material/plugins/group/plugin.py
.py
# Copyright (c) 2016-2025 Martin Donath <martin.donath@squidfunk.com> # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the # rights to use, c...
162
7,109
mkdocs-material
material/plugins/projects/config.py
.py
# Copyright (c) 2016-2025 Martin Donath <martin.donath@squidfunk.com> # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the # rights to use, c...
65
2,480
mkdocs-material
material/plugins/projects/plugin.py
.py
# Copyright (c) 2016-2025 Martin Donath <martin.donath@squidfunk.com> # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the # rights to use, c...
293
12,024
mkdocs-material
material/plugins/projects/builder/__init__.py
.py
# Copyright (c) 2016-2025 Martin Donath <martin.donath@squidfunk.com> # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the # rights to use, c...
321
13,007
mkdocs-material
material/plugins/projects/builder/log.py
.py
# Copyright (c) 2016-2025 Martin Donath <martin.donath@squidfunk.com> # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the # rights to use, c...
101
4,033
mkdocs-material
material/plugins/projects/builder/watcher/__init__.py
.py
# Copyright (c) 2016-2025 Martin Donath <martin.donath@squidfunk.com> # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the # rights to use, c...
99
3,883
mkdocs-material
material/plugins/projects/builder/watcher/handler.py
.py
# Copyright (c) 2016-2025 Martin Donath <martin.donath@squidfunk.com> # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the # rights to use, c...
106
3,874
mkdocs-material
material/plugins/projects/structure/__init__.py
.py
# Copyright (c) 2016-2025 Martin Donath <martin.donath@squidfunk.com> # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the # rights to use, c...
242
10,645
mkdocs-material
material/plugins/meta/plugin.py
.py
# Copyright (c) 2016-2025 Martin Donath <martin.donath@squidfunk.com> # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the # rights to use, c...
123
5,067
awesome-python
website/readme_parser.py
.py
"""Parse README.md into structured section data using markdown-it-py AST. Empirically verified behavior worth knowing before editing README.md: everything above `## Projects` is ignored; new subcategories need no parser change (a bullet without a leading link plus indented entries); a standalone all-bold paragraph ins...
472
16,056
awesome-python
website/fetch_pypi_downloads_via_bigquery.py
.py
#!/usr/bin/env python3 """Cross-check last-30-day PyPI download counts for given names via BigQuery. Queries the canonical source ClickPy mirrors — `bigquery-public-data.pypi.file_downloads` via the `bq` CLI — and prints name<TAB>count TSV to stdout. Names resolve through data/pypi_name_overrides.json, matching the ca...
83
3,220
awesome-python
website/fetch_github_stars.py
.py
#!/usr/bin/env python3 """Fetch GitHub star counts and owner info for all GitHub repos in README.md. The output file (data/github_stars.json) is gitignored; CI fetches it at deploy time, so local runs are for previews only — never commit the data. Entries removed from README.md leave harmless orphan keys behind. """ ...
183
6,525
awesome-python
website/fetch_pypi_downloads_via_pepy.py
.py
#!/usr/bin/env python3 """Spot-check last-30-day PyPI download counts via the pepy.tech API. Cross-check for a handful of packages during audits — not for full-README sweeps: the free API key is throttled to 5 requests/minute (10 burst), so this script sleeps 12s between requests and 530 names would take ~2 hours (use...
76
2,898
awesome-python
website/fetch_pypi_downloads_via_clickpy.py
.py
#!/usr/bin/env python3 """Fetch last-30-day PyPI download counts for all README entries via ClickPy. ClickPy is ClickHouse's public mirror of the PyPI download dataset (sql-clickhouse.clickhouse.com, user `demo`, no key, no personal account): one batched query covers the full README in under a second. Playground limit...
111
4,656
awesome-python
website/build.py
.py
#!/usr/bin/env python3 """Build a single-page HTML site from README.md for the awesome-python website.""" import json import re import shutil import xml.etree.ElementTree as ET from collections import Counter from collections.abc import Sequence from datetime import UTC, datetime from pathlib import Path from typing i...
794
28,763
awesome-python
website/tests/test_build.py
.py
"""Tests for the build module.""" import json import os import shutil import textwrap import xml.etree.ElementTree as ET from datetime import UTC, date, datetime from html.parser import HTMLParser from pathlib import Path import pytest from build import ( TemplateEntry, annotate_entries_with_stats, build,...
1,267
46,958
hermes-agent
mcp_serve.py
.py
""" Hermes MCP Server — expose messaging conversations as MCP tools. Starts a stdio MCP server that lets any MCP client (Claude Code, Cursor, Codex, etc.) list conversations, read message history, send messages, poll for live events, and manage approval requests across all connected platforms. Matches OpenClaw's 9-to...
1,061
38,200
hermes-agent
hermes_state_common.py
.py
"""Shared module-level constants for the SessionDB family of modules. Extracted verbatim from hermes_state.py so the SessionDB mixin modules (hermes_state_search / hermes_state_schema / hermes_state_portability) can reference them without importing hermes_state (which would be a cycle). hermes_state re-imports every n...
691
26,716
hermes-agent
batch_runner.py
.py
#!/usr/bin/env python3 """ Batch Agent Runner This module provides parallel batch processing capabilities for running the agent across multiple prompts from a dataset. It includes: - Dataset loading and batching - Parallel batch processing with multiprocessing - Checkpointing for fault tolerance and resumption - Traje...
1,331
57,704
hermes-agent
run_agent.py
.py
#!/usr/bin/env python3 """ AI Agent Runner with Tool Calling This module provides a clean, standalone agent that can execute AI models with tool calling capabilities. It handles the conversation loop, tool execution, and response management. Features: - Automatic tool calling loop until completion - Configurable mode...
9,048
418,896
hermes-agent
model_tools.py
.py
#!/usr/bin/env python3 """ Model Tools Module Thin orchestration layer over the tool registry. Each tool file in tools/ self-registers its schema, handler, and metadata via tools.registry.register(). This module triggers discovery (by importing all tool modules), then provides the public API that run_agent.py, cli.py,...
1,642
74,273
hermes-agent
tui_gateway/methods_tools.py
.py
"""Tools & system / slash.exec / insights / rollback / browser-plugins-cron-skills JSON-RPC handlers (moved verbatim from server.py). Handler bodies are byte-identical to their pre-split server.py form; they are rebound onto server.py's globals at install time — see method_ctx.py. """ from .method_ctx import HandlerR...
2,525
97,730
hermes-agent
tui_gateway/methods_profiles.py
.py
"""Profile JSON-RPC handlers — the ws twin of the dashboard's /api/profiles. Motivation: desktop plugins reach the backend exclusively through the generic ws JSON-RPC door (`host.request`). Profile enumeration/creation previously lived only on the dashboard REST router, which plugins cannot reach, so anything "one ch...
914
38,176
hermes-agent
tui_gateway/methods_session.py
.py
"""Session / delegation / spawn-tree / billing / pet JSON-RPC handlers (moved verbatim from server.py). Handler bodies are byte-identical to their pre-split server.py form; they are rebound onto server.py's globals at install time — see method_ctx.py. """ from .method_ctx import HandlerRegistry _registry = HandlerRe...
3,470
149,261
hermes-agent
tui_gateway/methods_prompt.py
.py
"""Prompt / attachment / respond JSON-RPC handlers (moved verbatim from server.py). Handler bodies are byte-identical to their pre-split server.py form; they are rebound onto server.py's globals at install time — see method_ctx.py. """ from .method_ctx import HandlerRegistry import types _registry = HandlerRegistry...
1,532
66,472