diff --git a/bandit_report.json b/bandit_report.json new file mode 100644 index 0000000..667e4fa --- /dev/null +++ b/bandit_report.json @@ -0,0 +1,8151 @@ +{ + "errors": [], + "generated_at": "2024-03-18T18:16:05Z", + "metrics": { + "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/__init__.py": { + "CONFIDENCE.HIGH": 0, + "CONFIDENCE.LOW": 0, + "CONFIDENCE.MEDIUM": 0, + "CONFIDENCE.UNDEFINED": 0, + "SEVERITY.HIGH": 0, + "SEVERITY.LOW": 0, + "SEVERITY.MEDIUM": 0, + "SEVERITY.UNDEFINED": 0, + "loc": 7, + "nosec": 0, + "skipped_tests": 0 + }, + "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/algorithm/__init__.py": { + "CONFIDENCE.HIGH": 0, + "CONFIDENCE.LOW": 0, + "CONFIDENCE.MEDIUM": 0, + "CONFIDENCE.UNDEFINED": 0, + "SEVERITY.HIGH": 0, + "SEVERITY.LOW": 0, + "SEVERITY.MEDIUM": 0, + "SEVERITY.UNDEFINED": 0, + "loc": 19, + "nosec": 0, + "skipped_tests": 0 + }, + "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/algorithm/bedrock.py": { + "CONFIDENCE.HIGH": 0, + "CONFIDENCE.LOW": 0, + "CONFIDENCE.MEDIUM": 0, + "CONFIDENCE.UNDEFINED": 0, + "SEVERITY.HIGH": 0, + "SEVERITY.LOW": 0, + "SEVERITY.MEDIUM": 0, + "SEVERITY.UNDEFINED": 0, + "loc": 136, + "nosec": 0, + "skipped_tests": 0 + }, + "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/algorithm/huggingface/__init__.py": { + "CONFIDENCE.HIGH": 0, + "CONFIDENCE.LOW": 0, + "CONFIDENCE.MEDIUM": 0, + "CONFIDENCE.UNDEFINED": 0, + "SEVERITY.HIGH": 0, + "SEVERITY.LOW": 0, + "SEVERITY.MEDIUM": 0, + "SEVERITY.UNDEFINED": 0, + "loc": 0, + "nosec": 0, + "skipped_tests": 0 + }, + "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/algorithm/huggingface/transformers.py": { + "CONFIDENCE.HIGH": 12, + "CONFIDENCE.LOW": 0, + "CONFIDENCE.MEDIUM": 0, + "CONFIDENCE.UNDEFINED": 0, + "SEVERITY.HIGH": 0, + "SEVERITY.LOW": 12, + "SEVERITY.MEDIUM": 0, + "SEVERITY.UNDEFINED": 0, + "loc": 502, + "nosec": 0, + "skipped_tests": 0 + }, + "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/algorithm/langchain.py": { + "CONFIDENCE.HIGH": 0, + "CONFIDENCE.LOW": 0, + "CONFIDENCE.MEDIUM": 0, + "CONFIDENCE.UNDEFINED": 0, + "SEVERITY.HIGH": 0, + "SEVERITY.LOW": 0, + "SEVERITY.MEDIUM": 0, + "SEVERITY.UNDEFINED": 0, + "loc": 82, + "nosec": 0, + "skipped_tests": 0 + }, + "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/algorithm/sentence_transformers.py": { + "CONFIDENCE.HIGH": 1, + "CONFIDENCE.LOW": 0, + "CONFIDENCE.MEDIUM": 0, + "CONFIDENCE.UNDEFINED": 0, + "SEVERITY.HIGH": 0, + "SEVERITY.LOW": 1, + "SEVERITY.MEDIUM": 0, + "SEVERITY.UNDEFINED": 0, + "loc": 81, + "nosec": 0, + "skipped_tests": 0 + }, + "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/algorithm/sklearn/SklearnSGDClassifier.py": { + "CONFIDENCE.HIGH": 1, + "CONFIDENCE.LOW": 0, + "CONFIDENCE.MEDIUM": 0, + "CONFIDENCE.UNDEFINED": 0, + "SEVERITY.HIGH": 0, + "SEVERITY.LOW": 1, + "SEVERITY.MEDIUM": 0, + "SEVERITY.UNDEFINED": 0, + "loc": 41, + "nosec": 0, + "skipped_tests": 0 + }, + "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/algorithm/sklearn/SklearnSGDRegressor.py": { + "CONFIDENCE.HIGH": 1, + "CONFIDENCE.LOW": 0, + "CONFIDENCE.MEDIUM": 0, + "CONFIDENCE.UNDEFINED": 0, + "SEVERITY.HIGH": 0, + "SEVERITY.LOW": 1, + "SEVERITY.MEDIUM": 0, + "SEVERITY.UNDEFINED": 0, + "loc": 34, + "nosec": 0, + "skipped_tests": 0 + }, + "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/algorithm/sklearn/__init__.py": { + "CONFIDENCE.HIGH": 0, + "CONFIDENCE.LOW": 0, + "CONFIDENCE.MEDIUM": 0, + "CONFIDENCE.UNDEFINED": 0, + "SEVERITY.HIGH": 0, + "SEVERITY.LOW": 0, + "SEVERITY.MEDIUM": 0, + "SEVERITY.UNDEFINED": 0, + "loc": 0, + "nosec": 0, + "skipped_tests": 0 + }, + "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/constants/AlgorithmConstants.py": { + "CONFIDENCE.HIGH": 0, + "CONFIDENCE.LOW": 0, + "CONFIDENCE.MEDIUM": 0, + "CONFIDENCE.UNDEFINED": 0, + "SEVERITY.HIGH": 0, + "SEVERITY.LOW": 0, + "SEVERITY.MEDIUM": 0, + "SEVERITY.UNDEFINED": 0, + "loc": 17, + "nosec": 0, + "skipped_tests": 0 + }, + "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/constants/Alias.py": { + "CONFIDENCE.HIGH": 1, + "CONFIDENCE.LOW": 0, + "CONFIDENCE.MEDIUM": 0, + "CONFIDENCE.UNDEFINED": 0, + "SEVERITY.HIGH": 0, + "SEVERITY.LOW": 1, + "SEVERITY.MEDIUM": 0, + "SEVERITY.UNDEFINED": 0, + "loc": 355, + "nosec": 0, + "skipped_tests": 0 + }, + "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/constants/DataProcessingConstants.py": { + "CONFIDENCE.HIGH": 0, + "CONFIDENCE.LOW": 0, + "CONFIDENCE.MEDIUM": 0, + "CONFIDENCE.UNDEFINED": 0, + "SEVERITY.HIGH": 0, + "SEVERITY.LOW": 0, + "SEVERITY.MEDIUM": 0, + "SEVERITY.UNDEFINED": 0, + "loc": 126, + "nosec": 0, + "skipped_tests": 0 + }, + "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/constants/FileConstants.py": { + "CONFIDENCE.HIGH": 0, + "CONFIDENCE.LOW": 0, + "CONFIDENCE.MEDIUM": 0, + "CONFIDENCE.UNDEFINED": 0, + "SEVERITY.HIGH": 0, + "SEVERITY.LOW": 0, + "SEVERITY.MEDIUM": 0, + "SEVERITY.UNDEFINED": 0, + "loc": 141, + "nosec": 0, + "skipped_tests": 0 + }, + "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/constants/MLConstants.py": { + "CONFIDENCE.HIGH": 0, + "CONFIDENCE.LOW": 0, + "CONFIDENCE.MEDIUM": 0, + "CONFIDENCE.UNDEFINED": 0, + "SEVERITY.HIGH": 0, + "SEVERITY.LOW": 0, + "SEVERITY.MEDIUM": 0, + "SEVERITY.UNDEFINED": 0, + "loc": 87, + "nosec": 0, + "skipped_tests": 0 + }, + "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/constants/MetricConstants.py": { + "CONFIDENCE.HIGH": 0, + "CONFIDENCE.LOW": 0, + "CONFIDENCE.MEDIUM": 0, + "CONFIDENCE.UNDEFINED": 0, + "SEVERITY.HIGH": 0, + "SEVERITY.LOW": 0, + "SEVERITY.MEDIUM": 0, + "SEVERITY.UNDEFINED": 0, + "loc": 10, + "nosec": 0, + "skipped_tests": 0 + }, + "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/constants/VisualizationConstants.py": { + "CONFIDENCE.HIGH": 0, + "CONFIDENCE.LOW": 0, + "CONFIDENCE.MEDIUM": 0, + "CONFIDENCE.UNDEFINED": 0, + "SEVERITY.HIGH": 0, + "SEVERITY.LOW": 0, + "SEVERITY.MEDIUM": 0, + "SEVERITY.UNDEFINED": 0, + "loc": 28, + "nosec": 0, + "skipped_tests": 0 + }, + "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/constants/__init__.py": { + "CONFIDENCE.HIGH": 0, + "CONFIDENCE.LOW": 0, + "CONFIDENCE.MEDIUM": 0, + "CONFIDENCE.UNDEFINED": 0, + "SEVERITY.HIGH": 0, + "SEVERITY.LOW": 0, + "SEVERITY.MEDIUM": 0, + "SEVERITY.UNDEFINED": 0, + "loc": 8, + "nosec": 0, + "skipped_tests": 0 + }, + "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/data/FileMetadata.py": { + "CONFIDENCE.HIGH": 4, + "CONFIDENCE.LOW": 1, + "CONFIDENCE.MEDIUM": 0, + "CONFIDENCE.UNDEFINED": 0, + "SEVERITY.HIGH": 0, + "SEVERITY.LOW": 4, + "SEVERITY.MEDIUM": 1, + "SEVERITY.UNDEFINED": 0, + "loc": 316, + "nosec": 0, + "skipped_tests": 0 + }, + "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/data/__init__.py": { + "CONFIDENCE.HIGH": 0, + "CONFIDENCE.LOW": 0, + "CONFIDENCE.MEDIUM": 0, + "CONFIDENCE.UNDEFINED": 0, + "SEVERITY.HIGH": 0, + "SEVERITY.LOW": 0, + "SEVERITY.MEDIUM": 0, + "SEVERITY.UNDEFINED": 0, + "loc": 7, + "nosec": 0, + "skipped_tests": 0 + }, + "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/data/asset.py": { + "CONFIDENCE.HIGH": 0, + "CONFIDENCE.LOW": 0, + "CONFIDENCE.MEDIUM": 0, + "CONFIDENCE.UNDEFINED": 0, + "SEVERITY.HIGH": 0, + "SEVERITY.LOW": 0, + "SEVERITY.MEDIUM": 0, + "SEVERITY.UNDEFINED": 0, + "loc": 118, + "nosec": 0, + "skipped_tests": 0 + }, + "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/data/pipeline.py": { + "CONFIDENCE.HIGH": 3, + "CONFIDENCE.LOW": 0, + "CONFIDENCE.MEDIUM": 0, + "CONFIDENCE.UNDEFINED": 0, + "SEVERITY.HIGH": 0, + "SEVERITY.LOW": 3, + "SEVERITY.MEDIUM": 0, + "SEVERITY.UNDEFINED": 0, + "loc": 955, + "nosec": 0, + "skipped_tests": 0 + }, + "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/data/processor/DataProcessor.py": { + "CONFIDENCE.HIGH": 0, + "CONFIDENCE.LOW": 0, + "CONFIDENCE.MEDIUM": 0, + "CONFIDENCE.UNDEFINED": 0, + "SEVERITY.HIGH": 0, + "SEVERITY.LOW": 0, + "SEVERITY.MEDIUM": 0, + "SEVERITY.UNDEFINED": 0, + "loc": 89, + "nosec": 0, + "skipped_tests": 0 + }, + "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/data/processor/Nto1ColumnProcessor.py": { + "CONFIDENCE.HIGH": 0, + "CONFIDENCE.LOW": 0, + "CONFIDENCE.MEDIUM": 0, + "CONFIDENCE.UNDEFINED": 0, + "SEVERITY.HIGH": 0, + "SEVERITY.LOW": 0, + "SEVERITY.MEDIUM": 0, + "SEVERITY.UNDEFINED": 0, + "loc": 43, + "nosec": 0, + "skipped_tests": 0 + }, + "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/data/processor/SingleColumnProcessor.py": { + "CONFIDENCE.HIGH": 0, + "CONFIDENCE.LOW": 0, + "CONFIDENCE.MEDIUM": 0, + "CONFIDENCE.UNDEFINED": 0, + "SEVERITY.HIGH": 0, + "SEVERITY.LOW": 0, + "SEVERITY.MEDIUM": 0, + "SEVERITY.UNDEFINED": 0, + "loc": 50, + "nosec": 0, + "skipped_tests": 0 + }, + "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/data/processor/__init__.py": { + "CONFIDENCE.HIGH": 0, + "CONFIDENCE.LOW": 0, + "CONFIDENCE.MEDIUM": 0, + "CONFIDENCE.UNDEFINED": 0, + "SEVERITY.HIGH": 0, + "SEVERITY.LOW": 0, + "SEVERITY.MEDIUM": 0, + "SEVERITY.UNDEFINED": 0, + "loc": 8, + "nosec": 0, + "skipped_tests": 0 + }, + "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/data/processor/categorical/CategoricalMissingValueImputation.py": { + "CONFIDENCE.HIGH": 0, + "CONFIDENCE.LOW": 0, + "CONFIDENCE.MEDIUM": 0, + "CONFIDENCE.UNDEFINED": 0, + "SEVERITY.HIGH": 0, + "SEVERITY.LOW": 0, + "SEVERITY.MEDIUM": 0, + "SEVERITY.UNDEFINED": 0, + "loc": 52, + "nosec": 0, + "skipped_tests": 0 + }, + "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/data/processor/categorical/LabelAffix.py": { + "CONFIDENCE.HIGH": 0, + "CONFIDENCE.LOW": 0, + "CONFIDENCE.MEDIUM": 0, + "CONFIDENCE.UNDEFINED": 0, + "SEVERITY.HIGH": 0, + "SEVERITY.LOW": 0, + "SEVERITY.MEDIUM": 0, + "SEVERITY.UNDEFINED": 0, + "loc": 20, + "nosec": 0, + "skipped_tests": 0 + }, + "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/data/processor/categorical/LabelEncoding.py": { + "CONFIDENCE.HIGH": 0, + "CONFIDENCE.LOW": 0, + "CONFIDENCE.MEDIUM": 0, + "CONFIDENCE.UNDEFINED": 0, + "SEVERITY.HIGH": 0, + "SEVERITY.LOW": 0, + "SEVERITY.MEDIUM": 0, + "SEVERITY.UNDEFINED": 0, + "loc": 168, + "nosec": 0, + "skipped_tests": 0 + }, + "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/data/processor/categorical/__init__.py": { + "CONFIDENCE.HIGH": 0, + "CONFIDENCE.LOW": 0, + "CONFIDENCE.MEDIUM": 0, + "CONFIDENCE.UNDEFINED": 0, + "SEVERITY.HIGH": 0, + "SEVERITY.LOW": 0, + "SEVERITY.MEDIUM": 0, + "SEVERITY.UNDEFINED": 0, + "loc": 3, + "nosec": 0, + "skipped_tests": 0 + }, + "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/data/processor/mixins.py": { + "CONFIDENCE.HIGH": 0, + "CONFIDENCE.LOW": 0, + "CONFIDENCE.MEDIUM": 0, + "CONFIDENCE.UNDEFINED": 0, + "SEVERITY.HIGH": 0, + "SEVERITY.LOW": 0, + "SEVERITY.MEDIUM": 0, + "SEVERITY.UNDEFINED": 0, + "loc": 86, + "nosec": 0, + "skipped_tests": 0 + }, + "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/data/processor/numeric/NumericMissingValueImputation.py": { + "CONFIDENCE.HIGH": 0, + "CONFIDENCE.LOW": 0, + "CONFIDENCE.MEDIUM": 0, + "CONFIDENCE.UNDEFINED": 0, + "SEVERITY.HIGH": 0, + "SEVERITY.LOW": 0, + "SEVERITY.MEDIUM": 0, + "SEVERITY.UNDEFINED": 0, + "loc": 60, + "nosec": 0, + "skipped_tests": 0 + }, + "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/data/processor/numeric/__init__.py": { + "CONFIDENCE.HIGH": 0, + "CONFIDENCE.LOW": 0, + "CONFIDENCE.MEDIUM": 0, + "CONFIDENCE.UNDEFINED": 0, + "SEVERITY.HIGH": 0, + "SEVERITY.LOW": 0, + "SEVERITY.MEDIUM": 0, + "SEVERITY.UNDEFINED": 0, + "loc": 1, + "nosec": 0, + "skipped_tests": 0 + }, + "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/data/processor/text/CaseTransformation.py": { + "CONFIDENCE.HIGH": 0, + "CONFIDENCE.LOW": 0, + "CONFIDENCE.MEDIUM": 0, + "CONFIDENCE.UNDEFINED": 0, + "SEVERITY.HIGH": 0, + "SEVERITY.LOW": 0, + "SEVERITY.MEDIUM": 0, + "SEVERITY.UNDEFINED": 0, + "loc": 23, + "nosec": 0, + "skipped_tests": 0 + }, + "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/data/processor/text/HtmlTagRemoval.py": { + "CONFIDENCE.HIGH": 0, + "CONFIDENCE.LOW": 0, + "CONFIDENCE.MEDIUM": 0, + "CONFIDENCE.UNDEFINED": 0, + "SEVERITY.HIGH": 0, + "SEVERITY.LOW": 0, + "SEVERITY.MEDIUM": 0, + "SEVERITY.UNDEFINED": 0, + "loc": 15, + "nosec": 0, + "skipped_tests": 0 + }, + "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/data/processor/text/PunctuationCleaner.py": { + "CONFIDENCE.HIGH": 0, + "CONFIDENCE.LOW": 0, + "CONFIDENCE.MEDIUM": 0, + "CONFIDENCE.UNDEFINED": 0, + "SEVERITY.HIGH": 0, + "SEVERITY.LOW": 0, + "SEVERITY.MEDIUM": 0, + "SEVERITY.UNDEFINED": 0, + "loc": 21, + "nosec": 0, + "skipped_tests": 0 + }, + "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/data/processor/text/RegexSubstitution.py": { + "CONFIDENCE.HIGH": 0, + "CONFIDENCE.LOW": 0, + "CONFIDENCE.MEDIUM": 0, + "CONFIDENCE.UNDEFINED": 0, + "SEVERITY.HIGH": 0, + "SEVERITY.LOW": 0, + "SEVERITY.MEDIUM": 0, + "SEVERITY.UNDEFINED": 0, + "loc": 46, + "nosec": 0, + "skipped_tests": 0 + }, + "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/data/processor/text/StringRemoval.py": { + "CONFIDENCE.HIGH": 0, + "CONFIDENCE.LOW": 0, + "CONFIDENCE.MEDIUM": 0, + "CONFIDENCE.UNDEFINED": 0, + "SEVERITY.HIGH": 0, + "SEVERITY.LOW": 0, + "SEVERITY.MEDIUM": 0, + "SEVERITY.UNDEFINED": 0, + "loc": 24, + "nosec": 0, + "skipped_tests": 0 + }, + "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/data/processor/text/TFIDFVectorization.py": { + "CONFIDENCE.HIGH": 1, + "CONFIDENCE.LOW": 0, + "CONFIDENCE.MEDIUM": 0, + "CONFIDENCE.UNDEFINED": 0, + "SEVERITY.HIGH": 0, + "SEVERITY.LOW": 1, + "SEVERITY.MEDIUM": 0, + "SEVERITY.UNDEFINED": 0, + "loc": 58, + "nosec": 0, + "skipped_tests": 0 + }, + "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/data/processor/text/TextConcatenation.py": { + "CONFIDENCE.HIGH": 0, + "CONFIDENCE.LOW": 0, + "CONFIDENCE.MEDIUM": 0, + "CONFIDENCE.UNDEFINED": 0, + "SEVERITY.HIGH": 0, + "SEVERITY.LOW": 0, + "SEVERITY.MEDIUM": 0, + "SEVERITY.UNDEFINED": 0, + "loc": 74, + "nosec": 0, + "skipped_tests": 0 + }, + "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/data/processor/text/__init__.py": { + "CONFIDENCE.HIGH": 0, + "CONFIDENCE.LOW": 0, + "CONFIDENCE.MEDIUM": 0, + "CONFIDENCE.UNDEFINED": 0, + "SEVERITY.HIGH": 0, + "SEVERITY.LOW": 0, + "SEVERITY.MEDIUM": 0, + "SEVERITY.UNDEFINED": 0, + "loc": 7, + "nosec": 0, + "skipped_tests": 0 + }, + "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/data/processor/vector/VectorAssembler.py": { + "CONFIDENCE.HIGH": 0, + "CONFIDENCE.LOW": 0, + "CONFIDENCE.MEDIUM": 0, + "CONFIDENCE.UNDEFINED": 0, + "SEVERITY.HIGH": 0, + "SEVERITY.LOW": 0, + "SEVERITY.MEDIUM": 0, + "SEVERITY.UNDEFINED": 0, + "loc": 49, + "nosec": 0, + "skipped_tests": 0 + }, + "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/data/processor/vector/VectorDensifier.py": { + "CONFIDENCE.HIGH": 0, + "CONFIDENCE.LOW": 0, + "CONFIDENCE.MEDIUM": 0, + "CONFIDENCE.UNDEFINED": 0, + "SEVERITY.HIGH": 0, + "SEVERITY.LOW": 0, + "SEVERITY.MEDIUM": 0, + "SEVERITY.UNDEFINED": 0, + "loc": 24, + "nosec": 0, + "skipped_tests": 0 + }, + "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/data/processor/vector/__init__.py": { + "CONFIDENCE.HIGH": 0, + "CONFIDENCE.LOW": 0, + "CONFIDENCE.MEDIUM": 0, + "CONFIDENCE.UNDEFINED": 0, + "SEVERITY.HIGH": 0, + "SEVERITY.LOW": 0, + "SEVERITY.MEDIUM": 0, + "SEVERITY.UNDEFINED": 0, + "loc": 2, + "nosec": 0, + "skipped_tests": 0 + }, + "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/data/reader/Reader.py": { + "CONFIDENCE.HIGH": 0, + "CONFIDENCE.LOW": 0, + "CONFIDENCE.MEDIUM": 0, + "CONFIDENCE.UNDEFINED": 0, + "SEVERITY.HIGH": 0, + "SEVERITY.LOW": 0, + "SEVERITY.MEDIUM": 0, + "SEVERITY.UNDEFINED": 0, + "loc": 403, + "nosec": 0, + "skipped_tests": 0 + }, + "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/data/reader/__init__.py": { + "CONFIDENCE.HIGH": 0, + "CONFIDENCE.LOW": 0, + "CONFIDENCE.MEDIUM": 0, + "CONFIDENCE.UNDEFINED": 0, + "SEVERITY.HIGH": 0, + "SEVERITY.LOW": 0, + "SEVERITY.MEDIUM": 0, + "SEVERITY.UNDEFINED": 0, + "loc": 5, + "nosec": 0, + "skipped_tests": 0 + }, + "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/data/reader/asset/AssetReader.py": { + "CONFIDENCE.HIGH": 0, + "CONFIDENCE.LOW": 0, + "CONFIDENCE.MEDIUM": 0, + "CONFIDENCE.UNDEFINED": 0, + "SEVERITY.HIGH": 0, + "SEVERITY.LOW": 0, + "SEVERITY.MEDIUM": 0, + "SEVERITY.UNDEFINED": 0, + "loc": 164, + "nosec": 0, + "skipped_tests": 0 + }, + "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/data/reader/asset/__init__.py": { + "CONFIDENCE.HIGH": 0, + "CONFIDENCE.LOW": 0, + "CONFIDENCE.MEDIUM": 0, + "CONFIDENCE.UNDEFINED": 0, + "SEVERITY.HIGH": 0, + "SEVERITY.LOW": 0, + "SEVERITY.MEDIUM": 0, + "SEVERITY.UNDEFINED": 0, + "loc": 2, + "nosec": 0, + "skipped_tests": 0 + }, + "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/data/reader/asset/audio/AudioReader.py": { + "CONFIDENCE.HIGH": 0, + "CONFIDENCE.LOW": 0, + "CONFIDENCE.MEDIUM": 0, + "CONFIDENCE.UNDEFINED": 0, + "SEVERITY.HIGH": 0, + "SEVERITY.LOW": 0, + "SEVERITY.MEDIUM": 0, + "SEVERITY.UNDEFINED": 0, + "loc": 20, + "nosec": 0, + "skipped_tests": 0 + }, + "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/data/reader/asset/audio/TorchAudioReader.py": { + "CONFIDENCE.HIGH": 0, + "CONFIDENCE.LOW": 0, + "CONFIDENCE.MEDIUM": 0, + "CONFIDENCE.UNDEFINED": 0, + "SEVERITY.HIGH": 0, + "SEVERITY.LOW": 0, + "SEVERITY.MEDIUM": 0, + "SEVERITY.UNDEFINED": 0, + "loc": 46, + "nosec": 0, + "skipped_tests": 0 + }, + "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/data/reader/asset/audio/__init__.py": { + "CONFIDENCE.HIGH": 0, + "CONFIDENCE.LOW": 0, + "CONFIDENCE.MEDIUM": 0, + "CONFIDENCE.UNDEFINED": 0, + "SEVERITY.HIGH": 0, + "SEVERITY.LOW": 0, + "SEVERITY.MEDIUM": 0, + "SEVERITY.UNDEFINED": 0, + "loc": 2, + "nosec": 0, + "skipped_tests": 0 + }, + "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/data/reader/asset/image/ImageIOReader.py": { + "CONFIDENCE.HIGH": 0, + "CONFIDENCE.LOW": 0, + "CONFIDENCE.MEDIUM": 0, + "CONFIDENCE.UNDEFINED": 0, + "SEVERITY.HIGH": 0, + "SEVERITY.LOW": 0, + "SEVERITY.MEDIUM": 0, + "SEVERITY.UNDEFINED": 0, + "loc": 79, + "nosec": 0, + "skipped_tests": 0 + }, + "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/data/reader/asset/image/ImageReader.py": { + "CONFIDENCE.HIGH": 0, + "CONFIDENCE.LOW": 0, + "CONFIDENCE.MEDIUM": 0, + "CONFIDENCE.UNDEFINED": 0, + "SEVERITY.HIGH": 0, + "SEVERITY.LOW": 0, + "SEVERITY.MEDIUM": 0, + "SEVERITY.UNDEFINED": 0, + "loc": 27, + "nosec": 0, + "skipped_tests": 0 + }, + "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/data/reader/asset/image/__init__.py": { + "CONFIDENCE.HIGH": 0, + "CONFIDENCE.LOW": 0, + "CONFIDENCE.MEDIUM": 0, + "CONFIDENCE.UNDEFINED": 0, + "SEVERITY.HIGH": 0, + "SEVERITY.LOW": 0, + "SEVERITY.MEDIUM": 0, + "SEVERITY.UNDEFINED": 0, + "loc": 2, + "nosec": 0, + "skipped_tests": 0 + }, + "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/data/reader/binary/PickleReader.py": { + "CONFIDENCE.HIGH": 2, + "CONFIDENCE.LOW": 0, + "CONFIDENCE.MEDIUM": 0, + "CONFIDENCE.UNDEFINED": 0, + "SEVERITY.HIGH": 0, + "SEVERITY.LOW": 1, + "SEVERITY.MEDIUM": 1, + "SEVERITY.UNDEFINED": 0, + "loc": 83, + "nosec": 0, + "skipped_tests": 0 + }, + "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/data/reader/binary/__init__.py": { + "CONFIDENCE.HIGH": 0, + "CONFIDENCE.LOW": 0, + "CONFIDENCE.MEDIUM": 0, + "CONFIDENCE.UNDEFINED": 0, + "SEVERITY.HIGH": 0, + "SEVERITY.LOW": 0, + "SEVERITY.MEDIUM": 0, + "SEVERITY.UNDEFINED": 0, + "loc": 1, + "nosec": 0, + "skipped_tests": 0 + }, + "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/data/reader/config/ConfigReader.py": { + "CONFIDENCE.HIGH": 0, + "CONFIDENCE.LOW": 1, + "CONFIDENCE.MEDIUM": 0, + "CONFIDENCE.UNDEFINED": 0, + "SEVERITY.HIGH": 0, + "SEVERITY.LOW": 0, + "SEVERITY.MEDIUM": 1, + "SEVERITY.UNDEFINED": 0, + "loc": 127, + "nosec": 0, + "skipped_tests": 0 + }, + "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/data/reader/config/JsonReader.py": { + "CONFIDENCE.HIGH": 0, + "CONFIDENCE.LOW": 0, + "CONFIDENCE.MEDIUM": 0, + "CONFIDENCE.UNDEFINED": 0, + "SEVERITY.HIGH": 0, + "SEVERITY.LOW": 0, + "SEVERITY.MEDIUM": 0, + "SEVERITY.UNDEFINED": 0, + "loc": 7, + "nosec": 0, + "skipped_tests": 0 + }, + "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/data/reader/config/YamlReader.py": { + "CONFIDENCE.HIGH": 0, + "CONFIDENCE.LOW": 0, + "CONFIDENCE.MEDIUM": 0, + "CONFIDENCE.UNDEFINED": 0, + "SEVERITY.HIGH": 0, + "SEVERITY.LOW": 0, + "SEVERITY.MEDIUM": 0, + "SEVERITY.UNDEFINED": 0, + "loc": 7, + "nosec": 0, + "skipped_tests": 0 + }, + "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/data/reader/config/__init__.py": { + "CONFIDENCE.HIGH": 0, + "CONFIDENCE.LOW": 0, + "CONFIDENCE.MEDIUM": 0, + "CONFIDENCE.UNDEFINED": 0, + "SEVERITY.HIGH": 0, + "SEVERITY.LOW": 0, + "SEVERITY.MEDIUM": 0, + "SEVERITY.UNDEFINED": 0, + "loc": 3, + "nosec": 0, + "skipped_tests": 0 + }, + "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/data/reader/dataframe/CsvReader.py": { + "CONFIDENCE.HIGH": 1, + "CONFIDENCE.LOW": 0, + "CONFIDENCE.MEDIUM": 0, + "CONFIDENCE.UNDEFINED": 0, + "SEVERITY.HIGH": 0, + "SEVERITY.LOW": 1, + "SEVERITY.MEDIUM": 0, + "SEVERITY.UNDEFINED": 0, + "loc": 93, + "nosec": 0, + "skipped_tests": 0 + }, + "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/data/reader/dataframe/DataFrameReader.py": { + "CONFIDENCE.HIGH": 0, + "CONFIDENCE.LOW": 0, + "CONFIDENCE.MEDIUM": 0, + "CONFIDENCE.UNDEFINED": 0, + "SEVERITY.HIGH": 0, + "SEVERITY.LOW": 0, + "SEVERITY.MEDIUM": 0, + "SEVERITY.UNDEFINED": 0, + "loc": 320, + "nosec": 0, + "skipped_tests": 0 + }, + "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/data/reader/dataframe/JsonLinesReader.py": { + "CONFIDENCE.HIGH": 1, + "CONFIDENCE.LOW": 0, + "CONFIDENCE.MEDIUM": 0, + "CONFIDENCE.UNDEFINED": 0, + "SEVERITY.HIGH": 0, + "SEVERITY.LOW": 1, + "SEVERITY.MEDIUM": 0, + "SEVERITY.UNDEFINED": 0, + "loc": 88, + "nosec": 0, + "skipped_tests": 0 + }, + "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/data/reader/dataframe/NpzReader.py": { + "CONFIDENCE.HIGH": 0, + "CONFIDENCE.LOW": 0, + "CONFIDENCE.MEDIUM": 0, + "CONFIDENCE.UNDEFINED": 0, + "SEVERITY.HIGH": 0, + "SEVERITY.LOW": 0, + "SEVERITY.MEDIUM": 0, + "SEVERITY.UNDEFINED": 0, + "loc": 98, + "nosec": 0, + "skipped_tests": 0 + }, + "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/data/reader/dataframe/ParquetReader.py": { + "CONFIDENCE.HIGH": 1, + "CONFIDENCE.LOW": 0, + "CONFIDENCE.MEDIUM": 0, + "CONFIDENCE.UNDEFINED": 0, + "SEVERITY.HIGH": 0, + "SEVERITY.LOW": 1, + "SEVERITY.MEDIUM": 0, + "SEVERITY.UNDEFINED": 0, + "loc": 100, + "nosec": 0, + "skipped_tests": 0 + }, + "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/data/reader/dataframe/__init__.py": { + "CONFIDENCE.HIGH": 0, + "CONFIDENCE.LOW": 0, + "CONFIDENCE.MEDIUM": 0, + "CONFIDENCE.UNDEFINED": 0, + "SEVERITY.HIGH": 0, + "SEVERITY.LOW": 0, + "SEVERITY.MEDIUM": 0, + "SEVERITY.UNDEFINED": 0, + "loc": 5, + "nosec": 0, + "skipped_tests": 0 + }, + "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/data/sdf/DaskScalableDataFrame.py": { + "CONFIDENCE.HIGH": 2, + "CONFIDENCE.LOW": 0, + "CONFIDENCE.MEDIUM": 0, + "CONFIDENCE.UNDEFINED": 0, + "SEVERITY.HIGH": 0, + "SEVERITY.LOW": 2, + "SEVERITY.MEDIUM": 0, + "SEVERITY.UNDEFINED": 0, + "loc": 516, + "nosec": 0, + "skipped_tests": 0 + }, + "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/data/sdf/DaskScalableSeries.py": { + "CONFIDENCE.HIGH": 0, + "CONFIDENCE.LOW": 0, + "CONFIDENCE.MEDIUM": 0, + "CONFIDENCE.UNDEFINED": 0, + "SEVERITY.HIGH": 0, + "SEVERITY.LOW": 0, + "SEVERITY.MEDIUM": 0, + "SEVERITY.UNDEFINED": 0, + "loc": 154, + "nosec": 0, + "skipped_tests": 0 + }, + "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/data/sdf/DatumScalableSeries.py": { + "CONFIDENCE.HIGH": 0, + "CONFIDENCE.LOW": 0, + "CONFIDENCE.MEDIUM": 0, + "CONFIDENCE.UNDEFINED": 0, + "SEVERITY.HIGH": 0, + "SEVERITY.LOW": 0, + "SEVERITY.MEDIUM": 0, + "SEVERITY.UNDEFINED": 0, + "loc": 313, + "nosec": 0, + "skipped_tests": 0 + }, + "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/data/sdf/DictScalableDataFrame.py": { + "CONFIDENCE.HIGH": 1, + "CONFIDENCE.LOW": 0, + "CONFIDENCE.MEDIUM": 0, + "CONFIDENCE.UNDEFINED": 0, + "SEVERITY.HIGH": 0, + "SEVERITY.LOW": 1, + "SEVERITY.MEDIUM": 0, + "SEVERITY.UNDEFINED": 0, + "loc": 316, + "nosec": 0, + "skipped_tests": 0 + }, + "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/data/sdf/ListOfDictScalableDataFrame.py": { + "CONFIDENCE.HIGH": 1, + "CONFIDENCE.LOW": 0, + "CONFIDENCE.MEDIUM": 0, + "CONFIDENCE.UNDEFINED": 0, + "SEVERITY.HIGH": 0, + "SEVERITY.LOW": 1, + "SEVERITY.MEDIUM": 0, + "SEVERITY.UNDEFINED": 0, + "loc": 318, + "nosec": 0, + "skipped_tests": 0 + }, + "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/data/sdf/NumpyArrayScalableSeries.py": { + "CONFIDENCE.HIGH": 1, + "CONFIDENCE.LOW": 0, + "CONFIDENCE.MEDIUM": 0, + "CONFIDENCE.UNDEFINED": 0, + "SEVERITY.HIGH": 0, + "SEVERITY.LOW": 1, + "SEVERITY.MEDIUM": 0, + "SEVERITY.UNDEFINED": 0, + "loc": 385, + "nosec": 0, + "skipped_tests": 0 + }, + "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/data/sdf/NumpyRecordArrayScalableDataFrame.py": { + "CONFIDENCE.HIGH": 1, + "CONFIDENCE.LOW": 0, + "CONFIDENCE.MEDIUM": 0, + "CONFIDENCE.UNDEFINED": 0, + "SEVERITY.HIGH": 0, + "SEVERITY.LOW": 1, + "SEVERITY.MEDIUM": 0, + "SEVERITY.UNDEFINED": 0, + "loc": 134, + "nosec": 0, + "skipped_tests": 0 + }, + "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/data/sdf/PandasScalableDataFrame.py": { + "CONFIDENCE.HIGH": 1, + "CONFIDENCE.LOW": 0, + "CONFIDENCE.MEDIUM": 0, + "CONFIDENCE.UNDEFINED": 0, + "SEVERITY.HIGH": 0, + "SEVERITY.LOW": 1, + "SEVERITY.MEDIUM": 0, + "SEVERITY.UNDEFINED": 0, + "loc": 86, + "nosec": 0, + "skipped_tests": 0 + }, + "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/data/sdf/PandasScalableSeries.py": { + "CONFIDENCE.HIGH": 0, + "CONFIDENCE.LOW": 0, + "CONFIDENCE.MEDIUM": 0, + "CONFIDENCE.UNDEFINED": 0, + "SEVERITY.HIGH": 0, + "SEVERITY.LOW": 0, + "SEVERITY.MEDIUM": 0, + "SEVERITY.UNDEFINED": 0, + "loc": 58, + "nosec": 0, + "skipped_tests": 0 + }, + "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/data/sdf/RecordScalableDataFrame.py": { + "CONFIDENCE.HIGH": 1, + "CONFIDENCE.LOW": 0, + "CONFIDENCE.MEDIUM": 0, + "CONFIDENCE.UNDEFINED": 0, + "SEVERITY.HIGH": 0, + "SEVERITY.LOW": 1, + "SEVERITY.MEDIUM": 0, + "SEVERITY.UNDEFINED": 0, + "loc": 213, + "nosec": 0, + "skipped_tests": 0 + }, + "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/data/sdf/ScalableDataFrame.py": { + "CONFIDENCE.HIGH": 8, + "CONFIDENCE.LOW": 0, + "CONFIDENCE.MEDIUM": 0, + "CONFIDENCE.UNDEFINED": 0, + "SEVERITY.HIGH": 0, + "SEVERITY.LOW": 8, + "SEVERITY.MEDIUM": 0, + "SEVERITY.UNDEFINED": 0, + "loc": 1572, + "nosec": 0, + "skipped_tests": 0 + }, + "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/data/sdf/ScalableDataFrameDataset.py": { + "CONFIDENCE.HIGH": 0, + "CONFIDENCE.LOW": 0, + "CONFIDENCE.MEDIUM": 0, + "CONFIDENCE.UNDEFINED": 0, + "SEVERITY.HIGH": 0, + "SEVERITY.LOW": 0, + "SEVERITY.MEDIUM": 0, + "SEVERITY.UNDEFINED": 0, + "loc": 68, + "nosec": 0, + "skipped_tests": 0 + }, + "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/data/sdf/ScalableSeries.py": { + "CONFIDENCE.HIGH": 1, + "CONFIDENCE.LOW": 0, + "CONFIDENCE.MEDIUM": 0, + "CONFIDENCE.UNDEFINED": 0, + "SEVERITY.HIGH": 0, + "SEVERITY.LOW": 1, + "SEVERITY.MEDIUM": 0, + "SEVERITY.UNDEFINED": 0, + "loc": 819, + "nosec": 0, + "skipped_tests": 0 + }, + "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/data/sdf/TensorScalableSeries.py": { + "CONFIDENCE.HIGH": 0, + "CONFIDENCE.LOW": 0, + "CONFIDENCE.MEDIUM": 0, + "CONFIDENCE.UNDEFINED": 0, + "SEVERITY.HIGH": 0, + "SEVERITY.LOW": 0, + "SEVERITY.MEDIUM": 0, + "SEVERITY.UNDEFINED": 0, + "loc": 53, + "nosec": 0, + "skipped_tests": 0 + }, + "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/data/sdf/TorchScalableSeries.py": { + "CONFIDENCE.HIGH": 0, + "CONFIDENCE.LOW": 0, + "CONFIDENCE.MEDIUM": 0, + "CONFIDENCE.UNDEFINED": 0, + "SEVERITY.HIGH": 0, + "SEVERITY.LOW": 0, + "SEVERITY.MEDIUM": 0, + "SEVERITY.UNDEFINED": 0, + "loc": 320, + "nosec": 0, + "skipped_tests": 0 + }, + "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/data/sdf/__init__.py": { + "CONFIDENCE.HIGH": 0, + "CONFIDENCE.LOW": 0, + "CONFIDENCE.MEDIUM": 0, + "CONFIDENCE.UNDEFINED": 0, + "SEVERITY.HIGH": 0, + "SEVERITY.LOW": 0, + "SEVERITY.MEDIUM": 0, + "SEVERITY.UNDEFINED": 0, + "loc": 13, + "nosec": 0, + "skipped_tests": 0 + }, + "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/data/writer/Writer.py": { + "CONFIDENCE.HIGH": 2, + "CONFIDENCE.LOW": 0, + "CONFIDENCE.MEDIUM": 0, + "CONFIDENCE.UNDEFINED": 0, + "SEVERITY.HIGH": 0, + "SEVERITY.LOW": 2, + "SEVERITY.MEDIUM": 0, + "SEVERITY.UNDEFINED": 0, + "loc": 339, + "nosec": 0, + "skipped_tests": 0 + }, + "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/data/writer/__init__.py": { + "CONFIDENCE.HIGH": 0, + "CONFIDENCE.LOW": 0, + "CONFIDENCE.MEDIUM": 0, + "CONFIDENCE.UNDEFINED": 0, + "SEVERITY.HIGH": 0, + "SEVERITY.LOW": 0, + "SEVERITY.MEDIUM": 0, + "SEVERITY.UNDEFINED": 0, + "loc": 4, + "nosec": 0, + "skipped_tests": 0 + }, + "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/data/writer/binary/PickleWriter.py": { + "CONFIDENCE.HIGH": 1, + "CONFIDENCE.LOW": 0, + "CONFIDENCE.MEDIUM": 0, + "CONFIDENCE.UNDEFINED": 0, + "SEVERITY.HIGH": 0, + "SEVERITY.LOW": 1, + "SEVERITY.MEDIUM": 0, + "SEVERITY.UNDEFINED": 0, + "loc": 57, + "nosec": 0, + "skipped_tests": 0 + }, + "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/data/writer/binary/__init__.py": { + "CONFIDENCE.HIGH": 0, + "CONFIDENCE.LOW": 0, + "CONFIDENCE.MEDIUM": 0, + "CONFIDENCE.UNDEFINED": 0, + "SEVERITY.HIGH": 0, + "SEVERITY.LOW": 0, + "SEVERITY.MEDIUM": 0, + "SEVERITY.UNDEFINED": 0, + "loc": 1, + "nosec": 0, + "skipped_tests": 0 + }, + "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/data/writer/config/ConfigWriter.py": { + "CONFIDENCE.HIGH": 0, + "CONFIDENCE.LOW": 0, + "CONFIDENCE.MEDIUM": 0, + "CONFIDENCE.UNDEFINED": 0, + "SEVERITY.HIGH": 0, + "SEVERITY.LOW": 0, + "SEVERITY.MEDIUM": 0, + "SEVERITY.UNDEFINED": 0, + "loc": 75, + "nosec": 0, + "skipped_tests": 0 + }, + "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/data/writer/config/JsonWriter.py": { + "CONFIDENCE.HIGH": 0, + "CONFIDENCE.LOW": 0, + "CONFIDENCE.MEDIUM": 0, + "CONFIDENCE.UNDEFINED": 0, + "SEVERITY.HIGH": 0, + "SEVERITY.LOW": 0, + "SEVERITY.MEDIUM": 0, + "SEVERITY.UNDEFINED": 0, + "loc": 11, + "nosec": 0, + "skipped_tests": 0 + }, + "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/data/writer/config/YamlWriter.py": { + "CONFIDENCE.HIGH": 0, + "CONFIDENCE.LOW": 0, + "CONFIDENCE.MEDIUM": 0, + "CONFIDENCE.UNDEFINED": 0, + "SEVERITY.HIGH": 0, + "SEVERITY.LOW": 0, + "SEVERITY.MEDIUM": 0, + "SEVERITY.UNDEFINED": 0, + "loc": 11, + "nosec": 0, + "skipped_tests": 0 + }, + "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/data/writer/config/__init__.py": { + "CONFIDENCE.HIGH": 0, + "CONFIDENCE.LOW": 0, + "CONFIDENCE.MEDIUM": 0, + "CONFIDENCE.UNDEFINED": 0, + "SEVERITY.HIGH": 0, + "SEVERITY.LOW": 0, + "SEVERITY.MEDIUM": 0, + "SEVERITY.UNDEFINED": 0, + "loc": 2, + "nosec": 0, + "skipped_tests": 0 + }, + "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/data/writer/dataframe/CsvWriter.py": { + "CONFIDENCE.HIGH": 1, + "CONFIDENCE.LOW": 0, + "CONFIDENCE.MEDIUM": 0, + "CONFIDENCE.UNDEFINED": 0, + "SEVERITY.HIGH": 0, + "SEVERITY.LOW": 1, + "SEVERITY.MEDIUM": 0, + "SEVERITY.UNDEFINED": 0, + "loc": 77, + "nosec": 0, + "skipped_tests": 0 + }, + "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/data/writer/dataframe/DataFrameWriter.py": { + "CONFIDENCE.HIGH": 0, + "CONFIDENCE.LOW": 0, + "CONFIDENCE.MEDIUM": 0, + "CONFIDENCE.UNDEFINED": 0, + "SEVERITY.HIGH": 0, + "SEVERITY.LOW": 0, + "SEVERITY.MEDIUM": 0, + "SEVERITY.UNDEFINED": 0, + "loc": 435, + "nosec": 0, + "skipped_tests": 0 + }, + "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/data/writer/dataframe/JsonLinesWriter.py": { + "CONFIDENCE.HIGH": 1, + "CONFIDENCE.LOW": 0, + "CONFIDENCE.MEDIUM": 0, + "CONFIDENCE.UNDEFINED": 0, + "SEVERITY.HIGH": 0, + "SEVERITY.LOW": 1, + "SEVERITY.MEDIUM": 0, + "SEVERITY.UNDEFINED": 0, + "loc": 68, + "nosec": 0, + "skipped_tests": 0 + }, + "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/data/writer/dataframe/MetricsWriter.py": { + "CONFIDENCE.HIGH": 0, + "CONFIDENCE.LOW": 0, + "CONFIDENCE.MEDIUM": 0, + "CONFIDENCE.UNDEFINED": 0, + "SEVERITY.HIGH": 0, + "SEVERITY.LOW": 0, + "SEVERITY.MEDIUM": 0, + "SEVERITY.UNDEFINED": 0, + "loc": 55, + "nosec": 0, + "skipped_tests": 0 + }, + "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/data/writer/dataframe/NpzWriter.py": { + "CONFIDENCE.HIGH": 1, + "CONFIDENCE.LOW": 0, + "CONFIDENCE.MEDIUM": 0, + "CONFIDENCE.UNDEFINED": 0, + "SEVERITY.HIGH": 0, + "SEVERITY.LOW": 1, + "SEVERITY.MEDIUM": 0, + "SEVERITY.UNDEFINED": 0, + "loc": 70, + "nosec": 0, + "skipped_tests": 0 + }, + "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/data/writer/dataframe/ParquetWriter.py": { + "CONFIDENCE.HIGH": 1, + "CONFIDENCE.LOW": 0, + "CONFIDENCE.MEDIUM": 0, + "CONFIDENCE.UNDEFINED": 0, + "SEVERITY.HIGH": 0, + "SEVERITY.LOW": 1, + "SEVERITY.MEDIUM": 0, + "SEVERITY.UNDEFINED": 0, + "loc": 70, + "nosec": 0, + "skipped_tests": 0 + }, + "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/data/writer/dataframe/__init__.py": { + "CONFIDENCE.HIGH": 0, + "CONFIDENCE.LOW": 0, + "CONFIDENCE.MEDIUM": 0, + "CONFIDENCE.UNDEFINED": 0, + "SEVERITY.HIGH": 0, + "SEVERITY.LOW": 0, + "SEVERITY.MEDIUM": 0, + "SEVERITY.UNDEFINED": 0, + "loc": 6, + "nosec": 0, + "skipped_tests": 0 + }, + "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/framework/__init__.py": { + "CONFIDENCE.HIGH": 0, + "CONFIDENCE.LOW": 0, + "CONFIDENCE.MEDIUM": 0, + "CONFIDENCE.UNDEFINED": 0, + "SEVERITY.HIGH": 0, + "SEVERITY.LOW": 0, + "SEVERITY.MEDIUM": 0, + "SEVERITY.UNDEFINED": 0, + "loc": 11, + "nosec": 0, + "skipped_tests": 0 + }, + "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/framework/algorithm.py": { + "CONFIDENCE.HIGH": 3, + "CONFIDENCE.LOW": 0, + "CONFIDENCE.MEDIUM": 0, + "CONFIDENCE.UNDEFINED": 0, + "SEVERITY.HIGH": 0, + "SEVERITY.LOW": 2, + "SEVERITY.MEDIUM": 1, + "SEVERITY.UNDEFINED": 0, + "loc": 636, + "nosec": 0, + "skipped_tests": 0 + }, + "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/framework/chain/Chain.py": { + "CONFIDENCE.HIGH": 3, + "CONFIDENCE.LOW": 0, + "CONFIDENCE.MEDIUM": 0, + "CONFIDENCE.UNDEFINED": 0, + "SEVERITY.HIGH": 0, + "SEVERITY.LOW": 3, + "SEVERITY.MEDIUM": 0, + "SEVERITY.UNDEFINED": 0, + "loc": 534, + "nosec": 0, + "skipped_tests": 0 + }, + "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/framework/chain/__init__.py": { + "CONFIDENCE.HIGH": 0, + "CONFIDENCE.LOW": 0, + "CONFIDENCE.MEDIUM": 0, + "CONFIDENCE.UNDEFINED": 0, + "SEVERITY.HIGH": 0, + "SEVERITY.LOW": 0, + "SEVERITY.MEDIUM": 0, + "SEVERITY.UNDEFINED": 0, + "loc": 1, + "nosec": 0, + "skipped_tests": 0 + }, + "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/framework/dl/__init__.py": { + "CONFIDENCE.HIGH": 0, + "CONFIDENCE.LOW": 0, + "CONFIDENCE.MEDIUM": 0, + "CONFIDENCE.UNDEFINED": 0, + "SEVERITY.HIGH": 0, + "SEVERITY.LOW": 0, + "SEVERITY.MEDIUM": 0, + "SEVERITY.UNDEFINED": 0, + "loc": 0, + "nosec": 0, + "skipped_tests": 0 + }, + "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/framework/dl/torch/PyTorchTaskDataDataset.py": { + "CONFIDENCE.HIGH": 0, + "CONFIDENCE.LOW": 0, + "CONFIDENCE.MEDIUM": 0, + "CONFIDENCE.UNDEFINED": 0, + "SEVERITY.HIGH": 0, + "SEVERITY.LOW": 0, + "SEVERITY.MEDIUM": 0, + "SEVERITY.UNDEFINED": 0, + "loc": 132, + "nosec": 0, + "skipped_tests": 0 + }, + "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/framework/dl/torch/__init__.py": { + "CONFIDENCE.HIGH": 0, + "CONFIDENCE.LOW": 0, + "CONFIDENCE.MEDIUM": 0, + "CONFIDENCE.UNDEFINED": 0, + "SEVERITY.HIGH": 0, + "SEVERITY.LOW": 0, + "SEVERITY.MEDIUM": 0, + "SEVERITY.UNDEFINED": 0, + "loc": 3, + "nosec": 0, + "skipped_tests": 0 + }, + "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/framework/dl/torch/torch_base.py": { + "CONFIDENCE.HIGH": 0, + "CONFIDENCE.LOW": 0, + "CONFIDENCE.MEDIUM": 0, + "CONFIDENCE.UNDEFINED": 0, + "SEVERITY.HIGH": 0, + "SEVERITY.LOW": 0, + "SEVERITY.MEDIUM": 0, + "SEVERITY.UNDEFINED": 0, + "loc": 416, + "nosec": 0, + "skipped_tests": 0 + }, + "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/framework/dl/torch/torch_tasks.py": { + "CONFIDENCE.HIGH": 1, + "CONFIDENCE.LOW": 0, + "CONFIDENCE.MEDIUM": 0, + "CONFIDENCE.UNDEFINED": 0, + "SEVERITY.HIGH": 0, + "SEVERITY.LOW": 1, + "SEVERITY.MEDIUM": 0, + "SEVERITY.UNDEFINED": 0, + "loc": 279, + "nosec": 0, + "skipped_tests": 0 + }, + "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/framework/evaluator/AccelerateEvaluator.py": { + "CONFIDENCE.HIGH": 3, + "CONFIDENCE.LOW": 0, + "CONFIDENCE.MEDIUM": 0, + "CONFIDENCE.UNDEFINED": 0, + "SEVERITY.HIGH": 0, + "SEVERITY.LOW": 3, + "SEVERITY.MEDIUM": 0, + "SEVERITY.UNDEFINED": 0, + "loc": 263, + "nosec": 0, + "skipped_tests": 0 + }, + "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/framework/evaluator/Evaluator.py": { + "CONFIDENCE.HIGH": 0, + "CONFIDENCE.LOW": 0, + "CONFIDENCE.MEDIUM": 0, + "CONFIDENCE.UNDEFINED": 0, + "SEVERITY.HIGH": 0, + "SEVERITY.LOW": 0, + "SEVERITY.MEDIUM": 0, + "SEVERITY.UNDEFINED": 0, + "loc": 511, + "nosec": 0, + "skipped_tests": 0 + }, + "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/framework/evaluator/LocalEvaluator.py": { + "CONFIDENCE.HIGH": 0, + "CONFIDENCE.LOW": 0, + "CONFIDENCE.MEDIUM": 0, + "CONFIDENCE.UNDEFINED": 0, + "SEVERITY.HIGH": 0, + "SEVERITY.LOW": 0, + "SEVERITY.MEDIUM": 0, + "SEVERITY.UNDEFINED": 0, + "loc": 138, + "nosec": 0, + "skipped_tests": 0 + }, + "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/framework/evaluator/RayEvaluator.py": { + "CONFIDENCE.HIGH": 4, + "CONFIDENCE.LOW": 0, + "CONFIDENCE.MEDIUM": 0, + "CONFIDENCE.UNDEFINED": 0, + "SEVERITY.HIGH": 0, + "SEVERITY.LOW": 4, + "SEVERITY.MEDIUM": 0, + "SEVERITY.UNDEFINED": 0, + "loc": 743, + "nosec": 0, + "skipped_tests": 0 + }, + "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/framework/evaluator/__init__.py": { + "CONFIDENCE.HIGH": 0, + "CONFIDENCE.LOW": 0, + "CONFIDENCE.MEDIUM": 0, + "CONFIDENCE.UNDEFINED": 0, + "SEVERITY.HIGH": 0, + "SEVERITY.LOW": 0, + "SEVERITY.MEDIUM": 0, + "SEVERITY.UNDEFINED": 0, + "loc": 4, + "nosec": 0, + "skipped_tests": 0 + }, + "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/framework/metric.py": { + "CONFIDENCE.HIGH": 2, + "CONFIDENCE.LOW": 0, + "CONFIDENCE.MEDIUM": 0, + "CONFIDENCE.UNDEFINED": 0, + "SEVERITY.HIGH": 0, + "SEVERITY.LOW": 2, + "SEVERITY.MEDIUM": 0, + "SEVERITY.UNDEFINED": 0, + "loc": 618, + "nosec": 0, + "skipped_tests": 0 + }, + "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/framework/mixins.py": { + "CONFIDENCE.HIGH": 6, + "CONFIDENCE.LOW": 0, + "CONFIDENCE.MEDIUM": 0, + "CONFIDENCE.UNDEFINED": 0, + "SEVERITY.HIGH": 0, + "SEVERITY.LOW": 6, + "SEVERITY.MEDIUM": 0, + "SEVERITY.UNDEFINED": 0, + "loc": 1289, + "nosec": 0, + "skipped_tests": 0 + }, + "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/framework/predictions.py": { + "CONFIDENCE.HIGH": 0, + "CONFIDENCE.LOW": 0, + "CONFIDENCE.MEDIUM": 0, + "CONFIDENCE.UNDEFINED": 0, + "SEVERITY.HIGH": 0, + "SEVERITY.LOW": 0, + "SEVERITY.MEDIUM": 0, + "SEVERITY.UNDEFINED": 0, + "loc": 458, + "nosec": 0, + "skipped_tests": 0 + }, + "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/framework/ray_base.py": { + "CONFIDENCE.HIGH": 0, + "CONFIDENCE.LOW": 0, + "CONFIDENCE.MEDIUM": 0, + "CONFIDENCE.UNDEFINED": 0, + "SEVERITY.HIGH": 0, + "SEVERITY.LOW": 0, + "SEVERITY.MEDIUM": 0, + "SEVERITY.UNDEFINED": 0, + "loc": 106, + "nosec": 0, + "skipped_tests": 0 + }, + "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/framework/task/__init__.py": { + "CONFIDENCE.HIGH": 0, + "CONFIDENCE.LOW": 0, + "CONFIDENCE.MEDIUM": 0, + "CONFIDENCE.UNDEFINED": 0, + "SEVERITY.HIGH": 0, + "SEVERITY.LOW": 0, + "SEVERITY.MEDIUM": 0, + "SEVERITY.UNDEFINED": 0, + "loc": 7, + "nosec": 0, + "skipped_tests": 0 + }, + "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/framework/task/classification.py": { + "CONFIDENCE.HIGH": 0, + "CONFIDENCE.LOW": 0, + "CONFIDENCE.MEDIUM": 0, + "CONFIDENCE.UNDEFINED": 0, + "SEVERITY.HIGH": 0, + "SEVERITY.LOW": 0, + "SEVERITY.MEDIUM": 0, + "SEVERITY.UNDEFINED": 0, + "loc": 636, + "nosec": 0, + "skipped_tests": 0 + }, + "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/framework/task/dense_retrieval.py": { + "CONFIDENCE.HIGH": 3, + "CONFIDENCE.LOW": 0, + "CONFIDENCE.MEDIUM": 0, + "CONFIDENCE.UNDEFINED": 0, + "SEVERITY.HIGH": 0, + "SEVERITY.LOW": 3, + "SEVERITY.MEDIUM": 0, + "SEVERITY.UNDEFINED": 0, + "loc": 373, + "nosec": 0, + "skipped_tests": 0 + }, + "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/framework/task/embedding.py": { + "CONFIDENCE.HIGH": 0, + "CONFIDENCE.LOW": 0, + "CONFIDENCE.MEDIUM": 0, + "CONFIDENCE.UNDEFINED": 0, + "SEVERITY.HIGH": 0, + "SEVERITY.LOW": 0, + "SEVERITY.MEDIUM": 0, + "SEVERITY.UNDEFINED": 0, + "loc": 42, + "nosec": 0, + "skipped_tests": 0 + }, + "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/framework/task/ranking.py": { + "CONFIDENCE.HIGH": 0, + "CONFIDENCE.LOW": 0, + "CONFIDENCE.MEDIUM": 0, + "CONFIDENCE.UNDEFINED": 0, + "SEVERITY.HIGH": 0, + "SEVERITY.LOW": 0, + "SEVERITY.MEDIUM": 0, + "SEVERITY.UNDEFINED": 0, + "loc": 41, + "nosec": 0, + "skipped_tests": 0 + }, + "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/framework/task/regression.py": { + "CONFIDENCE.HIGH": 1, + "CONFIDENCE.LOW": 0, + "CONFIDENCE.MEDIUM": 0, + "CONFIDENCE.UNDEFINED": 0, + "SEVERITY.HIGH": 0, + "SEVERITY.LOW": 1, + "SEVERITY.MEDIUM": 0, + "SEVERITY.UNDEFINED": 0, + "loc": 51, + "nosec": 0, + "skipped_tests": 0 + }, + "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/framework/task/retrieval.py": { + "CONFIDENCE.HIGH": 0, + "CONFIDENCE.LOW": 0, + "CONFIDENCE.MEDIUM": 0, + "CONFIDENCE.UNDEFINED": 0, + "SEVERITY.HIGH": 0, + "SEVERITY.LOW": 0, + "SEVERITY.MEDIUM": 0, + "SEVERITY.UNDEFINED": 0, + "loc": 221, + "nosec": 0, + "skipped_tests": 0 + }, + "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/framework/task/sparse_retrieval.py": { + "CONFIDENCE.HIGH": 12, + "CONFIDENCE.LOW": 0, + "CONFIDENCE.MEDIUM": 0, + "CONFIDENCE.UNDEFINED": 0, + "SEVERITY.HIGH": 0, + "SEVERITY.LOW": 12, + "SEVERITY.MEDIUM": 0, + "SEVERITY.UNDEFINED": 0, + "loc": 925, + "nosec": 0, + "skipped_tests": 0 + }, + "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/framework/task/text_generation.py": { + "CONFIDENCE.HIGH": 13, + "CONFIDENCE.LOW": 0, + "CONFIDENCE.MEDIUM": 0, + "CONFIDENCE.UNDEFINED": 0, + "SEVERITY.HIGH": 0, + "SEVERITY.LOW": 13, + "SEVERITY.MEDIUM": 0, + "SEVERITY.UNDEFINED": 0, + "loc": 1096, + "nosec": 0, + "skipped_tests": 0 + }, + "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/framework/task_data.py": { + "CONFIDENCE.HIGH": 1, + "CONFIDENCE.LOW": 0, + "CONFIDENCE.MEDIUM": 0, + "CONFIDENCE.UNDEFINED": 0, + "SEVERITY.HIGH": 0, + "SEVERITY.LOW": 1, + "SEVERITY.MEDIUM": 0, + "SEVERITY.UNDEFINED": 0, + "loc": 358, + "nosec": 0, + "skipped_tests": 0 + }, + "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/framework/tracker/AimTracker.py": { + "CONFIDENCE.HIGH": 1, + "CONFIDENCE.LOW": 0, + "CONFIDENCE.MEDIUM": 0, + "CONFIDENCE.UNDEFINED": 0, + "SEVERITY.HIGH": 0, + "SEVERITY.LOW": 1, + "SEVERITY.MEDIUM": 0, + "SEVERITY.UNDEFINED": 0, + "loc": 128, + "nosec": 0, + "skipped_tests": 0 + }, + "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/framework/tracker/LogFileTracker.py": { + "CONFIDENCE.HIGH": 4, + "CONFIDENCE.LOW": 0, + "CONFIDENCE.MEDIUM": 0, + "CONFIDENCE.UNDEFINED": 0, + "SEVERITY.HIGH": 0, + "SEVERITY.LOW": 4, + "SEVERITY.MEDIUM": 0, + "SEVERITY.UNDEFINED": 0, + "loc": 127, + "nosec": 0, + "skipped_tests": 0 + }, + "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/framework/tracker/Tracker.py": { + "CONFIDENCE.HIGH": 0, + "CONFIDENCE.LOW": 0, + "CONFIDENCE.MEDIUM": 0, + "CONFIDENCE.UNDEFINED": 0, + "SEVERITY.HIGH": 0, + "SEVERITY.LOW": 0, + "SEVERITY.MEDIUM": 0, + "SEVERITY.UNDEFINED": 0, + "loc": 196, + "nosec": 0, + "skipped_tests": 0 + }, + "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/framework/tracker/__init__.py": { + "CONFIDENCE.HIGH": 0, + "CONFIDENCE.LOW": 0, + "CONFIDENCE.MEDIUM": 0, + "CONFIDENCE.UNDEFINED": 0, + "SEVERITY.HIGH": 0, + "SEVERITY.LOW": 0, + "SEVERITY.MEDIUM": 0, + "SEVERITY.UNDEFINED": 0, + "loc": 16, + "nosec": 0, + "skipped_tests": 0 + }, + "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/framework/trainer/AccelerateTrainer.py": { + "CONFIDENCE.HIGH": 1, + "CONFIDENCE.LOW": 0, + "CONFIDENCE.MEDIUM": 0, + "CONFIDENCE.UNDEFINED": 0, + "SEVERITY.HIGH": 0, + "SEVERITY.LOW": 1, + "SEVERITY.MEDIUM": 0, + "SEVERITY.UNDEFINED": 0, + "loc": 356, + "nosec": 0, + "skipped_tests": 0 + }, + "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/framework/trainer/LocalTrainer.py": { + "CONFIDENCE.HIGH": 0, + "CONFIDENCE.LOW": 0, + "CONFIDENCE.MEDIUM": 0, + "CONFIDENCE.UNDEFINED": 0, + "SEVERITY.HIGH": 0, + "SEVERITY.LOW": 0, + "SEVERITY.MEDIUM": 0, + "SEVERITY.UNDEFINED": 0, + "loc": 143, + "nosec": 0, + "skipped_tests": 0 + }, + "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/framework/trainer/RayTuneTrainer.py": { + "CONFIDENCE.HIGH": 10, + "CONFIDENCE.LOW": 0, + "CONFIDENCE.MEDIUM": 0, + "CONFIDENCE.UNDEFINED": 0, + "SEVERITY.HIGH": 0, + "SEVERITY.LOW": 9, + "SEVERITY.MEDIUM": 1, + "SEVERITY.UNDEFINED": 0, + "loc": 1318, + "nosec": 0, + "skipped_tests": 0 + }, + "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/framework/trainer/Trainer.py": { + "CONFIDENCE.HIGH": 4, + "CONFIDENCE.LOW": 0, + "CONFIDENCE.MEDIUM": 0, + "CONFIDENCE.UNDEFINED": 0, + "SEVERITY.HIGH": 0, + "SEVERITY.LOW": 4, + "SEVERITY.MEDIUM": 0, + "SEVERITY.UNDEFINED": 0, + "loc": 872, + "nosec": 0, + "skipped_tests": 0 + }, + "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/framework/trainer/__init__.py": { + "CONFIDENCE.HIGH": 0, + "CONFIDENCE.LOW": 0, + "CONFIDENCE.MEDIUM": 0, + "CONFIDENCE.UNDEFINED": 0, + "SEVERITY.HIGH": 0, + "SEVERITY.LOW": 0, + "SEVERITY.MEDIUM": 0, + "SEVERITY.UNDEFINED": 0, + "loc": 4, + "nosec": 0, + "skipped_tests": 0 + }, + "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/framework/visualize.py": { + "CONFIDENCE.HIGH": 0, + "CONFIDENCE.LOW": 0, + "CONFIDENCE.MEDIUM": 0, + "CONFIDENCE.UNDEFINED": 0, + "SEVERITY.HIGH": 0, + "SEVERITY.LOW": 0, + "SEVERITY.MEDIUM": 0, + "SEVERITY.UNDEFINED": 0, + "loc": 356, + "nosec": 0, + "skipped_tests": 0 + }, + "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/metric/__init__.py": { + "CONFIDENCE.HIGH": 0, + "CONFIDENCE.LOW": 0, + "CONFIDENCE.MEDIUM": 0, + "CONFIDENCE.UNDEFINED": 0, + "SEVERITY.HIGH": 0, + "SEVERITY.LOW": 0, + "SEVERITY.MEDIUM": 0, + "SEVERITY.UNDEFINED": 0, + "loc": 19, + "nosec": 0, + "skipped_tests": 0 + }, + "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/metric/classification_metrics.py": { + "CONFIDENCE.HIGH": 4, + "CONFIDENCE.LOW": 0, + "CONFIDENCE.MEDIUM": 0, + "CONFIDENCE.UNDEFINED": 0, + "SEVERITY.HIGH": 0, + "SEVERITY.LOW": 4, + "SEVERITY.MEDIUM": 0, + "SEVERITY.UNDEFINED": 0, + "loc": 568, + "nosec": 0, + "skipped_tests": 0 + }, + "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/metric/regression_metrics.py": { + "CONFIDENCE.HIGH": 0, + "CONFIDENCE.LOW": 0, + "CONFIDENCE.MEDIUM": 0, + "CONFIDENCE.UNDEFINED": 0, + "SEVERITY.HIGH": 0, + "SEVERITY.LOW": 0, + "SEVERITY.MEDIUM": 0, + "SEVERITY.UNDEFINED": 0, + "loc": 44, + "nosec": 0, + "skipped_tests": 0 + }, + "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/metric/text_generation_metrics.py": { + "CONFIDENCE.HIGH": 10, + "CONFIDENCE.LOW": 0, + "CONFIDENCE.MEDIUM": 0, + "CONFIDENCE.UNDEFINED": 0, + "SEVERITY.HIGH": 0, + "SEVERITY.LOW": 10, + "SEVERITY.MEDIUM": 0, + "SEVERITY.UNDEFINED": 0, + "loc": 1440, + "nosec": 0, + "skipped_tests": 0 + }, + "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/util/__init__.py": { + "CONFIDENCE.HIGH": 0, + "CONFIDENCE.LOW": 0, + "CONFIDENCE.MEDIUM": 0, + "CONFIDENCE.UNDEFINED": 0, + "SEVERITY.HIGH": 0, + "SEVERITY.LOW": 0, + "SEVERITY.MEDIUM": 0, + "SEVERITY.UNDEFINED": 0, + "loc": 10, + "nosec": 0, + "skipped_tests": 0 + }, + "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/util/aws/__init__.py": { + "CONFIDENCE.HIGH": 0, + "CONFIDENCE.LOW": 0, + "CONFIDENCE.MEDIUM": 0, + "CONFIDENCE.UNDEFINED": 0, + "SEVERITY.HIGH": 0, + "SEVERITY.LOW": 0, + "SEVERITY.MEDIUM": 0, + "SEVERITY.UNDEFINED": 0, + "loc": 1, + "nosec": 0, + "skipped_tests": 0 + }, + "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/util/aws/s3.py": { + "CONFIDENCE.HIGH": 7, + "CONFIDENCE.LOW": 0, + "CONFIDENCE.MEDIUM": 0, + "CONFIDENCE.UNDEFINED": 0, + "SEVERITY.HIGH": 0, + "SEVERITY.LOW": 6, + "SEVERITY.MEDIUM": 1, + "SEVERITY.UNDEFINED": 0, + "loc": 488, + "nosec": 0, + "skipped_tests": 0 + }, + "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/util/concurrency.py": { + "CONFIDENCE.HIGH": 7, + "CONFIDENCE.LOW": 0, + "CONFIDENCE.MEDIUM": 0, + "CONFIDENCE.UNDEFINED": 0, + "SEVERITY.HIGH": 0, + "SEVERITY.LOW": 7, + "SEVERITY.MEDIUM": 0, + "SEVERITY.UNDEFINED": 0, + "loc": 683, + "nosec": 0, + "skipped_tests": 0 + }, + "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/util/environment.py": { + "CONFIDENCE.HIGH": 0, + "CONFIDENCE.LOW": 0, + "CONFIDENCE.MEDIUM": 0, + "CONFIDENCE.UNDEFINED": 0, + "SEVERITY.HIGH": 0, + "SEVERITY.LOW": 0, + "SEVERITY.MEDIUM": 0, + "SEVERITY.UNDEFINED": 0, + "loc": 43, + "nosec": 0, + "skipped_tests": 0 + }, + "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/util/filesystem.py": { + "CONFIDENCE.HIGH": 5, + "CONFIDENCE.LOW": 0, + "CONFIDENCE.MEDIUM": 0, + "CONFIDENCE.UNDEFINED": 0, + "SEVERITY.HIGH": 0, + "SEVERITY.LOW": 4, + "SEVERITY.MEDIUM": 1, + "SEVERITY.UNDEFINED": 0, + "loc": 408, + "nosec": 0, + "skipped_tests": 0 + }, + "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/util/jupyter.py": { + "CONFIDENCE.HIGH": 2, + "CONFIDENCE.LOW": 0, + "CONFIDENCE.MEDIUM": 0, + "CONFIDENCE.UNDEFINED": 0, + "SEVERITY.HIGH": 0, + "SEVERITY.LOW": 1, + "SEVERITY.MEDIUM": 1, + "SEVERITY.UNDEFINED": 0, + "loc": 105, + "nosec": 0, + "skipped_tests": 0 + }, + "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/util/language.py": { + "CONFIDENCE.HIGH": 60, + "CONFIDENCE.LOW": 0, + "CONFIDENCE.MEDIUM": 0, + "CONFIDENCE.UNDEFINED": 0, + "SEVERITY.HIGH": 0, + "SEVERITY.LOW": 60, + "SEVERITY.MEDIUM": 0, + "SEVERITY.UNDEFINED": 0, + "loc": 2590, + "nosec": 0, + "skipped_tests": 0 + }, + "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/util/logging.py": { + "CONFIDENCE.HIGH": 0, + "CONFIDENCE.LOW": 0, + "CONFIDENCE.MEDIUM": 0, + "CONFIDENCE.UNDEFINED": 0, + "SEVERITY.HIGH": 0, + "SEVERITY.LOW": 0, + "SEVERITY.MEDIUM": 0, + "SEVERITY.UNDEFINED": 0, + "loc": 242, + "nosec": 0, + "skipped_tests": 0 + }, + "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/util/notify.py": { + "CONFIDENCE.HIGH": 0, + "CONFIDENCE.LOW": 2, + "CONFIDENCE.MEDIUM": 0, + "CONFIDENCE.UNDEFINED": 0, + "SEVERITY.HIGH": 0, + "SEVERITY.LOW": 0, + "SEVERITY.MEDIUM": 2, + "SEVERITY.UNDEFINED": 0, + "loc": 151, + "nosec": 0, + "skipped_tests": 0 + }, + "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/util/profiling.py": { + "CONFIDENCE.HIGH": 0, + "CONFIDENCE.LOW": 0, + "CONFIDENCE.MEDIUM": 0, + "CONFIDENCE.UNDEFINED": 0, + "SEVERITY.HIGH": 0, + "SEVERITY.LOW": 0, + "SEVERITY.MEDIUM": 0, + "SEVERITY.UNDEFINED": 0, + "loc": 176, + "nosec": 0, + "skipped_tests": 0 + }, + "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/util/schema.py": { + "CONFIDENCE.HIGH": 2, + "CONFIDENCE.LOW": 0, + "CONFIDENCE.MEDIUM": 0, + "CONFIDENCE.UNDEFINED": 0, + "SEVERITY.HIGH": 0, + "SEVERITY.LOW": 2, + "SEVERITY.MEDIUM": 0, + "SEVERITY.UNDEFINED": 0, + "loc": 658, + "nosec": 0, + "skipped_tests": 0 + }, + "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/util/string.py": { + "CONFIDENCE.HIGH": 23, + "CONFIDENCE.LOW": 0, + "CONFIDENCE.MEDIUM": 0, + "CONFIDENCE.UNDEFINED": 0, + "SEVERITY.HIGH": 0, + "SEVERITY.LOW": 23, + "SEVERITY.MEDIUM": 0, + "SEVERITY.UNDEFINED": 0, + "loc": 1694, + "nosec": 0, + "skipped_tests": 0 + }, + "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/util/struct.py": { + "CONFIDENCE.HIGH": 1, + "CONFIDENCE.LOW": 0, + "CONFIDENCE.MEDIUM": 0, + "CONFIDENCE.UNDEFINED": 0, + "SEVERITY.HIGH": 0, + "SEVERITY.LOW": 1, + "SEVERITY.MEDIUM": 0, + "SEVERITY.UNDEFINED": 0, + "loc": 116, + "nosec": 0, + "skipped_tests": 0 + }, + "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/viz/ConfusionMatrixViz.py": { + "CONFIDENCE.HIGH": 0, + "CONFIDENCE.LOW": 0, + "CONFIDENCE.MEDIUM": 0, + "CONFIDENCE.UNDEFINED": 0, + "SEVERITY.HIGH": 0, + "SEVERITY.LOW": 0, + "SEVERITY.MEDIUM": 0, + "SEVERITY.UNDEFINED": 0, + "loc": 33, + "nosec": 0, + "skipped_tests": 0 + }, + "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/viz/CorrelationMatrix.py": { + "CONFIDENCE.HIGH": 0, + "CONFIDENCE.LOW": 0, + "CONFIDENCE.MEDIUM": 0, + "CONFIDENCE.UNDEFINED": 0, + "SEVERITY.HIGH": 0, + "SEVERITY.LOW": 0, + "SEVERITY.MEDIUM": 0, + "SEVERITY.UNDEFINED": 0, + "loc": 41, + "nosec": 0, + "skipped_tests": 0 + }, + "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/viz/PrecisionRecallCurve.py": { + "CONFIDENCE.HIGH": 0, + "CONFIDENCE.LOW": 0, + "CONFIDENCE.MEDIUM": 0, + "CONFIDENCE.UNDEFINED": 0, + "SEVERITY.HIGH": 0, + "SEVERITY.LOW": 0, + "SEVERITY.MEDIUM": 0, + "SEVERITY.UNDEFINED": 0, + "loc": 3, + "nosec": 0, + "skipped_tests": 0 + }, + "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/viz/TextGenerationsViz.py": { + "CONFIDENCE.HIGH": 0, + "CONFIDENCE.LOW": 0, + "CONFIDENCE.MEDIUM": 0, + "CONFIDENCE.UNDEFINED": 0, + "SEVERITY.HIGH": 0, + "SEVERITY.LOW": 0, + "SEVERITY.MEDIUM": 0, + "SEVERITY.UNDEFINED": 0, + "loc": 28, + "nosec": 0, + "skipped_tests": 0 + }, + "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/viz/Waffle.py": { + "CONFIDENCE.HIGH": 0, + "CONFIDENCE.LOW": 0, + "CONFIDENCE.MEDIUM": 0, + "CONFIDENCE.UNDEFINED": 0, + "SEVERITY.HIGH": 0, + "SEVERITY.LOW": 0, + "SEVERITY.MEDIUM": 0, + "SEVERITY.UNDEFINED": 0, + "loc": 77, + "nosec": 0, + "skipped_tests": 0 + }, + "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/viz/__init__.py": { + "CONFIDENCE.HIGH": 0, + "CONFIDENCE.LOW": 0, + "CONFIDENCE.MEDIUM": 0, + "CONFIDENCE.UNDEFINED": 0, + "SEVERITY.HIGH": 0, + "SEVERITY.LOW": 0, + "SEVERITY.MEDIUM": 0, + "SEVERITY.UNDEFINED": 0, + "loc": 19, + "nosec": 0, + "skipped_tests": 0 + }, + "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/expt/__init__.py": { + "CONFIDENCE.HIGH": 0, + "CONFIDENCE.LOW": 0, + "CONFIDENCE.MEDIUM": 0, + "CONFIDENCE.UNDEFINED": 0, + "SEVERITY.HIGH": 0, + "SEVERITY.LOW": 0, + "SEVERITY.MEDIUM": 0, + "SEVERITY.UNDEFINED": 0, + "loc": 5, + "nosec": 0, + "skipped_tests": 0 + }, + "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/expt/common.py": { + "CONFIDENCE.HIGH": 18, + "CONFIDENCE.LOW": 0, + "CONFIDENCE.MEDIUM": 0, + "CONFIDENCE.UNDEFINED": 0, + "SEVERITY.HIGH": 0, + "SEVERITY.LOW": 18, + "SEVERITY.MEDIUM": 0, + "SEVERITY.UNDEFINED": 0, + "loc": 1992, + "nosec": 0, + "skipped_tests": 0 + }, + "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/expt/corpus.py": { + "CONFIDENCE.HIGH": 0, + "CONFIDENCE.LOW": 0, + "CONFIDENCE.MEDIUM": 0, + "CONFIDENCE.UNDEFINED": 0, + "SEVERITY.HIGH": 0, + "SEVERITY.LOW": 0, + "SEVERITY.MEDIUM": 0, + "SEVERITY.UNDEFINED": 0, + "loc": 293, + "nosec": 0, + "skipped_tests": 0 + }, + "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/expt/data.py": { + "CONFIDENCE.HIGH": 3, + "CONFIDENCE.LOW": 0, + "CONFIDENCE.MEDIUM": 0, + "CONFIDENCE.UNDEFINED": 0, + "SEVERITY.HIGH": 0, + "SEVERITY.LOW": 3, + "SEVERITY.MEDIUM": 0, + "SEVERITY.UNDEFINED": 0, + "loc": 739, + "nosec": 0, + "skipped_tests": 0 + }, + "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/expt/driver.py": { + "CONFIDENCE.HIGH": 6, + "CONFIDENCE.LOW": 0, + "CONFIDENCE.MEDIUM": 0, + "CONFIDENCE.UNDEFINED": 0, + "SEVERITY.HIGH": 0, + "SEVERITY.LOW": 6, + "SEVERITY.MEDIUM": 0, + "SEVERITY.UNDEFINED": 0, + "loc": 239, + "nosec": 0, + "skipped_tests": 0 + }, + "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/expt/generation.py": { + "CONFIDENCE.HIGH": 11, + "CONFIDENCE.LOW": 0, + "CONFIDENCE.MEDIUM": 0, + "CONFIDENCE.UNDEFINED": 0, + "SEVERITY.HIGH": 0, + "SEVERITY.LOW": 11, + "SEVERITY.MEDIUM": 0, + "SEVERITY.UNDEFINED": 0, + "loc": 1955, + "nosec": 0, + "skipped_tests": 0 + }, + "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/expt/main.py": { + "CONFIDENCE.HIGH": 0, + "CONFIDENCE.LOW": 0, + "CONFIDENCE.MEDIUM": 0, + "CONFIDENCE.UNDEFINED": 0, + "SEVERITY.HIGH": 0, + "SEVERITY.LOW": 0, + "SEVERITY.MEDIUM": 0, + "SEVERITY.UNDEFINED": 0, + "loc": 1075, + "nosec": 0, + "skipped_tests": 0 + }, + "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/expt/metrics.py": { + "CONFIDENCE.HIGH": 9, + "CONFIDENCE.LOW": 0, + "CONFIDENCE.MEDIUM": 0, + "CONFIDENCE.UNDEFINED": 0, + "SEVERITY.HIGH": 0, + "SEVERITY.LOW": 9, + "SEVERITY.MEDIUM": 0, + "SEVERITY.UNDEFINED": 0, + "loc": 1611, + "nosec": 0, + "skipped_tests": 0 + }, + "_totals": { + "CONFIDENCE.HIGH": 293, + "CONFIDENCE.LOW": 4, + "CONFIDENCE.MEDIUM": 0, + "CONFIDENCE.UNDEFINED": 0, + "SEVERITY.HIGH": 0, + "SEVERITY.LOW": 287, + "SEVERITY.MEDIUM": 10, + "SEVERITY.UNDEFINED": 0, + "loc": 43248, + "nosec": 0, + "skipped_tests": 0 + } + }, + "results": [ + { + "code": "586 ## Convert from log-softmax-probs to softmax-probs.\n587 assert renormalize_logits is True\n588 token_probs: np.ndarray = np.exp(token_probs)\n", + "col_offset": 16, + "end_col_offset": 49, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/algorithm/huggingface/transformers.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 587, + "line_range": [ + 587 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "588 token_probs: np.ndarray = np.exp(token_probs)\n589 assert min_possible_score == 0.0\n590 assert 0.0 < output_scores_tolerance < 1.0\n", + "col_offset": 16, + "end_col_offset": 48, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/algorithm/huggingface/transformers.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 589, + "line_range": [ + 589 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "589 assert min_possible_score == 0.0\n590 assert 0.0 < output_scores_tolerance < 1.0\n591 elif output_scores_format == 'log-probabilities':\n", + "col_offset": 16, + "end_col_offset": 58, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/algorithm/huggingface/transformers.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 590, + "line_range": [ + 590 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "592 ## `token_probs` is already in log-softmax form.\n593 assert renormalize_logits is True\n594 assert min_possible_score == -inf\n", + "col_offset": 16, + "end_col_offset": 49, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/algorithm/huggingface/transformers.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 593, + "line_range": [ + 593 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "593 assert renormalize_logits is True\n594 assert min_possible_score == -inf\n595 assert output_scores_tolerance < 0.0\n", + "col_offset": 16, + "end_col_offset": 49, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/algorithm/huggingface/transformers.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 594, + "line_range": [ + 594 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "594 assert min_possible_score == -inf\n595 assert output_scores_tolerance < 0.0\n596 elif output_scores_format == 'logits':\n", + "col_offset": 16, + "end_col_offset": 52, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/algorithm/huggingface/transformers.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 595, + "line_range": [ + 595 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "596 elif output_scores_format == 'logits':\n597 assert renormalize_logits is False\n598 assert min_possible_score == -inf\n", + "col_offset": 16, + "end_col_offset": 50, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/algorithm/huggingface/transformers.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 597, + "line_range": [ + 597 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "597 assert renormalize_logits is False\n598 assert min_possible_score == -inf\n599 assert output_scores_tolerance is None ## Do not filter out any tokens.\n", + "col_offset": 16, + "end_col_offset": 49, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/algorithm/huggingface/transformers.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 598, + "line_range": [ + 598 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "598 assert min_possible_score == -inf\n599 assert output_scores_tolerance is None ## Do not filter out any tokens.\n600 else:\n", + "col_offset": 16, + "end_col_offset": 54, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/algorithm/huggingface/transformers.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 599, + "line_range": [ + 599 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "602 ## Check dim 0 has same size as number of examples:\n603 assert token_probs.shape[0] == batch_size\n604 ## Check dim 1 has same size as number of generated tokens:\n", + "col_offset": 12, + "end_col_offset": 53, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/algorithm/huggingface/transformers.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 603, + "line_range": [ + 603 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "604 ## Check dim 1 has same size as number of generated tokens:\n605 assert token_probs.shape[1] == num_generated_tokens\n606 ## Check dim 2 has same size as vocab:\n", + "col_offset": 12, + "end_col_offset": 63, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/algorithm/huggingface/transformers.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 605, + "line_range": [ + 605 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "609 token_probs: np.ndarray = token_probs[:, :, :len(id2token_np)]\n610 assert token_probs.shape[2] == len(id2token_np)\n611 \n", + "col_offset": 12, + "end_col_offset": 59, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/algorithm/huggingface/transformers.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 610, + "line_range": [ + 610 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "43 else:\n44 assert model_dir.storage is Storage.LOCAL_FILE_SYSTEM, 'Can only load models from disk.'\n45 self.tokenizer: PreTrainedTokenizerBase = AutoTokenizer.from_pretrained(model_dir.path)\n", + "col_offset": 16, + "end_col_offset": 104, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/algorithm/sentence_transformers.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 44, + "line_range": [ + 44 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "31 else:\n32 assert model_dir.storage is Storage.LOCAL_FILE_SYSTEM, 'Can only load models from disk.'\n33 self.model: SGDClassifier = joblib.load(os.path.join(model_dir.path, 'model.pkl'))\n", + "col_offset": 16, + "end_col_offset": 104, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/algorithm/sklearn/SklearnSGDClassifier.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 32, + "line_range": [ + 32 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "28 else:\n29 assert model_dir.storage is Storage.LOCAL_FILE_SYSTEM, 'Can only load models from disk.'\n30 self.model: SGDRegressor = joblib.load(os.path.join(model_dir.path, 'model.pkl'))\n", + "col_offset": 16, + "end_col_offset": 104, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/algorithm/sklearn/SklearnSGDRegressor.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 29, + "line_range": [ + 29 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "285 progress_bar: Optional[Dict] = dict()\n286 assert progress_bar is None or isinstance(progress_bar, dict)\n287 return progress_bar\n", + "col_offset": 8, + "end_col_offset": 69, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/constants/Alias.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 286, + "line_range": [ + 286 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "29 path: Dict = dict(path=path)\n30 assert isinstance(path, dict)\n31 path: Dict = {\n", + "col_offset": 8, + "end_col_offset": 37, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/data/FileMetadata.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 30, + "line_range": [ + 30 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "101 elif storage is Storage.URL:\n102 return str(requests.head(path).status_code).startswith('2')\n103 raise NotImplementedError(f'Cannot determine whether following path exists on {storage}: \"{path}\"')\n", + "col_offset": 23, + "end_col_offset": 42, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/data/FileMetadata.py", + "issue_confidence": "LOW", + "issue_cwe": { + "id": 400, + "link": "https://cwe.mitre.org/data/definitions/400.html" + }, + "issue_severity": "MEDIUM", + "issue_text": "Requests call without timeout", + "line_number": 102, + "line_range": [ + 102 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b113_request_without_timeout.html", + "test_id": "B113", + "test_name": "request_without_timeout" + }, + { + "code": "148 if self.is_path_valid_dir():\n149 assert file_name is not None\n150 local_file: FileMetadata = self.file_in_dir(file_name, return_metadata=True)\n", + "col_offset": 16, + "end_col_offset": 44, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/data/FileMetadata.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 149, + "line_range": [ + 149 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "151 else:\n152 assert file_name is None\n153 local_file: FileMetadata = self\n", + "col_offset": 16, + "end_col_offset": 40, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/data/FileMetadata.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 152, + "line_range": [ + 152 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "208 def __truediv__(self, subdir_name: str) -> FileMetadata:\n209 assert isinstance(subdir_name, str)\n210 return self.subdir_in_dir(\n", + "col_offset": 8, + "end_col_offset": 43, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/data/FileMetadata.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 209, + "line_range": [ + 209 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "220 supported_input_mltypes: Tuple[MLType] = data_processor.input_mltypes\n221 assert input_mltype in supported_input_mltypes, \\\n222 f'\"{str(input_mltype)}\" not included in supported MLTypes: \"{str(supported_input_mltypes)}\"'\n223 ## For 1:1 data processors, the supported input MLType should be a list of MLTypes\n", + "col_offset": 12, + "end_col_offset": 108, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/data/pipeline.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 221, + "line_range": [ + 221, + 222 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "303 ## dict returned by create_pipeline_step_processors should have exactly one item.\n304 assert len(pipeline_step_processors) <= 1\n305 for input_cols, step_processor in pipeline_step_processors.items():\n", + "col_offset": 8, + "end_col_offset": 49, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/data/pipeline.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 304, + "line_range": [ + 304 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "597 reader: Reader = Reader.of(config.format)\n598 assert isinstance(reader, ConfigReader)\n599 Log.debug('\\nReading pipeline config...')\n", + "col_offset": 12, + "end_col_offset": 51, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/data/pipeline.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 598, + "line_range": [ + 598 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "39 ngram_range = tuple(ngram_range)\n40 assert isinstance(ngram_range, tuple)\n41 sklearn_tfidf_params['ngram_range'] = ngram_range\n", + "col_offset": 16, + "end_col_offset": 53, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/data/processor/text/TFIDFVectorization.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 40, + "line_range": [ + 40 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "2 from abc import abstractmethod, ABC\n3 import io, requests, pickle\n4 from requests import Response\n", + "col_offset": 0, + "end_col_offset": 27, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/data/reader/binary/PickleReader.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 502, + "link": "https://cwe.mitre.org/data/definitions/502.html" + }, + "issue_severity": "LOW", + "issue_text": "Consider possible security implications associated with pickle module.", + "line_number": 3, + "line_range": [ + 3 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/blacklists/blacklist_imports.html#b403-import-pickle", + "test_id": "B403", + "test_name": "blacklist" + }, + { + "code": "30 stream.seek(0)\n31 return pickle.load(stream)\n32 except Exception as e:\n", + "col_offset": 23, + "end_col_offset": 42, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/data/reader/binary/PickleReader.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 502, + "link": "https://cwe.mitre.org/data/definitions/502.html" + }, + "issue_severity": "MEDIUM", + "issue_text": "Pickle and modules that wrap it can be unsafe when used to deserialize untrusted data, possible security issue.", + "line_number": 31, + "line_range": [ + 31 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/blacklists/blacklist_calls.html#b301-pickle", + "test_id": "B301", + "test_name": "blacklist" + }, + { + "code": "62 if text is None:\n63 response: Response = requests.get(url)\n64 text: str = response.text\n", + "col_offset": 41, + "end_col_offset": 58, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/data/reader/config/ConfigReader.py", + "issue_confidence": "LOW", + "issue_cwe": { + "id": 400, + "link": "https://cwe.mitre.org/data/definitions/400.html" + }, + "issue_severity": "MEDIUM", + "issue_text": "Requests call without timeout", + "line_number": 63, + "line_range": [ + 63 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b113_request_without_timeout.html", + "test_id": "B113", + "test_name": "request_without_timeout" + }, + { + "code": "52 except NoCredentialsError:\n53 assert storage is Storage.S3\n54 ## Create a new session and read manually:\n", + "col_offset": 12, + "end_col_offset": 40, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/data/reader/dataframe/CsvReader.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 53, + "line_range": [ + 53 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "45 except NoCredentialsError:\n46 assert storage is Storage.S3\n47 ## Create a new session and read manually:\n", + "col_offset": 12, + "end_col_offset": 40, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/data/reader/dataframe/JsonLinesReader.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 46, + "line_range": [ + 46 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "41 except NoCredentialsError:\n42 assert storage is Storage.S3\n43 ## Create a new session and read manually:\n", + "col_offset": 12, + "end_col_offset": 40, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/data/reader/dataframe/ParquetReader.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 42, + "line_range": [ + 42 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "106 for sdf in sdfs:\n107 assert isinstance(sdf, DaskScalableDataFrame)\n108 ddf_list.append(sdf._data)\n", + "col_offset": 12, + "end_col_offset": 57, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/data/sdf/DaskScalableDataFrame.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 107, + "line_range": [ + 107 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "392 if num_chunks is not None:\n393 assert length is not None, f'`length` should be set in the upper half of this loop.'\n394 num_rows: int = self._stream_update_num_rows_according_to_num_chunks(\n", + "col_offset": 28, + "end_col_offset": 112, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/data/sdf/DaskScalableDataFrame.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 393, + "line_range": [ + 393 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "219 for sdf in sdfs:\n220 assert isinstance(sdf, DictScalableDataFrame)\n221 cols.update(sdf.columns_set)\n", + "col_offset": 12, + "end_col_offset": 57, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/data/sdf/DictScalableDataFrame.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 220, + "line_range": [ + 220 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "251 for sdf in sdfs:\n252 assert isinstance(sdf, ListOfDictScalableDataFrame)\n253 list_of_dicts.extend(sdf._data)\n", + "col_offset": 12, + "end_col_offset": 63, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/data/sdf/ListOfDictScalableDataFrame.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 252, + "line_range": [ + 252 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "54 )\n55 assert isinstance(data, np.ndarray), f'Found type: {type(data)}'\n56 if np.issubdtype(data.dtype, np.unicode_) and str_to_object:\n", + "col_offset": 12, + "end_col_offset": 76, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/data/sdf/NumpyArrayScalableSeries.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 55, + "line_range": [ + 55 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "110 for df in dfs:\n111 assert isinstance(df, cls)\n112 df_list.append(df._data)\n", + "col_offset": 12, + "end_col_offset": 38, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/data/sdf/NumpyRecordArrayScalableDataFrame.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 111, + "line_range": [ + 111 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "95 for sdf in sdfs:\n96 assert isinstance(sdf, PandasScalableDataFrame)\n97 df_list.append(sdf._data)\n", + "col_offset": 12, + "end_col_offset": 59, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/data/sdf/PandasScalableDataFrame.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 96, + "line_range": [ + 96 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "132 for sdf in sdfs:\n133 assert isinstance(sdf, RecordScalableDataFrame)\n134 list_of_dicts.append(sdf.raw())\n", + "col_offset": 12, + "end_col_offset": 59, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/data/sdf/RecordScalableDataFrame.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 133, + "line_range": [ + 133 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "109 data: ScalableDataFrame = data.to_frame()\n110 assert isinstance(data, ScalableDataFrame)\n111 if layout is None:\n", + "col_offset": 8, + "end_col_offset": 50, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/data/sdf/ScalableDataFrame.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 110, + "line_range": [ + 110 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "996 num_batches_per_shard += M\n997 assert remaining_num_rows < M * S * B\n998 # assert remaining_num_rows == (N - M*S*B*((new_P//S)-1))\n", + "col_offset": 8, + "end_col_offset": 45, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/data/sdf/ScalableDataFrame.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 997, + "line_range": [ + 997 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "1007 num_batches_per_shard += num_remaining_complete_columns\n1008 assert remaining_num_rows < S * B\n1009 \n", + "col_offset": 8, + "end_col_offset": 41, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/data/sdf/ScalableDataFrame.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 1008, + "line_range": [ + 1008 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "1029 remaining_num_rows -= final_col_num_rows\n1030 assert remaining_num_rows == 0\n1031 \n", + "col_offset": 12, + "end_col_offset": 42, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/data/sdf/ScalableDataFrame.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 1030, + "line_range": [ + 1030 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "1093 if parallelize is Parallelize.processes:\n1094 assert map_executor == 'spawn'\n1095 return ProcessPoolExecutor(max_workers=num_workers)\n", + "col_offset": 16, + "end_col_offset": 46, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/data/sdf/ScalableDataFrame.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 1094, + "line_range": [ + 1094 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "1096 elif parallelize is Parallelize.threads:\n1097 assert map_executor == 'spawn'\n1098 return ThreadPoolExecutor(max_workers=num_workers)\n", + "col_offset": 16, + "end_col_offset": 46, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/data/sdf/ScalableDataFrame.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 1097, + "line_range": [ + 1097 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "1184 raise e\n1185 assert map_failure == 'drop'\n1186 return\n", + "col_offset": 12, + "end_col_offset": 40, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/data/sdf/ScalableDataFrame.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 1185, + "line_range": [ + 1185 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "1200 raise e\n1201 assert map_failure == 'drop'\n1202 return None\n", + "col_offset": 12, + "end_col_offset": 40, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/data/sdf/ScalableDataFrame.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 1201, + "line_range": [ + 1201 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "91 data: ScalableSeries = cls.get_subclass(layout)(data=data, **kwargs)\n92 assert isinstance(data, ScalableSeries)\n93 if layout is None:\n", + "col_offset": 8, + "end_col_offset": 47, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/data/sdf/ScalableSeries.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 92, + "line_range": [ + 92 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "220 else:\n221 assert len(written_paths) == 1\n222 written_path: str = written_paths[0]\n", + "col_offset": 20, + "end_col_offset": 50, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/data/writer/Writer.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 221, + "line_range": [ + 221 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "291 else:\n292 assert len(written_s3_paths) == 1\n293 written_s3_path: str = written_s3_paths[0]\n", + "col_offset": 20, + "end_col_offset": 53, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/data/writer/Writer.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 292, + "line_range": [ + 292 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "1 from typing import *\n2 import io, pickle\n3 from abc import abstractmethod, ABC\n", + "col_offset": 0, + "end_col_offset": 17, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/data/writer/binary/PickleWriter.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 502, + "link": "https://cwe.mitre.org/data/definitions/502.html" + }, + "issue_severity": "LOW", + "issue_text": "Consider possible security implications associated with pickle module.", + "line_number": 2, + "line_range": [ + 2 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/blacklists/blacklist_imports.html#b403-import-pickle", + "test_id": "B403", + "test_name": "blacklist" + }, + { + "code": "76 ## We are writing multiple files to a directory (either in local or remote).\n77 assert name_function is not None, f'We require a `name_function` when writing to a directory.'\n78 sdf.to_csv(\n", + "col_offset": 12, + "end_col_offset": 106, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/data/writer/dataframe/CsvWriter.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 77, + "line_range": [ + 77 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "71 ## We are writing multiple files to a directory (either in local or remote).\n72 assert name_function is not None, f'We require a `name_function` when writing to a directory.'\n73 sdf.to_json(\n", + "col_offset": 12, + "end_col_offset": 106, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/data/writer/dataframe/JsonLinesWriter.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 72, + "line_range": [ + 72 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "72 ## We are writing multiple files to a directory (either in local or remote).\n73 assert name_function is not None, f'We require a `name_function` when writing to a directory.'\n74 params = self.filtered_params(DaskDataFrame.compute, DaskDataFrame.get_partition, Pandas_to_npz)\n", + "col_offset": 12, + "end_col_offset": 106, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/data/writer/dataframe/NpzWriter.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 73, + "line_range": [ + 73 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "70 ## We are writing multiple files to a directory (either in local or remote).\n71 assert name_function is not None, f'We require a `name_function` when writing to a directory.'\n72 params = self.filtered_params(Dask_to_parquet, Pandas_to_parquet)\n", + "col_offset": 12, + "end_col_offset": 106, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/data/writer/dataframe/ParquetWriter.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 71, + "line_range": [ + 71 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "4 import numpy as np\n5 import time, traceback, pickle, gc, os, tempfile\n6 from synthesizrr.base.constants import FileFormat, DataLayout, MLType, DataSplit, MLTypeSchema, Storage\n", + "col_offset": 0, + "end_col_offset": 48, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/framework/algorithm.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 502, + "link": "https://cwe.mitre.org/data/definitions/502.html" + }, + "issue_severity": "LOW", + "issue_text": "Consider possible security implications associated with pickle module.", + "line_number": 5, + "line_range": [ + 5 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/blacklists/blacklist_imports.html#b403-import-pickle", + "test_id": "B403", + "test_name": "blacklist" + }, + { + "code": "265 ## Copy to local cache directory:\n266 assert cache_dir is not None\n267 cache_dir.mkdir()\n", + "col_offset": 16, + "end_col_offset": 44, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/framework/algorithm.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 266, + "line_range": [ + 266 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "691 with model_dir.open(file_name=model_params_file_name, mode=\"rb\", tmpdir=tmpdir) as inp:\n692 model_params: Dict = pickle.load(inp)\n693 if not isinstance(model_params, dict):\n", + "col_offset": 33, + "end_col_offset": 49, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/framework/algorithm.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 502, + "link": "https://cwe.mitre.org/data/definitions/502.html" + }, + "issue_severity": "MEDIUM", + "issue_text": "Pickle and modules that wrap it can be unsafe when used to deserialize untrusted data, possible security issue.", + "line_number": 692, + "line_range": [ + 692 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/blacklists/blacklist_calls.html#b301-pickle", + "test_id": "B301", + "test_name": "blacklist" + }, + { + "code": "4 import numpy as np\n5 import time, traceback, pickle, gc, os, json\n6 from synthesizrr.base.util import Registry, MutableParameters, Parameters, set_param_from_alias, is_list_like, as_list, \\\n", + "col_offset": 0, + "end_col_offset": 44, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/framework/chain/Chain.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 502, + "link": "https://cwe.mitre.org/data/definitions/502.html" + }, + "issue_severity": "LOW", + "issue_text": "Consider possible security implications associated with pickle module.", + "line_number": 5, + "line_range": [ + 5 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/blacklists/blacklist_imports.html#b403-import-pickle", + "test_id": "B403", + "test_name": "blacklist" + }, + { + "code": "269 if after is not None:\n270 assert isinstance(after, ChainExecution)\n271 tracker: Tracker = Tracker.of(get_default(tracker, 'noop'))\n", + "col_offset": 12, + "end_col_offset": 52, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/framework/chain/Chain.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 270, + "line_range": [ + 270 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "661 outputs: Dict = chain_exn.outputs\n662 assert isinstance(outputs, dict)\n663 outputs['__exn__'] = chain_exn\n", + "col_offset": 8, + "end_col_offset": 40, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/framework/chain/Chain.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 662, + "line_range": [ + 662 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "66 else:\n67 assert required_embeddings == 'multi'\n68 output: List[Tensor] = self.embed_multi(input, **kwargs)\n", + "col_offset": 16, + "end_col_offset": 53, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/framework/dl/torch/torch_tasks.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 67, + "line_range": [ + 67 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "36 params['model_weights_dtype'] = getattr(torch, params['model_weights_dtype'])\n37 assert isinstance(params['model_weights_dtype'], torch.dtype)\n38 return params\n", + "col_offset": 16, + "end_col_offset": 77, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/framework/evaluator/AccelerateEvaluator.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 37, + "line_range": [ + 37 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "186 raise ValueError(f'For non-HuggingFace PyTorch models, you must specify model_dir for loading.')\n187 assert isinstance(model_dir, FileMetadata)\n188 model_dir_path: str = model_dir.path\n", + "col_offset": 12, + "end_col_offset": 54, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/framework/evaluator/AccelerateEvaluator.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 187, + "line_range": [ + 187 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "263 ## Load the model into CPU memory:\n264 assert cache_dir is not None\n265 model: Algorithm = Algorithm.of(**{\n", + "col_offset": 12, + "end_col_offset": 40, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/framework/evaluator/AccelerateEvaluator.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 264, + "line_range": [ + 264 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "167 if error_to_raise is None:\n168 assert isinstance(macro_batch, ScalableDataFrame) and macro_batch.layout == DataLayout.PANDAS\n169 macro_batch_save_file: Optional[FileMetadata] = None ## Saves a macro batch\n", + "col_offset": 20, + "end_col_offset": 113, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/framework/evaluator/RayEvaluator.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 168, + "line_range": [ + 168 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "540 )\n541 assert predictions_destination.format is not None ## Checked in .evaluate().\n542 \n", + "col_offset": 16, + "end_col_offset": 65, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/framework/evaluator/RayEvaluator.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 541, + "line_range": [ + 541 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "649 elif load_balancing_strategy is LoadBalancingStrategy.RANDOM:\n650 rnd_actor_i: int = random.choice(list(range(0, num_actors_created)))\n651 actor_comp: ActorComposite = self.model[rnd_actor_i]\n", + "col_offset": 43, + "end_col_offset": 92, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/framework/evaluator/RayEvaluator.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 330, + "link": "https://cwe.mitre.org/data/definitions/330.html" + }, + "issue_severity": "LOW", + "issue_text": "Standard pseudo-random generators are not suitable for security/cryptographic purposes.", + "line_number": 650, + "line_range": [ + 650 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/blacklists/blacklist_calls.html#b311-random", + "test_id": "B311", + "test_name": "blacklist" + }, + { + "code": "674 ## Select an actor randomly among those with min usage and latest_last_completed_timestamp.\n675 actor_id: str = random.choice([\n676 actor_id\n677 for actor_usage, last_completed_timestamp, actor_id in actor_usages\n678 if actor_usage == min_actor_usage \\\n679 and last_completed_timestamp == latest_last_completed_timestamp\n680 ])\n681 actor_comp: ActorComposite = only_item([\n", + "col_offset": 40, + "end_col_offset": 26, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/framework/evaluator/RayEvaluator.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 330, + "link": "https://cwe.mitre.org/data/definitions/330.html" + }, + "issue_severity": "LOW", + "issue_text": "Standard pseudo-random generators are not suitable for security/cryptographic purposes.", + "line_number": 675, + "line_range": [ + 675, + 676, + 677, + 678, + 679, + 680 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/blacklists/blacklist_calls.html#b311-random", + "test_id": "B311", + "test_name": "blacklist" + }, + { + "code": "1 from typing import *\n2 import math, copy, io, pickle\n3 from abc import ABC, abstractmethod\n", + "col_offset": 0, + "end_col_offset": 29, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/framework/metric.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 502, + "link": "https://cwe.mitre.org/data/definitions/502.html" + }, + "issue_severity": "LOW", + "issue_text": "Consider possible security implications associated with pickle module.", + "line_number": 2, + "line_range": [ + 2 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/blacklists/blacklist_imports.html#b403-import-pickle", + "test_id": "B403", + "test_name": "blacklist" + }, + { + "code": "661 ) -> str:\n662 assert isinstance(range, bool)\n663 \n", + "col_offset": 4, + "end_col_offset": 34, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/framework/metric.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 662, + "line_range": [ + 662 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "559 progress_bar: Optional[Dict] = None\n560 assert progress_bar is None or isinstance(progress_bar, dict)\n561 \n", + "col_offset": 8, + "end_col_offset": 69, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/framework/mixins.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 560, + "line_range": [ + 560 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "708 raise ValueError(f'Cannot iterate over files for data which is in memory')\n709 assert isinstance(self.data, FileMetadata)\n710 \n", + "col_offset": 8, + "end_col_offset": 50, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/framework/mixins.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 709, + "line_range": [ + 709 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "775 raise ValueError(f'Cannot detect any file formats from asset paths: {asset_paths.to_list()}')\n776 assert len(asset_formats) == 1 and len(non_existent_asset_paths) == 0\n777 ## At least one item in this batch column was non-None:\n", + "col_offset": 20, + "end_col_offset": 89, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/framework/mixins.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 776, + "line_range": [ + 776 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "925 for row in self.iter(num_rows=1, stream_as=DataLayout.LIST_OF_DICT):\n926 assert isinstance(row, InputOutputDataMixin)\n927 row.set_layout(DataLayout.RECORD)\n", + "col_offset": 12, + "end_col_offset": 56, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/framework/mixins.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 926, + "line_range": [ + 926 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "999 for batch in self.iter(**kwargs):\n1000 assert isinstance(batch, InputOutputDataMixin)\n1001 if len(get_fn_args(fn)) == 1:\n", + "col_offset": 12, + "end_col_offset": 58, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/framework/mixins.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 1000, + "line_range": [ + 1000 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "1021 for batch in self.iter(**kwargs):\n1022 assert isinstance(batch, InputOutputDataMixin)\n1023 if len(get_fn_args(fn)) == 1:\n", + "col_offset": 12, + "end_col_offset": 58, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/framework/mixins.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 1022, + "line_range": [ + 1022 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "212 for batch in data.iter(**kwargs):\n213 assert isinstance(batch, Embeddings)\n214 faiss_idxs: np.ndarray = np.arange(\n", + "col_offset": 16, + "end_col_offset": 52, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/framework/task/dense_retrieval.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 213, + "line_range": [ + 213 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "263 for queries_batch in queries.stream(batch_size=index_retrieval_batch_size):\n264 assert isinstance(queries_batch, ScalableSeries)\n265 queries_batch_np: np.ndarray = queries_batch.numpy(stack=True)\n", + "col_offset": 16, + "end_col_offset": 64, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/framework/task/dense_retrieval.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 264, + "line_range": [ + 264 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "271 )\n272 assert top_k_distances.shape[0] == top_k_faiss_idxs.shape[0] == len(queries_batch)\n273 for i in range(len(queries_batch)):\n", + "col_offset": 16, + "end_col_offset": 98, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/framework/task/dense_retrieval.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 272, + "line_range": [ + 272 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "41 def ground_truth_scores(self) -> ScalableSeries:\n42 assert self.has_ground_truths\n43 ground_truth_scores_col: str = next(iter(self.data_schema.ground_truths_schema.keys()))\n", + "col_offset": 8, + "end_col_offset": 37, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/framework/task/regression.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 42, + "line_range": [ + 42 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "52 doc_id: str = str(doc_id)\n53 assert len(doc_id) > 0\n54 return doc_id\n", + "col_offset": 8, + "end_col_offset": 30, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/framework/task/sparse_retrieval.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 53, + "line_range": [ + 53 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "112 ) -> BM25IndexStore:\n113 assert self.class_name == index2.class_name\n114 dict_keys_to_exclude: List[str] = [\n", + "col_offset": 8, + "end_col_offset": 51, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/framework/task/sparse_retrieval.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 113, + "line_range": [ + 113 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "324 if documents is not None:\n325 assert isinstance(documents, RetrievalCorpus)\n326 kwargs['progress_bar'] = False\n", + "col_offset": 8, + "end_col_offset": 53, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/framework/task/sparse_retrieval.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 325, + "line_range": [ + 325 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "401 )\n402 assert isinstance(data, RetrievalCorpus)\n403 id_col: str = data.data_schema.index_col\n", + "col_offset": 8, + "end_col_offset": 48, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/framework/task/sparse_retrieval.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 402, + "line_range": [ + 402 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "484 for queries_batch in queries.stream(batch_size=index_retrieval_batch_size):\n485 assert isinstance(queries_batch, ScalableSeries)\n486 ranked_results.extend(self._retrieve_batch(\n", + "col_offset": 12, + "end_col_offset": 60, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/framework/task/sparse_retrieval.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 485, + "line_range": [ + 485 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "537 for documents_batch in corpus_gen:\n538 assert isinstance(documents_batch, RetrievalCorpus)\n539 index_futs.append(\n", + "col_offset": 16, + "end_col_offset": 67, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/framework/task/sparse_retrieval.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 538, + "line_range": [ + 538 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "644 )\n645 assert isinstance(documents, RetrievalCorpus)\n646 index_store_update: BM25IndexStore = _create_index_store(\n", + "col_offset": 12, + "end_col_offset": 57, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/framework/task/sparse_retrieval.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 645, + "line_range": [ + 645 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "716 for documents_batch_i, documents_batch in enumerate(corpus_gen):\n717 assert isinstance(documents_batch, RetrievalCorpus)\n718 ## Select in randomized round-robin order:\n", + "col_offset": 12, + "end_col_offset": 63, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/framework/task/sparse_retrieval.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 717, + "line_range": [ + 717 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "735 )\n736 assert bool(all(accumulate(index_futs, progress_bar=pbar)))\n737 ## Next steps:\n", + "col_offset": 8, + "end_col_offset": 67, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/framework/task/sparse_retrieval.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 736, + "line_range": [ + 736 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "800 )\n801 assert len(batch_ranked_results) == len(queries_batch)\n802 return batch_ranked_results\n", + "col_offset": 8, + "end_col_offset": 62, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/framework/task/sparse_retrieval.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 801, + "line_range": [ + 801 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "811 ## For a particular query, sort the top-k results across actors.\n812 assert how in {'max', 'min'}\n813 query_top_k_results: List[Tuple[BM25IndexStoreDoc, float]] = []\n", + "col_offset": 8, + "end_col_offset": 36, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/framework/task/sparse_retrieval.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 812, + "line_range": [ + 812 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "996 )\n997 assert len(corpus_random_sample) == total_num_results\n998 index_col: str = self.corpus.data_schema.index_col\n", + "col_offset": 8, + "end_col_offset": 61, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/framework/task/sparse_retrieval.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 997, + "line_range": [ + 997 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "132 batch_icl_idxs_in_use: List[Set] = [as_set(batch_idx) for batch_idx in batch.index()]\n133 assert len(batch_icl_idxs_in_use) == len(batch)\n134 # print(f'Columns before: {batch.data.columns}')\n", + "col_offset": 8, + "end_col_offset": 55, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/framework/task/text_generation.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 133, + "line_range": [ + 133 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "258 \"\"\"\n259 assert isinstance(self.icl_dataset, ClassificationData)\n260 assert isinstance(self.icl_entailment_pos_dataset, ClassificationData)\n", + "col_offset": 8, + "end_col_offset": 63, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/framework/task/text_generation.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 259, + "line_range": [ + 259 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "259 assert isinstance(self.icl_dataset, ClassificationData)\n260 assert isinstance(self.icl_entailment_pos_dataset, ClassificationData)\n261 assert isinstance(self.icl_entailment_neg_dataset, ClassificationData)\n", + "col_offset": 8, + "end_col_offset": 78, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/framework/task/text_generation.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 260, + "line_range": [ + 260 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "260 assert isinstance(self.icl_entailment_pos_dataset, ClassificationData)\n261 assert isinstance(self.icl_entailment_neg_dataset, ClassificationData)\n262 ## We want to avoid accidentally \"leaking\" the answer by selecting an ICL example with the same idx as the\n", + "col_offset": 8, + "end_col_offset": 78, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/framework/task/text_generation.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 261, + "line_range": [ + 261 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "264 batch_icl_idxs_in_use: List[Set] = [as_set(batch_idx) for batch_idx in batch.index()]\n265 assert len(batch_icl_idxs_in_use) == len(batch)\n266 for shot_i in self.shot_idxs(self.num_shots): ## 1, 2, 3, ...\n", + "col_offset": 8, + "end_col_offset": 55, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/framework/task/text_generation.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 265, + "line_range": [ + 265 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "510 params['min_possible_score']: float = 0.0\n511 assert 0.0 < params['output_scores_tolerance'] < 1.0\n512 elif params['output_scores_format'] == 'log-probabilities':\n", + "col_offset": 12, + "end_col_offset": 64, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/framework/task/text_generation.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 511, + "line_range": [ + 511 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "514 params['min_possible_score']: float = -inf\n515 assert 0.0 < params['output_scores_tolerance'] < 1.0\n516 params['output_scores_tolerance']: float = log(params['output_scores_tolerance'])\n", + "col_offset": 12, + "end_col_offset": 64, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/framework/task/text_generation.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 515, + "line_range": [ + 515 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "516 params['output_scores_tolerance']: float = log(params['output_scores_tolerance'])\n517 assert params['output_scores_tolerance'] < 0.0\n518 elif params['output_scores_format'] == 'logits':\n", + "col_offset": 12, + "end_col_offset": 58, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/framework/task/text_generation.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 517, + "line_range": [ + 517 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "600 generation_params: TextGenerationParams = self.hyperparams.generation_params\n601 assert isinstance(generation_params, TextGenerationParams)\n602 assert generated_token_ids.shape == generated_tokens.shape == generated_token_scores.shape\n", + "col_offset": 12, + "end_col_offset": 70, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/framework/task/text_generation.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 601, + "line_range": [ + 601 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "601 assert isinstance(generation_params, TextGenerationParams)\n602 assert generated_token_ids.shape == generated_tokens.shape == generated_token_scores.shape\n603 batch_size: int = generated_token_ids.shape[0]\n", + "col_offset": 12, + "end_col_offset": 102, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/framework/task/text_generation.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 602, + "line_range": [ + 602 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "793 def _create_predictions(self, batch: Dataset, predictions: Any, **kwargs) -> TextGenerations:\n794 assert isinstance(predictions, TextGenerations)\n795 return predictions\n", + "col_offset": 8, + "end_col_offset": 55, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/framework/task/text_generation.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 794, + "line_range": [ + 794 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "831 })\n832 assert isinstance(self.retriever, Retriever)\n833 \n", + "col_offset": 12, + "end_col_offset": 56, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/framework/task/text_generation.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 832, + "line_range": [ + 832 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "942 def _create_predictions(self, batch: Dataset, predictions: Any, **kwargs) -> TextGenerations:\n943 assert isinstance(predictions, TextGenerations)\n944 return predictions\n", + "col_offset": 8, + "end_col_offset": 55, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/framework/task/text_generation.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 943, + "line_range": [ + 943 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "106 raise e\n107 assert isinstance(data_schema, Schema)\n108 if not cls._allow_empty_features_schema and len(data_schema.features_schema) == 0:\n", + "col_offset": 8, + "end_col_offset": 46, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/framework/task_data.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 107, + "line_range": [ + 107 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "57 self.repo: Repo = Repo(self.repo_dir, init=True)\n58 assert isinstance(self.repo, Repo)\n59 \n", + "col_offset": 12, + "end_col_offset": 46, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/framework/tracker/AimTracker.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 58, + "line_range": [ + 58 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "50 log_file.get_dir(return_metadata=True).mkdir()\n51 assert log_file.storage is Storage.LOCAL_FILE_SYSTEM\n52 assert not log_file.is_path_valid_dir()\n", + "col_offset": 8, + "end_col_offset": 60, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/framework/tracker/LogFileTracker.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 51, + "line_range": [ + 51 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "51 assert log_file.storage is Storage.LOCAL_FILE_SYSTEM\n52 assert not log_file.is_path_valid_dir()\n53 process_id: int = os.getpid()\n", + "col_offset": 8, + "end_col_offset": 47, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/framework/tracker/LogFileTracker.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 52, + "line_range": [ + 52 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "64 )\n65 assert self.logger is not None\n66 assert self.logger_handler is not None\n", + "col_offset": 8, + "end_col_offset": 38, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/framework/tracker/LogFileTracker.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 65, + "line_range": [ + 65 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "65 assert self.logger is not None\n66 assert self.logger_handler is not None\n67 \n", + "col_offset": 8, + "end_col_offset": 46, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/framework/tracker/LogFileTracker.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 66, + "line_range": [ + 66 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "161 tracker: Tracker = Tracker.of(tracker)\n162 assert isinstance(tracker, Tracker)\n163 \n", + "col_offset": 12, + "end_col_offset": 47, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/framework/trainer/AccelerateTrainer.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 162, + "line_range": [ + 162 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "6 from types import ModuleType\n7 import time, os, gc, io, pickle, math, copy, pandas as pd, numpy as np, random\n8 import ray\n", + "col_offset": 0, + "end_col_offset": 78, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/framework/trainer/RayTuneTrainer.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 502, + "link": "https://cwe.mitre.org/data/definitions/502.html" + }, + "issue_severity": "LOW", + "issue_text": "Consider possible security implications associated with pickle module.", + "line_number": 7, + "line_range": [ + 7 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/blacklists/blacklist_imports.html#b403-import-pickle", + "test_id": "B403", + "test_name": "blacklist" + }, + { + "code": "145 if isinstance(metric, TabularMetric):\n146 assert isinstance(metric.value, pd.DataFrame)\n147 return _RAY_METRIC_IS_DATAFRAME_PREFIX + metric.value.to_json(orient='records')\n", + "col_offset": 8, + "end_col_offset": 53, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/framework/trainer/RayTuneTrainer.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 146, + "line_range": [ + 146 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "166 value.seek(0)\n167 return pickle.load(value)\n168 \n", + "col_offset": 11, + "end_col_offset": 29, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/framework/trainer/RayTuneTrainer.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 502, + "link": "https://cwe.mitre.org/data/definitions/502.html" + }, + "issue_severity": "MEDIUM", + "issue_text": "Pickle and modules that wrap it can be unsafe when used to deserialize untrusted data, possible security issue.", + "line_number": 167, + "line_range": [ + 167 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/blacklists/blacklist_calls.html#b301-pickle", + "test_id": "B301", + "test_name": "blacklist" + }, + { + "code": "191 for student_metric in trial_metrics[data_split]:\n192 assert isinstance(student_metric, Metric)\n193 student_metric_name: str = student_metric.display_name\n", + "col_offset": 12, + "end_col_offset": 53, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/framework/trainer/RayTuneTrainer.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 192, + "line_range": [ + 192 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "200 else:\n201 assert student_metrics[student_metric_name]['metric_class'] == type(student_metric)\n202 student_metrics_stats: Dict[str, Dict[str, Union[int, float]]] = {}\n", + "col_offset": 16, + "end_col_offset": 99, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/framework/trainer/RayTuneTrainer.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 201, + "line_range": [ + 201 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "869 final_model_results: tune.ResultGrid = results\n870 assert len(list(final_model_results)) == self.num_models\n871 \n", + "col_offset": 16, + "end_col_offset": 72, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/framework/trainer/RayTuneTrainer.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 870, + "line_range": [ + 870 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "933 final_model_results: tune.ResultGrid = retry(tuner.fit, retries=2)\n934 assert len(list(final_model_results)) == self.num_final_models\n935 retrain_timer.stop()\n", + "col_offset": 20, + "end_col_offset": 82, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/framework/trainer/RayTuneTrainer.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 934, + "line_range": [ + 934 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "1127 ## Priority: global K-Fold seed > random seed.\n1128 k_fold_seed: int = get_default(k_fold.seed, random.randint(0, int(1e9)))\n1129 if k_fold.seed is None:\n", + "col_offset": 64, + "end_col_offset": 91, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/framework/trainer/RayTuneTrainer.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 330, + "link": "https://cwe.mitre.org/data/definitions/330.html" + }, + "issue_severity": "LOW", + "issue_text": "Standard pseudo-random generators are not suitable for security/cryptographic purposes.", + "line_number": 1128, + "line_range": [ + 1128 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/blacklists/blacklist_calls.html#b311-random", + "test_id": "B311", + "test_name": "blacklist" + }, + { + "code": "1211 def _create_tune_config_for_tuning(self, datasets: Datasets, metrics: Optional[Metrics]) -> tune.TuneConfig:\n1212 assert self.is_n_models_without_tuning() is False\n1213 num_models: int = self.num_models\n", + "col_offset": 8, + "end_col_offset": 57, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/framework/trainer/RayTuneTrainer.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 1212, + "line_range": [ + 1212 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "1445 if _RAY_KFOLD_CURRENT_FOLD_NAME in hp_iter_num_df.columns:\n1446 assert hp_df[_RAY_KFOLD_CURRENT_FOLD_NAME].nunique() == self.k_fold.num_folds\n1447 ## Allows for the case where the same set of hyperparams might be repeated multiple times,\n", + "col_offset": 20, + "end_col_offset": 97, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/framework/trainer/RayTuneTrainer.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 1446, + "line_range": [ + 1446 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "193 params['AlgorithmClass']: Type[Algorithm] = Algorithm.get_subclass((params['task'], AlgorithmClass))\n194 assert issubclass(params['AlgorithmClass'], Algorithm)\n195 \n", + "col_offset": 8, + "end_col_offset": 62, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/framework/trainer/Trainer.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 194, + "line_range": [ + 194 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "304 load_model: FileMetadata = FileMetadata.of(load_model)\n305 assert isinstance(load_model, FileMetadata)\n306 if load_model.is_path_valid_dir() is False:\n", + "col_offset": 12, + "end_col_offset": 55, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/framework/trainer/Trainer.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 305, + "line_range": [ + 305 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "316 save_model: FileMetadata = FileMetadata.of(save_model)\n317 assert isinstance(save_model, FileMetadata)\n318 if save_model.is_path_valid_dir() is False:\n", + "col_offset": 12, + "end_col_offset": 55, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/framework/trainer/Trainer.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 317, + "line_range": [ + 317 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "368 for dataset_metric in dataset_metrics:\n369 assert isinstance(dataset_metric, Metric)\n370 dataset_metrics_unique[dataset_metric.display_name] = dataset_metric\n", + "col_offset": 16, + "end_col_offset": 57, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/framework/trainer/Trainer.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 369, + "line_range": [ + 369 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "598 self._labelspace = data.labelspace\n599 assert self._labelspace == data.labelspace\n600 for lb in self._labelspace:\n", + "col_offset": 8, + "end_col_offset": 50, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/metric/classification_metrics.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 599, + "line_range": [ + 599 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "651 self._labelspace = data.labelspace\n652 assert self._labelspace == data.labelspace\n653 \n", + "col_offset": 8, + "end_col_offset": 50, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/metric/classification_metrics.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 652, + "line_range": [ + 652 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "655 self._idx_col_name = data.data_schema.index_col\n656 assert self._idx_col_name == data.data_schema.index_col\n657 \n", + "col_offset": 8, + "end_col_offset": 63, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/metric/classification_metrics.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 656, + "line_range": [ + 656 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "659 self._gt_col_name = data.ground_truth_label_col_name\n660 assert self._gt_col_name == data.ground_truth_label_col_name\n661 \n", + "col_offset": 8, + "end_col_offset": 68, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/metric/classification_metrics.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 660, + "line_range": [ + 660 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "344 )\n345 assert isinstance(statement_extraction_gens, NextTokens)\n346 assert len(statement_extraction_gens) == len(rag_gens)\n", + "col_offset": 8, + "end_col_offset": 64, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/metric/text_generation_metrics.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 345, + "line_range": [ + 345 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "345 assert isinstance(statement_extraction_gens, NextTokens)\n346 assert len(statement_extraction_gens) == len(rag_gens)\n347 statement_extraction_gens.set_layout(DataLayout.PANDAS)\n", + "col_offset": 8, + "end_col_offset": 62, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/metric/text_generation_metrics.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 346, + "line_range": [ + 346 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "464 )\n465 assert isinstance(statement_verification_gens, NextTokens)\n466 assert len(statement_verification_gens) == len(rag_gens_with_statements_flattened)\n", + "col_offset": 8, + "end_col_offset": 66, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/metric/text_generation_metrics.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 465, + "line_range": [ + 465 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "465 assert isinstance(statement_verification_gens, NextTokens)\n466 assert len(statement_verification_gens) == len(rag_gens_with_statements_flattened)\n467 statement_verification_gens.set_layout(DataLayout.PANDAS)\n", + "col_offset": 8, + "end_col_offset": 90, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/metric/text_generation_metrics.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 466, + "line_range": [ + 466 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "726 )\n727 assert isinstance(relevant_context_extraction, NextTokens)\n728 assert len(relevant_context_extraction) == len(rag_gens)\n", + "col_offset": 8, + "end_col_offset": 66, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/metric/text_generation_metrics.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 727, + "line_range": [ + 727 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "727 assert isinstance(relevant_context_extraction, NextTokens)\n728 assert len(relevant_context_extraction) == len(rag_gens)\n729 relevant_context_extraction.set_layout(DataLayout.PANDAS)\n", + "col_offset": 8, + "end_col_offset": 64, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/metric/text_generation_metrics.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 728, + "line_range": [ + 728 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "950 if settings.get('device_id') is not None:\n951 settings['device_id'] = random.choice(EnvUtil.cuda_visible_devices())\n952 clear_device_cache()\n", + "col_offset": 44, + "end_col_offset": 89, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/metric/text_generation_metrics.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 330, + "link": "https://cwe.mitre.org/data/definitions/330.html" + }, + "issue_severity": "LOW", + "issue_text": "Standard pseudo-random generators are not suitable for security/cryptographic purposes.", + "line_number": 951, + "line_range": [ + 951 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/blacklists/blacklist_calls.html#b311-random", + "test_id": "B311", + "test_name": "blacklist" + }, + { + "code": "1392 clf_dataset: ClassificationData = data\n1393 assert isinstance(clf_dataset, ClassificationData)\n1394 clf_dataset: ClassificationData = clf_dataset.read()\n", + "col_offset": 8, + "end_col_offset": 58, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/metric/text_generation_metrics.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 1393, + "line_range": [ + 1393 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "1621 )\n1622 assert isinstance(final_model_results, tune.ResultGrid)\n1623 if final_model_results.num_errors > 0:\n", + "col_offset": 8, + "end_col_offset": 63, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/metric/text_generation_metrics.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 1622, + "line_range": [ + 1622 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "1635 if self.params.hpo:\n1636 assert isinstance(tune_results, tune.ResultGrid)\n1637 tune_metrics: pd.DataFrame = tune_trainer.get_detailed_metrics(tune_results)\n", + "col_offset": 12, + "end_col_offset": 60, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/metric/text_generation_metrics.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 1636, + "line_range": [ + 1636 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "1 from typing import *\n2 import io, random, re, math, os, time, boto3, botocore, fnmatch, pickle\n3 from urllib.parse import urlparse, ParseResult\n", + "col_offset": 0, + "end_col_offset": 71, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/util/aws/s3.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 502, + "link": "https://cwe.mitre.org/data/definitions/502.html" + }, + "issue_severity": "LOW", + "issue_text": "Consider possible security implications associated with pickle module.", + "line_number": 2, + "line_range": [ + 2 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/blacklists/blacklist_imports.html#b403-import-pickle", + "test_id": "B403", + "test_name": "blacklist" + }, + { + "code": "231 pickled_data = cls.stream_s3_object(s3_path, retry=retry).read()\n232 loaded_data = pickle.loads(pickled_data)\n233 if loaded_data is None:\n", + "col_offset": 22, + "end_col_offset": 48, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/util/aws/s3.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 502, + "link": "https://cwe.mitre.org/data/definitions/502.html" + }, + "issue_severity": "MEDIUM", + "issue_text": "Pickle and modules that wrap it can be unsafe when used to deserialize untrusted data, possible security issue.", + "line_number": 232, + "line_range": [ + 232 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/blacklists/blacklist_calls.html#b301-pickle", + "test_id": "B301", + "test_name": "blacklist" + }, + { + "code": "323 )\n324 assert cls.s3_object_exists(destination_s3_path), f'Could not find file {destination_s3_path} after copying'\n325 return True\n", + "col_offset": 12, + "end_col_offset": 120, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/util/aws/s3.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 324, + "line_range": [ + 324 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "371 s3 = boto3.resource('s3')\n372 assert cls.s3_object_exists(source_s3_path), f'Could not find file {source_s3_path} to copy'\n373 ## Ref: https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/s3.html#S3.Client.download_file\n", + "col_offset": 12, + "end_col_offset": 104, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/util/aws/s3.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 372, + "line_range": [ + 372 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "417 return True\n418 time.sleep(random.randint(0, 30000) / 1000) ## Wait randomly between 0 and 30 seconds to acquire locks.\n419 lock_file: str = os.path.join(destination_local_dir, 'litmus-download.lock')\n", + "col_offset": 23, + "end_col_offset": 47, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/util/aws/s3.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 330, + "link": "https://cwe.mitre.org/data/definitions/330.html" + }, + "issue_severity": "LOW", + "issue_text": "Standard pseudo-random generators are not suitable for security/cryptographic purposes.", + "line_number": 418, + "line_range": [ + 418 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/blacklists/blacklist_calls.html#b311-random", + "test_id": "B311", + "test_name": "blacklist" + }, + { + "code": "458 s3 = boto3.resource('s3')\n459 assert cls.s3_object_exists(source_s3_path)\n460 ## Ref: https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/s3.html#S3.Client.copy\n", + "col_offset": 12, + "end_col_offset": 55, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/util/aws/s3.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 459, + "line_range": [ + 459 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "467 )\n468 assert cls.s3_object_exists(destination_s3_path), f'Could not find file {destination_s3_path} after copying'\n469 return True\n", + "col_offset": 12, + "end_col_offset": 120, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/util/aws/s3.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 468, + "line_range": [ + 468 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "793 ) -> str:\n794 assert isinstance(daemons, dict)\n795 assert isinstance(wait, (int, float)) and wait >= 0.0\n", + "col_offset": 4, + "end_col_offset": 36, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/util/concurrency.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 794, + "line_range": [ + 794 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "794 assert isinstance(daemons, dict)\n795 assert isinstance(wait, (int, float)) and wait >= 0.0\n796 if daemon_id is None:\n", + "col_offset": 4, + "end_col_offset": 57, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/util/concurrency.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 795, + "line_range": [ + 795 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "802 daemon_id: str = dt.strftime('%Y-%m-%d %H:%M:%S.%f').strip()\n803 assert isinstance(daemon_id, str) and len(daemon_id) > 0\n804 assert daemon_id not in daemons, f'Daemon with id \"{daemon_id}\" already exists.'\n", + "col_offset": 4, + "end_col_offset": 60, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/util/concurrency.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 803, + "line_range": [ + 803 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "803 assert isinstance(daemon_id, str) and len(daemon_id) > 0\n804 assert daemon_id not in daemons, f'Daemon with id \"{daemon_id}\" already exists.'\n805 \n", + "col_offset": 4, + "end_col_offset": 84, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/util/concurrency.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 804, + "line_range": [ + 804 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "816 def stop_daemon(daemon_id: str, daemons: Dict[str, List[bool]] = _DAEMONS) -> bool:\n817 assert isinstance(daemons, dict)\n818 assert isinstance(daemon_id, str) and len(daemon_id) > 0\n", + "col_offset": 4, + "end_col_offset": 36, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/util/concurrency.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 817, + "line_range": [ + 817 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "817 assert isinstance(daemons, dict)\n818 assert isinstance(daemon_id, str) and len(daemon_id) > 0\n819 daemon_sentinel: List[bool] = daemons.pop(daemon_id, [False])\n", + "col_offset": 4, + "end_col_offset": 60, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/util/concurrency.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 818, + "line_range": [ + 818 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "819 daemon_sentinel: List[bool] = daemons.pop(daemon_id, [False])\n820 assert len(daemon_sentinel) == 1\n821 return daemon_sentinel.pop()\n", + "col_offset": 4, + "end_col_offset": 36, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/util/concurrency.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 820, + "line_range": [ + 820 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "1 from typing import *\n2 import io, json, yaml, os, errno, sys, glob, pathlib, math, copy, time, shutil, pickle\n3 from synthesizrr.base.util.language import as_list, is_list_like, format_exception_msg, remove_values\n", + "col_offset": 0, + "end_col_offset": 86, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/util/filesystem.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 502, + "link": "https://cwe.mitre.org/data/definitions/502.html" + }, + "issue_severity": "LOW", + "issue_text": "Consider possible security implications associated with pickle module.", + "line_number": 2, + "line_range": [ + 2 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/blacklists/blacklist_imports.html#b403-import-pickle", + "test_id": "B403", + "test_name": "blacklist" + }, + { + "code": "204 path: str = cls.expand_dir(path)\n205 assert cls.exists(path), f'Path {path} does not exist.'\n206 return round(os.path.getmtime(path), decimals)\n", + "col_offset": 8, + "end_col_offset": 63, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/util/filesystem.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 205, + "line_range": [ + 205 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "210 path: str = cls.expand_dir(path)\n211 assert cls.exists(path), f'Path {path} does not exist.'\n212 return os.path.getmtime(path)\n", + "col_offset": 8, + "end_col_offset": 63, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/util/filesystem.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 211, + "line_range": [ + 211 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "280 with io.open(path, 'rb') as inp:\n281 data = pickle.load(inp)\n282 assert data is not None\n", + "col_offset": 23, + "end_col_offset": 39, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/util/filesystem.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 502, + "link": "https://cwe.mitre.org/data/definitions/502.html" + }, + "issue_severity": "MEDIUM", + "issue_text": "Pickle and modules that wrap it can be unsafe when used to deserialize untrusted data, possible security issue.", + "line_number": 281, + "line_range": [ + 281 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/blacklists/blacklist_calls.html#b301-pickle", + "test_id": "B301", + "test_name": "blacklist" + }, + { + "code": "281 data = pickle.load(inp)\n282 assert data is not None\n283 return data\n", + "col_offset": 16, + "end_col_offset": 39, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/util/filesystem.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 282, + "line_range": [ + 282 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "64 # Use a timeout in case this is a stale entry.\n65 with urllib.request.urlopen(url, timeout=0.5) as req:\n66 return json.load(req)\n", + "col_offset": 17, + "end_col_offset": 57, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/util/jupyter.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 22, + "link": "https://cwe.mitre.org/data/definitions/22.html" + }, + "issue_severity": "MEDIUM", + "issue_text": "Audit url open for permitted schemes. Allowing use of file:/ or custom schemes is often unexpected.", + "line_number": 65, + "line_range": [ + 65 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/blacklists/blacklist_calls.html#b310-urllib-urlopen", + "test_id": "B310", + "test_name": "blacklist" + }, + { + "code": "82 return srv, PurePath(sess['notebook']['path'])\n83 except Exception:\n84 pass # There may be stale entries in the runtime directory\n85 return None, None\n", + "col_offset": 12, + "end_col_offset": 20, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/util/jupyter.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Try, Except, Pass detected.", + "line_number": 83, + "line_range": [ + 83, + 84 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b110_try_except_pass.html", + "test_id": "B110", + "test_name": "try_except_pass" + }, + { + "code": "114 for x in args:\n115 assert x in {True, False}\n116 if not x: ## Check for falsy values\n", + "col_offset": 8, + "end_col_offset": 33, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/util/language.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 115, + "line_range": [ + 115 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "122 for x in args:\n123 assert x in {True, False}\n124 if x: ## Check for truthy values\n", + "col_offset": 8, + "end_col_offset": 33, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/util/language.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 123, + "line_range": [ + 123 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "191 remove: Set[str] = set(remove)\n192 assert isinstance(remove, (list, tuple, set))\n193 if len(remove) == 0:\n", + "col_offset": 4, + "end_col_offset": 49, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/util/language.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 192, + "line_range": [ + 192 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "344 params_str: str = call_str.replace(f'{name}(', '')\n345 assert params_str.endswith(')')\n346 params_str: str = params_str[:-1]\n", + "col_offset": 8, + "end_col_offset": 39, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/util/language.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 345, + "line_range": [ + 345 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "639 return True\n640 assert isinstance(y, type) or (isinstance(y, (list, tuple)) and np.all([isinstance(z, type) for z in y]))\n641 if (isinstance(y, type) and isinstance(x, y)) or (isinstance(y, list) and np.any([isinstance(x, z) for z in y])):\n", + "col_offset": 4, + "end_col_offset": 109, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/util/language.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 640, + "line_range": [ + 640 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "659 return False\n660 assert isinstance(x, type)\n661 assert isinstance(y, type) or (isinstance(y, list) and np.all([isinstance(z, type) for z in y]))\n", + "col_offset": 4, + "end_col_offset": 30, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/util/language.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 660, + "line_range": [ + 660 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "660 assert isinstance(x, type)\n661 assert isinstance(y, type) or (isinstance(y, list) and np.all([isinstance(z, type) for z in y]))\n662 if (isinstance(y, type) and issubclass(x, y)) or (isinstance(y, list) and np.any([issubclass(x, z) for z in y])):\n", + "col_offset": 4, + "end_col_offset": 100, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/util/language.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 661, + "line_range": [ + 661 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "756 \"\"\"\n757 assert error in {\"raise\", \"warn\", \"ignore\"}\n758 names: Optional[Set[str]] = set(names)\n", + "col_offset": 4, + "end_col_offset": 47, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/util/language.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 757, + "line_range": [ + 757 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "1064 def assert_not_empty_list(l: List):\n1065 assert is_not_empty_list(l)\n1066 \n", + "col_offset": 4, + "end_col_offset": 31, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/util/language.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 1065, + "line_range": [ + 1065 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "1068 def assert_not_empty_list_like(l: ListOrTuple, error_message=''):\n1069 assert is_not_empty_list_like(l), error_message\n1070 \n", + "col_offset": 4, + "end_col_offset": 51, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/util/language.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 1069, + "line_range": [ + 1069 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "1184 def get_subset(small_list: ListOrTuple, big_list: ListOrTuple) -> Set:\n1185 assert is_list_like(small_list)\n1186 assert is_list_like(big_list)\n", + "col_offset": 4, + "end_col_offset": 35, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/util/language.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 1185, + "line_range": [ + 1185 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "1185 assert is_list_like(small_list)\n1186 assert is_list_like(big_list)\n1187 return set.intersection(set(small_list), set(big_list))\n", + "col_offset": 4, + "end_col_offset": 33, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/util/language.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 1186, + "line_range": [ + 1186 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "1263 d = {}\n1264 assert isinstance(d, dict)\n1265 if default_params is None:\n", + "col_offset": 4, + "end_col_offset": 30, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/util/language.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 1264, + "line_range": [ + 1264 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "1266 return d\n1267 assert isinstance(default_params, dict)\n1268 for k, v in default_params.items():\n", + "col_offset": 4, + "end_col_offset": 43, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/util/language.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 1267, + "line_range": [ + 1267 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "1283 ) -> List[Tuple]:\n1284 assert by in {'key', 'value'}\n1285 if order is not None:\n", + "col_offset": 4, + "end_col_offset": 33, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/util/language.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 1284, + "line_range": [ + 1284 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "1286 order: List = as_list(order)\n1287 assert by == 'key'\n1288 out_d: Dict = {}\n", + "col_offset": 8, + "end_col_offset": 26, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/util/language.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 1287, + "line_range": [ + 1287 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "1309 ) -> Any:\n1310 assert how in {'max', 'min'}\n1311 sorted_items: List[Tuple] = sorted_dict(\n", + "col_offset": 4, + "end_col_offset": 32, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/util/language.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 1310, + "line_range": [ + 1310 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "1389 return {}\n1390 assert isinstance(AutoEnumClass, AutoEnum.__class__)\n1391 d = AutoEnumClass.convert_keys(d)\n", + "col_offset": 4, + "end_col_offset": 56, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/util/language.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 1390, + "line_range": [ + 1390 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "1422 def assert_not_empty_dict(d: Dict):\n1423 assert is_not_empty_dict(d)\n1424 \n", + "col_offset": 4, + "end_col_offset": 31, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/util/language.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 1423, + "line_range": [ + 1423 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "1606 ## Ref: https://datascience.stackexchange.com/a/16801/35826\n1607 assert isinstance(df, PandasDataFrame)\n1608 return (~df.isna()).sum(axis=1)\n", + "col_offset": 4, + "end_col_offset": 42, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/util/language.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 1607, + "line_range": [ + 1607 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "1611 def get_max_num_non_null_columns_per_row(df: PandasDataFrame) -> int:\n1612 assert isinstance(df, PandasDataFrame)\n1613 return get_num_non_null_columns_per_row(df).max()\n", + "col_offset": 4, + "end_col_offset": 42, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/util/language.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 1612, + "line_range": [ + 1612 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "1664 data: PandasDataFrame = pd.DataFrame(data)\n1665 assert isinstance(data, PandasDataFrame)\n1666 return data\n", + "col_offset": 4, + "end_col_offset": 44, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/util/language.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 1665, + "line_range": [ + 1665 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "1682 ) -> Union[List, Set, Tuple]:\n1683 assert output_type in {list, set, tuple}\n1684 if not is_list_or_set_like(l):\n", + "col_offset": 4, + "end_col_offset": 44, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/util/language.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 1683, + "line_range": [ + 1683 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "1696 ) -> Union[List, Tuple, Set, Any]:\n1697 assert outer_type in {list, set, tuple}\n1698 assert inner_type in {list, set, tuple}\n", + "col_offset": 4, + "end_col_offset": 43, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/util/language.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 1697, + "line_range": [ + 1697 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "1697 assert outer_type in {list, set, tuple}\n1698 assert inner_type in {list, set, tuple}\n1699 if not is_list_or_set_like(l):\n", + "col_offset": 4, + "end_col_offset": 43, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/util/language.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 1698, + "line_range": [ + 1698 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "1734 ) -> Optional[Any]:\n1735 py_random: random.Random = random.Random(seed)\n1736 if (is_list_like(struct) or is_set_like(struct)) and len(struct) > 0:\n", + "col_offset": 31, + "end_col_offset": 50, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/util/language.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 330, + "link": "https://cwe.mitre.org/data/definitions/330.html" + }, + "issue_severity": "LOW", + "issue_text": "Standard pseudo-random generators are not suitable for security/cryptographic purposes.", + "line_number": 1735, + "line_range": [ + 1735 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/blacklists/blacklist_calls.html#b311-random", + "test_id": "B311", + "test_name": "blacklist" + }, + { + "code": "1749 def any_key(d: Dict, *, seed: Optional[int] = None, raise_error: bool = True) -> Optional[Any]:\n1750 py_random: random.Random = random.Random(seed)\n1751 if is_not_empty_dict(d):\n", + "col_offset": 31, + "end_col_offset": 50, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/util/language.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 330, + "link": "https://cwe.mitre.org/data/definitions/330.html" + }, + "issue_severity": "LOW", + "issue_text": "Standard pseudo-random generators are not suitable for security/cryptographic purposes.", + "line_number": 1750, + "line_range": [ + 1750 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/blacklists/blacklist_calls.html#b311-random", + "test_id": "B311", + "test_name": "blacklist" + }, + { + "code": "1845 \"\"\"Inclusive range, useful for coding up math notation.\"\"\"\n1846 assert isinstance(low, (int, float)) and isinstance(high, (int, float)) and isinstance(step, (int, float))\n1847 out: List[float] = [\n", + "col_offset": 4, + "end_col_offset": 110, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/util/language.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 1846, + "line_range": [ + 1846 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "1861 ) -> bool:\n1862 assert isinstance(l, (list, tuple, np.ndarray, pd.Series, pd.DataFrame))\n1863 assert idx >= 0, f'Can only check validity of non-negative indexes'\n", + "col_offset": 4, + "end_col_offset": 76, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/util/language.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 1862, + "line_range": [ + 1862 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "1862 assert isinstance(l, (list, tuple, np.ndarray, pd.Series, pd.DataFrame))\n1863 assert idx >= 0, f'Can only check validity of non-negative indexes'\n1864 if len(l) == 0:\n", + "col_offset": 4, + "end_col_offset": 71, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/util/language.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 1863, + "line_range": [ + 1863 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "1874 ) -> Generator[List[Any], None, None]:\n1875 assert isinstance(batch_size, int) and batch_size > 0\n1876 if is_int_in_floats_clothing(struct):\n", + "col_offset": 4, + "end_col_offset": 57, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/util/language.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 1875, + "line_range": [ + 1875 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "1919 np_random = np.random.RandomState(seed)\n1920 py_random = random.Random(seed)\n1921 if not is_list_like(data):\n", + "col_offset": 16, + "end_col_offset": 35, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/util/language.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 330, + "link": "https://cwe.mitre.org/data/definitions/330.html" + }, + "issue_severity": "LOW", + "issue_text": "Standard pseudo-random generators are not suitable for security/cryptographic purposes.", + "line_number": 1920, + "line_range": [ + 1920 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/blacklists/blacklist_calls.html#b311-random", + "test_id": "B311", + "test_name": "blacklist" + }, + { + "code": "1954 def values_dist(vals: Union[List, Tuple, np.ndarray, pd.Series]) -> pd.Series:\n1955 assert isinstance(vals, (list, tuple, np.ndarray, pd.Series))\n1956 val_counts: pd.Series = pd.Series(Counter(vals)) ## Includes nan and None as keys.\n", + "col_offset": 4, + "end_col_offset": 65, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/util/language.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 1955, + "line_range": [ + 1955 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "1975 target_prob_dist: pd.Series = target\n1976 assert isinstance(target_prob_dist, pd.Series)\n1977 assert abs(float(target_prob_dist.sum()) - 1.0) <= 1e-2 ## Sum of probs should be exactly or very close to 1.\n", + "col_offset": 4, + "end_col_offset": 50, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/util/language.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 1976, + "line_range": [ + 1976 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "1976 assert isinstance(target_prob_dist, pd.Series)\n1977 assert abs(float(target_prob_dist.sum()) - 1.0) <= 1e-2 ## Sum of probs should be exactly or very close to 1.\n1978 \n", + "col_offset": 4, + "end_col_offset": 59, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/util/language.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 1977, + "line_range": [ + 1977 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "1978 \n1979 assert isinstance(source, (list, tuple, np.ndarray, pd.Series))\n1980 source_vc: pd.Series = pd.Series(Counter(source))\n", + "col_offset": 4, + "end_col_offset": 67, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/util/language.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 1979, + "line_range": [ + 1979 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "2013 probabilities: np.ndarray = np.array(probabilities)\n2014 assert is_numpy_float_array(probabilities)\n2015 prob_sum: float = float(probabilities.sum())\n", + "col_offset": 8, + "end_col_offset": 50, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/util/language.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 2014, + "line_range": [ + 2014 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "2037 rnd_idxs: List[int] = list(range(len(struct)))\n2038 random.Random(seed).shuffle(rnd_idxs)\n2039 for rnd_idx in rnd_idxs:\n", + "col_offset": 4, + "end_col_offset": 23, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/util/language.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 330, + "link": "https://cwe.mitre.org/data/definitions/330.html" + }, + "issue_severity": "LOW", + "issue_text": "Standard pseudo-random generators are not suitable for security/cryptographic purposes.", + "line_number": 2038, + "line_range": [ + 2038 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/blacklists/blacklist_calls.html#b311-random", + "test_id": "B311", + "test_name": "blacklist" + }, + { + "code": "2043 def random_cartesian_product(*lists, seed: Optional[int] = None, n: int):\n2044 rnd = random.Random(seed)\n2045 cartesian_idxs: Set[Tuple[int, ...]] = set()\n", + "col_offset": 10, + "end_col_offset": 29, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/util/language.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 330, + "link": "https://cwe.mitre.org/data/definitions/330.html" + }, + "issue_severity": "LOW", + "issue_text": "Standard pseudo-random generators are not suitable for security/cryptographic purposes.", + "line_number": 2044, + "line_range": [ + 2044 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/blacklists/blacklist_calls.html#b311-random", + "test_id": "B311", + "test_name": "blacklist" + }, + { + "code": "2070 return max(d, key=d.get)\n2071 assert is_list_like(d)\n2072 return max([(i, x) for (i, x) in enumerate(d)], key=lambda x: x[1])[0]\n", + "col_offset": 4, + "end_col_offset": 26, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/util/language.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 2071, + "line_range": [ + 2071 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "2080 return min(d, key=d.get)\n2081 assert is_list_like(d)\n2082 return min([(i, x) for (i, x) in enumerate(d)], key=lambda x: x[1])[0]\n", + "col_offset": 4, + "end_col_offset": 26, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/util/language.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 2081, + "line_range": [ + 2081 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "2093 \"\"\"Efficiently gets the top-k elements from a numpy array.\"\"\"\n2094 assert isinstance(k, int) and k > 0\n2095 ## np.argpartition creates a new array with the top-k/bottom-k scores in the head/tail k elements,\n", + "col_offset": 4, + "end_col_offset": 39, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/util/language.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 2094, + "line_range": [ + 2094 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "2143 def clip(low: Union[int, float], val: Union[int, float], high: Union[int, float]):\n2144 assert isinstance(low, (int, float, np.integer, np.float_))\n2145 assert isinstance(high, (int, float, np.integer, np.float_))\n", + "col_offset": 4, + "end_col_offset": 63, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/util/language.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 2144, + "line_range": [ + 2144 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "2144 assert isinstance(low, (int, float, np.integer, np.float_))\n2145 assert isinstance(high, (int, float, np.integer, np.float_))\n2146 assert isinstance(val, (int, float, np.integer, np.float_))\n", + "col_offset": 4, + "end_col_offset": 64, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/util/language.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 2145, + "line_range": [ + 2145 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "2145 assert isinstance(high, (int, float, np.integer, np.float_))\n2146 assert isinstance(val, (int, float, np.integer, np.float_))\n2147 assert low <= high\n", + "col_offset": 4, + "end_col_offset": 63, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/util/language.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 2146, + "line_range": [ + 2146 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "2146 assert isinstance(val, (int, float, np.integer, np.float_))\n2147 assert low <= high\n2148 return max(low, min(val, high))\n", + "col_offset": 4, + "end_col_offset": 22, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/util/language.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 2147, + "line_range": [ + 2147 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "2151 def pad_interval(low: Union[int, float], high: Union[int, float], pad: float) -> Tuple[float, float]:\n2152 assert isinstance(low, (int, float, np.integer, np.float_))\n2153 assert isinstance(high, (int, float, np.integer, np.float_))\n", + "col_offset": 4, + "end_col_offset": 63, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/util/language.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 2152, + "line_range": [ + 2152 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "2152 assert isinstance(low, (int, float, np.integer, np.float_))\n2153 assert isinstance(high, (int, float, np.integer, np.float_))\n2154 assert isinstance(pad, (int, float, np.integer, np.float_)) and 0.0 <= pad <= 1.0\n", + "col_offset": 4, + "end_col_offset": 64, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/util/language.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 2153, + "line_range": [ + 2153 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "2153 assert isinstance(high, (int, float, np.integer, np.float_))\n2154 assert isinstance(pad, (int, float, np.integer, np.float_)) and 0.0 <= pad <= 1.0\n2155 assert low <= high\n", + "col_offset": 4, + "end_col_offset": 85, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/util/language.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 2154, + "line_range": [ + 2154 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "2154 assert isinstance(pad, (int, float, np.integer, np.float_)) and 0.0 <= pad <= 1.0\n2155 assert low <= high\n2156 width: float = float(high) - float(low)\n", + "col_offset": 4, + "end_col_offset": 22, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/util/language.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 2155, + "line_range": [ + 2155 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "2374 registered_names: Set[str] = set(registered.keys())\n2375 assert len(registered_names) > 0, f'Invalid state: key {k} is registered to an empty dict'\n2376 if subclass_name in registered_names and cls._allow_subclass_override is False:\n", + "col_offset": 12, + "end_col_offset": 102, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/util/language.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 2375, + "line_range": [ + 2375 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "2381 elif subclass_name not in registered_names and cls._allow_multiple_subclasses is False:\n2382 assert len(registered_names) == 1, \\\n2383 f'Invalid state: _allow_multiple_subclasses is False but we have multiple subclasses registered ' \\\n2384 f'against key {k}'\n2385 raise KeyError(\n", + "col_offset": 16, + "end_col_offset": 38, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/util/language.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 2382, + "line_range": [ + 2382, + 2383, + 2384 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "2842 final_columns.append(col)\n2843 assert set(final_columns) == set(df_columns)\n2844 return df[final_columns]\n", + "col_offset": 4, + "end_col_offset": 48, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/util/language.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 2843, + "line_range": [ + 2843 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "2946 }\n2947 assert isinstance(progress_bar, dict)\n2948 return ProgressBar(**progress_bar)\n", + "col_offset": 8, + "end_col_offset": 45, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/util/language.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 2947, + "line_range": [ + 2947 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "3146 def is_sorted(l: Union[List[_Comparable], Tuple[_Comparable, ...]]) -> bool:\n3147 assert isinstance(l, (list, tuple))\n3148 length = len(l)\n", + "col_offset": 4, + "end_col_offset": 39, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/util/language.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 3147, + "line_range": [ + 3147 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "3148 length = len(l)\n3149 assert length > 0\n3150 if length == 1:\n", + "col_offset": 4, + "end_col_offset": 21, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/util/language.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 3149, + "line_range": [ + 3149 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "3200 if order is not None:\n3201 assert len(plots_list) > 0\n3202 assert len(order) == len(plots_list)\n", + "col_offset": 8, + "end_col_offset": 34, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/util/language.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 3201, + "line_range": [ + 3201 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "3201 assert len(plots_list) > 0\n3202 assert len(order) == len(plots_list)\n3203 assert len(set(p[0] for p in plots_list)) == len(order)\n", + "col_offset": 8, + "end_col_offset": 44, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/util/language.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 3202, + "line_range": [ + 3202 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "3202 assert len(order) == len(plots_list)\n3203 assert len(set(p[0] for p in plots_list)) == len(order)\n3204 ordered_plots_list: List[Any] = []\n", + "col_offset": 8, + "end_col_offset": 63, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/util/language.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 3203, + "line_range": [ + 3203 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "3217 if isinstance(plot, tuple):\n3218 assert len(plot) == 2\n3219 plot = plot[1]\n", + "col_offset": 12, + "end_col_offset": 33, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/util/language.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 3218, + "line_range": [ + 3218 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "154 msg = '/md\\n\\n' + msg\n155 response = requests.post(url=self.webhook, json={\"Content\": msg})\n156 return str(response.status_code).startswith('2')\n", + "col_offset": 19, + "end_col_offset": 73, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/util/notify.py", + "issue_confidence": "LOW", + "issue_cwe": { + "id": 400, + "link": "https://cwe.mitre.org/data/definitions/400.html" + }, + "issue_severity": "MEDIUM", + "issue_text": "Requests call without timeout", + "line_number": 155, + "line_range": [ + 155 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b113_request_without_timeout.html", + "test_id": "B113", + "test_name": "request_without_timeout" + }, + { + "code": "172 msg: str = str(msg)\n173 response = requests.post(self.webhook, json={\"content\": msg}, headers={'Content-Type': 'application/json'})\n174 return str(response.status_code).startswith('2')\n", + "col_offset": 19, + "end_col_offset": 115, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/util/notify.py", + "issue_confidence": "LOW", + "issue_cwe": { + "id": 400, + "link": "https://cwe.mitre.org/data/definitions/400.html" + }, + "issue_severity": "MEDIUM", + "issue_text": "Requests call without timeout", + "line_number": 173, + "line_range": [ + 173 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b113_request_without_timeout.html", + "test_id": "B113", + "test_name": "request_without_timeout" + }, + { + "code": "292 )\n293 assert inferred_schema.columns_set == set(schema.keys())\n294 return inferred_schema\n", + "col_offset": 8, + "end_col_offset": 64, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/util/schema.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 293, + "line_range": [ + 293 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "385 inferred_schema: Schema = Schema(**schema)\n386 assert inferred_schema.columns_set <= columns_set\n387 return inferred_schema\n", + "col_offset": 8, + "end_col_offset": 57, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/util/schema.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 386, + "line_range": [ + 386 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "202 def assert_not_empty(cls, string: Any, error_message: str = ''):\n203 assert cls.is_not_empty(string), error_message\n204 \n", + "col_offset": 8, + "end_col_offset": 54, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/util/string.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 203, + "line_range": [ + 203 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "206 def assert_not_empty_bytes(cls, string: Any, error_message: str = ''):\n207 assert cls.is_not_empty_str_or_bytes(string), error_message\n208 \n", + "col_offset": 8, + "end_col_offset": 67, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/util/string.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 207, + "line_range": [ + 207 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "210 def assert_not_empty_str_or_bytes(cls, string: Any, error_message: str = ''):\n211 assert cls.is_not_empty_str_or_bytes(string), error_message\n212 \n", + "col_offset": 8, + "end_col_offset": 67, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/util/string.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 211, + "line_range": [ + 211 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "283 def convert_str_to_type(cls, val: str, expected_type: Type) -> Any:\n284 assert isinstance(expected_type, type)\n285 if isinstance(val, expected_type):\n", + "col_offset": 8, + "end_col_offset": 46, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/util/string.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 284, + "line_range": [ + 284 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "343 if unit is not None:\n344 assert isinstance(unit, str)\n345 unit = unit.upper()\n", + "col_offset": 12, + "end_col_offset": 40, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/util/string.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 344, + "line_range": [ + 344 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "345 unit = unit.upper()\n346 assert unit in cls.FILE_SIZE_UNITS\n347 return sizes[unit]\n", + "col_offset": 12, + "end_col_offset": 46, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/util/string.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 346, + "line_range": [ + 346 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "426 if unit is not None:\n427 assert isinstance(unit, str)\n428 unit = unit.lower()\n", + "col_offset": 12, + "end_col_offset": 40, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/util/string.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 427, + "line_range": [ + 427 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "428 unit = unit.lower()\n429 assert unit in TIME_UNITS\n430 return times[unit]\n", + "col_offset": 12, + "end_col_offset": 37, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/util/string.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 429, + "line_range": [ + 429 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "442 return '0'\n443 assert abs(n) > 0\n444 if 0 < abs(n) < 1:\n", + "col_offset": 8, + "end_col_offset": 25, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/util/string.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 443, + "line_range": [ + 443 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "480 ) -> Union[Dict, float]:\n481 assert n >= 0\n482 N_UNITS = {\n", + "col_offset": 8, + "end_col_offset": 21, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/util/string.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 481, + "line_range": [ + 481 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "506 if unit is not None:\n507 assert isinstance(unit, str)\n508 unit = unit.lower()\n", + "col_offset": 12, + "end_col_offset": 40, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/util/string.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 507, + "line_range": [ + 507 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "508 unit = unit.lower()\n509 assert unit in N_UNITS\n510 return numbers[unit]\n", + "col_offset": 12, + "end_col_offset": 34, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/util/string.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 509, + "line_range": [ + 509 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "526 def get_num_zeros_to_pad(cls, max_i: int) -> int:\n527 assert isinstance(max_i, int) and max_i >= 1\n528 num_zeros = math.ceil(math.log10(max_i)) ## Ref: https://stackoverflow.com/a/51837162/4900327\n", + "col_offset": 8, + "end_col_offset": 52, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/util/string.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 527, + "line_range": [ + 527 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "534 def pad_zeros(cls, i: int, max_i: int = int(1e12)) -> str:\n535 assert isinstance(i, int)\n536 assert i >= 0\n", + "col_offset": 8, + "end_col_offset": 33, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/util/string.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 535, + "line_range": [ + 535 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "535 assert isinstance(i, int)\n536 assert i >= 0\n537 assert isinstance(max_i, int)\n", + "col_offset": 8, + "end_col_offset": 21, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/util/string.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 536, + "line_range": [ + 536 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "536 assert i >= 0\n537 assert isinstance(max_i, int)\n538 assert max_i >= i, f'Expected max_i to be >= current i; found max_i={max_i}, i={i}'\n", + "col_offset": 8, + "end_col_offset": 37, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/util/string.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 537, + "line_range": [ + 537 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "537 assert isinstance(max_i, int)\n538 assert max_i >= i, f'Expected max_i to be >= current i; found max_i={max_i}, i={i}'\n539 num_zeros: int = cls.get_num_zeros_to_pad(max_i)\n", + "col_offset": 8, + "end_col_offset": 91, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/util/string.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 538, + "line_range": [ + 538 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "626 min_num_chars, max_num_chars = length\n627 assert min_num_chars <= max_num_chars, \\\n628 f'Must have min_num_chars ({min_num_chars}) <= max_num_chars ({max_num_chars})'\n629 if spaces_prob is not None:\n", + "col_offset": 8, + "end_col_offset": 91, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/util/string.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 627, + "line_range": [ + 627, + 628 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "667 cartesian_product_parts: List[List[str]] = []\n668 assert len(order) > 0\n669 for order_part in order:\n", + "col_offset": 8, + "end_col_offset": 29, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/util/string.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 668, + "line_range": [ + 668 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "688 def __random_cartesian_product(*lists, seed: Optional[int] = None, n: int):\n689 rnd = random.Random(seed)\n690 cartesian_idxs: Set[Tuple[int, ...]] = set()\n", + "col_offset": 14, + "end_col_offset": 33, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/util/string.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 330, + "link": "https://cwe.mitre.org/data/definitions/330.html" + }, + "issue_severity": "LOW", + "issue_text": "Standard pseudo-random generators are not suitable for security/cryptographic purposes.", + "line_number": 689, + "line_range": [ + 689 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/blacklists/blacklist_calls.html#b311-random", + "test_id": "B311", + "test_name": "blacklist" + }, + { + "code": "759 def convert_integer_to_base_n_str(cls, integer: int, base: int) -> str:\n760 assert isinstance(integer, int)\n761 assert isinstance(base, int) and base in cls.BASE_CONVERTER_MAP, \\\n", + "col_offset": 8, + "end_col_offset": 39, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/util/string.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 760, + "line_range": [ + 760 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "760 assert isinstance(integer, int)\n761 assert isinstance(base, int) and base in cls.BASE_CONVERTER_MAP, \\\n762 f'Param `base` must be an integer in {list(cls.BASE_CONVERTER_MAP.keys())}; found: {base}'\n763 return cls.BASE_CONVERTER_MAP[base].encode(integer)\n", + "col_offset": 8, + "end_col_offset": 102, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/util/string.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 761, + "line_range": [ + 761, + 762 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "800 if not isinstance(strings_to_match, list) and not isinstance(strings_to_match, tuple):\n801 assert isinstance(strings_to_match, str), f'Input must be of a string or list of strings; found type ' \\\n802 f'{type(strings_to_match)} with value: {strings_to_match}'\n803 strings_to_match: List[str] = [strings_to_match]\n", + "col_offset": 12, + "end_col_offset": 112, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/util/string.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 801, + "line_range": [ + 801, + 802 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "99 \n100 assert is_list_like(nodes)\n101 set_param_from_alias(params=kwargs, param='progress_bar', alias=['progress', 'pbar'], default=True)\n", + "col_offset": 8, + "end_col_offset": 34, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/util/struct.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 100, + "line_range": [ + 100 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "81 return num_samples_per_label\n82 assert isinstance(num_samples_per_label, int)\n83 num_samples_per_label: Dict[str, conint(ge=1)] = {\n", + "col_offset": 4, + "end_col_offset": 49, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/expt/common.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 82, + "line_range": [ + 82 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "86 }\n87 assert isinstance(num_samples_per_label, dict)\n88 return num_samples_per_label\n", + "col_offset": 4, + "end_col_offset": 50, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/expt/common.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 87, + "line_range": [ + 87 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "209 else:\n210 assert batch_size >= 4\n211 ## For smaller models like TinyBERT, vary the batch size steps.\n", + "col_offset": 12, + "end_col_offset": 34, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/expt/common.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 210, + "line_range": [ + 210 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "537 icl_and_prompt_template_dict: Dict[str, str] = ICL_AND_PROMPT_TEMPLATE_DICT[(self, expt)]\n538 assert 'icl_template' in icl_and_prompt_template_dict\n539 assert 'prompt_template' in icl_and_prompt_template_dict\n", + "col_offset": 8, + "end_col_offset": 61, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/expt/common.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 538, + "line_range": [ + 538 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "538 assert 'icl_template' in icl_and_prompt_template_dict\n539 assert 'prompt_template' in icl_and_prompt_template_dict\n540 assert 'claude_replacements' in icl_and_prompt_template_dict\n", + "col_offset": 8, + "end_col_offset": 64, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/expt/common.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 539, + "line_range": [ + 539 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "539 assert 'prompt_template' in icl_and_prompt_template_dict\n540 assert 'claude_replacements' in icl_and_prompt_template_dict\n541 icl_template: str = icl_and_prompt_template_dict['icl_template']\n", + "col_offset": 8, + "end_col_offset": 68, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/expt/common.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 540, + "line_range": [ + 540 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "545 for repl in as_list(claude_replacements):\n546 assert icl_template.find(repl[0]) >= 0\n547 icl_template: str = icl_template.replace(\n", + "col_offset": 16, + "end_col_offset": 54, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/expt/common.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 546, + "line_range": [ + 546 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "550 )\n551 assert prompt_template.find(repl[0]) >= 0\n552 prompt_template: str = prompt_template.replace(\n", + "col_offset": 16, + "end_col_offset": 57, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/expt/common.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 551, + "line_range": [ + 551 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "555 )\n556 assert '{{icl[example_text]}}' in icl_template\n557 assert '{{icl_examples}}' in prompt_template\n", + "col_offset": 8, + "end_col_offset": 54, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/expt/common.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 556, + "line_range": [ + 556 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "556 assert '{{icl[example_text]}}' in icl_template\n557 assert '{{icl_examples}}' in prompt_template\n558 if expt is Experiment.SynthesizRR:\n", + "col_offset": 8, + "end_col_offset": 52, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/expt/common.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 557, + "line_range": [ + 557 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "558 if expt is Experiment.SynthesizRR:\n559 assert '{{icl[retrieved_context]}}' in icl_template\n560 assert '{{retrieved_context}}' in prompt_template\n", + "col_offset": 12, + "end_col_offset": 63, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/expt/common.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 559, + "line_range": [ + 559 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "559 assert '{{icl[retrieved_context]}}' in icl_template\n560 assert '{{retrieved_context}}' in prompt_template\n561 return dict(\n", + "col_offset": 12, + "end_col_offset": 61, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/expt/common.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 560, + "line_range": [ + 560 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "1128 sentence_end_token_id: int = tokenizer.get_vocab()[sentence_end]\n1129 assert sentence_end == tokenizer.decode(sentence_end_token_id)\n1130 token_ids: List[int] = tokenizer.encode(text, add_special_tokens=False)\n", + "col_offset": 8, + "end_col_offset": 70, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/expt/common.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 1129, + "line_range": [ + 1129 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "1268 from synthesizrr.base.metric.classification_metrics import DatasetCartography\n1269 assert isinstance(metric, TextGenerationStudent)\n1270 if str_normalize(metric.params.algorithm) == str_normalize('pytorch'):\n", + "col_offset": 8, + "end_col_offset": 56, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/expt/common.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 1269, + "line_range": [ + 1269 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "1279 student_metrics: Metrics = metric.params.metrics\n1280 assert isinstance(student_metrics, Metrics)\n1281 for _train_student_metric in student_metrics[DataSplit.TRAIN]:\n", + "col_offset": 12, + "end_col_offset": 55, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/expt/common.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 1280, + "line_range": [ + 1280 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "1465 if student_hpo_validation_set == 'seed':\n1466 assert val_set is not None\n1467 validation_dataset: Dataset = val_set\n", + "col_offset": 12, + "end_col_offset": 38, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/expt/common.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 1466, + "line_range": [ + 1466 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "1475 validation_dataset: Optional[Dataset] = None\n1476 assert val_frac is not None\n1477 else:\n", + "col_offset": 12, + "end_col_offset": 39, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/expt/common.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 1476, + "line_range": [ + 1476 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "1674 replacement: Tuple[str, str] = ICL_AND_PROMPT_TEMPLATE_DICT[(dataset_name, expt)]['claude_replacements'][1]\n1675 assert replacement[0] in {\n1676 'News Article:',\n1677 'Rewritten Article:',\n1678 'Summary:',\n1679 'Review:',\n1680 'Product Question:',\n1681 'Headline:',\n1682 }\n1683 if model_name.is_claude():\n", + "col_offset": 4, + "end_col_offset": 5, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/expt/common.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 1675, + "line_range": [ + 1675, + 1676, + 1677, + 1678, + 1679, + 1680, + 1681, + 1682 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "252 for SynthesizRRDatasetSubclass in cls.subclasses():\n253 assert issubclass(SynthesizRRDatasetSubclass, SynthesizRRDataset)\n254 SynthesizRRDatasetSubclass.setup()\n", + "col_offset": 12, + "end_col_offset": 77, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/expt/data.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 253, + "line_range": [ + 253 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "613 reviews = reviews.query(f'product_category in {list(attrprompt_cats)}').reset_index(drop=True)\n614 assert set(reviews['product_category']) == attrprompt_cats\n615 assert reviews['unique_id'].nunique() == len(reviews)\n", + "col_offset": 8, + "end_col_offset": 66, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/expt/data.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 614, + "line_range": [ + 614 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "614 assert set(reviews['product_category']) == attrprompt_cats\n615 assert reviews['unique_id'].nunique() == len(reviews)\n616 # reviews['product_category'].value_counts()\n", + "col_offset": 8, + "end_col_offset": 61, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/expt/data.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 615, + "line_range": [ + 615 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "155 if expt is Experiment.SynthesizRR:\n156 assert corpus is not None\n157 assert retriever is not None\n", + "col_offset": 8, + "end_col_offset": 33, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/expt/driver.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 156, + "line_range": [ + 156 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "156 assert corpus is not None\n157 assert retriever is not None\n158 \n", + "col_offset": 8, + "end_col_offset": 36, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/expt/driver.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 157, + "line_range": [ + 157 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "159 if expt is not Experiment.Gold:\n160 assert model_name is not None\n161 assert num_samples_per_label is not None\n", + "col_offset": 8, + "end_col_offset": 37, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/expt/driver.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 160, + "line_range": [ + 160 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "160 assert model_name is not None\n161 assert num_samples_per_label is not None\n162 assert seed_type is not None\n", + "col_offset": 8, + "end_col_offset": 48, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/expt/driver.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 161, + "line_range": [ + 161 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "161 assert num_samples_per_label is not None\n162 assert seed_type is not None\n163 \n", + "col_offset": 8, + "end_col_offset": 36, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/expt/driver.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 162, + "line_range": [ + 162 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "166 llm_num_gpus: int = model_name.llm_resources_per_model().get('gpu', 0)\n167 assert llm_num_gpus >= 0\n168 if llm_num_gpus > 0:\n", + "col_offset": 12, + "end_col_offset": 36, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/expt/driver.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 167, + "line_range": [ + 167 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "2 from abc import ABC, abstractmethod\n3 import types, time, traceback, pickle, gc, os, json, numpy as np, math\n4 import pandas as pd\n", + "col_offset": 0, + "end_col_offset": 70, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/expt/generation.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 502, + "link": "https://cwe.mitre.org/data/definitions/502.html" + }, + "issue_severity": "LOW", + "issue_text": "Consider possible security implications associated with pickle module.", + "line_number": 3, + "line_range": [ + 3 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/blacklists/blacklist_imports.html#b403-import-pickle", + "test_id": "B403", + "test_name": "blacklist" + }, + { + "code": "526 check_isinstance(corpus_embeddings_dir, FileMetadata)\n527 assert embedder_params is not None\n528 assert embedder_ndim is not None\n", + "col_offset": 12, + "end_col_offset": 46, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/expt/generation.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 527, + "line_range": [ + 527 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "527 assert embedder_params is not None\n528 assert embedder_ndim is not None\n529 ## Dense retriever:\n", + "col_offset": 12, + "end_col_offset": 44, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/expt/generation.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 528, + "line_range": [ + 528 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "752 ) -> Tuple[ClassificationData, TextInputs]:\n753 assert len(retr_icl_distance_range) == 2\n754 assert len(synthesizrr_distance_range) == 2\n", + "col_offset": 8, + "end_col_offset": 48, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/expt/generation.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 753, + "line_range": [ + 753 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "753 assert len(retr_icl_distance_range) == 2\n754 assert len(synthesizrr_distance_range) == 2\n755 assert len(retr_icl_token_range) == 2\n", + "col_offset": 8, + "end_col_offset": 51, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/expt/generation.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 754, + "line_range": [ + 754 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "754 assert len(synthesizrr_distance_range) == 2\n755 assert len(retr_icl_token_range) == 2\n756 \n", + "col_offset": 8, + "end_col_offset": 45, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/expt/generation.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 755, + "line_range": [ + 755 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "757 if retriever is Retriever.Random:\n758 assert icl_type in {'curated', 'seed'}\n759 \n", + "col_offset": 12, + "end_col_offset": 50, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/expt/generation.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 758, + "line_range": [ + 758 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "900 tokenizer: Any = model_name.tokenizer()\n901 assert ex[label_col] == label_text\n902 added_to_icl_dataset: bool = False\n", + "col_offset": 8, + "end_col_offset": 42, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/expt/generation.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 901, + "line_range": [ + 901 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "938 \n939 assert ex.get(distance_metric_top_k_col(top_k=top_k)) is not None\n940 assert ex.get(distance_top_k_col(top_k=top_k)) is not None\n", + "col_offset": 12, + "end_col_offset": 77, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/expt/generation.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 939, + "line_range": [ + 939 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "939 assert ex.get(distance_metric_top_k_col(top_k=top_k)) is not None\n940 assert ex.get(distance_top_k_col(top_k=top_k)) is not None\n941 if icl_type == 'retrieved':\n", + "col_offset": 12, + "end_col_offset": 70, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/expt/generation.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 940, + "line_range": [ + 940 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "1510 )\n1511 assert isinstance(text_gens, TextGenerationsPredictionsBase)\n1512 self.info(\n", + "col_offset": 8, + "end_col_offset": 68, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/expt/generation.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 1511, + "line_range": [ + 1511 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "2 from abc import ABC, abstractmethod\n3 import types, time, traceback, pickle, gc, os, json, numpy as np, math\n4 import pandas as pd\n", + "col_offset": 0, + "end_col_offset": 70, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/expt/metrics.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 502, + "link": "https://cwe.mitre.org/data/definitions/502.html" + }, + "issue_severity": "LOW", + "issue_text": "Consider possible security implications associated with pickle module.", + "line_number": 3, + "line_range": [ + 3 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/blacklists/blacklist_imports.html#b403-import-pickle", + "test_id": "B403", + "test_name": "blacklist" + }, + { + "code": "84 ) -> TextGenerationsPredictionsBase:\n85 assert text_gens_parser is not None\n86 text_gens_data: List[Dict] = []\n", + "col_offset": 8, + "end_col_offset": 43, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/expt/metrics.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 85, + "line_range": [ + 85 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "131 text_gens_expanded_with_refs.data_schema.features_schema[references_col] = MLType.TEXT\n132 assert isinstance(text_gens_expanded_with_refs, TextGenerationsPredictionsBase)\n133 \n", + "col_offset": 8, + "end_col_offset": 87, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/expt/metrics.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 132, + "line_range": [ + 132 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "285 ## Apply filters:\n286 assert len(df_filters) > 0\n287 return cart_df.query(' and '.join(df_filters)).reset_index(drop=True)\n", + "col_offset": 20, + "end_col_offset": 46, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/expt/metrics.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 286, + "line_range": [ + 286 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "517 metrics_labels_to_evaluate.extend(list(label_verbalizer.keys()))\n518 assert len(metrics_labels_to_evaluate) > 0\n519 self.info(f'Evaluating labels: {metrics_labels_to_evaluate}')\n", + "col_offset": 8, + "end_col_offset": 50, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/expt/metrics.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 518, + "line_range": [ + 518 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "1250 else:\n1251 assert label_text in label_verbalizer\n1252 assert label_text in dataset_name.label_verbalizer()\n", + "col_offset": 12, + "end_col_offset": 49, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/expt/metrics.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 1251, + "line_range": [ + 1251 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "1251 assert label_text in label_verbalizer\n1252 assert label_text in dataset_name.label_verbalizer()\n1253 if label_verbalizer[label_text] != dataset_name.label_verbalizer()[label_text]:\n", + "col_offset": 12, + "end_col_offset": 64, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/expt/metrics.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 1252, + "line_range": [ + 1252 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "1624 else:\n1625 assert label_text in label_verbalizer\n1626 assert label_text in dataset_name.label_verbalizer()\n", + "col_offset": 12, + "end_col_offset": 49, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/expt/metrics.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 1625, + "line_range": [ + 1625 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + }, + { + "code": "1625 assert label_text in label_verbalizer\n1626 assert label_text in dataset_name.label_verbalizer()\n1627 if label_verbalizer[label_text] != dataset_name.label_verbalizer()[label_text]:\n", + "col_offset": 12, + "end_col_offset": 64, + "filename": "/Users/adivekar/workplace/synthesizrr/src/synthesizrr/expt/metrics.py", + "issue_confidence": "HIGH", + "issue_cwe": { + "id": 703, + "link": "https://cwe.mitre.org/data/definitions/703.html" + }, + "issue_severity": "LOW", + "issue_text": "Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.", + "line_number": 1626, + "line_range": [ + 1626 + ], + "more_info": "https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html", + "test_id": "B101", + "test_name": "assert_used" + } + ] +} \ No newline at end of file diff --git a/bandit_report_code.txt b/bandit_report_code.txt new file mode 100644 index 0000000..2e4dec1 --- /dev/null +++ b/bandit_report_code.txt @@ -0,0 +1,3011 @@ +Working... ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 100% 0:00:03 +Run started:2024-03-18 18:18:01.816860 + +Test results: +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/algorithm/huggingface/transformers.py:587:16 +586 ## Convert from log-softmax-probs to softmax-probs. +587 assert renormalize_logits is True +588 token_probs: np.ndarray = np.exp(token_probs) + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/algorithm/huggingface/transformers.py:589:16 +588 token_probs: np.ndarray = np.exp(token_probs) +589 assert min_possible_score == 0.0 +590 assert 0.0 < output_scores_tolerance < 1.0 + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/algorithm/huggingface/transformers.py:590:16 +589 assert min_possible_score == 0.0 +590 assert 0.0 < output_scores_tolerance < 1.0 +591 elif output_scores_format == 'log-probabilities': + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/algorithm/huggingface/transformers.py:593:16 +592 ## `token_probs` is already in log-softmax form. +593 assert renormalize_logits is True +594 assert min_possible_score == -inf + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/algorithm/huggingface/transformers.py:594:16 +593 assert renormalize_logits is True +594 assert min_possible_score == -inf +595 assert output_scores_tolerance < 0.0 + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/algorithm/huggingface/transformers.py:595:16 +594 assert min_possible_score == -inf +595 assert output_scores_tolerance < 0.0 +596 elif output_scores_format == 'logits': + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/algorithm/huggingface/transformers.py:597:16 +596 elif output_scores_format == 'logits': +597 assert renormalize_logits is False +598 assert min_possible_score == -inf + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/algorithm/huggingface/transformers.py:598:16 +597 assert renormalize_logits is False +598 assert min_possible_score == -inf +599 assert output_scores_tolerance is None ## Do not filter out any tokens. + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/algorithm/huggingface/transformers.py:599:16 +598 assert min_possible_score == -inf +599 assert output_scores_tolerance is None ## Do not filter out any tokens. +600 else: + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/algorithm/huggingface/transformers.py:603:12 +602 ## Check dim 0 has same size as number of examples: +603 assert token_probs.shape[0] == batch_size +604 ## Check dim 1 has same size as number of generated tokens: + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/algorithm/huggingface/transformers.py:605:12 +604 ## Check dim 1 has same size as number of generated tokens: +605 assert token_probs.shape[1] == num_generated_tokens +606 ## Check dim 2 has same size as vocab: + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/algorithm/huggingface/transformers.py:610:12 +609 token_probs: np.ndarray = token_probs[:, :, :len(id2token_np)] +610 assert token_probs.shape[2] == len(id2token_np) +611 + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/algorithm/sentence_transformers.py:44:16 +43 else: +44 assert model_dir.storage is Storage.LOCAL_FILE_SYSTEM, 'Can only load models from disk.' +45 self.tokenizer: PreTrainedTokenizerBase = AutoTokenizer.from_pretrained(model_dir.path) + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/algorithm/sklearn/SklearnSGDClassifier.py:32:16 +31 else: +32 assert model_dir.storage is Storage.LOCAL_FILE_SYSTEM, 'Can only load models from disk.' +33 self.model: SGDClassifier = joblib.load(os.path.join(model_dir.path, 'model.pkl')) + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/algorithm/sklearn/SklearnSGDRegressor.py:29:16 +28 else: +29 assert model_dir.storage is Storage.LOCAL_FILE_SYSTEM, 'Can only load models from disk.' +30 self.model: SGDRegressor = joblib.load(os.path.join(model_dir.path, 'model.pkl')) + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/constants/Alias.py:286:8 +285 progress_bar: Optional[Dict] = dict() +286 assert progress_bar is None or isinstance(progress_bar, dict) +287 return progress_bar + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/data/FileMetadata.py:30:8 +29 path: Dict = dict(path=path) +30 assert isinstance(path, dict) +31 path: Dict = { + +-------------------------------------------------- +>> Issue: [B113:request_without_timeout] Requests call without timeout + Severity: Medium Confidence: Low + CWE: CWE-400 (https://cwe.mitre.org/data/definitions/400.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b113_request_without_timeout.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/data/FileMetadata.py:102:23 +101 elif storage is Storage.URL: +102 return str(requests.head(path).status_code).startswith('2') +103 raise NotImplementedError(f'Cannot determine whether following path exists on {storage}: "{path}"') + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/data/FileMetadata.py:149:16 +148 if self.is_path_valid_dir(): +149 assert file_name is not None +150 local_file: FileMetadata = self.file_in_dir(file_name, return_metadata=True) + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/data/FileMetadata.py:152:16 +151 else: +152 assert file_name is None +153 local_file: FileMetadata = self + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/data/FileMetadata.py:209:8 +208 def __truediv__(self, subdir_name: str) -> FileMetadata: +209 assert isinstance(subdir_name, str) +210 return self.subdir_in_dir( + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/data/pipeline.py:221:12 +220 supported_input_mltypes: Tuple[MLType] = data_processor.input_mltypes +221 assert input_mltype in supported_input_mltypes, \ +222 f'"{str(input_mltype)}" not included in supported MLTypes: "{str(supported_input_mltypes)}"' +223 ## For 1:1 data processors, the supported input MLType should be a list of MLTypes + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/data/pipeline.py:304:8 +303 ## dict returned by create_pipeline_step_processors should have exactly one item. +304 assert len(pipeline_step_processors) <= 1 +305 for input_cols, step_processor in pipeline_step_processors.items(): + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/data/pipeline.py:598:12 +597 reader: Reader = Reader.of(config.format) +598 assert isinstance(reader, ConfigReader) +599 Log.debug('\nReading pipeline config...') + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/data/processor/text/TFIDFVectorization.py:40:16 +39 ngram_range = tuple(ngram_range) +40 assert isinstance(ngram_range, tuple) +41 sklearn_tfidf_params['ngram_range'] = ngram_range + +-------------------------------------------------- +>> Issue: [B403:blacklist] Consider possible security implications associated with pickle module. + Severity: Low Confidence: High + CWE: CWE-502 (https://cwe.mitre.org/data/definitions/502.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/blacklists/blacklist_imports.html#b403-import-pickle + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/data/reader/binary/PickleReader.py:3:0 +2 from abc import abstractmethod, ABC +3 import io, requests, pickle +4 from requests import Response + +-------------------------------------------------- +>> Issue: [B301:blacklist] Pickle and modules that wrap it can be unsafe when used to deserialize untrusted data, possible security issue. + Severity: Medium Confidence: High + CWE: CWE-502 (https://cwe.mitre.org/data/definitions/502.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/blacklists/blacklist_calls.html#b301-pickle + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/data/reader/binary/PickleReader.py:31:23 +30 stream.seek(0) +31 return pickle.load(stream) +32 except Exception as e: + +-------------------------------------------------- +>> Issue: [B113:request_without_timeout] Requests call without timeout + Severity: Medium Confidence: Low + CWE: CWE-400 (https://cwe.mitre.org/data/definitions/400.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b113_request_without_timeout.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/data/reader/config/ConfigReader.py:63:41 +62 if text is None: +63 response: Response = requests.get(url) +64 text: str = response.text + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/data/reader/dataframe/CsvReader.py:53:12 +52 except NoCredentialsError: +53 assert storage is Storage.S3 +54 ## Create a new session and read manually: + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/data/reader/dataframe/JsonLinesReader.py:46:12 +45 except NoCredentialsError: +46 assert storage is Storage.S3 +47 ## Create a new session and read manually: + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/data/reader/dataframe/ParquetReader.py:42:12 +41 except NoCredentialsError: +42 assert storage is Storage.S3 +43 ## Create a new session and read manually: + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/data/sdf/DaskScalableDataFrame.py:107:12 +106 for sdf in sdfs: +107 assert isinstance(sdf, DaskScalableDataFrame) +108 ddf_list.append(sdf._data) + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/data/sdf/DaskScalableDataFrame.py:393:28 +392 if num_chunks is not None: +393 assert length is not None, f'`length` should be set in the upper half of this loop.' +394 num_rows: int = self._stream_update_num_rows_according_to_num_chunks( + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/data/sdf/DictScalableDataFrame.py:220:12 +219 for sdf in sdfs: +220 assert isinstance(sdf, DictScalableDataFrame) +221 cols.update(sdf.columns_set) + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/data/sdf/ListOfDictScalableDataFrame.py:252:12 +251 for sdf in sdfs: +252 assert isinstance(sdf, ListOfDictScalableDataFrame) +253 list_of_dicts.extend(sdf._data) + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/data/sdf/NumpyArrayScalableSeries.py:55:12 +54 ) +55 assert isinstance(data, np.ndarray), f'Found type: {type(data)}' +56 if np.issubdtype(data.dtype, np.unicode_) and str_to_object: + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/data/sdf/NumpyRecordArrayScalableDataFrame.py:111:12 +110 for df in dfs: +111 assert isinstance(df, cls) +112 df_list.append(df._data) + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/data/sdf/PandasScalableDataFrame.py:96:12 +95 for sdf in sdfs: +96 assert isinstance(sdf, PandasScalableDataFrame) +97 df_list.append(sdf._data) + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/data/sdf/RecordScalableDataFrame.py:133:12 +132 for sdf in sdfs: +133 assert isinstance(sdf, RecordScalableDataFrame) +134 list_of_dicts.append(sdf.raw()) + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/data/sdf/ScalableDataFrame.py:110:8 +109 data: ScalableDataFrame = data.to_frame() +110 assert isinstance(data, ScalableDataFrame) +111 if layout is None: + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/data/sdf/ScalableDataFrame.py:997:8 +996 num_batches_per_shard += M +997 assert remaining_num_rows < M * S * B +998 # assert remaining_num_rows == (N - M*S*B*((new_P//S)-1)) + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/data/sdf/ScalableDataFrame.py:1008:8 +1007 num_batches_per_shard += num_remaining_complete_columns +1008 assert remaining_num_rows < S * B +1009 + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/data/sdf/ScalableDataFrame.py:1030:12 +1029 remaining_num_rows -= final_col_num_rows +1030 assert remaining_num_rows == 0 +1031 + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/data/sdf/ScalableDataFrame.py:1094:16 +1093 if parallelize is Parallelize.processes: +1094 assert map_executor == 'spawn' +1095 return ProcessPoolExecutor(max_workers=num_workers) + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/data/sdf/ScalableDataFrame.py:1097:16 +1096 elif parallelize is Parallelize.threads: +1097 assert map_executor == 'spawn' +1098 return ThreadPoolExecutor(max_workers=num_workers) + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/data/sdf/ScalableDataFrame.py:1185:12 +1184 raise e +1185 assert map_failure == 'drop' +1186 return + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/data/sdf/ScalableDataFrame.py:1201:12 +1200 raise e +1201 assert map_failure == 'drop' +1202 return None + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/data/sdf/ScalableSeries.py:92:8 +91 data: ScalableSeries = cls.get_subclass(layout)(data=data, **kwargs) +92 assert isinstance(data, ScalableSeries) +93 if layout is None: + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/data/writer/Writer.py:221:20 +220 else: +221 assert len(written_paths) == 1 +222 written_path: str = written_paths[0] + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/data/writer/Writer.py:292:20 +291 else: +292 assert len(written_s3_paths) == 1 +293 written_s3_path: str = written_s3_paths[0] + +-------------------------------------------------- +>> Issue: [B403:blacklist] Consider possible security implications associated with pickle module. + Severity: Low Confidence: High + CWE: CWE-502 (https://cwe.mitre.org/data/definitions/502.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/blacklists/blacklist_imports.html#b403-import-pickle + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/data/writer/binary/PickleWriter.py:2:0 +1 from typing import * +2 import io, pickle +3 from abc import abstractmethod, ABC + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/data/writer/dataframe/CsvWriter.py:77:12 +76 ## We are writing multiple files to a directory (either in local or remote). +77 assert name_function is not None, f'We require a `name_function` when writing to a directory.' +78 sdf.to_csv( + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/data/writer/dataframe/JsonLinesWriter.py:72:12 +71 ## We are writing multiple files to a directory (either in local or remote). +72 assert name_function is not None, f'We require a `name_function` when writing to a directory.' +73 sdf.to_json( + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/data/writer/dataframe/NpzWriter.py:73:12 +72 ## We are writing multiple files to a directory (either in local or remote). +73 assert name_function is not None, f'We require a `name_function` when writing to a directory.' +74 params = self.filtered_params(DaskDataFrame.compute, DaskDataFrame.get_partition, Pandas_to_npz) + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/data/writer/dataframe/ParquetWriter.py:71:12 +70 ## We are writing multiple files to a directory (either in local or remote). +71 assert name_function is not None, f'We require a `name_function` when writing to a directory.' +72 params = self.filtered_params(Dask_to_parquet, Pandas_to_parquet) + +-------------------------------------------------- +>> Issue: [B403:blacklist] Consider possible security implications associated with pickle module. + Severity: Low Confidence: High + CWE: CWE-502 (https://cwe.mitre.org/data/definitions/502.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/blacklists/blacklist_imports.html#b403-import-pickle + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/framework/algorithm.py:5:0 +4 import numpy as np +5 import time, traceback, pickle, gc, os, tempfile +6 from synthesizrr.base.constants import FileFormat, DataLayout, MLType, DataSplit, MLTypeSchema, Storage + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/framework/algorithm.py:266:16 +265 ## Copy to local cache directory: +266 assert cache_dir is not None +267 cache_dir.mkdir() + +-------------------------------------------------- +>> Issue: [B301:blacklist] Pickle and modules that wrap it can be unsafe when used to deserialize untrusted data, possible security issue. + Severity: Medium Confidence: High + CWE: CWE-502 (https://cwe.mitre.org/data/definitions/502.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/blacklists/blacklist_calls.html#b301-pickle + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/framework/algorithm.py:692:33 +691 with model_dir.open(file_name=model_params_file_name, mode="rb", tmpdir=tmpdir) as inp: +692 model_params: Dict = pickle.load(inp) +693 if not isinstance(model_params, dict): + +-------------------------------------------------- +>> Issue: [B403:blacklist] Consider possible security implications associated with pickle module. + Severity: Low Confidence: High + CWE: CWE-502 (https://cwe.mitre.org/data/definitions/502.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/blacklists/blacklist_imports.html#b403-import-pickle + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/framework/chain/Chain.py:5:0 +4 import numpy as np +5 import time, traceback, pickle, gc, os, json +6 from synthesizrr.base.util import Registry, MutableParameters, Parameters, set_param_from_alias, is_list_like, as_list, \ + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/framework/chain/Chain.py:270:12 +269 if after is not None: +270 assert isinstance(after, ChainExecution) +271 tracker: Tracker = Tracker.of(get_default(tracker, 'noop')) + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/framework/chain/Chain.py:662:8 +661 outputs: Dict = chain_exn.outputs +662 assert isinstance(outputs, dict) +663 outputs['__exn__'] = chain_exn + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/framework/dl/torch/torch_tasks.py:67:16 +66 else: +67 assert required_embeddings == 'multi' +68 output: List[Tensor] = self.embed_multi(input, **kwargs) + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/framework/evaluator/AccelerateEvaluator.py:37:16 +36 params['model_weights_dtype'] = getattr(torch, params['model_weights_dtype']) +37 assert isinstance(params['model_weights_dtype'], torch.dtype) +38 return params + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/framework/evaluator/AccelerateEvaluator.py:187:12 +186 raise ValueError(f'For non-HuggingFace PyTorch models, you must specify model_dir for loading.') +187 assert isinstance(model_dir, FileMetadata) +188 model_dir_path: str = model_dir.path + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/framework/evaluator/AccelerateEvaluator.py:264:12 +263 ## Load the model into CPU memory: +264 assert cache_dir is not None +265 model: Algorithm = Algorithm.of(**{ + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/framework/evaluator/RayEvaluator.py:168:20 +167 if error_to_raise is None: +168 assert isinstance(macro_batch, ScalableDataFrame) and macro_batch.layout == DataLayout.PANDAS +169 macro_batch_save_file: Optional[FileMetadata] = None ## Saves a macro batch + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/framework/evaluator/RayEvaluator.py:541:16 +540 ) +541 assert predictions_destination.format is not None ## Checked in .evaluate(). +542 + +-------------------------------------------------- +>> Issue: [B311:blacklist] Standard pseudo-random generators are not suitable for security/cryptographic purposes. + Severity: Low Confidence: High + CWE: CWE-330 (https://cwe.mitre.org/data/definitions/330.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/blacklists/blacklist_calls.html#b311-random + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/framework/evaluator/RayEvaluator.py:650:43 +649 elif load_balancing_strategy is LoadBalancingStrategy.RANDOM: +650 rnd_actor_i: int = random.choice(list(range(0, num_actors_created))) +651 actor_comp: ActorComposite = self.model[rnd_actor_i] + +-------------------------------------------------- +>> Issue: [B311:blacklist] Standard pseudo-random generators are not suitable for security/cryptographic purposes. + Severity: Low Confidence: High + CWE: CWE-330 (https://cwe.mitre.org/data/definitions/330.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/blacklists/blacklist_calls.html#b311-random + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/framework/evaluator/RayEvaluator.py:675:40 +674 ## Select an actor randomly among those with min usage and latest_last_completed_timestamp. +675 actor_id: str = random.choice([ +676 actor_id +677 for actor_usage, last_completed_timestamp, actor_id in actor_usages +678 if actor_usage == min_actor_usage \ +679 and last_completed_timestamp == latest_last_completed_timestamp +680 ]) +681 actor_comp: ActorComposite = only_item([ + +-------------------------------------------------- +>> Issue: [B403:blacklist] Consider possible security implications associated with pickle module. + Severity: Low Confidence: High + CWE: CWE-502 (https://cwe.mitre.org/data/definitions/502.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/blacklists/blacklist_imports.html#b403-import-pickle + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/framework/metric.py:2:0 +1 from typing import * +2 import math, copy, io, pickle +3 from abc import ABC, abstractmethod + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/framework/metric.py:662:4 +661 ) -> str: +662 assert isinstance(range, bool) +663 + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/framework/mixins.py:560:8 +559 progress_bar: Optional[Dict] = None +560 assert progress_bar is None or isinstance(progress_bar, dict) +561 + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/framework/mixins.py:709:8 +708 raise ValueError(f'Cannot iterate over files for data which is in memory') +709 assert isinstance(self.data, FileMetadata) +710 + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/framework/mixins.py:776:20 +775 raise ValueError(f'Cannot detect any file formats from asset paths: {asset_paths.to_list()}') +776 assert len(asset_formats) == 1 and len(non_existent_asset_paths) == 0 +777 ## At least one item in this batch column was non-None: + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/framework/mixins.py:926:12 +925 for row in self.iter(num_rows=1, stream_as=DataLayout.LIST_OF_DICT): +926 assert isinstance(row, InputOutputDataMixin) +927 row.set_layout(DataLayout.RECORD) + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/framework/mixins.py:1000:12 +999 for batch in self.iter(**kwargs): +1000 assert isinstance(batch, InputOutputDataMixin) +1001 if len(get_fn_args(fn)) == 1: + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/framework/mixins.py:1022:12 +1021 for batch in self.iter(**kwargs): +1022 assert isinstance(batch, InputOutputDataMixin) +1023 if len(get_fn_args(fn)) == 1: + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/framework/task/dense_retrieval.py:213:16 +212 for batch in data.iter(**kwargs): +213 assert isinstance(batch, Embeddings) +214 faiss_idxs: np.ndarray = np.arange( + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/framework/task/dense_retrieval.py:264:16 +263 for queries_batch in queries.stream(batch_size=index_retrieval_batch_size): +264 assert isinstance(queries_batch, ScalableSeries) +265 queries_batch_np: np.ndarray = queries_batch.numpy(stack=True) + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/framework/task/dense_retrieval.py:272:16 +271 ) +272 assert top_k_distances.shape[0] == top_k_faiss_idxs.shape[0] == len(queries_batch) +273 for i in range(len(queries_batch)): + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/framework/task/regression.py:42:8 +41 def ground_truth_scores(self) -> ScalableSeries: +42 assert self.has_ground_truths +43 ground_truth_scores_col: str = next(iter(self.data_schema.ground_truths_schema.keys())) + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/framework/task/sparse_retrieval.py:53:8 +52 doc_id: str = str(doc_id) +53 assert len(doc_id) > 0 +54 return doc_id + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/framework/task/sparse_retrieval.py:113:8 +112 ) -> BM25IndexStore: +113 assert self.class_name == index2.class_name +114 dict_keys_to_exclude: List[str] = [ + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/framework/task/sparse_retrieval.py:325:8 +324 if documents is not None: +325 assert isinstance(documents, RetrievalCorpus) +326 kwargs['progress_bar'] = False + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/framework/task/sparse_retrieval.py:402:8 +401 ) +402 assert isinstance(data, RetrievalCorpus) +403 id_col: str = data.data_schema.index_col + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/framework/task/sparse_retrieval.py:485:12 +484 for queries_batch in queries.stream(batch_size=index_retrieval_batch_size): +485 assert isinstance(queries_batch, ScalableSeries) +486 ranked_results.extend(self._retrieve_batch( + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/framework/task/sparse_retrieval.py:538:16 +537 for documents_batch in corpus_gen: +538 assert isinstance(documents_batch, RetrievalCorpus) +539 index_futs.append( + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/framework/task/sparse_retrieval.py:645:12 +644 ) +645 assert isinstance(documents, RetrievalCorpus) +646 index_store_update: BM25IndexStore = _create_index_store( + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/framework/task/sparse_retrieval.py:717:12 +716 for documents_batch_i, documents_batch in enumerate(corpus_gen): +717 assert isinstance(documents_batch, RetrievalCorpus) +718 ## Select in randomized round-robin order: + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/framework/task/sparse_retrieval.py:736:8 +735 ) +736 assert bool(all(accumulate(index_futs, progress_bar=pbar))) +737 ## Next steps: + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/framework/task/sparse_retrieval.py:801:8 +800 ) +801 assert len(batch_ranked_results) == len(queries_batch) +802 return batch_ranked_results + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/framework/task/sparse_retrieval.py:812:8 +811 ## For a particular query, sort the top-k results across actors. +812 assert how in {'max', 'min'} +813 query_top_k_results: List[Tuple[BM25IndexStoreDoc, float]] = [] + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/framework/task/sparse_retrieval.py:997:8 +996 ) +997 assert len(corpus_random_sample) == total_num_results +998 index_col: str = self.corpus.data_schema.index_col + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/framework/task/text_generation.py:133:8 +132 batch_icl_idxs_in_use: List[Set] = [as_set(batch_idx) for batch_idx in batch.index()] +133 assert len(batch_icl_idxs_in_use) == len(batch) +134 # print(f'Columns before: {batch.data.columns}') + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/framework/task/text_generation.py:259:8 +258 """ +259 assert isinstance(self.icl_dataset, ClassificationData) +260 assert isinstance(self.icl_entailment_pos_dataset, ClassificationData) + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/framework/task/text_generation.py:260:8 +259 assert isinstance(self.icl_dataset, ClassificationData) +260 assert isinstance(self.icl_entailment_pos_dataset, ClassificationData) +261 assert isinstance(self.icl_entailment_neg_dataset, ClassificationData) + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/framework/task/text_generation.py:261:8 +260 assert isinstance(self.icl_entailment_pos_dataset, ClassificationData) +261 assert isinstance(self.icl_entailment_neg_dataset, ClassificationData) +262 ## We want to avoid accidentally "leaking" the answer by selecting an ICL example with the same idx as the + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/framework/task/text_generation.py:265:8 +264 batch_icl_idxs_in_use: List[Set] = [as_set(batch_idx) for batch_idx in batch.index()] +265 assert len(batch_icl_idxs_in_use) == len(batch) +266 for shot_i in self.shot_idxs(self.num_shots): ## 1, 2, 3, ... + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/framework/task/text_generation.py:511:12 +510 params['min_possible_score']: float = 0.0 +511 assert 0.0 < params['output_scores_tolerance'] < 1.0 +512 elif params['output_scores_format'] == 'log-probabilities': + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/framework/task/text_generation.py:515:12 +514 params['min_possible_score']: float = -inf +515 assert 0.0 < params['output_scores_tolerance'] < 1.0 +516 params['output_scores_tolerance']: float = log(params['output_scores_tolerance']) + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/framework/task/text_generation.py:517:12 +516 params['output_scores_tolerance']: float = log(params['output_scores_tolerance']) +517 assert params['output_scores_tolerance'] < 0.0 +518 elif params['output_scores_format'] == 'logits': + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/framework/task/text_generation.py:601:12 +600 generation_params: TextGenerationParams = self.hyperparams.generation_params +601 assert isinstance(generation_params, TextGenerationParams) +602 assert generated_token_ids.shape == generated_tokens.shape == generated_token_scores.shape + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/framework/task/text_generation.py:602:12 +601 assert isinstance(generation_params, TextGenerationParams) +602 assert generated_token_ids.shape == generated_tokens.shape == generated_token_scores.shape +603 batch_size: int = generated_token_ids.shape[0] + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/framework/task/text_generation.py:794:8 +793 def _create_predictions(self, batch: Dataset, predictions: Any, **kwargs) -> TextGenerations: +794 assert isinstance(predictions, TextGenerations) +795 return predictions + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/framework/task/text_generation.py:832:12 +831 }) +832 assert isinstance(self.retriever, Retriever) +833 + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/framework/task/text_generation.py:943:8 +942 def _create_predictions(self, batch: Dataset, predictions: Any, **kwargs) -> TextGenerations: +943 assert isinstance(predictions, TextGenerations) +944 return predictions + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/framework/task_data.py:107:8 +106 raise e +107 assert isinstance(data_schema, Schema) +108 if not cls._allow_empty_features_schema and len(data_schema.features_schema) == 0: + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/framework/tracker/AimTracker.py:58:12 +57 self.repo: Repo = Repo(self.repo_dir, init=True) +58 assert isinstance(self.repo, Repo) +59 + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/framework/tracker/LogFileTracker.py:51:8 +50 log_file.get_dir(return_metadata=True).mkdir() +51 assert log_file.storage is Storage.LOCAL_FILE_SYSTEM +52 assert not log_file.is_path_valid_dir() + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/framework/tracker/LogFileTracker.py:52:8 +51 assert log_file.storage is Storage.LOCAL_FILE_SYSTEM +52 assert not log_file.is_path_valid_dir() +53 process_id: int = os.getpid() + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/framework/tracker/LogFileTracker.py:65:8 +64 ) +65 assert self.logger is not None +66 assert self.logger_handler is not None + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/framework/tracker/LogFileTracker.py:66:8 +65 assert self.logger is not None +66 assert self.logger_handler is not None +67 + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/framework/trainer/AccelerateTrainer.py:162:12 +161 tracker: Tracker = Tracker.of(tracker) +162 assert isinstance(tracker, Tracker) +163 + +-------------------------------------------------- +>> Issue: [B403:blacklist] Consider possible security implications associated with pickle module. + Severity: Low Confidence: High + CWE: CWE-502 (https://cwe.mitre.org/data/definitions/502.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/blacklists/blacklist_imports.html#b403-import-pickle + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/framework/trainer/RayTuneTrainer.py:7:0 +6 from types import ModuleType +7 import time, os, gc, io, pickle, math, copy, pandas as pd, numpy as np, random +8 import ray + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/framework/trainer/RayTuneTrainer.py:146:8 +145 if isinstance(metric, TabularMetric): +146 assert isinstance(metric.value, pd.DataFrame) +147 return _RAY_METRIC_IS_DATAFRAME_PREFIX + metric.value.to_json(orient='records') + +-------------------------------------------------- +>> Issue: [B301:blacklist] Pickle and modules that wrap it can be unsafe when used to deserialize untrusted data, possible security issue. + Severity: Medium Confidence: High + CWE: CWE-502 (https://cwe.mitre.org/data/definitions/502.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/blacklists/blacklist_calls.html#b301-pickle + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/framework/trainer/RayTuneTrainer.py:167:11 +166 value.seek(0) +167 return pickle.load(value) +168 + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/framework/trainer/RayTuneTrainer.py:192:12 +191 for student_metric in trial_metrics[data_split]: +192 assert isinstance(student_metric, Metric) +193 student_metric_name: str = student_metric.display_name + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/framework/trainer/RayTuneTrainer.py:201:16 +200 else: +201 assert student_metrics[student_metric_name]['metric_class'] == type(student_metric) +202 student_metrics_stats: Dict[str, Dict[str, Union[int, float]]] = {} + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/framework/trainer/RayTuneTrainer.py:870:16 +869 final_model_results: tune.ResultGrid = results +870 assert len(list(final_model_results)) == self.num_models +871 + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/framework/trainer/RayTuneTrainer.py:934:20 +933 final_model_results: tune.ResultGrid = retry(tuner.fit, retries=2) +934 assert len(list(final_model_results)) == self.num_final_models +935 retrain_timer.stop() + +-------------------------------------------------- +>> Issue: [B311:blacklist] Standard pseudo-random generators are not suitable for security/cryptographic purposes. + Severity: Low Confidence: High + CWE: CWE-330 (https://cwe.mitre.org/data/definitions/330.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/blacklists/blacklist_calls.html#b311-random + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/framework/trainer/RayTuneTrainer.py:1128:64 +1127 ## Priority: global K-Fold seed > random seed. +1128 k_fold_seed: int = get_default(k_fold.seed, random.randint(0, int(1e9))) +1129 if k_fold.seed is None: + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/framework/trainer/RayTuneTrainer.py:1212:8 +1211 def _create_tune_config_for_tuning(self, datasets: Datasets, metrics: Optional[Metrics]) -> tune.TuneConfig: +1212 assert self.is_n_models_without_tuning() is False +1213 num_models: int = self.num_models + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/framework/trainer/RayTuneTrainer.py:1446:20 +1445 if _RAY_KFOLD_CURRENT_FOLD_NAME in hp_iter_num_df.columns: +1446 assert hp_df[_RAY_KFOLD_CURRENT_FOLD_NAME].nunique() == self.k_fold.num_folds +1447 ## Allows for the case where the same set of hyperparams might be repeated multiple times, + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/framework/trainer/Trainer.py:194:8 +193 params['AlgorithmClass']: Type[Algorithm] = Algorithm.get_subclass((params['task'], AlgorithmClass)) +194 assert issubclass(params['AlgorithmClass'], Algorithm) +195 + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/framework/trainer/Trainer.py:305:12 +304 load_model: FileMetadata = FileMetadata.of(load_model) +305 assert isinstance(load_model, FileMetadata) +306 if load_model.is_path_valid_dir() is False: + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/framework/trainer/Trainer.py:317:12 +316 save_model: FileMetadata = FileMetadata.of(save_model) +317 assert isinstance(save_model, FileMetadata) +318 if save_model.is_path_valid_dir() is False: + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/framework/trainer/Trainer.py:369:16 +368 for dataset_metric in dataset_metrics: +369 assert isinstance(dataset_metric, Metric) +370 dataset_metrics_unique[dataset_metric.display_name] = dataset_metric + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/metric/classification_metrics.py:599:8 +598 self._labelspace = data.labelspace +599 assert self._labelspace == data.labelspace +600 for lb in self._labelspace: + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/metric/classification_metrics.py:652:8 +651 self._labelspace = data.labelspace +652 assert self._labelspace == data.labelspace +653 + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/metric/classification_metrics.py:656:8 +655 self._idx_col_name = data.data_schema.index_col +656 assert self._idx_col_name == data.data_schema.index_col +657 + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/metric/classification_metrics.py:660:8 +659 self._gt_col_name = data.ground_truth_label_col_name +660 assert self._gt_col_name == data.ground_truth_label_col_name +661 + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/metric/text_generation_metrics.py:345:8 +344 ) +345 assert isinstance(statement_extraction_gens, NextTokens) +346 assert len(statement_extraction_gens) == len(rag_gens) + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/metric/text_generation_metrics.py:346:8 +345 assert isinstance(statement_extraction_gens, NextTokens) +346 assert len(statement_extraction_gens) == len(rag_gens) +347 statement_extraction_gens.set_layout(DataLayout.PANDAS) + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/metric/text_generation_metrics.py:465:8 +464 ) +465 assert isinstance(statement_verification_gens, NextTokens) +466 assert len(statement_verification_gens) == len(rag_gens_with_statements_flattened) + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/metric/text_generation_metrics.py:466:8 +465 assert isinstance(statement_verification_gens, NextTokens) +466 assert len(statement_verification_gens) == len(rag_gens_with_statements_flattened) +467 statement_verification_gens.set_layout(DataLayout.PANDAS) + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/metric/text_generation_metrics.py:727:8 +726 ) +727 assert isinstance(relevant_context_extraction, NextTokens) +728 assert len(relevant_context_extraction) == len(rag_gens) + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/metric/text_generation_metrics.py:728:8 +727 assert isinstance(relevant_context_extraction, NextTokens) +728 assert len(relevant_context_extraction) == len(rag_gens) +729 relevant_context_extraction.set_layout(DataLayout.PANDAS) + +-------------------------------------------------- +>> Issue: [B311:blacklist] Standard pseudo-random generators are not suitable for security/cryptographic purposes. + Severity: Low Confidence: High + CWE: CWE-330 (https://cwe.mitre.org/data/definitions/330.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/blacklists/blacklist_calls.html#b311-random + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/metric/text_generation_metrics.py:951:44 +950 if settings.get('device_id') is not None: +951 settings['device_id'] = random.choice(EnvUtil.cuda_visible_devices()) +952 clear_device_cache() + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/metric/text_generation_metrics.py:1393:8 +1392 clf_dataset: ClassificationData = data +1393 assert isinstance(clf_dataset, ClassificationData) +1394 clf_dataset: ClassificationData = clf_dataset.read() + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/metric/text_generation_metrics.py:1622:8 +1621 ) +1622 assert isinstance(final_model_results, tune.ResultGrid) +1623 if final_model_results.num_errors > 0: + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/metric/text_generation_metrics.py:1636:12 +1635 if self.params.hpo: +1636 assert isinstance(tune_results, tune.ResultGrid) +1637 tune_metrics: pd.DataFrame = tune_trainer.get_detailed_metrics(tune_results) + +-------------------------------------------------- +>> Issue: [B403:blacklist] Consider possible security implications associated with pickle module. + Severity: Low Confidence: High + CWE: CWE-502 (https://cwe.mitre.org/data/definitions/502.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/blacklists/blacklist_imports.html#b403-import-pickle + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/util/aws/s3.py:2:0 +1 from typing import * +2 import io, random, re, math, os, time, boto3, botocore, fnmatch, pickle +3 from urllib.parse import urlparse, ParseResult + +-------------------------------------------------- +>> Issue: [B301:blacklist] Pickle and modules that wrap it can be unsafe when used to deserialize untrusted data, possible security issue. + Severity: Medium Confidence: High + CWE: CWE-502 (https://cwe.mitre.org/data/definitions/502.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/blacklists/blacklist_calls.html#b301-pickle + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/util/aws/s3.py:232:22 +231 pickled_data = cls.stream_s3_object(s3_path, retry=retry).read() +232 loaded_data = pickle.loads(pickled_data) +233 if loaded_data is None: + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/util/aws/s3.py:324:12 +323 ) +324 assert cls.s3_object_exists(destination_s3_path), f'Could not find file {destination_s3_path} after copying' +325 return True + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/util/aws/s3.py:372:12 +371 s3 = boto3.resource('s3') +372 assert cls.s3_object_exists(source_s3_path), f'Could not find file {source_s3_path} to copy' +373 ## Ref: https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/s3.html#S3.Client.download_file + +-------------------------------------------------- +>> Issue: [B311:blacklist] Standard pseudo-random generators are not suitable for security/cryptographic purposes. + Severity: Low Confidence: High + CWE: CWE-330 (https://cwe.mitre.org/data/definitions/330.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/blacklists/blacklist_calls.html#b311-random + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/util/aws/s3.py:418:23 +417 return True +418 time.sleep(random.randint(0, 30000) / 1000) ## Wait randomly between 0 and 30 seconds to acquire locks. +419 lock_file: str = os.path.join(destination_local_dir, 'litmus-download.lock') + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/util/aws/s3.py:459:12 +458 s3 = boto3.resource('s3') +459 assert cls.s3_object_exists(source_s3_path) +460 ## Ref: https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/s3.html#S3.Client.copy + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/util/aws/s3.py:468:12 +467 ) +468 assert cls.s3_object_exists(destination_s3_path), f'Could not find file {destination_s3_path} after copying' +469 return True + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/util/concurrency.py:794:4 +793 ) -> str: +794 assert isinstance(daemons, dict) +795 assert isinstance(wait, (int, float)) and wait >= 0.0 + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/util/concurrency.py:795:4 +794 assert isinstance(daemons, dict) +795 assert isinstance(wait, (int, float)) and wait >= 0.0 +796 if daemon_id is None: + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/util/concurrency.py:803:4 +802 daemon_id: str = dt.strftime('%Y-%m-%d %H:%M:%S.%f').strip() +803 assert isinstance(daemon_id, str) and len(daemon_id) > 0 +804 assert daemon_id not in daemons, f'Daemon with id "{daemon_id}" already exists.' + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/util/concurrency.py:804:4 +803 assert isinstance(daemon_id, str) and len(daemon_id) > 0 +804 assert daemon_id not in daemons, f'Daemon with id "{daemon_id}" already exists.' +805 + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/util/concurrency.py:817:4 +816 def stop_daemon(daemon_id: str, daemons: Dict[str, List[bool]] = _DAEMONS) -> bool: +817 assert isinstance(daemons, dict) +818 assert isinstance(daemon_id, str) and len(daemon_id) > 0 + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/util/concurrency.py:818:4 +817 assert isinstance(daemons, dict) +818 assert isinstance(daemon_id, str) and len(daemon_id) > 0 +819 daemon_sentinel: List[bool] = daemons.pop(daemon_id, [False]) + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/util/concurrency.py:820:4 +819 daemon_sentinel: List[bool] = daemons.pop(daemon_id, [False]) +820 assert len(daemon_sentinel) == 1 +821 return daemon_sentinel.pop() + +-------------------------------------------------- +>> Issue: [B403:blacklist] Consider possible security implications associated with pickle module. + Severity: Low Confidence: High + CWE: CWE-502 (https://cwe.mitre.org/data/definitions/502.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/blacklists/blacklist_imports.html#b403-import-pickle + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/util/filesystem.py:2:0 +1 from typing import * +2 import io, json, yaml, os, errno, sys, glob, pathlib, math, copy, time, shutil, pickle +3 from synthesizrr.base.util.language import as_list, is_list_like, format_exception_msg, remove_values + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/util/filesystem.py:205:8 +204 path: str = cls.expand_dir(path) +205 assert cls.exists(path), f'Path {path} does not exist.' +206 return round(os.path.getmtime(path), decimals) + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/util/filesystem.py:211:8 +210 path: str = cls.expand_dir(path) +211 assert cls.exists(path), f'Path {path} does not exist.' +212 return os.path.getmtime(path) + +-------------------------------------------------- +>> Issue: [B301:blacklist] Pickle and modules that wrap it can be unsafe when used to deserialize untrusted data, possible security issue. + Severity: Medium Confidence: High + CWE: CWE-502 (https://cwe.mitre.org/data/definitions/502.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/blacklists/blacklist_calls.html#b301-pickle + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/util/filesystem.py:281:23 +280 with io.open(path, 'rb') as inp: +281 data = pickle.load(inp) +282 assert data is not None + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/util/filesystem.py:282:16 +281 data = pickle.load(inp) +282 assert data is not None +283 return data + +-------------------------------------------------- +>> Issue: [B310:blacklist] Audit url open for permitted schemes. Allowing use of file:/ or custom schemes is often unexpected. + Severity: Medium Confidence: High + CWE: CWE-22 (https://cwe.mitre.org/data/definitions/22.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/blacklists/blacklist_calls.html#b310-urllib-urlopen + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/util/jupyter.py:65:17 +64 # Use a timeout in case this is a stale entry. +65 with urllib.request.urlopen(url, timeout=0.5) as req: +66 return json.load(req) + +-------------------------------------------------- +>> Issue: [B110:try_except_pass] Try, Except, Pass detected. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b110_try_except_pass.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/util/jupyter.py:83:12 +82 return srv, PurePath(sess['notebook']['path']) +83 except Exception: +84 pass # There may be stale entries in the runtime directory +85 return None, None + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/util/language.py:115:8 +114 for x in args: +115 assert x in {True, False} +116 if not x: ## Check for falsy values + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/util/language.py:123:8 +122 for x in args: +123 assert x in {True, False} +124 if x: ## Check for truthy values + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/util/language.py:192:4 +191 remove: Set[str] = set(remove) +192 assert isinstance(remove, (list, tuple, set)) +193 if len(remove) == 0: + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/util/language.py:345:8 +344 params_str: str = call_str.replace(f'{name}(', '') +345 assert params_str.endswith(')') +346 params_str: str = params_str[:-1] + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/util/language.py:640:4 +639 return True +640 assert isinstance(y, type) or (isinstance(y, (list, tuple)) and np.all([isinstance(z, type) for z in y])) +641 if (isinstance(y, type) and isinstance(x, y)) or (isinstance(y, list) and np.any([isinstance(x, z) for z in y])): + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/util/language.py:660:4 +659 return False +660 assert isinstance(x, type) +661 assert isinstance(y, type) or (isinstance(y, list) and np.all([isinstance(z, type) for z in y])) + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/util/language.py:661:4 +660 assert isinstance(x, type) +661 assert isinstance(y, type) or (isinstance(y, list) and np.all([isinstance(z, type) for z in y])) +662 if (isinstance(y, type) and issubclass(x, y)) or (isinstance(y, list) and np.any([issubclass(x, z) for z in y])): + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/util/language.py:757:4 +756 """ +757 assert error in {"raise", "warn", "ignore"} +758 names: Optional[Set[str]] = set(names) + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/util/language.py:1065:4 +1064 def assert_not_empty_list(l: List): +1065 assert is_not_empty_list(l) +1066 + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/util/language.py:1069:4 +1068 def assert_not_empty_list_like(l: ListOrTuple, error_message=''): +1069 assert is_not_empty_list_like(l), error_message +1070 + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/util/language.py:1185:4 +1184 def get_subset(small_list: ListOrTuple, big_list: ListOrTuple) -> Set: +1185 assert is_list_like(small_list) +1186 assert is_list_like(big_list) + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/util/language.py:1186:4 +1185 assert is_list_like(small_list) +1186 assert is_list_like(big_list) +1187 return set.intersection(set(small_list), set(big_list)) + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/util/language.py:1264:4 +1263 d = {} +1264 assert isinstance(d, dict) +1265 if default_params is None: + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/util/language.py:1267:4 +1266 return d +1267 assert isinstance(default_params, dict) +1268 for k, v in default_params.items(): + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/util/language.py:1284:4 +1283 ) -> List[Tuple]: +1284 assert by in {'key', 'value'} +1285 if order is not None: + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/util/language.py:1287:8 +1286 order: List = as_list(order) +1287 assert by == 'key' +1288 out_d: Dict = {} + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/util/language.py:1310:4 +1309 ) -> Any: +1310 assert how in {'max', 'min'} +1311 sorted_items: List[Tuple] = sorted_dict( + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/util/language.py:1390:4 +1389 return {} +1390 assert isinstance(AutoEnumClass, AutoEnum.__class__) +1391 d = AutoEnumClass.convert_keys(d) + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/util/language.py:1423:4 +1422 def assert_not_empty_dict(d: Dict): +1423 assert is_not_empty_dict(d) +1424 + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/util/language.py:1607:4 +1606 ## Ref: https://datascience.stackexchange.com/a/16801/35826 +1607 assert isinstance(df, PandasDataFrame) +1608 return (~df.isna()).sum(axis=1) + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/util/language.py:1612:4 +1611 def get_max_num_non_null_columns_per_row(df: PandasDataFrame) -> int: +1612 assert isinstance(df, PandasDataFrame) +1613 return get_num_non_null_columns_per_row(df).max() + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/util/language.py:1665:4 +1664 data: PandasDataFrame = pd.DataFrame(data) +1665 assert isinstance(data, PandasDataFrame) +1666 return data + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/util/language.py:1683:4 +1682 ) -> Union[List, Set, Tuple]: +1683 assert output_type in {list, set, tuple} +1684 if not is_list_or_set_like(l): + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/util/language.py:1697:4 +1696 ) -> Union[List, Tuple, Set, Any]: +1697 assert outer_type in {list, set, tuple} +1698 assert inner_type in {list, set, tuple} + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/util/language.py:1698:4 +1697 assert outer_type in {list, set, tuple} +1698 assert inner_type in {list, set, tuple} +1699 if not is_list_or_set_like(l): + +-------------------------------------------------- +>> Issue: [B311:blacklist] Standard pseudo-random generators are not suitable for security/cryptographic purposes. + Severity: Low Confidence: High + CWE: CWE-330 (https://cwe.mitre.org/data/definitions/330.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/blacklists/blacklist_calls.html#b311-random + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/util/language.py:1735:31 +1734 ) -> Optional[Any]: +1735 py_random: random.Random = random.Random(seed) +1736 if (is_list_like(struct) or is_set_like(struct)) and len(struct) > 0: + +-------------------------------------------------- +>> Issue: [B311:blacklist] Standard pseudo-random generators are not suitable for security/cryptographic purposes. + Severity: Low Confidence: High + CWE: CWE-330 (https://cwe.mitre.org/data/definitions/330.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/blacklists/blacklist_calls.html#b311-random + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/util/language.py:1750:31 +1749 def any_key(d: Dict, *, seed: Optional[int] = None, raise_error: bool = True) -> Optional[Any]: +1750 py_random: random.Random = random.Random(seed) +1751 if is_not_empty_dict(d): + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/util/language.py:1846:4 +1845 """Inclusive range, useful for coding up math notation.""" +1846 assert isinstance(low, (int, float)) and isinstance(high, (int, float)) and isinstance(step, (int, float)) +1847 out: List[float] = [ + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/util/language.py:1862:4 +1861 ) -> bool: +1862 assert isinstance(l, (list, tuple, np.ndarray, pd.Series, pd.DataFrame)) +1863 assert idx >= 0, f'Can only check validity of non-negative indexes' + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/util/language.py:1863:4 +1862 assert isinstance(l, (list, tuple, np.ndarray, pd.Series, pd.DataFrame)) +1863 assert idx >= 0, f'Can only check validity of non-negative indexes' +1864 if len(l) == 0: + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/util/language.py:1875:4 +1874 ) -> Generator[List[Any], None, None]: +1875 assert isinstance(batch_size, int) and batch_size > 0 +1876 if is_int_in_floats_clothing(struct): + +-------------------------------------------------- +>> Issue: [B311:blacklist] Standard pseudo-random generators are not suitable for security/cryptographic purposes. + Severity: Low Confidence: High + CWE: CWE-330 (https://cwe.mitre.org/data/definitions/330.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/blacklists/blacklist_calls.html#b311-random + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/util/language.py:1920:16 +1919 np_random = np.random.RandomState(seed) +1920 py_random = random.Random(seed) +1921 if not is_list_like(data): + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/util/language.py:1955:4 +1954 def values_dist(vals: Union[List, Tuple, np.ndarray, pd.Series]) -> pd.Series: +1955 assert isinstance(vals, (list, tuple, np.ndarray, pd.Series)) +1956 val_counts: pd.Series = pd.Series(Counter(vals)) ## Includes nan and None as keys. + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/util/language.py:1976:4 +1975 target_prob_dist: pd.Series = target +1976 assert isinstance(target_prob_dist, pd.Series) +1977 assert abs(float(target_prob_dist.sum()) - 1.0) <= 1e-2 ## Sum of probs should be exactly or very close to 1. + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/util/language.py:1977:4 +1976 assert isinstance(target_prob_dist, pd.Series) +1977 assert abs(float(target_prob_dist.sum()) - 1.0) <= 1e-2 ## Sum of probs should be exactly or very close to 1. +1978 + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/util/language.py:1979:4 +1978 +1979 assert isinstance(source, (list, tuple, np.ndarray, pd.Series)) +1980 source_vc: pd.Series = pd.Series(Counter(source)) + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/util/language.py:2014:8 +2013 probabilities: np.ndarray = np.array(probabilities) +2014 assert is_numpy_float_array(probabilities) +2015 prob_sum: float = float(probabilities.sum()) + +-------------------------------------------------- +>> Issue: [B311:blacklist] Standard pseudo-random generators are not suitable for security/cryptographic purposes. + Severity: Low Confidence: High + CWE: CWE-330 (https://cwe.mitre.org/data/definitions/330.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/blacklists/blacklist_calls.html#b311-random + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/util/language.py:2038:4 +2037 rnd_idxs: List[int] = list(range(len(struct))) +2038 random.Random(seed).shuffle(rnd_idxs) +2039 for rnd_idx in rnd_idxs: + +-------------------------------------------------- +>> Issue: [B311:blacklist] Standard pseudo-random generators are not suitable for security/cryptographic purposes. + Severity: Low Confidence: High + CWE: CWE-330 (https://cwe.mitre.org/data/definitions/330.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/blacklists/blacklist_calls.html#b311-random + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/util/language.py:2044:10 +2043 def random_cartesian_product(*lists, seed: Optional[int] = None, n: int): +2044 rnd = random.Random(seed) +2045 cartesian_idxs: Set[Tuple[int, ...]] = set() + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/util/language.py:2071:4 +2070 return max(d, key=d.get) +2071 assert is_list_like(d) +2072 return max([(i, x) for (i, x) in enumerate(d)], key=lambda x: x[1])[0] + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/util/language.py:2081:4 +2080 return min(d, key=d.get) +2081 assert is_list_like(d) +2082 return min([(i, x) for (i, x) in enumerate(d)], key=lambda x: x[1])[0] + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/util/language.py:2094:4 +2093 """Efficiently gets the top-k elements from a numpy array.""" +2094 assert isinstance(k, int) and k > 0 +2095 ## np.argpartition creates a new array with the top-k/bottom-k scores in the head/tail k elements, + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/util/language.py:2144:4 +2143 def clip(low: Union[int, float], val: Union[int, float], high: Union[int, float]): +2144 assert isinstance(low, (int, float, np.integer, np.float_)) +2145 assert isinstance(high, (int, float, np.integer, np.float_)) + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/util/language.py:2145:4 +2144 assert isinstance(low, (int, float, np.integer, np.float_)) +2145 assert isinstance(high, (int, float, np.integer, np.float_)) +2146 assert isinstance(val, (int, float, np.integer, np.float_)) + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/util/language.py:2146:4 +2145 assert isinstance(high, (int, float, np.integer, np.float_)) +2146 assert isinstance(val, (int, float, np.integer, np.float_)) +2147 assert low <= high + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/util/language.py:2147:4 +2146 assert isinstance(val, (int, float, np.integer, np.float_)) +2147 assert low <= high +2148 return max(low, min(val, high)) + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/util/language.py:2152:4 +2151 def pad_interval(low: Union[int, float], high: Union[int, float], pad: float) -> Tuple[float, float]: +2152 assert isinstance(low, (int, float, np.integer, np.float_)) +2153 assert isinstance(high, (int, float, np.integer, np.float_)) + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/util/language.py:2153:4 +2152 assert isinstance(low, (int, float, np.integer, np.float_)) +2153 assert isinstance(high, (int, float, np.integer, np.float_)) +2154 assert isinstance(pad, (int, float, np.integer, np.float_)) and 0.0 <= pad <= 1.0 + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/util/language.py:2154:4 +2153 assert isinstance(high, (int, float, np.integer, np.float_)) +2154 assert isinstance(pad, (int, float, np.integer, np.float_)) and 0.0 <= pad <= 1.0 +2155 assert low <= high + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/util/language.py:2155:4 +2154 assert isinstance(pad, (int, float, np.integer, np.float_)) and 0.0 <= pad <= 1.0 +2155 assert low <= high +2156 width: float = float(high) - float(low) + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/util/language.py:2375:12 +2374 registered_names: Set[str] = set(registered.keys()) +2375 assert len(registered_names) > 0, f'Invalid state: key {k} is registered to an empty dict' +2376 if subclass_name in registered_names and cls._allow_subclass_override is False: + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/util/language.py:2382:16 +2381 elif subclass_name not in registered_names and cls._allow_multiple_subclasses is False: +2382 assert len(registered_names) == 1, \ +2383 f'Invalid state: _allow_multiple_subclasses is False but we have multiple subclasses registered ' \ +2384 f'against key {k}' +2385 raise KeyError( + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/util/language.py:2843:4 +2842 final_columns.append(col) +2843 assert set(final_columns) == set(df_columns) +2844 return df[final_columns] + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/util/language.py:2947:8 +2946 } +2947 assert isinstance(progress_bar, dict) +2948 return ProgressBar(**progress_bar) + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/util/language.py:3147:4 +3146 def is_sorted(l: Union[List[_Comparable], Tuple[_Comparable, ...]]) -> bool: +3147 assert isinstance(l, (list, tuple)) +3148 length = len(l) + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/util/language.py:3149:4 +3148 length = len(l) +3149 assert length > 0 +3150 if length == 1: + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/util/language.py:3201:8 +3200 if order is not None: +3201 assert len(plots_list) > 0 +3202 assert len(order) == len(plots_list) + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/util/language.py:3202:8 +3201 assert len(plots_list) > 0 +3202 assert len(order) == len(plots_list) +3203 assert len(set(p[0] for p in plots_list)) == len(order) + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/util/language.py:3203:8 +3202 assert len(order) == len(plots_list) +3203 assert len(set(p[0] for p in plots_list)) == len(order) +3204 ordered_plots_list: List[Any] = [] + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/util/language.py:3218:12 +3217 if isinstance(plot, tuple): +3218 assert len(plot) == 2 +3219 plot = plot[1] + +-------------------------------------------------- +>> Issue: [B113:request_without_timeout] Requests call without timeout + Severity: Medium Confidence: Low + CWE: CWE-400 (https://cwe.mitre.org/data/definitions/400.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b113_request_without_timeout.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/util/notify.py:155:19 +154 msg = '/md\n\n' + msg +155 response = requests.post(url=self.webhook, json={"Content": msg}) +156 return str(response.status_code).startswith('2') + +-------------------------------------------------- +>> Issue: [B113:request_without_timeout] Requests call without timeout + Severity: Medium Confidence: Low + CWE: CWE-400 (https://cwe.mitre.org/data/definitions/400.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b113_request_without_timeout.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/util/notify.py:173:19 +172 msg: str = str(msg) +173 response = requests.post(self.webhook, json={"content": msg}, headers={'Content-Type': 'application/json'}) +174 return str(response.status_code).startswith('2') + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/util/schema.py:293:8 +292 ) +293 assert inferred_schema.columns_set == set(schema.keys()) +294 return inferred_schema + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/util/schema.py:386:8 +385 inferred_schema: Schema = Schema(**schema) +386 assert inferred_schema.columns_set <= columns_set +387 return inferred_schema + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/util/string.py:203:8 +202 def assert_not_empty(cls, string: Any, error_message: str = ''): +203 assert cls.is_not_empty(string), error_message +204 + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/util/string.py:207:8 +206 def assert_not_empty_bytes(cls, string: Any, error_message: str = ''): +207 assert cls.is_not_empty_str_or_bytes(string), error_message +208 + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/util/string.py:211:8 +210 def assert_not_empty_str_or_bytes(cls, string: Any, error_message: str = ''): +211 assert cls.is_not_empty_str_or_bytes(string), error_message +212 + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/util/string.py:284:8 +283 def convert_str_to_type(cls, val: str, expected_type: Type) -> Any: +284 assert isinstance(expected_type, type) +285 if isinstance(val, expected_type): + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/util/string.py:344:12 +343 if unit is not None: +344 assert isinstance(unit, str) +345 unit = unit.upper() + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/util/string.py:346:12 +345 unit = unit.upper() +346 assert unit in cls.FILE_SIZE_UNITS +347 return sizes[unit] + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/util/string.py:427:12 +426 if unit is not None: +427 assert isinstance(unit, str) +428 unit = unit.lower() + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/util/string.py:429:12 +428 unit = unit.lower() +429 assert unit in TIME_UNITS +430 return times[unit] + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/util/string.py:443:8 +442 return '0' +443 assert abs(n) > 0 +444 if 0 < abs(n) < 1: + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/util/string.py:481:8 +480 ) -> Union[Dict, float]: +481 assert n >= 0 +482 N_UNITS = { + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/util/string.py:507:12 +506 if unit is not None: +507 assert isinstance(unit, str) +508 unit = unit.lower() + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/util/string.py:509:12 +508 unit = unit.lower() +509 assert unit in N_UNITS +510 return numbers[unit] + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/util/string.py:527:8 +526 def get_num_zeros_to_pad(cls, max_i: int) -> int: +527 assert isinstance(max_i, int) and max_i >= 1 +528 num_zeros = math.ceil(math.log10(max_i)) ## Ref: https://stackoverflow.com/a/51837162/4900327 + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/util/string.py:535:8 +534 def pad_zeros(cls, i: int, max_i: int = int(1e12)) -> str: +535 assert isinstance(i, int) +536 assert i >= 0 + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/util/string.py:536:8 +535 assert isinstance(i, int) +536 assert i >= 0 +537 assert isinstance(max_i, int) + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/util/string.py:537:8 +536 assert i >= 0 +537 assert isinstance(max_i, int) +538 assert max_i >= i, f'Expected max_i to be >= current i; found max_i={max_i}, i={i}' + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/util/string.py:538:8 +537 assert isinstance(max_i, int) +538 assert max_i >= i, f'Expected max_i to be >= current i; found max_i={max_i}, i={i}' +539 num_zeros: int = cls.get_num_zeros_to_pad(max_i) + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/util/string.py:627:8 +626 min_num_chars, max_num_chars = length +627 assert min_num_chars <= max_num_chars, \ +628 f'Must have min_num_chars ({min_num_chars}) <= max_num_chars ({max_num_chars})' +629 if spaces_prob is not None: + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/util/string.py:668:8 +667 cartesian_product_parts: List[List[str]] = [] +668 assert len(order) > 0 +669 for order_part in order: + +-------------------------------------------------- +>> Issue: [B311:blacklist] Standard pseudo-random generators are not suitable for security/cryptographic purposes. + Severity: Low Confidence: High + CWE: CWE-330 (https://cwe.mitre.org/data/definitions/330.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/blacklists/blacklist_calls.html#b311-random + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/util/string.py:689:14 +688 def __random_cartesian_product(*lists, seed: Optional[int] = None, n: int): +689 rnd = random.Random(seed) +690 cartesian_idxs: Set[Tuple[int, ...]] = set() + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/util/string.py:760:8 +759 def convert_integer_to_base_n_str(cls, integer: int, base: int) -> str: +760 assert isinstance(integer, int) +761 assert isinstance(base, int) and base in cls.BASE_CONVERTER_MAP, \ + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/util/string.py:761:8 +760 assert isinstance(integer, int) +761 assert isinstance(base, int) and base in cls.BASE_CONVERTER_MAP, \ +762 f'Param `base` must be an integer in {list(cls.BASE_CONVERTER_MAP.keys())}; found: {base}' +763 return cls.BASE_CONVERTER_MAP[base].encode(integer) + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/util/string.py:801:12 +800 if not isinstance(strings_to_match, list) and not isinstance(strings_to_match, tuple): +801 assert isinstance(strings_to_match, str), f'Input must be of a string or list of strings; found type ' \ +802 f'{type(strings_to_match)} with value: {strings_to_match}' +803 strings_to_match: List[str] = [strings_to_match] + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/base/util/struct.py:100:8 +99 +100 assert is_list_like(nodes) +101 set_param_from_alias(params=kwargs, param='progress_bar', alias=['progress', 'pbar'], default=True) + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/expt/common.py:82:4 +81 return num_samples_per_label +82 assert isinstance(num_samples_per_label, int) +83 num_samples_per_label: Dict[str, conint(ge=1)] = { + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/expt/common.py:87:4 +86 } +87 assert isinstance(num_samples_per_label, dict) +88 return num_samples_per_label + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/expt/common.py:210:12 +209 else: +210 assert batch_size >= 4 +211 ## For smaller models like TinyBERT, vary the batch size steps. + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/expt/common.py:538:8 +537 icl_and_prompt_template_dict: Dict[str, str] = ICL_AND_PROMPT_TEMPLATE_DICT[(self, expt)] +538 assert 'icl_template' in icl_and_prompt_template_dict +539 assert 'prompt_template' in icl_and_prompt_template_dict + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/expt/common.py:539:8 +538 assert 'icl_template' in icl_and_prompt_template_dict +539 assert 'prompt_template' in icl_and_prompt_template_dict +540 assert 'claude_replacements' in icl_and_prompt_template_dict + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/expt/common.py:540:8 +539 assert 'prompt_template' in icl_and_prompt_template_dict +540 assert 'claude_replacements' in icl_and_prompt_template_dict +541 icl_template: str = icl_and_prompt_template_dict['icl_template'] + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/expt/common.py:546:16 +545 for repl in as_list(claude_replacements): +546 assert icl_template.find(repl[0]) >= 0 +547 icl_template: str = icl_template.replace( + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/expt/common.py:551:16 +550 ) +551 assert prompt_template.find(repl[0]) >= 0 +552 prompt_template: str = prompt_template.replace( + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/expt/common.py:556:8 +555 ) +556 assert '{{icl[example_text]}}' in icl_template +557 assert '{{icl_examples}}' in prompt_template + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/expt/common.py:557:8 +556 assert '{{icl[example_text]}}' in icl_template +557 assert '{{icl_examples}}' in prompt_template +558 if expt is Experiment.SynthesizRR: + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/expt/common.py:559:12 +558 if expt is Experiment.SynthesizRR: +559 assert '{{icl[retrieved_context]}}' in icl_template +560 assert '{{retrieved_context}}' in prompt_template + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/expt/common.py:560:12 +559 assert '{{icl[retrieved_context]}}' in icl_template +560 assert '{{retrieved_context}}' in prompt_template +561 return dict( + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/expt/common.py:1129:8 +1128 sentence_end_token_id: int = tokenizer.get_vocab()[sentence_end] +1129 assert sentence_end == tokenizer.decode(sentence_end_token_id) +1130 token_ids: List[int] = tokenizer.encode(text, add_special_tokens=False) + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/expt/common.py:1269:8 +1268 from synthesizrr.base.metric.classification_metrics import DatasetCartography +1269 assert isinstance(metric, TextGenerationStudent) +1270 if str_normalize(metric.params.algorithm) == str_normalize('pytorch'): + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/expt/common.py:1280:12 +1279 student_metrics: Metrics = metric.params.metrics +1280 assert isinstance(student_metrics, Metrics) +1281 for _train_student_metric in student_metrics[DataSplit.TRAIN]: + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/expt/common.py:1466:12 +1465 if student_hpo_validation_set == 'seed': +1466 assert val_set is not None +1467 validation_dataset: Dataset = val_set + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/expt/common.py:1476:12 +1475 validation_dataset: Optional[Dataset] = None +1476 assert val_frac is not None +1477 else: + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/expt/common.py:1675:4 +1674 replacement: Tuple[str, str] = ICL_AND_PROMPT_TEMPLATE_DICT[(dataset_name, expt)]['claude_replacements'][1] +1675 assert replacement[0] in { +1676 'News Article:', +1677 'Rewritten Article:', +1678 'Summary:', +1679 'Review:', +1680 'Product Question:', +1681 'Headline:', +1682 } +1683 if model_name.is_claude(): + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/expt/data.py:253:12 +252 for SynthesizRRDatasetSubclass in cls.subclasses(): +253 assert issubclass(SynthesizRRDatasetSubclass, SynthesizRRDataset) +254 SynthesizRRDatasetSubclass.setup() + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/expt/data.py:614:8 +613 reviews = reviews.query(f'product_category in {list(attrprompt_cats)}').reset_index(drop=True) +614 assert set(reviews['product_category']) == attrprompt_cats +615 assert reviews['unique_id'].nunique() == len(reviews) + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/expt/data.py:615:8 +614 assert set(reviews['product_category']) == attrprompt_cats +615 assert reviews['unique_id'].nunique() == len(reviews) +616 # reviews['product_category'].value_counts() + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/expt/driver.py:156:8 +155 if expt is Experiment.SynthesizRR: +156 assert corpus is not None +157 assert retriever is not None + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/expt/driver.py:157:8 +156 assert corpus is not None +157 assert retriever is not None +158 + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/expt/driver.py:160:8 +159 if expt is not Experiment.Gold: +160 assert model_name is not None +161 assert num_samples_per_label is not None + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/expt/driver.py:161:8 +160 assert model_name is not None +161 assert num_samples_per_label is not None +162 assert seed_type is not None + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/expt/driver.py:162:8 +161 assert num_samples_per_label is not None +162 assert seed_type is not None +163 + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/expt/driver.py:167:12 +166 llm_num_gpus: int = model_name.llm_resources_per_model().get('gpu', 0) +167 assert llm_num_gpus >= 0 +168 if llm_num_gpus > 0: + +-------------------------------------------------- +>> Issue: [B403:blacklist] Consider possible security implications associated with pickle module. + Severity: Low Confidence: High + CWE: CWE-502 (https://cwe.mitre.org/data/definitions/502.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/blacklists/blacklist_imports.html#b403-import-pickle + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/expt/generation.py:3:0 +2 from abc import ABC, abstractmethod +3 import types, time, traceback, pickle, gc, os, json, numpy as np, math +4 import pandas as pd + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/expt/generation.py:527:12 +526 check_isinstance(corpus_embeddings_dir, FileMetadata) +527 assert embedder_params is not None +528 assert embedder_ndim is not None + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/expt/generation.py:528:12 +527 assert embedder_params is not None +528 assert embedder_ndim is not None +529 ## Dense retriever: + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/expt/generation.py:753:8 +752 ) -> Tuple[ClassificationData, TextInputs]: +753 assert len(retr_icl_distance_range) == 2 +754 assert len(synthesizrr_distance_range) == 2 + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/expt/generation.py:754:8 +753 assert len(retr_icl_distance_range) == 2 +754 assert len(synthesizrr_distance_range) == 2 +755 assert len(retr_icl_token_range) == 2 + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/expt/generation.py:755:8 +754 assert len(synthesizrr_distance_range) == 2 +755 assert len(retr_icl_token_range) == 2 +756 + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/expt/generation.py:758:12 +757 if retriever is Retriever.Random: +758 assert icl_type in {'curated', 'seed'} +759 + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/expt/generation.py:901:8 +900 tokenizer: Any = model_name.tokenizer() +901 assert ex[label_col] == label_text +902 added_to_icl_dataset: bool = False + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/expt/generation.py:939:12 +938 +939 assert ex.get(distance_metric_top_k_col(top_k=top_k)) is not None +940 assert ex.get(distance_top_k_col(top_k=top_k)) is not None + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/expt/generation.py:940:12 +939 assert ex.get(distance_metric_top_k_col(top_k=top_k)) is not None +940 assert ex.get(distance_top_k_col(top_k=top_k)) is not None +941 if icl_type == 'retrieved': + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/expt/generation.py:1511:8 +1510 ) +1511 assert isinstance(text_gens, TextGenerationsPredictionsBase) +1512 self.info( + +-------------------------------------------------- +>> Issue: [B403:blacklist] Consider possible security implications associated with pickle module. + Severity: Low Confidence: High + CWE: CWE-502 (https://cwe.mitre.org/data/definitions/502.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/blacklists/blacklist_imports.html#b403-import-pickle + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/expt/metrics.py:3:0 +2 from abc import ABC, abstractmethod +3 import types, time, traceback, pickle, gc, os, json, numpy as np, math +4 import pandas as pd + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/expt/metrics.py:85:8 +84 ) -> TextGenerationsPredictionsBase: +85 assert text_gens_parser is not None +86 text_gens_data: List[Dict] = [] + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/expt/metrics.py:132:8 +131 text_gens_expanded_with_refs.data_schema.features_schema[references_col] = MLType.TEXT +132 assert isinstance(text_gens_expanded_with_refs, TextGenerationsPredictionsBase) +133 + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/expt/metrics.py:286:20 +285 ## Apply filters: +286 assert len(df_filters) > 0 +287 return cart_df.query(' and '.join(df_filters)).reset_index(drop=True) + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/expt/metrics.py:518:8 +517 metrics_labels_to_evaluate.extend(list(label_verbalizer.keys())) +518 assert len(metrics_labels_to_evaluate) > 0 +519 self.info(f'Evaluating labels: {metrics_labels_to_evaluate}') + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/expt/metrics.py:1251:12 +1250 else: +1251 assert label_text in label_verbalizer +1252 assert label_text in dataset_name.label_verbalizer() + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/expt/metrics.py:1252:12 +1251 assert label_text in label_verbalizer +1252 assert label_text in dataset_name.label_verbalizer() +1253 if label_verbalizer[label_text] != dataset_name.label_verbalizer()[label_text]: + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/expt/metrics.py:1625:12 +1624 else: +1625 assert label_text in label_verbalizer +1626 assert label_text in dataset_name.label_verbalizer() + +-------------------------------------------------- +>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. + Severity: Low Confidence: High + CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html) + More Info: https://bandit.readthedocs.io/en/1.7.8/plugins/b101_assert_used.html + Location: /Users/adivekar/workplace/synthesizrr/src/synthesizrr/expt/metrics.py:1626:12 +1625 assert label_text in label_verbalizer +1626 assert label_text in dataset_name.label_verbalizer() +1627 if label_verbalizer[label_text] != dataset_name.label_verbalizer()[label_text]: + +-------------------------------------------------- + +Code scanned: + Total lines of code: 43248 + Total lines skipped (#nosec): 0 + Total potential issues skipped due to specifically being disabled (e.g., #nosec BXXX): 0 + +Run metrics: + Total issues (by severity): + Undefined: 0 + Low: 287 + Medium: 10 + High: 0 + Total issues (by confidence): + Undefined: 0 + Low: 4 + Medium: 0 + High: 293 +Files skipped (0): diff --git a/requirements.txt b/requirements.txt index c2721b1..a27175b 100644 --- a/requirements.txt +++ b/requirements.txt @@ -6,7 +6,7 @@ aimrecords==0.0.7 aimrocks==0.4.0 aiobotocore==2.13.0 aiofiles==23.2.1 -aiohttp==3.9.5 +aiohttp==3.10.2 aiohttp-cors==0.7.0 aioitertools==0.11.0 aiorwlock==1.4.0 @@ -33,7 +33,7 @@ boto3==1.34.106 botocore==1.34.106 brotli==1.1.0 cachetools==5.3.3 -certifi==2024.6.2 +certifi==2024.7.4 cffi==1.16.0 charset-normalizer==3.3.2 click==8.1.7 @@ -137,7 +137,7 @@ nbformat==5.10.4 nest-asyncio==1.6.0 networkx==3.3 ninja==1.11.1.1 -nltk==3.8.1 +nltk==3.8.2 notebook==7.2.0 notebook-shim==0.2.4 numpy==1.26.4 @@ -221,7 +221,7 @@ seaborn==0.13.2 send2trash==1.8.3 sentence-transformers==3.0.0 sentencepiece==0.2.0 -sentry-sdk==2.4.0 +sentry-sdk==2.8.0 setproctitle==1.3.3 setuptools==70.0.0 six==1.16.0 @@ -234,7 +234,7 @@ sqlalchemy==2.0.30 stack-data==0.6.3 starlette==0.36.2 statsmodels==0.14.2 -streamlit==1.35.0 +streamlit==1.37.0 sympy==1.12.1 tabulate==0.9.0 tblib==3.0.0