AI Slop Code RIsk Monitor

TingsongYu/PyTorch-Tutorial-2nd

《Pytorch实用教程》(第二版)无论是零基础入门,还是CV、NLP、LLM项目应用,或是进阶工程化部署落地,在这里都有。相信在本书的帮助下,读者将能够轻松掌握 PyTorch 的使用,成为一名优秀的深度学习工程师。

7.2 Moderate pattern signal View on GitHub

Maintenance and Governance Review

This report summarizes scanner evidence for TingsongYu/PyTorch-Tutorial-2nd, a Jupyter Notebook project with 4,625 GitHub stars. SynthScan examined 206,044 lines of code across 483 source files, recording 1175 pattern matches distributed across 21 syntactic categories. The legacy adjusted pattern signal is 7.2 (Moderate pattern signal); it is not an authorship estimate.

Use the findings to ask whether maintainers can explain intent, verify dependencies, simplify unnecessary scaffolding, and focus review effort. Risk Payload v1 adds ownership, supply-chain, over-engineering, and review-effort vectors when available. These are prompts for human verification, not probabilities, security findings, or measured maintenance costs.

7.2
Adjusted Signal
7.2
Raw Pattern Score
100%
Time Factor
2026-10-08
Last Push
4.6K
Stars
Jupyter Notebook
Language
206.0K
Lines of Code
483
Files
1.2K
Pattern Hits
2026-10-12
Scan Date
0.23
HC Hit Rate

Risk Review · v3

Use each vector to guide manual verification of the underlying findings.

Cognitive Ownership Risk 14.9/100 · LOW

Can maintainers explain intent, assumptions, and trade-offs? 757 finding(s).

Hallucinated Dependency & Supply Chain Risk 5.2/100 · LOW

Are imports declared and package/API names verified? 218 finding(s).

Agent Over-Engineering Ratio 15.8/100 · LOW

Are wrappers, guards, and repeated structures necessary? 303 finding(s).

PR Review Velocity Impact 34.9/100 · MEDIUM

Which changes need focused human review? 1175 finding(s).

What These Metrics Mean

Adjusted Signal
Legacy pattern score normalized per 1,000 scanned lines and multiplied by the repository-level time factor. It is not an estimate of AI authorship.
Raw Pattern Score
Sum of severity- and context-weighted pattern findings before applying the time factor.
Time Factor
A coarse multiplier based on repository last-push metadata. It does not identify when individual code was written.
Pattern Hits
Count of configured pattern findings. Review each location and surrounding code before acting.
HC Hit Rate
High- and critical-severity findings per scanned file. Severity is a configured detector weight, not proof of a vulnerability or authorship.
Lines / Files
Scan coverage denominators used by the legacy normalized score.

Pattern-Signal History

This chart tracks the legacy adjusted pattern score across scan runs. Changes can reflect source changes, scan coverage, or detector/scoring versions; they do not measure AI adoption or prove that a team refactored code. Compare runs only when their scoring versions are compatible. The dashed line tracks the raw pattern-hit count.

Severity Breakdown

Groups findings by configured severity weight. Severity is not a confidence estimate, security rating, or proof that a package is missing. Verify imports against the project's manifests and inspect each finding in its local design context.

CRITICAL 0HIGH 109MEDIUM 23LOW 1043

Directory Score Breakdown

This horizontal bar chart shows where configured pattern scores accumulate across directories. Treat the bars as locations to inspect, not as evidence of authorship or code quality. Use the file-level findings to decide whether a directory needs a focused ownership, dependency, complexity, or review check.

Pattern Findings

The scanner identified 1175 distinct pattern matches across 21 syntactic categories. Each entry below represents a discrete location in the source code where the engine recorded a detector match to inspect in context. Expand any category row to inspect the individual file paths, line numbers, code snippets, and the lexical context (CODE, COMMENT, or STRING) in which each match was detected.

Reading the findings table: The Severity column indicates the configured finding weight (CRITICAL / HIGH / MEDIUM / LOW). The Context column identifies whether the match occurred inside executable code, an inline comment, or a string literal — legacy comment-context matches receive a ×1.5 score weight. The ⚡ bolt icon marks clustered matches: three or more patterns within a 10-line window, each receiving an additional ×1.5 density multiplier under the legacy scoring model.

Cross-File Repetition94 hits · 470 pts
SeverityFileLineSnippetContext
HIGHcode/chapter-7/my_utils.py0@file name : 03_utils.py @author : tingsongyu https://github.com/tingsongyu @date : 2022-06-14 @brief : 训练所需的函数STRING
HIGHcode/chapter-9/b_seq2seq/utils/my_utils.py0@file name : 03_utils.py @author : tingsongyu https://github.com/tingsongyu @date : 2022-06-14 @brief : 训练所需的函数STRING
HIGHcode/chapter-9/c_transformer/utils/my_utils.py0@file name : 03_utils.py @author : tingsongyu https://github.com/tingsongyu @date : 2022-06-14 @brief : 训练所需的函数STRING
HIGHcode/chapter-8/02_segmentation/utils/utils.py0@file name : 03_utils.py @author : tingsongyu https://github.com/tingsongyu @date : 2022-06-14 @brief : 训练所需的函数STRING
HIGHcode/chapter-8/01_classification/utils/my_utils.py0@file name : 03_utils.py @author : tingsongyu https://github.com/tingsongyu @date : 2022-06-14 @brief : 训练所需的函数STRING
HIGHcode/chapter-6/my_utils.py0@file name : 03_utils.py @author : tingsongyu https://github.com/tingsongyu @date : 2022-06-14 @brief : 训练所需的函数STRING
HIGHcode/chapter-7/my_utils.py0混淆矩阵绘制并保存图片 :param confusion_mat: nd.array :param classes: list or tuple, 类别名称 :param set_name: str, 数据集名称 train or valiSTRING
HIGHcode/chapter-9/a_rnn_lstm/utils/my_utils.py0混淆矩阵绘制并保存图片 :param confusion_mat: nd.array :param classes: list or tuple, 类别名称 :param set_name: str, 数据集名称 train or valiSTRING
HIGHcode/chapter-9/b_seq2seq/utils/my_utils.py0混淆矩阵绘制并保存图片 :param confusion_mat: nd.array :param classes: list or tuple, 类别名称 :param set_name: str, 数据集名称 train or valiSTRING
HIGHcode/chapter-9/c_transformer/utils/my_utils.py0混淆矩阵绘制并保存图片 :param confusion_mat: nd.array :param classes: list or tuple, 类别名称 :param set_name: str, 数据集名称 train or valiSTRING
HIGHcode/chapter-8/01_classification/utils/my_utils.py0混淆矩阵绘制并保存图片 :param confusion_mat: nd.array :param classes: list or tuple, 类别名称 :param set_name: str, 数据集名称 train or valiSTRING
HIGHcode/chapter-6/my_utils.py0混淆矩阵绘制并保存图片 :param confusion_mat: nd.array :param classes: list or tuple, 类别名称 :param set_name: str, 数据集名称 train or valiSTRING
HIGHcode/chapter-7/my_utils.py0compute the average over a list of tensors with the same size.STRING
HIGHcode/chapter-9/a_rnn_lstm/utils/my_utils.py0compute the average over a list of tensors with the same size.STRING
HIGHcode/chapter-8/01_classification/utils/my_utils.py0compute the average over a list of tensors with the same size.STRING
HIGHcode/chapter-7/my_utils.py0在out_dir文件夹下以当前时间命名,创建日志文件夹,并创建logger用于记录信息 :param out_dir: str :return:STRING
HIGHcode/chapter-9/a_rnn_lstm/utils/my_utils.py0在out_dir文件夹下以当前时间命名,创建日志文件夹,并创建logger用于记录信息 :param out_dir: str :return:STRING
HIGHcode/chapter-9/b_seq2seq/utils/my_utils.py0在out_dir文件夹下以当前时间命名,创建日志文件夹,并创建logger用于记录信息 :param out_dir: str :return:STRING
HIGHcode/chapter-9/c_transformer/utils/my_utils.py0在out_dir文件夹下以当前时间命名,创建日志文件夹,并创建logger用于记录信息 :param out_dir: str :return:STRING
HIGHcode/chapter-8/02_segmentation/utils/utils.py0在out_dir文件夹下以当前时间命名,创建日志文件夹,并创建logger用于记录信息 :param out_dir: str :return:STRING
HIGHcode/chapter-8/01_classification/utils/my_utils.py0在out_dir文件夹下以当前时间命名,创建日志文件夹,并创建logger用于记录信息 :param out_dir: str :return:STRING
HIGHcode/chapter-7/my_utils.py0computes and stores the average and current value hacked from https://github.com/rwightman/pytorch-image-models/blob/masSTRING
HIGHcode/chapter-9/a_rnn_lstm/utils/my_utils.py0computes and stores the average and current value hacked from https://github.com/rwightman/pytorch-image-models/blob/masSTRING
HIGHcode/chapter-9/b_seq2seq/utils/my_utils.py0computes and stores the average and current value hacked from https://github.com/rwightman/pytorch-image-models/blob/masSTRING
HIGHcode/chapter-9/c_transformer/utils/my_utils.py0computes and stores the average and current value hacked from https://github.com/rwightman/pytorch-image-models/blob/masSTRING
HIGHcode/chapter-8/02_segmentation/utils/utils.py0computes and stores the average and current value hacked from https://github.com/rwightman/pytorch-image-models/blob/masSTRING
HIGHcode/chapter-8/01_classification/utils/my_utils.py0computes and stores the average and current value hacked from https://github.com/rwightman/pytorch-image-models/blob/masSTRING
HIGHcode/chapter-7/my_utils.py0computes the accuracy over the k top predictions for the specified values of k hacked from https://github.com/rwightman/STRING
HIGHcode/chapter-9/a_rnn_lstm/utils/my_utils.py0computes the accuracy over the k top predictions for the specified values of k hacked from https://github.com/rwightman/STRING
HIGHcode/chapter-9/b_seq2seq/utils/my_utils.py0computes the accuracy over the k top predictions for the specified values of k hacked from https://github.com/rwightman/STRING
HIGHcode/chapter-9/c_transformer/utils/my_utils.py0computes the accuracy over the k top predictions for the specified values of k hacked from https://github.com/rwightman/STRING
HIGHcode/chapter-8/02_segmentation/utils/utils.py0computes the accuracy over the k top predictions for the specified values of k hacked from https://github.com/rwightman/STRING
HIGHcode/chapter-8/01_classification/utils/my_utils.py0computes the accuracy over the k top predictions for the specified values of k hacked from https://github.com/rwightman/STRING
HIGHcode/chapter-9/a_rnn_lstm/utils/my_utils.py0加载预训练词向量权重 :param glove_file_path: :param word2idx: :return:STRING
HIGHcode/chapter-9/b_seq2seq/utils/my_utils.py0加载预训练词向量权重 :param glove_file_path: :param word2idx: :return:STRING
HIGHcode/chapter-9/c_transformer/utils/my_utils.py0加载预训练词向量权重 :param glove_file_path: :param word2idx: :return:STRING
HIGHcode/chapter-9/e_gpt/generate.py0checks whether cp is the codepoint of a cjk character.STRING
HIGHcode/chapter-9/e_gpt/tokenizations/tokenization_bert.py0checks whether cp is the codepoint of a cjk character.STRING
HIGH…-9/e_gpt/tokenizations/tokenization_bert_word_level.py0checks whether cp is the codepoint of a cjk character.STRING
HIGHcode/chapter-9/d_bert/callback/optimizater/sgdw.py0performs a single lookahead optimization step. arguments: closure (callable, optional): a closure that reevaluates the mSTRING
HIGHcode/chapter-9/d_bert/callback/optimizater/lamb.py0performs a single lookahead optimization step. arguments: closure (callable, optional): a closure that reevaluates the mSTRING
HIGHcode/chapter-9/d_bert/callback/optimizater/lars.py0performs a single lookahead optimization step. arguments: closure (callable, optional): a closure that reevaluates the mSTRING
HIGHcode/chapter-9/d_bert/callback/optimizater/adamw.py0performs a single lookahead optimization step. arguments: closure (callable, optional): a closure that reevaluates the mSTRING
HIGHcode/chapter-9/d_bert/callback/optimizater/adabound.py0performs a single lookahead optimization step. arguments: closure (callable, optional): a closure that reevaluates the mSTRING
HIGHcode/chapter-9/d_bert/callback/optimizater/nadam.py0performs a single lookahead optimization step. arguments: closure (callable, optional): a closure that reevaluates the mSTRING
HIGHcode/chapter-9/d_bert/callback/optimizater/ralars.py0performs a single lookahead optimization step. arguments: closure (callable, optional): a closure that reevaluates the mSTRING
HIGHcode/chapter-9/d_bert/callback/optimizater/lookahead.py0performs a single lookahead optimization step. arguments: closure (callable, optional): a closure that reevaluates the mSTRING
HIGHcode/chapter-11/02_resnet_inference.py0加载标签名 :param p_clsnames: :param p_clsnames_cn: :return:STRING
HIGHcode/chapter-12/a_trt_infer_engine_resnet50.py0加载标签名 :param p_clsnames: :param p_clsnames_cn: :return:STRING
HIGHcode/chapter-12/01_trt_resnet50_cuda.py0加载标签名 :param p_clsnames: :param p_clsnames_cn: :return:STRING
HIGHcode/chapter-12/04_build_resnet50_by_api.py0加载标签名 :param p_clsnames: :param p_clsnames_cn: :return:STRING
HIGHcode/chapter-12/05_trt_resnet50_execute_v3.py0加载标签名 :param p_clsnames: :param p_clsnames_cn: :return:STRING
HIGHcode/chapter-12/02_trt_resnet50_pycuda.py0加载标签名 :param p_clsnames: :param p_clsnames_cn: :return:STRING
HIGHcode/chapter-8/02_segmentation/02_train_seg.py0@file name : train_script.py @author : tingsongyu https://github.com/tingsongyu @date : 2023-02-04 @brief : 肺炎xray图像分类训练STRING
HIGHcode/chapter-8/02_segmentation/03_train_architecture.py0@file name : train_script.py @author : tingsongyu https://github.com/tingsongyu @date : 2023-02-04 @brief : 肺炎xray图像分类训练STRING
HIGHcode/chapter-8/01_classification/train_aug.py0@file name : train_script.py @author : tingsongyu https://github.com/tingsongyu @date : 2023-02-04 @brief : 肺炎xray图像分类训练STRING
HIGHcode/chapter-8/01_classification/train_main.py0@file name : train_script.py @author : tingsongyu https://github.com/tingsongyu @date : 2023-02-04 @brief : 肺炎xray图像分类训练STRING
HIGHcode/chapter-8/05_cyclegan/models/test_model.py0initialize the cyclegan class. parameters: opt (option class)-- stores all the experiment flags; needs to be a subclass STRING
HIGHcode/chapter-8/05_cyclegan/models/pix2pix_model.py0initialize the cyclegan class. parameters: opt (option class)-- stores all the experiment flags; needs to be a subclass STRING
HIGHcode/chapter-8/05_cyclegan/models/cycle_gan_model.py0initialize the cyclegan class. parameters: opt (option class)-- stores all the experiment flags; needs to be a subclass STRING
34 more matches not shown…
Over-Commented Block449 hits · 254 pts
SeverityFileLineSnippetContext
LOWcode/chapter-7/01_torch_save_load.py41 # "optimizer": optimizer.state_dict(),COMMENT
LOWcode/chapter-9/e_gpt/cache/vocab_small.txt8161##9COMMENT
LOWcode/chapter-9/e_gpt/cache/vocab_small.txt8601##2015COMMENT
LOWcode/chapter-9/e_gpt/cache/vocab_small.txt8821##boCOMMENT
LOWcode/chapter-9/e_gpt/cache/vocab_small.txt91612019COMMENT
LOWcode/chapter-9/e_gpt/cache/vocab_small.txt9341##46COMMENT
LOWcode/chapter-9/e_gpt/cache/vocab_small.txt9741##kingCOMMENT
LOWcode/chapter-9/e_gpt/cache/vocab_small.txt9761##マCOMMENT
LOWcode/chapter-9/e_gpt/cache/vocab_small.txt10141ofweekCOMMENT
LOWcode/chapter-9/e_gpt/cache/vocab_small.txt10281vcdCOMMENT
LOWcode/chapter-9/e_gpt/cache/vocab_small.txt11081##aticCOMMENT
LOWcode/chapter-9/e_gpt/cache/vocab_small.txt11361##ackCOMMENT
LOWcode/chapter-9/e_gpt/cache/vocab_small.txt11581328COMMENT
LOWcode/chapter-9/e_gpt/cache/vocab_small.txt12401##gasCOMMENT
LOWcode/chapter-9/e_gpt/cache/vocab_small.txt12501sylviaCOMMENT
LOWcode/chapter-9/e_gpt/cache/vocab_small.txt12941diaryCOMMENT
LOWcode/chapter-9/e_gpt/cache/vocab_small.txt13061##mesCOMMENT
LOWcode/chapter-9/e_gpt/cache/vocab_small.txt13121828COMMENT
LOWcode/chapter-9/e_gpt/cache/vocab.txt8161##9COMMENT
LOWcode/chapter-9/e_gpt/cache/vocab.txt8601##2015COMMENT
LOWcode/chapter-9/e_gpt/cache/vocab.txt8821##boCOMMENT
LOWcode/chapter-9/e_gpt/cache/vocab.txt91612019COMMENT
LOWcode/chapter-9/e_gpt/cache/vocab.txt9341##46COMMENT
LOWcode/chapter-9/e_gpt/cache/vocab.txt9741##kingCOMMENT
LOWcode/chapter-9/e_gpt/cache/vocab.txt9761##マCOMMENT
LOWcode/chapter-9/e_gpt/cache/vocab.txt10141ofweekCOMMENT
LOWcode/chapter-9/e_gpt/cache/vocab.txt10281vcdCOMMENT
LOWcode/chapter-9/e_gpt/cache/vocab.txt11081##aticCOMMENT
LOWcode/chapter-9/e_gpt/cache/vocab.txt11361##ackCOMMENT
LOWcode/chapter-9/e_gpt/cache/vocab.txt11581328COMMENT
LOWcode/chapter-9/e_gpt/cache/vocab.txt12401##gasCOMMENT
LOWcode/chapter-9/e_gpt/cache/vocab.txt12501sylviaCOMMENT
LOWcode/chapter-9/e_gpt/cache/vocab.txt12941diaryCOMMENT
LOWcode/chapter-9/e_gpt/cache/vocab.txt13061##mesCOMMENT
LOWcode/chapter-9/e_gpt/cache/vocab.txt13121828COMMENT
LOWcode/chapter-9/e_gpt/cache/vocab.txt13301##andaCOMMENT
LOWcode/chapter-9/e_gpt/cache/vocab.txt13321##$COMMENT
LOWcode/chapter-9/e_gpt/cache/vocab.txt13341##\COMMENT
LOWcode/chapter-9/e_gpt/cache/vocab.txt13361##¼COMMENT
LOWcode/chapter-9/e_gpt/cache/vocab.txt13381##αCOMMENT
LOWcode/chapter-9/e_gpt/cache/vocab.txt13401##χCOMMENT
LOWcode/chapter-9/e_gpt/cache/vocab.txt13421##хCOMMENT
LOWcode/chapter-9/e_gpt/cache/vocab.txt13441##يCOMMENT
LOWcode/chapter-9/e_gpt/cache/vocab.txt13461##ᄇCOMMENT
LOWcode/chapter-9/e_gpt/cache/vocab.txt13481##ᅯCOMMENT
LOWcode/chapter-9/e_gpt/cache/vocab.txt13501##‥COMMENT
LOWcode/chapter-9/e_gpt/cache/vocab.txt13521##ⅱCOMMENT
LOWcode/chapter-9/e_gpt/cache/vocab.txt13541##∼COMMENT
LOWcode/chapter-9/e_gpt/cache/vocab.txt13561##⑤COMMENT
LOWcode/chapter-9/e_gpt/cache/vocab.txt13581##┆COMMENT
LOWcode/chapter-9/e_gpt/cache/vocab.txt13601##▇COMMENT
LOWcode/chapter-9/e_gpt/cache/vocab.txt13621##☕COMMENT
LOWcode/chapter-9/e_gpt/cache/vocab.txt13641##✿COMMENT
LOWcode/chapter-9/e_gpt/cache/vocab.txt13661##〓COMMENT
LOWcode/chapter-9/e_gpt/cache/vocab.txt13681##ァCOMMENT
LOWcode/chapter-9/e_gpt/cache/vocab.txt13701##ヨCOMMENT
LOWcode/chapter-9/e_gpt/cache/vocab.txt13721##ㄤCOMMENT
LOWcode/chapter-9/e_gpt/cache/vocab.txt13741##专COMMENT
LOWcode/chapter-9/e_gpt/cache/vocab.txt13761##丫COMMENT
LOWcode/chapter-9/e_gpt/cache/vocab.txt13781##乌COMMENT
389 more matches not shown…
Unused Imports206 hits · 206 pts
SeverityFileLineSnippetContext
LOWcode/chapter-7/01_torch_save_load.py10CODE
LOWcode/chapter-7/06_albumentations-demo.py13CODE
LOWcode/chapter-7/06_albumentations-demo.py13CODE
LOWcode/chapter-7/06_albumentations-demo.py13CODE
LOWcode/chapter-7/06_albumentations-demo.py13CODE
LOWcode/chapter-7/06_albumentations-demo.py13CODE
LOWcode/chapter-7/06_albumentations-demo.py13CODE
LOWcode/chapter-7/06_albumentations-demo.py13CODE
LOWcode/chapter-7/06_albumentations-demo.py13CODE
LOWcode/chapter-7/06_albumentations-demo.py13CODE
LOWcode/chapter-7/06_albumentations-demo.py13CODE
LOWcode/chapter-7/06_albumentations-demo.py13CODE
LOWcode/chapter-7/06_albumentations-demo.py13CODE
LOWcode/chapter-7/06_albumentations-demo.py13CODE
LOWcode/chapter-7/06_albumentations-demo.py13CODE
LOWcode/chapter-7/06_albumentations-demo.py13CODE
LOWcode/chapter-7/06_albumentations-demo.py13CODE
LOWcode/chapter-7/06_albumentations-demo.py13CODE
LOWcode/chapter-7/06_albumentations-demo.py13CODE
LOWcode/chapter-7/06_albumentations-demo.py13CODE
LOWcode/chapter-7/06_albumentations-demo.py13CODE
LOWcode/chapter-7/06_albumentations-demo.py13CODE
LOWcode/chapter-7/02_fintune-freeze.py15CODE
LOWcode/chapter-7/02_fintune-freeze.py22CODE
LOWcode/chapter-7/02_fintune-multi-lr.py15CODE
LOWcode/chapter-7/02_fintune-multi-lr.py22CODE
LOWcode/chapter-9/a_rnn_lstm/a_gen_vocabulary.py12CODE
LOWcode/chapter-9/a_rnn_lstm/models/rnn.py10CODE
LOWcode/chapter-9/a_rnn_lstm/models/rnn.py11CODE
LOWcode/chapter-9/a_rnn_lstm/models/rnn.py12CODE
LOWcode/chapter-9/a_rnn_lstm/models/rnn.py15CODE
LOWcode/chapter-9/a_rnn_lstm/models/rnn.py16CODE
LOWcode/chapter-9/a_rnn_lstm/models/rnn.py17CODE
LOWcode/chapter-9/a_rnn_lstm/models/rnn.py18CODE
LOWcode/chapter-9/a_rnn_lstm/models/rnn.py19CODE
LOWcode/chapter-9/a_rnn_lstm/models/rnn.py20CODE
LOWcode/chapter-9/e_gpt/train.py21CODE
LOWcode/chapter-9/e_gpt/tokenizations/tokenization_bert.py17CODE
LOWcode/chapter-9/e_gpt/tokenizations/tokenization_bert.py17CODE
LOWcode/chapter-9/e_gpt/tokenizations/tokenization_bert.py17CODE
LOWcode/chapter-9/e_gpt/tokenizations/tokenization_bert.py17CODE
LOW…-9/e_gpt/tokenizations/tokenization_bert_word_level.py17CODE
LOW…-9/e_gpt/tokenizations/tokenization_bert_word_level.py17CODE
LOW…-9/e_gpt/tokenizations/tokenization_bert_word_level.py17CODE
LOW…-9/e_gpt/tokenizations/tokenization_bert_word_level.py17CODE
LOWcode/chapter-9/b_seq2seq/b_gen_vocabulary.py9CODE
LOWcode/chapter-9/b_seq2seq/c_inference.py10CODE
LOWcode/chapter-9/b_seq2seq/c_inference.py12CODE
LOWcode/chapter-9/b_seq2seq/c_inference.py13CODE
LOWcode/chapter-9/b_seq2seq/c_inference.py14CODE
LOWcode/chapter-9/b_seq2seq/c_inference.py16CODE
LOWcode/chapter-9/b_seq2seq/c_inference.py17CODE
LOWcode/chapter-9/d_bert/run_ner_softmax.py1CODE
LOWcode/chapter-9/d_bert/run_ner_softmax.py9CODE
LOWcode/chapter-9/d_bert/metrics/ner_metrics.py1CODE
LOW…_bert/tools/convert_albert_tf_checkpoint_to_pytorch.py3CODE
LOW…_bert/tools/convert_albert_tf_checkpoint_to_pytorch.py4CODE
LOW…_bert/tools/convert_albert_tf_checkpoint_to_pytorch.py5CODE
LOWcode/chapter-9/d_bert/processors/utils_ner.py4CODE
LOWcode/chapter-9/d_bert/callback/optimizater/nadam.py1CODE
146 more matches not shown…
Deep Nesting127 hits · 127 pts
SeverityFileLineSnippetContext
LOWcode/chapter-9/e_gpt/generate.py136CODE
LOWcode/chapter-9/e_gpt/train.py128CODE
LOWcode/chapter-9/e_gpt/tokenizations/tokenization_bert.py347CODE
LOW…-9/e_gpt/tokenizations/tokenization_bert_word_level.py364CODE
LOWcode/chapter-9/d_bert/run_ner_softmax.py35CODE
LOWcode/chapter-9/d_bert/run_ner_softmax.py196CODE
LOWcode/chapter-9/d_bert/tools/common.py280CODE
LOWcode/chapter-9/d_bert/tools/common.py295CODE
LOWcode/chapter-9/d_bert/tools/common.py296CODE
LOWcode/chapter-9/d_bert/processors/utils_ner.py78CODE
LOWcode/chapter-9/d_bert/processors/utils_ner.py122CODE
LOWcode/chapter-9/d_bert/processors/utils_ner.py32CODE
LOWcode/chapter-9/d_bert/processors/utils_ner.py56CODE
LOWcode/chapter-9/d_bert/processors/ner_seq.py181CODE
LOWcode/chapter-9/d_bert/processors/ner_span.py197CODE
LOWcode/chapter-9/d_bert/callback/lr_scheduler.py143CODE
LOWcode/chapter-9/d_bert/callback/lr_scheduler.py301CODE
LOWcode/chapter-9/d_bert/callback/lr_scheduler.py351CODE
LOWcode/chapter-9/d_bert/callback/trainingmonitor.py26CODE
LOWcode/chapter-9/d_bert/callback/optimizater/sgdw.py47CODE
LOWcode/chapter-9/d_bert/callback/optimizater/adafactor.py67CODE
LOWcode/chapter-9/d_bert/callback/optimizater/lars.py45CODE
LOWcode/chapter-9/d_bert/callback/optimizater/radam.py25CODE
LOWcode/chapter-9/d_bert/callback/optimizater/adabound.py52CODE
LOWcode/chapter-9/d_bert/callback/optimizater/ralamb.py20CODE
LOWcode/chapter-9/d_bert/callback/optimizater/lookahead.py80CODE
LOWcode/chapter-9/c_transformer/train_transformer.py148CODE
LOWcode/chapter-8/03_detection/visdrone2yolo.py16CODE
LOW…de/chapter-8/03_detection/yolov5-master/00-save-gif.py54CODE
LOWcode/chapter-8/03_detection/yolov5-master/val.py99CODE
LOWcode/chapter-8/03_detection/yolov5-master/val.py372CODE
LOWcode/chapter-8/03_detection/yolov5-master/train.py70CODE
LOWcode/chapter-8/03_detection/yolov5-master/train.py481CODE
LOWcode/chapter-8/03_detection/yolov5-master/hubconf.py16CODE
LOWcode/chapter-8/03_detection/yolov5-master/detect.py55CODE
LOW…e/chapter-8/03_detection/yolov5-master/classify/val.py45CODE
LOW…apter-8/03_detection/yolov5-master/classify/predict.py56CODE
LOW…chapter-8/03_detection/yolov5-master/classify/train.py56CODE
LOW…de/chapter-8/03_detection/yolov5-master/segment/val.py130CODE
LOW…de/chapter-8/03_detection/yolov5-master/segment/val.py436CODE
LOW…hapter-8/03_detection/yolov5-master/segment/predict.py56CODE
LOW…/chapter-8/03_detection/yolov5-master/segment/train.py69CODE
LOW…/chapter-8/03_detection/yolov5-master/segment/train.py507CODE
LOW…/chapter-8/03_detection/yolov5-master/utils/metrics.py222CODE
LOW…pter-8/03_detection/yolov5-master/utils/dataloaders.py930CODE
LOW…pter-8/03_detection/yolov5-master/utils/dataloaders.py990CODE
LOW…pter-8/03_detection/yolov5-master/utils/dataloaders.py241CODE
LOW…pter-8/03_detection/yolov5-master/utils/dataloaders.py439CODE
LOW…pter-8/03_detection/yolov5-master/utils/dataloaders.py750CODE
LOW…pter-8/03_detection/yolov5-master/utils/dataloaders.py808CODE
LOW…hapter-8/03_detection/yolov5-master/utils/downloads.py84CODE
LOW…de/chapter-8/03_detection/yolov5-master/utils/plots.py230CODE
LOW…de/chapter-8/03_detection/yolov5-master/utils/plots.py514CODE
LOW…pter-8/03_detection/yolov5-master/utils/torch_utils.py66CODE
LOW…pter-8/03_detection/yolov5-master/utils/torch_utils.py151CODE
LOW…pter-8/03_detection/yolov5-master/utils/torch_utils.py212CODE
LOW…pter-8/03_detection/yolov5-master/utils/torch_utils.py318CODE
LOW…/chapter-8/03_detection/yolov5-master/utils/general.py468CODE
LOW…/chapter-8/03_detection/yolov5-master/utils/general.py506CODE
LOW…/chapter-8/03_detection/yolov5-master/utils/general.py628CODE
67 more matches not shown…
Excessive Try-Catch Wrapping87 hits · 94 pts
SeverityFileLineSnippetContext
LOWcode/chapter-8/03_detection/yolov5-master/val.py326 except Exception as e:CODE
LOWcode/chapter-8/03_detection/yolov5-master/export.py109 except Exception as e:CODE
LOWcode/chapter-8/03_detection/yolov5-master/export.py183 except Exception as e:CODE
LOWcode/chapter-8/03_detection/yolov5-master/export.py254 except Exception:CODE
LOWcode/chapter-8/03_detection/yolov5-master/export.py326 except Exception:CODE
LOWcode/chapter-8/03_detection/yolov5-master/hubconf.py59 except Exception:CODE
LOWcode/chapter-8/03_detection/yolov5-master/hubconf.py75 except Exception as e:CODE
LOWcode/chapter-8/03_detection/yolov5-master/benchmarks.py91 except Exception as e:CODE
LOWcode/chapter-8/03_detection/yolov5-master/benchmarks.py133 except Exception:CODE
LOW…de/chapter-8/03_detection/yolov5-master/segment/val.py392 except Exception as e:CODE
LOW…hapter-8/03_detection/yolov5-master/utils/autobatch.py55 except Exception as e:CODE
LOW…pter-8/03_detection/yolov5-master/utils/dataloaders.py482 except Exception as e:CODE
LOW…pter-8/03_detection/yolov5-master/utils/dataloaders.py492 except Exception:CODE
LOW…pter-8/03_detection/yolov5-master/utils/dataloaders.py640 except Exception as e:CODE
LOW…pter-8/03_detection/yolov5-master/utils/dataloaders.py1036 except Exception as e:CODE
LOW…pter-8/03_detection/yolov5-master/utils/dataloaders.py1065 except Exception as e:CODE
LOW…pter-8/03_detection/yolov5-master/utils/dataloaders.py1105 except Exception as e: # use OpenCVCODE
LOW…hapter-8/03_detection/yolov5-master/utils/downloads.py70 except Exception as e: # url2CODE
LOW⚡…hapter-8/03_detection/yolov5-master/utils/downloads.py112 except Exception:CODE
LOW⚡…hapter-8/03_detection/yolov5-master/utils/downloads.py115 except Exception:CODE
LOW⚡…hapter-8/03_detection/yolov5-master/utils/downloads.py118 except Exception:CODE
LOW…de/chapter-8/03_detection/yolov5-master/utils/plots.py61 except Exception: # download if missingCODE
LOW…de/chapter-8/03_detection/yolov5-master/utils/plots.py507 except Exception as e:CODE
LOW…de/chapter-8/03_detection/yolov5-master/utils/plots.py539 except Exception as e:CODE
LOW…apter-8/03_detection/yolov5-master/utils/autoanchor.py136 except Exception:CODE
LOW…pter-8/03_detection/yolov5-master/utils/torch_utils.py104 except Exception:CODE
LOW…pter-8/03_detection/yolov5-master/utils/torch_utils.py174 except Exception:CODE
LOW…pter-8/03_detection/yolov5-master/utils/torch_utils.py185 except Exception: # no backward methodCODE
LOW…pter-8/03_detection/yolov5-master/utils/torch_utils.py195 except Exception as e:CODE
LOW…pter-8/03_detection/yolov5-master/utils/torch_utils.py290 except Exception:CODE
LOW…pter-8/03_detection/yolov5-master/utils/torch_utils.py357 except Exception:CODE
LOW…/chapter-8/03_detection/yolov5-master/utils/general.py322 except Exception:CODE
LOW…/chapter-8/03_detection/yolov5-master/utils/general.py420 except Exception as e:CODE
LOW…/chapter-8/03_detection/yolov5-master/utils/general.py446 except Exception as e:CODE
LOW…/chapter-8/03_detection/yolov5-master/utils/general.py594 except Exception:CODE
LOW…/chapter-8/03_detection/yolov5-master/utils/general.py1130 except Exception:CODE
MEDIUM…/chapter-8/03_detection/yolov5-master/utils/general.py1126def imwrite(path, im):CODE
LOW…er-8/03_detection/yolov5-master/utils/augmentations.py45 except Exception as e:CODE
LOW…er-8/03_detection/yolov5-master/utils/augmentations.py343 except Exception as e:CODE
LOW…8/03_detection/yolov5-master/utils/loggers/__init__.py113 except Exception:CODE
LOW…8/03_detection/yolov5-master/utils/loggers/__init__.py392 except Exception as e:CODE
LOW…ction/yolov5-master/utils/loggers/comet/comet_utils.py61 except Exception as e:CODE
LOW…er-8/03_detection/yolov5-master/utils/segment/plots.py139 except Exception as e:CODE
LOW…de/chapter-8/03_detection/yolov5-master/models/yolo.py387 except Exception as e:CODE
MEDIUM…de/chapter-8/03_detection/yolov5-master/models/yolo.py388 print(f'Error in {cfg}: {e}')CODE
LOW…pter-8/03_detection/yolov5-master/data/Objects365.yaml437 except Exception as e:CODE
LOW…e/chapter-8/03_detection/yolov5-master/data/xView.yaml132 except Exception as e:CODE
LOWcode/chapter-8/04_tracking/utils/autobatch.py55 except Exception as e:CODE
LOWcode/chapter-8/04_tracking/utils/dataloaders.py482 except Exception as e:CODE
LOWcode/chapter-8/04_tracking/utils/dataloaders.py492 except Exception:CODE
LOWcode/chapter-8/04_tracking/utils/dataloaders.py640 except Exception as e:CODE
LOWcode/chapter-8/04_tracking/utils/dataloaders.py1036 except Exception as e:CODE
LOWcode/chapter-8/04_tracking/utils/dataloaders.py1065 except Exception as e:CODE
LOWcode/chapter-8/04_tracking/utils/dataloaders.py1105 except Exception as e: # use OpenCVCODE
LOWcode/chapter-8/04_tracking/utils/downloads.py70 except Exception as e: # url2CODE
LOW⚡code/chapter-8/04_tracking/utils/downloads.py112 except Exception:CODE
LOW⚡code/chapter-8/04_tracking/utils/downloads.py115 except Exception:CODE
LOW⚡code/chapter-8/04_tracking/utils/downloads.py118 except Exception:CODE
LOWcode/chapter-8/04_tracking/utils/plots.py61 except Exception: # download if missingCODE
LOWcode/chapter-8/04_tracking/utils/plots.py507 except Exception as e:CODE
27 more matches not shown…
AI Structural Patterns55 hits · 55 pts
SeverityFileLineSnippetContext
LOWcode/chapter-7/my_utils.py87CODE
LOWcode/chapter-7/my_utils.py124CODE
LOWcode/chapter-9/e_gpt/tokenizations/tokenization_bert.py105CODE
LOW…-9/e_gpt/tokenizations/tokenization_bert_word_level.py108CODE
LOWcode/chapter-9/d_bert/processors/ner_seq.py68CODE
LOWcode/chapter-9/d_bert/processors/ner_seq.py29CODE
LOWcode/chapter-9/d_bert/processors/ner_seq.py49CODE
LOWcode/chapter-9/d_bert/processors/ner_span.py64CODE
LOWcode/chapter-9/d_bert/processors/ner_span.py21CODE
LOWcode/chapter-9/d_bert/processors/ner_span.py44CODE
LOWcode/chapter-9/d_bert/callback/lr_scheduler.py143CODE
LOWcode/chapter-9/d_bert/callback/lr_scheduler.py261CODE
LOWcode/chapter-9/d_bert/callback/optimizater/adafactor.py18CODE
LOWcode/chapter-9/c_transformer/c_train_curve_plot.py23CODE
LOWcode/chapter-9/c_transformer/transformer/Models.py132CODE
LOW…de/chapter-8/03_detection/yolov5-master/00-save-gif.py54CODE
LOWcode/chapter-8/03_detection/yolov5-master/val.py99CODE
LOWcode/chapter-8/03_detection/yolov5-master/export.py311CODE
LOWcode/chapter-8/03_detection/yolov5-master/export.py510CODE
LOWcode/chapter-8/03_detection/yolov5-master/detect.py55CODE
LOWcode/chapter-8/03_detection/yolov5-master/benchmarks.py52CODE
LOWcode/chapter-8/03_detection/yolov5-master/benchmarks.py114CODE
LOW…e/chapter-8/03_detection/yolov5-master/classify/val.py45CODE
LOW…apter-8/03_detection/yolov5-master/classify/predict.py56CODE
LOW…de/chapter-8/03_detection/yolov5-master/segment/val.py130CODE
LOW…hapter-8/03_detection/yolov5-master/segment/predict.py56CODE
LOW…pter-8/03_detection/yolov5-master/utils/dataloaders.py103CODE
LOW…pter-8/03_detection/yolov5-master/utils/dataloaders.py439CODE
LOW…/chapter-8/03_detection/yolov5-master/utils/general.py889CODE
LOW…er-8/03_detection/yolov5-master/utils/augmentations.py144CODE
LOW…er-8/03_detection/yolov5-master/utils/augmentations.py305CODE
LOW…3_detection/yolov5-master/utils/segment/dataloaders.py23CODE
LOW…3_detection/yolov5-master/utils/segment/dataloaders.py84CODE
LOW…detection/yolov5-master/utils/segment/augmentations.py25CODE
LOWcode/chapter-8/05_cyclegan/models/networks.py433CODE
LOWcode/chapter-8/01_classification/utils/my_utils.py89CODE
LOWcode/chapter-8/01_classification/utils/my_utils.py126CODE
LOWcode/chapter-8/04_tracking/utils/dataloaders.py103CODE
LOWcode/chapter-8/04_tracking/utils/dataloaders.py439CODE
LOWcode/chapter-8/04_tracking/utils/general.py889CODE
LOWcode/chapter-8/04_tracking/utils/augmentations.py144CODE
LOWcode/chapter-8/04_tracking/utils/augmentations.py305CODE
LOWcode/chapter-8/04_tracking/utils/segment/dataloaders.py23CODE
LOWcode/chapter-8/04_tracking/utils/segment/dataloaders.py84CODE
LOW…e/chapter-8/04_tracking/utils/segment/augmentations.py25CODE
LOW…chapter-8/04_tracking/deep_sort/deep_sort/deep_sort.py14CODE
LOW…-8/07_image_captioning/clip_cap_base/my_utils/utils.py90CODE
LOW…/07_image_captioning/clip_cap_base/my_models/models.py147CODE
LOW…/07_image_captioning/clip_cap_base/my_models/models.py171CODE
LOW…e/chapter-8/07_image_captioning/cnn_rnn_base/models.py39CODE
LOWcode/chapter-6/my_utils.py61CODE
LOWcode/chapter-6/my_utils.py95CODE
LOWcode/chapter-2/02_COVID_19_cls.py97CODE
LOWcode/chapter-5/02_sgd.py95CODE
LOWcode/chapter-5/03_lr_scheduler.py97CODE
Redundant / Tautological Comments33 hits · 50 pts
SeverityFileLineSnippetContext
LOWcode/chapter-7/07_model_ensemble.py263 # Print results on different ensemble methodsCOMMENT
LOWcode/chapter-9/d_bert/run_ner_softmax.py62 # Check if saved optimizer or scheduler states existCOMMENT
LOWcode/chapter-9/d_bert/run_ner_softmax.py96 # Check if continuing training from a checkpointCOMMENT
LOWcode/chapter-9/d_bert/tools/plot.py52 # Loop over data dimensions and create text annotations.COMMENT
LOWcode/chapter-9/d_bert/models/layers/crf.py231 # Set score to the next score if this timestep is valid (mask == 1)COMMENT
LOWcode/chapter-9/d_bert/models/layers/crf.py294 # Set score to the next score if this timestep is valid (mask == 1)COMMENT
LOWcode/chapter-9/d_bert/models/layers/crf.py382 # Set score to the next score if this timestep is valid (mask == 1)COMMENT
LOW…de/chapter-8/03_detection/yolov5-master/00-save-gif.py157 # Print resultsCOMMENT
LOW…de/chapter-8/03_detection/yolov5-master/00-save-gif.py209 # Print resultsCOMMENT
LOWcode/chapter-8/03_detection/yolov5-master/val.py281 # Print resultsCOMMENT
LOWcode/chapter-8/03_detection/yolov5-master/val.py287 # Print results per classCOMMENT
LOWcode/chapter-8/03_detection/yolov5-master/detect.py158 # Print resultsCOMMENT
LOWcode/chapter-8/03_detection/yolov5-master/detect.py210 # Print resultsCOMMENT
LOWcode/chapter-8/03_detection/yolov5-master/benchmarks.py99 # Print resultsCOMMENT
LOWcode/chapter-8/03_detection/yolov5-master/benchmarks.py136 # Print resultsCOMMENT
LOW…e/chapter-8/03_detection/yolov5-master/classify/val.py135 # Print resultsCOMMENT
LOW…apter-8/03_detection/yolov5-master/classify/predict.py140 # Print resultsCOMMENT
LOW…apter-8/03_detection/yolov5-master/classify/predict.py184 # Print resultsCOMMENT
LOW…de/chapter-8/03_detection/yolov5-master/segment/val.py344 # Print resultsCOMMENT
LOW…de/chapter-8/03_detection/yolov5-master/segment/val.py350 # Print results per classCOMMENT
LOW…hapter-8/03_detection/yolov5-master/segment/predict.py170 # Print resultsCOMMENT
LOW…hapter-8/03_detection/yolov5-master/segment/predict.py231 # Print resultsCOMMENT
LOW…hapter-8/03_detection/yolov5-master/utils/downloads.py17 # Check if string is URL and check if URL existsCOMMENT
LOW…/chapter-8/03_detection/yolov5-master/utils/general.py437 # Check if environment supports image displaysCOMMENT
LOW…etection/yolov5-master/utils/loggers/comet/__init__.py157 # Check if running the Experiment with the Comet OptimizerCOMMENT
LOW…etection/yolov5-master/utils/loggers/comet/__init__.py433 # Check if running Experiment with Comet OptimizerCOMMENT
LOW…n/yolov5-master/utils/loggers/clearml/clearml_utils.py112 # Set data to data_dict because wandb will crash without this information and opt is the best wayCOMMENT
LOWcode/chapter-8/04_tracking/utils/downloads.py17 # Check if string is URL and check if URL existsCOMMENT
LOWcode/chapter-8/04_tracking/utils/general.py437 # Check if environment supports image displaysCOMMENT
LOW…/chapter-8/04_tracking/utils/loggers/comet/__init__.py157 # Check if running the Experiment with the Comet OptimizerCOMMENT
LOW…/chapter-8/04_tracking/utils/loggers/comet/__init__.py433 # Check if running Experiment with Comet OptimizerCOMMENT
LOW…r-8/04_tracking/utils/loggers/clearml/clearml_utils.py112 # Set data to data_dict because wandb will crash without this information and opt is the best wayCOMMENT
LOW…chapter-8/07_image_captioning/cnn_rnn_base/01_train.py125 # Check if there was an improvementCOMMENT
Hyper-Verbose Identifiers48 hits · 48 pts
SeverityFileLineSnippetContext
LOWcode/chapter-9/d_bert/02_predict_parse.py12def extract_entities_from_lines(test_data_path, predictions_path):CODE
LOW…_bert/tools/convert_albert_tf_checkpoint_to_pytorch.py14def convert_tf_checkpoint_to_pytorch(tf_checkpoint_path, bert_config_file, pytorch_dump_path):CODE
LOWcode/chapter-9/d_bert/processors/utils_ner.py6class DataProcessor(object):CODE
LOWcode/chapter-9/d_bert/processors/ner_seq.py68def convert_examples_to_features(examples,label_list,max_seq_length,tokenizer,CODE
LOWcode/chapter-9/d_bert/processors/ner_span.py64def convert_examples_to_features(examples,label_list,max_seq_length,tokenizer,CODE
LOWcode/chapter-9/d_bert/callback/lr_scheduler.py13def get_constant_schedule_with_warmup(optimizer, num_warmup_steps, last_epoch=-1):CODE
LOWcode/chapter-9/d_bert/callback/lr_scheduler.py25def get_linear_schedule_with_warmup(optimizer, num_warmup_steps, num_training_steps, last_epoch=-1):CODE
LOWcode/chapter-9/d_bert/callback/lr_scheduler.py37def get_cosine_schedule_with_warmup(optimizer, num_warmup_steps, num_training_steps, num_cycles=.5, last_epoch=-1):CODE
LOWcode/chapter-9/d_bert/callback/lr_scheduler.py51def get_cosine_with_hard_restarts_schedule_with_warmup(optimizer, num_warmup_steps, num_training_steps, num_cycles=1., lCODE
LOWcode/chapter-9/c_transformer/transformer/Models.py32 def _get_sinusoid_encoding_table(self, n_position, d_hid):CODE
LOWcode/chapter-9/c_transformer/transformer/Translator.py60 def _get_the_best_score_and_idx(self, gen_seq, dec_output, scores, step):CODE
LOW…e/chapter-8/03_detection/yolov5-master/utils/triton.py32 def create_input_placeholders() -> typing.List[InferInput]:CODE
LOW…e/chapter-8/03_detection/yolov5-master/utils/triton.py44 def create_input_placeholders() -> typing.List[InferInput]:CODE
LOW…pter-8/03_detection/yolov5-master/utils/dataloaders.py1197def create_classification_dataloader(path,CODE
LOW…pter-8/03_detection/yolov5-master/utils/torch_utils.py66def reshape_classifier_output(model, n=1000):CODE
LOW…pter-8/03_detection/yolov5-master/utils/torch_utils.py89def torch_distributed_zero_first(local_rank: int):CODE
LOW…8/03_detection/yolov5-master/utils/loggers/__init__.py151 def on_pretrain_routine_start(self):CODE
LOW…etection/yolov5-master/utils/loggers/comet/__init__.py348 def download_dataset_artifact(self, artifact_path):CODE
LOW…ction/yolov5-master/utils/loggers/comet/comet_utils.py19def download_model_checkpoint(opt, experiment):CODE
LOW…-8/03_detection/yolov5-master/utils/segment/metrics.py17def ap_per_class_box_and_mask(CODE
LOWcode/chapter-8/03_detection/yolov5-master/models/tf.py554def representative_dataset_gen(dataset, ncalib=100):CODE
LOWcode/chapter-8/05_cyclegan/util/visualizer.py107 def create_visdom_connections(self):CODE
LOWcode/chapter-8/05_cyclegan/models/test_model.py12 def modify_commandline_options(parser, is_train=True):CODE
LOWcode/chapter-8/05_cyclegan/models/template_model.py25 def modify_commandline_options(parser, is_train=True):CODE
LOWcode/chapter-8/05_cyclegan/models/cycle_gan_model.py20 def modify_commandline_options(parser, is_train=True):CODE
LOWcode/chapter-8/05_cyclegan/models/pix2pix_model.py17 def modify_commandline_options(parser, is_train=True):CODE
LOWcode/chapter-8/05_cyclegan/models/colorization_model.py15 def modify_commandline_options(parser, is_train=True):CODE
LOWcode/chapter-8/05_cyclegan/models/base_model.py47 def modify_commandline_options(parser, is_train):CODE
LOWcode/chapter-8/05_cyclegan/models/base_model.py162 def __patch_instance_norm_state_dict(self, state_dict, module, keys, i=0):CODE
LOWcode/chapter-8/05_cyclegan/data/colorization_dataset.py16 def modify_commandline_options(parser, is_train):CODE
LOWcode/chapter-8/05_cyclegan/data/base_dataset.py33 def modify_commandline_options(parser, is_train):CODE
LOWcode/chapter-8/05_cyclegan/data/template_dataset.py22 def modify_commandline_options(parser, is_train):CODE
LOW…apter-8/06_diffusion-model/DDPM/Diffusion/Diffusion.py71 def predict_xt_prev_mean_from_eps(self, x_t, t, eps):CODE
LOW…model/DDPM/DiffusionFreeGuidence/DiffusionCondition.py68 def predict_xt_prev_mean_from_eps(self, x_t, t, eps):CODE
LOWcode/chapter-8/04_tracking/01-main.py125 def get_currently_ids_by_area(tracks, bbox_area_list_, area_index):CODE
LOWcode/chapter-8/04_tracking/utils/triton.py32 def create_input_placeholders() -> typing.List[InferInput]:CODE
LOWcode/chapter-8/04_tracking/utils/triton.py44 def create_input_placeholders() -> typing.List[InferInput]:CODE
LOWcode/chapter-8/04_tracking/utils/dataloaders.py1197def create_classification_dataloader(path,CODE
LOWcode/chapter-8/04_tracking/utils/torch_utils.py66def reshape_classifier_output(model, n=1000):CODE
LOWcode/chapter-8/04_tracking/utils/torch_utils.py89def torch_distributed_zero_first(local_rank: int):CODE
LOWcode/chapter-8/04_tracking/utils/loggers/__init__.py151 def on_pretrain_routine_start(self):CODE
LOW…/chapter-8/04_tracking/utils/loggers/comet/__init__.py348 def download_dataset_artifact(self, artifact_path):CODE
LOW…apter-8/04_tracking/utils/loggers/comet/comet_utils.py19def download_model_checkpoint(opt, experiment):CODE
LOWcode/chapter-8/04_tracking/utils/segment/metrics.py17def ap_per_class_box_and_mask(CODE
LOWcode/chapter-8/04_tracking/models/tf.py554def representative_dataset_gen(dataset, ncalib=100):CODE
LOW…e/chapter-8/04_tracking/deep_sort/utils/json_logger.py358 def schedule_output_by_frames(self, frames_quota, frame_counter, output_dir=JsonMeta.PATH_TO_SAVE):CODE
LOW…e/chapter-8/07_image_captioning/cnn_rnn_base/models.py133 def load_pretrained_embeddings(self, embeddings):CODE
LOW…ter-8/07_image_captioning/cnn_rnn_base/02_inference.py21def caption_image_beam_search(encoder, decoder, img, word_map, beam_size=3):CODE
Docstring Block Structure7 hits · 35 pts
SeverityFileLineSnippetContext
HIGH…e/chapter-8/04_tracking/deep_sort/utils/json_logger.py196 Args: frame_id (int): timestamp (float): opencv captured frame time property RSTRING
HIGH…e/chapter-8/04_tracking/deep_sort/utils/json_logger.py228 Args: frame_id: bbox_id: Returns: bbox_id (int): Raises:STRING
HIGH…e/chapter-8/04_tracking/deep_sort/utils/json_logger.py246 Args: frame_id (int): bbox_id (int): top (int): left (int): STRING
HIGH…e/chapter-8/04_tracking/deep_sort/utils/json_logger.py274 Args: frame_id: bbox_id: category: confidence: the confidence vSTRING
HIGH…e/chapter-8/04_tracking/deep_sort/utils/json_logger.py307 Args: output_name: Returns: None Notes: It creates the jsSTRING
HIGH…e/chapter-8/04_tracking/deep_sort/utils/json_logger.py328 Notes: Creates folder and then periodically stores the jsons on that address. Args: STRING
HIGH…e/chapter-8/04_tracking/deep_sort/utils/json_logger.py369 Notes: We use this function to output jsons whenever possible. like the time that we exSTRING
Self-Referential Comments14 hits · 34 pts
SeverityFileLineSnippetContext
MEDIUMcode/chapter-9/a_rnn_lstm/models/rnn.py103 # Create an instance of the RNNTextClassifierCOMMENT
MEDIUM…pter-8/03_detection/yolov5-master/utils/dataloaders.py321 # Create a new video capture objectCOMMENT
MEDIUM…hapter-8/03_detection/yolov5-master/utils/callbacks.py15 # Define the available callbacksCOMMENT
MEDIUM…de/chapter-8/03_detection/yolov5-master/models/yolo.py280 # Create a YOLOv5 classification model from a YOLOv5 detection modelCOMMENT
MEDIUM…de/chapter-8/03_detection/yolov5-master/models/yolo.py295 # Create a YOLOv5 classification model from a *.yaml fileCOMMENT
MEDIUMcode/chapter-8/05_cyclegan/util/image_pool.py6 """This class implements an image buffer that stores previously generated images.STRING
MEDIUMcode/chapter-8/05_cyclegan/models/base_model.py9 """This class is an abstract base class (ABC) for models.STRING
MEDIUMcode/chapter-8/05_cyclegan/data/base_dataset.py1"""This module implements an abstract base class (ABC) 'BaseDataset' for datasets.STRING
MEDIUMcode/chapter-8/05_cyclegan/data/base_dataset.py14 """This class is an abstract base class (ABC) for datasets.STRING
MEDIUMcode/chapter-8/04_tracking/utils/dataloaders.py321 # Create a new video capture objectCOMMENT
MEDIUMcode/chapter-8/04_tracking/utils/callbacks.py15 # Define the available callbacksCOMMENT
MEDIUMcode/chapter-8/04_tracking/models/yolo.py280 # Create a YOLOv5 classification model from a YOLOv5 detection modelCOMMENT
MEDIUMcode/chapter-8/04_tracking/models/yolo.py295 # Create a YOLOv5 classification model from a *.yaml fileCOMMENT
MEDIUM…de/chapter-8/07_image_captioning/cnn_rnn_base/utils.py80 # Create a base/root name for all output filesCOMMENT
Empty Error Handlers6 hits · 30 pts
SeverityFileLineSnippetContext
HIGH…er-8/03_detection/yolov5-master/utils/augmentations.py43except ImportError: # package not installed, skipCODE
HIGHcode/chapter-8/03_detection/yolov5-master/models/tf.py394except NameError:CODE
HIGHcode/chapter-8/04_tracking/utils/augmentations.py43except ImportError: # package not installed, skipCODE
HIGHcode/chapter-8/04_tracking/models/tf.py394except NameError:CODE
HIGHcode/chapter-10/cli_demo_baichuan2.py78except KeyboardInterrupt:CODE
HIGHscripts/gen_star_history.py64except Exception:CODE
Slop Phrases3 hits · 14 pts
SeverityFileLineSnippetContext
MEDIUM⚡code/chapter-8/05_cyclegan/models/template_model.py57 # you can use opt.isTrain to specify different behaviors for training and test. For example, some networks will COMMENT
MEDIUM⚡code/chapter-8/05_cyclegan/models/template_model.py59 # define networks; you can use opt.isTrain to specify different behaviors for training and test.COMMENT
MEDIUM⚡code/chapter-8/05_cyclegan/models/template_model.py66 # If two networks are updated at the same time, you can use itertools.chain to group them. See cycle_gan_modCOMMENT
Modern Structural Boilerplate13 hits · 13 pts
SeverityFileLineSnippetContext
LOWcode/chapter-9/e_gpt/tokenizations/tokenization_bert.py27logger = logging.getLogger(__name__)CODE
LOW…-9/e_gpt/tokenizations/tokenization_bert_word_level.py28logger = logging.getLogger(__name__)CODE
LOWcode/chapter-9/d_bert/processors/ner_seq.py8logger = logging.getLogger(__name__)CODE
LOWcode/chapter-9/d_bert/processors/ner_span.py8logger = logging.getLogger(__name__)CODE
LOWcode/chapter-9/c_transformer/transformer/__init__.py9__all__ = [CODE
LOW…etection/yolov5-master/utils/loggers/comet/__init__.py8logger = logging.getLogger(__name__)CODE
LOW…ction/yolov5-master/utils/loggers/comet/comet_utils.py12logger = logging.getLogger(__name__)CODE
LOW…/03_detection/yolov5-master/utils/loggers/comet/hpo.py10logger = logging.getLogger(__name__)CODE
LOW…/chapter-8/04_tracking/utils/loggers/comet/__init__.py8logger = logging.getLogger(__name__)CODE
LOW…apter-8/04_tracking/utils/loggers/comet/comet_utils.py12logger = logging.getLogger(__name__)CODE
LOWcode/chapter-8/04_tracking/utils/loggers/comet/hpo.py10logger = logging.getLogger(__name__)CODE
LOW…/chapter-8/04_tracking/deep_sort/deep_sort/__init__.py4__all__ = ['DeepSort', 'build_tracker']CODE
LOW…chapter-8/04_tracking/deep_sort/deep_sort/deep_sort.py10__all__ = ['DeepSort']CODE
Fake / Example Data11 hits · 12 pts
SeverityFileLineSnippetContext
LOW⚡code/chapter-11/01_resnet_export_onnx.py18 dummy_data = torch.randn((1, 3, 224, 224))CODE
LOW⚡code/chapter-11/01_resnet_export_onnx.py22 torch.onnx.export(model, (dummy_data), "resnet50_bs_1.onnx",CODE
LOW⚡code/chapter-11/01_resnet_export_onnx.py30 torch.onnx.export(model, (dummy_data), "resnet50_bs_dynamic.onnx",CODE
LOWcode/chapter-8/05_cyclegan/models/networks.py278def cal_gradient_penalty(netD, real_data, fake_data, device, type='mixed', constant=1.0, lambda_gp=10.0):CODE
LOWcode/chapter-8/05_cyclegan/models/networks.py284 fake_data (tensor array) -- generated images from the generatorSTRING
LOWcode/chapter-8/05_cyclegan/models/networks.py296 interpolatesv = fake_dataCODE
LOWcode/chapter-8/05_cyclegan/models/networks.py300 interpolatesv = alpha * real_data + ((1 - alpha) * fake_data)CODE
LOW…e/chapter-8/01_classification/01_resnet_export_onnx.py34 dummy_data = torch.randn((1, 3, 224, 224))CODE
LOW…e/chapter-8/01_classification/01_resnet_export_onnx.py39 torch.onnx.export(model, (dummy_data), path_out,CODE
LOW…/07_image_captioning/clip_cap_base/my_models/models.py168 dummy_token = self.get_dummy_token(tokens.shape[0], tokens.device)CODE
LOW…/07_image_captioning/clip_cap_base/my_models/models.py169 labels = torch.cat((dummy_token, tokens), dim=1)CODE
Verbosity Indicators5 hits · 10 pts
SeverityFileLineSnippetContext
LOWcode/chapter-1/03-torch-compile-performance.py148 # Step 1: Normalize the input arrays to have zero mean and unit varianceCOMMENT
LOW⚡code/chapter-1/03-torch-compile-performance.py159 # Step 2: Perform the tensor product followed by sum over last two dimensionsCOMMENT
LOW⚡code/chapter-1/03-torch-compile-performance.py162 # Step 3: Apply thresholding to clip values outside of [-1, 1]COMMENT
LOW⚡code/chapter-1/03-torch-compile-performance.py165 # Step 4: Apply exponential function for non-linearityCOMMENT
LOW⚡code/chapter-1/03-torch-compile-performance.py168 # Step 5: Add a small regularization term to avoid overfittingCOMMENT
Structural Annotation Overuse5 hits · 10 pts
SeverityFileLineSnippetContext
LOWcode/chapter-1/03-torch-compile-performance.py148 # Step 1: Normalize the input arrays to have zero mean and unit varianceCOMMENT
LOW⚡code/chapter-1/03-torch-compile-performance.py159 # Step 2: Perform the tensor product followed by sum over last two dimensionsCOMMENT
LOW⚡code/chapter-1/03-torch-compile-performance.py162 # Step 3: Apply thresholding to clip values outside of [-1, 1]COMMENT
LOW⚡code/chapter-1/03-torch-compile-performance.py165 # Step 4: Apply exponential function for non-linearityCOMMENT
LOW⚡code/chapter-1/03-torch-compile-performance.py168 # Step 5: Add a small regularization term to avoid overfittingCOMMENT
Example Usage Blocks6 hits · 9 pts
SeverityFileLineSnippetContext
LOWcode/chapter-9/a_rnn_lstm/models/rnn.py96 # Example usageCOMMENT
LOWcode/chapter-9/b_seq2seq/models/seq2seq.py137 # Example usageCOMMENT
LOW…hapter-8/03_detection/yolov5-master/utils/autobatch.py23 # Usage:COMMENT
LOW…/chapter-8/03_detection/yolov5-master/models/common.py318 # Usage:COMMENT
LOWcode/chapter-8/04_tracking/utils/autobatch.py23 # Usage:COMMENT
LOWcode/chapter-8/04_tracking/models/common.py318 # Usage:COMMENT
AI Response Leakage1 hit · 8 pts
SeverityFileLineSnippetContext
HIGHcode/chapter-6/04_cam_series_demo.py86 # In this example grayscale_cam has only one image in the batch:COMMENT
AI Slop Vocabulary2 hits · 6 pts
SeverityFileLineSnippetContext
MEDIUM…/chapter-8/03_detection/yolov5-master/models/common.py623 # YOLOv5 input-robust model wrapper for passing cv2/np/PIL/torch inputs. Includes preprocessing, inference and NMSCOMMENT
MEDIUMcode/chapter-8/04_tracking/models/common.py623 # YOLOv5 input-robust model wrapper for passing cv2/np/PIL/torch inputs. Includes preprocessing, inference and NMSCOMMENT
TODO Padding2 hits · 3 pts
SeverityFileLineSnippetContext
LOW…er-8/03_detection/yolov5-master/utils/augmentations.py325 # TODO: implement AugMix, AutoAug & RandAug in albumentationCOMMENT
LOWcode/chapter-8/04_tracking/utils/augmentations.py325 # TODO: implement AugMix, AutoAug & RandAug in albumentationCOMMENT
Cross-Language Confusion1 hit · 2 pts
SeverityFileLineSnippetContext
HIGHcode/chapter-8/03_detection/yolov5-master/export.py41 $ cd .. && git clone https://github.com/zldrobit/tfjs-yolov5-example.git && cd tfjs-yolov5-exampleSTRING