added stringdate 2024-11-18 17:59:49 2024-11-19 03:44:43 | created int64 126B 2,086B | id stringlengths 40 40 | int_score int64 2 5 | metadata dict | score float64 2.31 5.41 | source stringclasses 1
value | text stringlengths 259 26.9k | num_lines int64 16 649 | avg_line_length float64 15 61 | max_line_length int64 31 179 | ast_depth int64 8 40 | length int64 101 3.8k | lang stringclasses 1
value | sast_semgrep_findings stringlengths 1.17k 878k | sast_semgrep_findings_count int64 1 629 | sast_semgrep_success bool 1
class | sast_semgrep_error stringclasses 1
value | cwe_ids listlengths 1 561 | rule_ids listlengths 1 561 | subcategories listlengths 1 561 | confidences listlengths 1 561 | severities listlengths 1 561 | line_starts listlengths 1 561 | line_ends listlengths 1 561 | column_starts listlengths 1 561 | column_ends listlengths 1 561 | owasp_categories listlengths 1 561 | messages listlengths 1 561 | cvss_scores listlengths 1 561 | likelihoods listlengths 1 561 | impacts listlengths 1 561 | filename stringlengths 4 105 | path stringlengths 5 372 | repo_name stringlengths 5 115 | license stringclasses 452
values |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
2024-11-19T02:17:13.147910+00:00 | 1,615,836,704,000 | 5d817c826140e95131c114cfca47d3831d7b03f2 | 2 | {
"blob_id": "5d817c826140e95131c114cfca47d3831d7b03f2",
"branch_name": "refs/heads/main",
"committer_date": 1615836704000,
"content_id": "22db5b2708d29f36b7fa99550a2ea0c819ede93a",
"detected_licenses": [
"MIT"
],
"directory_id": "6540512c187659129bb371e60a48fe04368af88b",
"extension": "py",
"file... | 2.421875 | stackv2 | import logging
import os
from datetime import datetime
import click
from . import __version__
from .console import console
from .download import download_data_from_ogimet
from .exceptions import MonthError, YearError
from .logger import logger
def print_version(ctx, param, value):
if not value or ctx.resilient_... | 85 | 27.41 | 88 | 15 | 632 | python | [{"finding_id": "semgrep_rules.python.lang.best-practice.pass-body-fn_4158b4827d3b9481_9c383c3d", "tool_name": "semgrep", "rule_id": "rules.python.lang.best-practice.pass-body-fn", "finding_type": "best-practice", "severity": "medium", "confidence": "medium", "message": "`pass` is the body of function taf_ver. Consider... | 4 | true | [
""
] | [
"rules.python.lang.best-practice.pass-body-fn"
] | [
"best-practice"
] | [
"MEDIUM"
] | [
"MEDIUM"
] | [
21
] | [
26
] | [
1
] | [
9
] | [
""
] | [
"`pass` is the body of function taf_ver. Consider removing this or raise NotImplementedError() if this is a TODO"
] | [
5
] | [
""
] | [
""
] | __main__.py | /tafver_metars/__main__.py | diego-garro/tafver-metars | MIT | |
2024-11-19T02:17:17.239001+00:00 | 1,473,129,020,000 | 35996df6878c4bb0e3067091985b675c2551e1cc | 3 | {
"blob_id": "35996df6878c4bb0e3067091985b675c2551e1cc",
"branch_name": "refs/heads/master",
"committer_date": 1473129020000,
"content_id": "1db632f3ea860c8ed8083a0c5dd8e9ceb3d17b8a",
"detected_licenses": [
"MIT"
],
"directory_id": "972f0cd0b7e9fe9aaa0fd617cf627956c547d5e6",
"extension": "py",
"fi... | 2.75 | stackv2 | from i3pystatus.core.util import internet, require
from i3pystatus.weather import Backend
from datetime import datetime
from urllib.request import urlopen
import re
import xml.etree.ElementTree as ElementTree
WEATHER_COM_URL = \
'http://wxdata.weather.com/wxdata/weather/local/%s?unit=%s&dayf=1&cc=*'
ON_LEFTCLICK_... | 138 | 38.37 | 79 | 18 | 1,267 | python | [{"finding_id": "semgrep_rules.python.lang.security.use-defused-xml_10bd2b2716355705_9619116f", "tool_name": "semgrep", "rule_id": "rules.python.lang.security.use-defused-xml", "finding_type": "security", "severity": "high", "confidence": "low", "message": "The Python documentation recommends using `defusedxml` instead... | 2 | true | [
"CWE-611"
] | [
"rules.python.lang.security.use-defused-xml"
] | [
"security"
] | [
"LOW"
] | [
"HIGH"
] | [
7
] | [
7
] | [
1
] | [
44
] | [
"A04:2017 - XML External Entities (XXE)"
] | [
"The Python documentation recommends using `defusedxml` instead of `xml` because the native Python `xml` library is vulnerable to XML External Entity (XXE) attacks. These attacks can leak confidential data and \"XML bombs\" can cause denial of service."
] | [
7.5
] | [
"LOW"
] | [
"MEDIUM"
] | weathercom.py | /i3pystatus/weather/weathercom.py | Frechdachs/i3pystatus | MIT | |
2024-11-19T02:17:18.370355+00:00 | 1,565,379,761,000 | 7a371ca22b15b924dc2b3d6974895143275c6789 | 2 | {
"blob_id": "7a371ca22b15b924dc2b3d6974895143275c6789",
"branch_name": "refs/heads/master",
"committer_date": 1565379761000,
"content_id": "d2ccdad6c96c4a47b1ea4bc5b533dd9285d7115d",
"detected_licenses": [
"Apache-2.0"
],
"directory_id": "cab706505e5267575fcbae653dbca7f3254641f6",
"extension": "py"... | 2.34375 | stackv2 | #!/usr/bin/python
# -*- coding: utf-8 -*-
import sys
import time
from os.path import dirname, abspath
sys.path.append(dirname(dirname(dirname(dirname(abspath(__file__))))))
reload(sys)
sys.setdefaultencoding('utf-8')
import rospy
from std_msgs.msg import String
from EmeraldAI.Logic.SpeechProcessing.Google import Goog... | 100 | 28.07 | 98 | 16 | 705 | python | [{"finding_id": "semgrep_rules.python.lang.correctness.common-mistakes.string-is-comparison_05724cb85b5b0fee_e31fc691", "tool_name": "semgrep", "rule_id": "rules.python.lang.correctness.common-mistakes.string-is-comparison", "finding_type": "correctness", "severity": "high", "confidence": "medium", "message": "Found st... | 2 | true | [
""
] | [
"rules.python.lang.correctness.common-mistakes.string-is-comparison"
] | [
"correctness"
] | [
"MEDIUM"
] | [
"HIGH"
] | [
27
] | [
27
] | [
7
] | [
34
] | [
""
] | [
"Found string comparison using 'is' operator. The 'is' operator is for reference equality, not value equality, and therefore should not be used to compare strings. For more information, see https://github.com/satwikkansal/wtfpython#-how-not-to-use-is-operator\""
] | [
7.5
] | [
""
] | [
""
] | STT.py | /EmeraldAI/Application/IO/STT.py | MaxMorgenstern/EmeraldAI | Apache-2.0 | |
2024-11-19T02:17:20.174350+00:00 | 1,407,788,004,000 | faae35711707da818bea4e3e0e64d6fd47d9f9f9 | 3 | {
"blob_id": "faae35711707da818bea4e3e0e64d6fd47d9f9f9",
"branch_name": "refs/heads/master",
"committer_date": 1407788004000,
"content_id": "25bbc1a1c5cef03691dc8d5a455b0760b607554b",
"detected_licenses": [
"MIT"
],
"directory_id": "79fca39fda40f86fdb48751716e16147e54fb64d",
"extension": "py",
"fi... | 2.703125 | stackv2 | #!/usr/bin/env python
from flask import current_app, Flask, request
from subprocess import Popen
import argparse
import logging
import sys
def create_app(commands_file, log_file=None):
""" Create the WSGI app and load configuration from file.
Logging to log_file and sysout.
"""
app = Flask('remosh')... | 71 | 32.8 | 92 | 17 | 549 | python | [{"finding_id": "semgrep_rules.python.lang.best-practice.unspecified-open-encoding_5d18c0a49bbee42f_790c9fb0", "tool_name": "semgrep", "rule_id": "rules.python.lang.best-practice.unspecified-open-encoding", "finding_type": "best-practice", "severity": "medium", "confidence": "medium", "message": "Missing 'encoding' par... | 8 | true | [
"CWE-78",
"CWE-78",
"CWE-78",
"CWE-78"
] | [
"rules.python.flask.security.injection.subprocess-injection",
"rules.python.lang.security.audit.dangerous-subprocess-use-audit",
"rules.python.lang.security.dangerous-subprocess-use",
"rules.python.lang.security.audit.subprocess-shell-true"
] | [
"security",
"security",
"security",
"security"
] | [
"HIGH",
"LOW",
"MEDIUM",
"MEDIUM"
] | [
"HIGH",
"HIGH",
"HIGH",
"HIGH"
] | [
40,
40,
40,
40
] | [
40,
40,
40,
40
] | [
9,
9,
15,
30
] | [
93,
93,
22,
34
] | [
"A01:2017 - Injection",
"A01:2017 - Injection",
"A01:2017 - Injection",
"A01:2017 - Injection"
] | [
"Detected user input entering a `subprocess` call unsafely. This could result in a command injection vulnerability. An attacker could use this vulnerability to execute arbitrary commands on the host, which allows them to download malware, scan sensitive data, or run any command they wish on the server. Do not let u... | [
7.5,
7.5,
7.5,
7.5
] | [
"HIGH",
"LOW",
"MEDIUM",
"HIGH"
] | [
"MEDIUM",
"HIGH",
"HIGH",
"LOW"
] | remosh.py | /remosh.py | thusoy/remosh | MIT | |
2024-11-19T02:17:20.832360+00:00 | 1,604,066,380,000 | 602589998877699c0491efb7f228eff602b8d7c5 | 4 | {
"blob_id": "602589998877699c0491efb7f228eff602b8d7c5",
"branch_name": "refs/heads/master",
"committer_date": 1604066380000,
"content_id": "d7f0c8e5ee74b63a78ecf8b7fc52b2aa9d9a8272",
"detected_licenses": [
"MIT",
"Python-2.0"
],
"directory_id": "45ac8de1df3edcfe366639416d8bc7764d5c10c4",
"exten... | 3.5 | stackv2 | #import Gui Package and libraries
import tkinter.font
from tkinter import *
import math
def clearall():
'''Clear function toclear the screen
and reset all variables'''
global expression
global equation
global value
global ans
expression=''
value=''
ans=''
equation.set... | 280 | 28.98 | 142 | 18 | 2,449 | python | [{"finding_id": "semgrep_rules.python.lang.security.audit.eval-detected_8e1450c81247c82d_60eb1e6a", "tool_name": "semgrep", "rule_id": "rules.python.lang.security.audit.eval-detected", "finding_type": "security", "severity": "medium", "confidence": "low", "message": "Detected the use of eval(). eval() can be dangerous ... | 16 | true | [
"CWE-95",
"CWE-95",
"CWE-95",
"CWE-95",
"CWE-95",
"CWE-95",
"CWE-95",
"",
"",
"",
"",
"",
"",
"",
"",
""
] | [
"rules.python.lang.security.audit.eval-detected",
"rules.python.lang.security.audit.eval-detected",
"rules.python.lang.security.audit.eval-detected",
"rules.python.lang.security.audit.eval-detected",
"rules.python.lang.security.audit.eval-detected",
"rules.python.lang.security.audit.eval-detected",
"rul... | [
"security",
"security",
"security",
"security",
"security",
"security",
"security",
"maintainability",
"maintainability",
"maintainability",
"maintainability",
"maintainability",
"maintainability",
"maintainability",
"maintainability",
"maintainability"
] | [
"LOW",
"LOW",
"LOW",
"LOW",
"LOW",
"LOW",
"LOW",
"MEDIUM",
"MEDIUM",
"MEDIUM",
"MEDIUM",
"MEDIUM",
"MEDIUM",
"MEDIUM",
"MEDIUM",
"MEDIUM"
] | [
"MEDIUM",
"MEDIUM",
"MEDIUM",
"MEDIUM",
"MEDIUM",
"MEDIUM",
"MEDIUM",
"MEDIUM",
"MEDIUM",
"MEDIUM",
"MEDIUM",
"MEDIUM",
"MEDIUM",
"MEDIUM",
"MEDIUM",
"MEDIUM"
] | [
101,
118,
131,
135,
139,
146,
150,
232,
240,
242,
248,
250,
252,
254,
256,
266
] | [
101,
118,
131,
135,
139,
146,
150,
232,
240,
242,
248,
250,
252,
254,
256,
266
] | [
19,
23,
23,
23,
23,
23,
23,
62,
31,
31,
31,
31,
31,
31,
31,
51
] | [
30,
34,
34,
34,
34,
34,
34,
73,
42,
45,
44,
44,
44,
44,
44,
62
] | [
"A03:2021 - Injection",
"A03:2021 - Injection",
"A03:2021 - Injection",
"A03:2021 - Injection",
"A03:2021 - Injection",
"A03:2021 - Injection",
"A03:2021 - Injection",
"",
"",
"",
"",
"",
"",
"",
"",
""
] | [
"Detected the use of eval(). eval() can be dangerous if used to evaluate dynamic content. If this content can be input from outside the program, this may be a code injection vulnerability. Ensure evaluated content is not definable by external sources.",
"Detected the use of eval(). eval() can be dangerous if used... | [
5,
5,
5,
5,
5,
5,
5,
5,
5,
5,
5,
5,
5,
5,
5,
5
] | [
"LOW",
"LOW",
"LOW",
"LOW",
"LOW",
"LOW",
"LOW",
"",
"",
"",
"",
"",
"",
"",
"",
""
] | [
"HIGH",
"HIGH",
"HIGH",
"HIGH",
"HIGH",
"HIGH",
"HIGH",
"",
"",
"",
"",
"",
"",
"",
"",
""
] | Scientific_Calculator.py | /Scripts/Miscellaneous/Scientific_Calculator_GUI/Scientific_Calculator.py | valterm/Python_and_the_Web | MIT,Python-2.0 | |
2024-11-19T02:17:20.935793+00:00 | 1,691,469,499,000 | f8ab4b9aadac1c8b32c05a9efa1c75c7633a003d | 2 | {
"blob_id": "f8ab4b9aadac1c8b32c05a9efa1c75c7633a003d",
"branch_name": "refs/heads/master",
"committer_date": 1691469499000,
"content_id": "94dd6cada6cd2a1fc4d3e24b91f6138bd6a53531",
"detected_licenses": [
"Apache-2.0"
],
"directory_id": "e730078c4838c1417d8af093c741f641a88bb52f",
"extension": "py"... | 2.328125 | stackv2 | from exchangelib import Mailbox, Message
def folder_to_dict(folder):
return {
'id': folder.folder_id,
'name': folder.name,
'class': folder.folder_class,
'total_count': folder.total_count,
'child_folder_count': folder.child_folder_count,
'unread_count': folder.unread... | 50 | 39.34 | 100 | 16 | 436 | python | [{"finding_id": "semgrep_rules.python.lang.maintainability.is-function-without-parentheses_565287af42a14b4a_b1151583", "tool_name": "semgrep", "rule_id": "rules.python.lang.maintainability.is-function-without-parentheses", "finding_type": "maintainability", "severity": "medium", "confidence": "medium", "message": "Is \... | 1 | true | [
""
] | [
"rules.python.lang.maintainability.is-function-without-parentheses"
] | [
"maintainability"
] | [
"MEDIUM"
] | [
"MEDIUM"
] | [
27
] | [
27
] | [
21
] | [
34
] | [
""
] | [
"Is \"is_draft\" a function or an attribute? If it is a function, you may have meant item.is_draft() because item.is_draft is always true."
] | [
5
] | [
""
] | [
""
] | __init__.py | /actions/base/__init__.py | StackStorm-Exchange/stackstorm-msexchange | Apache-2.0 | |
2024-11-19T02:17:22.457255+00:00 | 1,656,697,725,000 | c8d636bfeff279f5da45230ae5396cdafc9d8430 | 2 | {
"blob_id": "c8d636bfeff279f5da45230ae5396cdafc9d8430",
"branch_name": "refs/heads/master",
"committer_date": 1656697725000,
"content_id": "10319a7706824587358eba5b86338ed9c5486776",
"detected_licenses": [
"MIT"
],
"directory_id": "025ec7e012d74fd7af02cec8c892fe62310ed76a",
"extension": "py",
"fi... | 2.40625 | stackv2 | import json
import requests
import sys
import time
from urllib.parse import unquote
def whereis(event, context):
requests.packages.urllib3.disable_warnings()
print(event)
print(context)
slackstring = event['body']
slackstringdict = dict(item.split("=") for item in slackstring.split("&"))
ur... | 68 | 29.9 | 141 | 19 | 531 | python | [{"finding_id": "semgrep_rules.python.requests.best-practice.use-raise-for-status_d8736f3d7680097d_34fd9e00", "tool_name": "semgrep", "rule_id": "rules.python.requests.best-practice.use-raise-for-status", "finding_type": "best-practice", "severity": "medium", "confidence": "medium", "message": "There's an HTTP request ... | 6 | true | [
"CWE-295",
"CWE-295"
] | [
"rules.python.requests.security.disabled-cert-validation",
"rules.python.requests.security.disabled-cert-validation"
] | [
"security",
"security"
] | [
"LOW",
"LOW"
] | [
"HIGH",
"HIGH"
] | [
19,
33
] | [
19,
33
] | [
12,
12
] | [
76,
76
] | [
"A03:2017 - Sensitive Data Exposure",
"A03:2017 - Sensitive Data Exposure"
] | [
"Certificate verification has been explicitly disabled. This permits insecure connections to insecure servers. Re-enable certification validation.",
"Certificate verification has been explicitly disabled. This permits insecure connections to insecure servers. Re-enable certification validation."
] | [
7.5,
7.5
] | [
"LOW",
"LOW"
] | [
"LOW",
"LOW"
] | handler.py | /handler.py | LewisLebentz/WhereIs | MIT | |
2024-11-19T02:17:23.722124+00:00 | 1,521,247,051,000 | 56875603201024875d9e86847169a5d93fa177e0 | 3 | {
"blob_id": "56875603201024875d9e86847169a5d93fa177e0",
"branch_name": "refs/heads/master",
"committer_date": 1521247051000,
"content_id": "292e0ea167fca2fe5fed12d8b443be304e663091",
"detected_licenses": [
"MIT"
],
"directory_id": "d85ab2164228212b95917a341f1b464e29f4aa8f",
"extension": "py",
"fi... | 2.546875 | stackv2 | from flask import Flask, request, Response
from flask_mqtt import Mqtt, MQTT_LOG_ERR
from flask_migrate import Migrate
from flask_sslify import SSLify
from flask_cors import CORS
from functools import wraps
from app.models import *
from urllib.parse import urlparse
import os
import random
app = Flask(__name__)
CORS(a... | 121 | 31.26 | 113 | 17 | 932 | python | [{"finding_id": "semgrep_rules.python.lang.correctness.common-mistakes.string-is-comparison_c3aad6e12569fc80_7729afff", "tool_name": "semgrep", "rule_id": "rules.python.lang.correctness.common-mistakes.string-is-comparison", "finding_type": "correctness", "severity": "high", "confidence": "medium", "message": "Found st... | 5 | true | [
"",
"",
"CWE-79"
] | [
"rules.python.lang.correctness.common-mistakes.string-is-comparison",
"rules.python.lang.correctness.common-mistakes.string-is-comparison",
"rules.python.flask.security.audit.directly-returned-format-string"
] | [
"correctness",
"correctness",
"security"
] | [
"MEDIUM",
"MEDIUM",
"MEDIUM"
] | [
"HIGH",
"HIGH",
"MEDIUM"
] | [
17,
41,
73
] | [
17,
41,
73
] | [
4,
8,
5
] | [
37,
30,
79
] | [
"",
"",
"A07:2017 - Cross-Site Scripting (XSS)"
] | [
"Found string comparison using 'is' operator. The 'is' operator is for reference equality, not value equality, and therefore should not be used to compare strings. For more information, see https://github.com/satwikkansal/wtfpython#-how-not-to-use-is-operator\"",
"Found string comparison using 'is' operator. The ... | [
7.5,
7.5,
5
] | [
"",
"",
"HIGH"
] | [
"",
"",
"MEDIUM"
] | __init__.py | /app/__init__.py | jaredbriskman/BabyHarvesterGateway | MIT | |
2024-11-19T02:17:29.105213+00:00 | 1,692,217,536,000 | b373d036238d20de2c63031683d6c769c55d648f | 2 | {
"blob_id": "b373d036238d20de2c63031683d6c769c55d648f",
"branch_name": "refs/heads/master",
"committer_date": 1692217536000,
"content_id": "75e0724d5292967071c2b1ae0b0c685614f80e35",
"detected_licenses": [
"BSD-3-Clause"
],
"directory_id": "bd1acdd042a0db557e80520556f3f38576323e17",
"extension": "p... | 2.453125 | stackv2 | from datetime import date
from cms.models import CMSPlugin
from django.db import models
from django.utils.functional import cached_property
from django.utils.translation import gettext_lazy as _
from ..utils import comma_separated
from .startend import StartEndMixin
from .utils import change_year
class SchoolYearMa... | 146 | 33.22 | 116 | 17 | 1,077 | python | [{"finding_id": "semgrep_rules.python.django.correctness.nontext-field-must-set-null-true_b5f811c8094b23a1_6a83af76", "tool_name": "semgrep", "rule_id": "rules.python.django.correctness.nontext-field-must-set-null-true", "finding_type": "correctness", "severity": "high", "confidence": "medium", "message": "null=True sh... | 1 | true | [
""
] | [
"rules.python.django.correctness.nontext-field-must-set-null-true"
] | [
"correctness"
] | [
"MEDIUM"
] | [
"HIGH"
] | [
115
] | [
115
] | [
5
] | [
67
] | [
""
] | [
"null=True should be set if blank=True is set on non-text fields."
] | [
7.5
] | [
""
] | [
""
] | schoolyear.py | /leprikon/models/schoolyear.py | leprikon-cz/leprikon | BSD-3-Clause | |
2024-11-19T02:17:30.304410+00:00 | 1,628,573,742,000 | 36d69cbf67e040269fdf83a10fe0b4a5ff25c03b | 2 | {
"blob_id": "36d69cbf67e040269fdf83a10fe0b4a5ff25c03b",
"branch_name": "refs/heads/master",
"committer_date": 1628573742000,
"content_id": "d59b1164ec0e378e70b451b6c0564816ecfcf6ca",
"detected_licenses": [
"MIT"
],
"directory_id": "6fa554aff1f9507eca282ebd1352fb6689ad4842",
"extension": "py",
"fi... | 2.421875 | stackv2 | # -*- coding: utf-8 -*-
"""
photolog
~~~~~~~~
photolog 패키지 초기화 모듈.
photolog에 대한 flask 어플리케이션을 생성함.
config, blueprint, session, DB연결 등을 초기화함.
:copyright: (c) 2013-2016 by 4mba.
:license: MIT LICENSE 2.0, see license for more details.
"""
import os
from flask import Flask, render_template,... | 93 | 33.05 | 72 | 11 | 855 | python | [{"finding_id": "semgrep_rules.python.lang.security.audit.eval-detected_a7e906c6228af9fe_9a56bcfb", "tool_name": "semgrep", "rule_id": "rules.python.lang.security.audit.eval-detected", "finding_type": "security", "severity": "medium", "confidence": "low", "message": "Detected the use of eval(). eval() can be dangerous ... | 1 | true | [
"CWE-95"
] | [
"rules.python.lang.security.audit.eval-detected"
] | [
"security"
] | [
"LOW"
] | [
"MEDIUM"
] | [
64
] | [
64
] | [
28
] | [
68
] | [
"A03:2021 - Injection"
] | [
"Detected the use of eval(). eval() can be dangerous if used to evaluate dynamic content. If this content can be input from outside the program, this may be a code injection vulnerability. Ensure evaluated content is not definable by external sources."
] | [
5
] | [
"LOW"
] | [
"HIGH"
] | __init__.py | /ch05/photolog/photolog/__init__.py | wikibook/flask | MIT | |
2024-11-19T02:17:30.408582+00:00 | 1,556,878,290,000 | 928d5b80d8856be76150343d1f255f58a93d27af | 3 | {
"blob_id": "928d5b80d8856be76150343d1f255f58a93d27af",
"branch_name": "refs/heads/master",
"committer_date": 1556878290000,
"content_id": "531a4a4f710672e9d76dadfd3d85189cbb964c33",
"detected_licenses": [
"Apache-2.0"
],
"directory_id": "3d4085e97301b13ed69914b4ecc3db74febcac05",
"extension": "py"... | 3.171875 | stackv2 | class Solve():
def __init__(self, InitSolvedSide):
self.InitSolvedSide = InitSolvedSide
self.InitSolvedSide = 'W'
self.OppositeInitSolvedSide = InvertInitSolvedSide()
def FindPositionPiece(ColourToFind):
"""split cubes into grouped blocks and return position and wether it is a middle or corner piece"""
#r... | 87 | 27.4 | 107 | 16 | 777 | python | [{"finding_id": "semgrep_rules.python.lang.maintainability.useless-literal_3bc01b2a85d45226_2a55559c", "tool_name": "semgrep", "rule_id": "rules.python.lang.maintainability.useless-literal", "finding_type": "maintainability", "severity": "medium", "confidence": "medium", "message": "key `'R'` is uselessly assigned twic... | 42 | true | [
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
""
] | [
"rules.python.lang.maintainability.useless-literal",
"rules.python.lang.maintainability.useless-literal",
"rules.python.lang.maintainability.useless-literal",
"rules.python.lang.maintainability.useless-literal",
"rules.python.lang.maintainability.useless-literal",
"rules.python.lang.maintainability.useles... | [
"maintainability",
"maintainability",
"maintainability",
"maintainability",
"maintainability",
"maintainability",
"maintainability",
"maintainability",
"maintainability",
"maintainability",
"maintainability",
"maintainability",
"maintainability",
"maintainability",
"maintainability",
"... | [
"MEDIUM",
"MEDIUM",
"MEDIUM",
"MEDIUM",
"MEDIUM",
"MEDIUM",
"MEDIUM",
"MEDIUM",
"MEDIUM",
"MEDIUM",
"MEDIUM",
"MEDIUM",
"MEDIUM",
"MEDIUM",
"MEDIUM",
"MEDIUM",
"MEDIUM",
"MEDIUM",
"MEDIUM",
"MEDIUM",
"MEDIUM",
"MEDIUM",
"MEDIUM",
"MEDIUM",
"MEDIUM",
"MEDIUM",
"MED... | [
"MEDIUM",
"MEDIUM",
"MEDIUM",
"MEDIUM",
"MEDIUM",
"MEDIUM",
"MEDIUM",
"MEDIUM",
"MEDIUM",
"MEDIUM",
"MEDIUM",
"MEDIUM",
"MEDIUM",
"MEDIUM",
"MEDIUM",
"MEDIUM",
"MEDIUM",
"MEDIUM",
"MEDIUM",
"MEDIUM",
"MEDIUM",
"MEDIUM",
"MEDIUM",
"MEDIUM",
"MEDIUM",
"MEDIUM",
"MED... | [
68,
68,
68,
68,
70,
70,
70,
70,
70,
70,
70,
70,
72,
72,
72,
72,
72,
72,
72,
72,
74,
74,
74,
74,
74,
74,
76,
76,
76,
76,
76,
76,
76,
76,
78,
78,
78,
78,
78,
78,
78,
78
] | [
68,
68,
68,
68,
70,
70,
70,
70,
70,
70,
70,
70,
72,
72,
72,
72,
72,
72,
72,
72,
74,
74,
74,
74,
74,
74,
76,
76,
76,
76,
76,
76,
76,
76,
78,
78,
78,
78,
78,
78,
78,
78
] | [
26,
35,
44,
53,
36,
45,
54,
63,
72,
81,
90,
99,
37,
46,
55,
64,
73,
82,
91,
100,
34,
43,
51,
59,
67,
75,
31,
40,
49,
58,
67,
76,
85,
94,
38,
47,
55,
63,
71,
79,
87,
95
] | [
29,
38,
47,
56,
39,
48,
57,
66,
75,
84,
93,
102,
40,
49,
58,
67,
76,
85,
94,
103,
37,
46,
54,
62,
70,
78,
34,
43,
52,
61,
70,
79,
88,
97,
41,
50,
58,
66,
74,
82,
90,
98
] | [
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
""
] | [
"key `'R'` is uselessly assigned twice",
"key `'B'` is uselessly assigned twice",
"key `'R'` is uselessly assigned twice",
"key `'B'` is uselessly assigned twice",
"key `'T'` is uselessly assigned twice",
"key `'R'` is uselessly assigned twice",
"key `'T'` is uselessly assigned twice",
"key `'R'` is u... | [
5,
5,
5,
5,
5,
5,
5,
5,
5,
5,
5,
5,
5,
5,
5,
5,
5,
5,
5,
5,
5,
5,
5,
5,
5,
5,
5,
5,
5,
5,
5,
5,
5,
5,
5,
5,
5,
5,
5,
5,
5,
5
] | [
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
""
] | [
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
""
] | Solve.py | /Solve.py | Kitaarspeler/Rubiks-Cube | Apache-2.0 | |
2024-11-19T02:17:31.274700+00:00 | 1,562,682,137,000 | d7929aa31fdc5f68735aaaa2e824c80db22cf124 | 3 | {
"blob_id": "d7929aa31fdc5f68735aaaa2e824c80db22cf124",
"branch_name": "refs/heads/master",
"committer_date": 1562682137000,
"content_id": "5fbacca2eb55dfbbca84dabe3ffe652497c6b74e",
"detected_licenses": [
"MIT"
],
"directory_id": "9ac4b9328a66ffd84be730bcb52d437ad45c4e4e",
"extension": "py",
"fi... | 2.75 | stackv2 | import os
import json
import shutil
import logging
class CPSPop():
"""
functions: extract detailed population from worldpop dataset
"""
def __init__(self,tempDirectory="temp"):
"""
tempDirectory: location of directory to store generate tiff files for polygons
"""
if tem... | 124 | 38.61 | 106 | 17 | 1,129 | python | [{"finding_id": "semgrep_rules.python.lang.best-practice.unspecified-open-encoding_ead3cc4db5b7b999_e24b4a80", "tool_name": "semgrep", "rule_id": "rules.python.lang.best-practice.unspecified-open-encoding", "finding_type": "best-practice", "severity": "medium", "confidence": "medium", "message": "Missing 'encoding' par... | 3 | true | [
"CWE-78"
] | [
"rules.python.lang.security.audit.dangerous-system-call-audit"
] | [
"security"
] | [
"LOW"
] | [
"HIGH"
] | [
69
] | [
69
] | [
9
] | [
31
] | [
"A01:2017 - Injection"
] | [
"Found dynamic content used in a system call. This is dangerous if external data can reach this function call because it allows a malicious actor to execute commands. Use the 'subprocess' module instead, which is easier to use without accidentally exposing a command injection vulnerability."
] | [
7.5
] | [
"LOW"
] | [
"HIGH"
] | cpsraster.py | /cps/build/lib/cpssdk/cpsraster.py | GrandDuelist/cpssdk | MIT | |
2024-11-19T02:17:32.928330+00:00 | 1,650,790,504,000 | 50b42d92bf08a7c1e3152faa9c46b7701f22eb19 | 3 | {
"blob_id": "50b42d92bf08a7c1e3152faa9c46b7701f22eb19",
"branch_name": "refs/heads/master",
"committer_date": 1650790504000,
"content_id": "f95c7bf7bae91e6ef2aec54b99909cb5992a1b5d",
"detected_licenses": [
"MIT"
],
"directory_id": "4d2ea5408566ad355b96dfbc3035fc8b42cdc430",
"extension": "py",
"fi... | 2.8125 | stackv2 | import pandas as pd
from sklearn.model_selection import train_test_split
from sklearn.preprocessing import StandardScaler
from sklearn.neighbors import KNeighborsClassifier
from sklearn.metrics import accuracy_score
import matplotlib.pyplot as plt
from sklearn.model_selection import GridSearchCV
import numpy as np
all... | 55 | 36.85 | 142 | 12 | 492 | python | [{"finding_id": "semgrep_rules.python.lang.maintainability.return-not-in-function_a731b50d77cdbddd_91f0a375", "tool_name": "semgrep", "rule_id": "rules.python.lang.maintainability.return-not-in-function", "finding_type": "maintainability", "severity": "medium", "confidence": "medium", "message": "`return` only makes se... | 1 | true | [
""
] | [
"rules.python.lang.maintainability.return-not-in-function"
] | [
"maintainability"
] | [
"MEDIUM"
] | [
"MEDIUM"
] | [
47
] | [
47
] | [
27
] | [
47
] | [
""
] | [
"`return` only makes sense inside a function"
] | [
5
] | [
""
] | [
""
] | main.py | /main.py | tonitruif/Python | MIT | |
2024-11-19T02:17:32.982034+00:00 | 1,641,871,915,000 | 37d4c05d2987098cc4875eaa6c39d29441a40b10 | 4 | {
"blob_id": "37d4c05d2987098cc4875eaa6c39d29441a40b10",
"branch_name": "refs/heads/master",
"committer_date": 1641871915000,
"content_id": "5a8b749b9aeec40b4afe02867a59eb4ddb23bf18",
"detected_licenses": [
"MIT"
],
"directory_id": "5d1be09adb4843af71980a4b78f8b9e78536a172",
"extension": "py",
"fi... | 3.9375 | stackv2 | # Chapter04-01
# 파이썬 심화
# 시퀀스형
# 컨테이너(Container : 서로다른 자료형[list, tuple, collections.deque], Flat : 한 개의 자료형[str,bytes,bytearray,array.array, memoryview])
# 가변(list, bytearray, array.array, memoryview, deque) vs 불변(tuple, str, bytes)
# 리스트 및 튜플 고급
# 지능형 리스트(Comprehending Lists)
# Non Comprehending Lists
chars = '+_)(... | 97 | 16.96 | 122 | 10 | 655 | python | [{"finding_id": "semgrep_rules.python.lang.maintainability.return-not-in-function_ed2ed3c5edcb5c0a_a3fbbd50", "tool_name": "semgrep", "rule_id": "rules.python.lang.maintainability.return-not-in-function", "finding_type": "maintainability", "severity": "medium", "confidence": "medium", "message": "`return` only makes se... | 1 | true | [
""
] | [
"rules.python.lang.maintainability.return-not-in-function"
] | [
"maintainability"
] | [
"MEDIUM"
] | [
"MEDIUM"
] | [
24
] | [
24
] | [
37
] | [
43
] | [
""
] | [
"`return` only makes sense inside a function"
] | [
5
] | [
""
] | [
""
] | p_chapter04_01.py | /python/example/p_chapter04_01.py | groovallstar/test2 | MIT | |
2024-11-19T02:17:34.362517+00:00 | 1,527,215,899,000 | ae95cbcb0153002b582aea092b403826185e6ce8 | 2 | {
"blob_id": "ae95cbcb0153002b582aea092b403826185e6ce8",
"branch_name": "refs/heads/master",
"committer_date": 1527215899000,
"content_id": "7ea081cf847c7a8a7ce161c4f65d77ab8540f9bb",
"detected_licenses": [
"Apache-2.0"
],
"directory_id": "34f53b792d7cad4a6120c665b6896a4aa089c088",
"extension": "py"... | 2.4375 | stackv2 | import pandas as pd
import numpy as np
import statsmodels.api as sm
import talib
def init(context):
# 在context中保存全局变量
context.hs300 = "000300.XSHG"
context.n1 = 18
context.s1 = 1
context.s2 = 0.8
def before_trading(context):
pass
def handle_bar(context, bar_dict):
high = history_bars(cont... | 36 | 23.39 | 70 | 11 | 292 | python | [{"finding_id": "semgrep_rules.python.lang.best-practice.pass-body-fn_1843fadaaf2f7d89_916d912c", "tool_name": "semgrep", "rule_id": "rules.python.lang.best-practice.pass-body-fn", "finding_type": "best-practice", "severity": "medium", "confidence": "medium", "message": "`pass` is the body of function before_trading. C... | 2 | true | [
"",
""
] | [
"rules.python.lang.best-practice.pass-body-fn",
"rules.python.lang.best-practice.pass-body-fn"
] | [
"best-practice",
"best-practice"
] | [
"MEDIUM",
"MEDIUM"
] | [
"MEDIUM",
"MEDIUM"
] | [
13,
35
] | [
14,
36
] | [
1,
1
] | [
9,
9
] | [
"",
""
] | [
"`pass` is the body of function before_trading. Consider removing this or raise NotImplementedError() if this is a TODO",
"`pass` is the body of function after_trading. Consider removing this or raise NotImplementedError() if this is a TODO"
] | [
5,
5
] | [
"",
""
] | [
"",
""
] | rsrs.py | /rqalpha/strategy/rsrs.py | shinezai/Rqalpha-myquant-learning | Apache-2.0 | |
2024-11-19T02:17:34.485926+00:00 | 1,580,667,590,000 | 9337a5243b801a0748ac594bbbbe5da745cfb204 | 3 | {
"blob_id": "9337a5243b801a0748ac594bbbbe5da745cfb204",
"branch_name": "refs/heads/master",
"committer_date": 1580667590000,
"content_id": "47605ae0d12a4a29f1e83772854249624904659b",
"detected_licenses": [
"MIT"
],
"directory_id": "83657e1b0565c86a0c2a14ac93074c31224713dc",
"extension": "py",
"fi... | 2.8125 | stackv2 | import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
from sklearn.model_selection import train_test_split
from sklearn.linear_model import LinearRegression
import pickle
dataset = pd.read_csv('dataset.csv')
X = dataset.iloc[:, :-1].values
y = dataset.iloc[:, 1].values
X_train, X_test, y_train, y_te... | 22 | 26.5 | 93 | 9 | 157 | python | [{"finding_id": "semgrep_rules.python.lang.security.deserialization.avoid-pickle_eed044974997407e_3f83a5ae", "tool_name": "semgrep", "rule_id": "rules.python.lang.security.deserialization.avoid-pickle", "finding_type": "security", "severity": "medium", "confidence": "low", "message": "Avoid using `pickle`, which is kno... | 2 | true | [
"CWE-502",
"CWE-502"
] | [
"rules.python.lang.security.deserialization.avoid-pickle",
"rules.python.lang.security.deserialization.avoid-pickle"
] | [
"security",
"security"
] | [
"LOW",
"LOW"
] | [
"MEDIUM",
"MEDIUM"
] | [
19,
21
] | [
19,
21
] | [
1,
9
] | [
47,
44
] | [
"A08:2017 - Insecure Deserialization",
"A08:2017 - Insecure Deserialization"
] | [
"Avoid using `pickle`, which is known to lead to code execution vulnerabilities. When unpickling, the serialized data could be manipulated to run arbitrary code. Instead, consider serializing the relevant data as JSON or a similar text-based serialization format.",
"Avoid using `pickle`, which is known to lead to... | [
5,
5
] | [
"LOW",
"LOW"
] | [
"MEDIUM",
"MEDIUM"
] | model.py | /Web-app/model.py | profHajal/ML-practice | MIT | |
2024-11-19T02:17:34.531069+00:00 | 1,505,462,825,000 | 8df7fb0a49c2673662e8bf20af33733c010734ca | 3 | {
"blob_id": "8df7fb0a49c2673662e8bf20af33733c010734ca",
"branch_name": "refs/heads/master",
"committer_date": 1505462825000,
"content_id": "f2be341eeeb7895229a12908e2e60875b6af481a",
"detected_licenses": [
"MIT"
],
"directory_id": "751961daf20c197ffc14ed5d2e73738a5d3e5f22",
"extension": "py",
"fi... | 2.765625 | stackv2 | """
Script for working with features related to Regional Adjacency Graphs (RAG's)
and cut normalizations. These features are appended with the initial 56 features
in the final model.
"""
from skimage import data, segmentation, color, io
from skimage.future import graph
from matplotlib import pyplot as plt
def show... | 49 | 24.63 | 91 | 10 | 354 | python | [{"finding_id": "semgrep_rules.python.lang.maintainability.return-not-in-function_3c3e2935d7a1fa9c_64b92fb6", "tool_name": "semgrep", "rule_id": "rules.python.lang.maintainability.return-not-in-function", "finding_type": "maintainability", "severity": "medium", "confidence": "medium", "message": "`return` only makes se... | 1 | true | [
""
] | [
"rules.python.lang.maintainability.return-not-in-function"
] | [
"maintainability"
] | [
"MEDIUM"
] | [
"MEDIUM"
] | [
49
] | [
49
] | [
2
] | [
8
] | [
""
] | [
"`return` only makes sense inside a function"
] | [
5
] | [
""
] | [
""
] | rag_cut_normalization.py | /src/ImageProcessing/rag_cut_normalization.py | minghuii/image-aesthetics-learning | MIT | |
2024-11-19T02:17:34.591914+00:00 | 1,432,132,340,000 | 0a607e987baf9bfa5ec26a801f952bba39d3fa44 | 2 | {
"blob_id": "0a607e987baf9bfa5ec26a801f952bba39d3fa44",
"branch_name": "refs/heads/master",
"committer_date": 1432132340000,
"content_id": "77a310602da61ac2fad68df7fd87c449f197d7fc",
"detected_licenses": [
"Apache-2.0"
],
"directory_id": "29f936b86108e61cbe2b04f9142e186235584d9b",
"extension": "py"... | 2.40625 | stackv2 | import pickle
import socket
import struct
class graphite_emitter(object):
def __init__(self, config=None, logger=None):
self.log = logger
self.config = config
if not self.config['interval']:
self.interval = 1
else:
self.interval = self.config['interval']
... | 85 | 32.59 | 172 | 21 | 616 | python | [{"finding_id": "semgrep_rules.python.lang.security.deserialization.avoid-pickle_c1f8fae9b4abf2be_20516a1b", "tool_name": "semgrep", "rule_id": "rules.python.lang.security.deserialization.avoid-pickle", "finding_type": "security", "severity": "medium", "confidence": "low", "message": "Avoid using `pickle`, which is kno... | 1 | true | [
"CWE-502"
] | [
"rules.python.lang.security.deserialization.avoid-pickle"
] | [
"security"
] | [
"LOW"
] | [
"MEDIUM"
] | [
57
] | [
57
] | [
32
] | [
69
] | [
"A08:2017 - Insecure Deserialization"
] | [
"Avoid using `pickle`, which is known to lead to code execution vulnerabilities. When unpickling, the serialized data could be manipulated to run arbitrary code. Instead, consider serializing the relevant data as JSON or a similar text-based serialization format."
] | [
5
] | [
"LOW"
] | [
"MEDIUM"
] | graphite_emitter.py | /badger_emitters/graphite_emitter.py | cboggs/stat-badger | Apache-2.0 | |
2024-11-19T02:17:34.865311+00:00 | 1,624,466,408,000 | 989e2de57d0b53145ef26054b4798f6213731a38 | 2 | {
"blob_id": "989e2de57d0b53145ef26054b4798f6213731a38",
"branch_name": "refs/heads/main",
"committer_date": 1624466408000,
"content_id": "75aa957b7c0401c446b51fb4c2654ca87618681d",
"detected_licenses": [
"MIT"
],
"directory_id": "11397009da2c3a073d7b22f0e4a3bc1719ed1bab",
"extension": "py",
"file... | 2.390625 | stackv2 | import datetime
import json
import logging
from pymatgen.core.structure import Lattice
from AnalysisModule.prepare.disclean_function import *
from AnalysisModule.prepare.saentry import SaotoEntry
from AnalysisModule.routines.util import Composition
from AnalysisModule.routines.util import strip_elements
try:
fro... | 358 | 42.39 | 131 | 20 | 3,293 | python | [{"finding_id": "semgrep_rules.python.lang.maintainability.is-function-without-parentheses_bf8e6eac8c417c7b_721853b7", "tool_name": "semgrep", "rule_id": "rules.python.lang.maintainability.is-function-without-parentheses", "finding_type": "maintainability", "severity": "medium", "confidence": "medium", "message": "Is \... | 2 | true | [
"",
""
] | [
"rules.python.lang.maintainability.is-function-without-parentheses",
"rules.python.lang.maintainability.is-function-without-parentheses"
] | [
"maintainability",
"maintainability"
] | [
"MEDIUM",
"MEDIUM"
] | [
"MEDIUM",
"MEDIUM"
] | [
248,
249
] | [
248,
249
] | [
39,
36
] | [
52,
46
] | [
"",
""
] | [
"Is \"is_acceptor\" a function or an attribute? If it is a function, you may have meant a.is_acceptor() because a.is_acceptor is always true.",
"Is \"is_donor\" a function or an attribute? If it is a function, you may have meant a.is_donor() because a.is_donor is always true."
] | [
5,
5
] | [
"",
""
] | [
"",
""
] | csd_exporter.py | /AnalysisModule/prepare/csd_exporter.py | qai222/ATMOxide | MIT | |
2024-11-19T02:17:36.502528+00:00 | 1,522,330,306,000 | 5b8ffad5daef2b342d9248ad89af3c13e3678a7b | 3 | {
"blob_id": "5b8ffad5daef2b342d9248ad89af3c13e3678a7b",
"branch_name": "refs/heads/master",
"committer_date": 1522962807000,
"content_id": "e8e924b768ca42b7d9876a3f3cca20726fbdb088",
"detected_licenses": [
"MIT"
],
"directory_id": "a362448fae1b1348daf2451532c6191053354444",
"extension": "py",
"fi... | 2.546875 | stackv2 | #!/usr/bin/env python2
from datetime import datetime
import praw
import facebook
import urllib2
import os.path
def main():
cfg = {
"fb_page_id" : "",
"fb_access_token" : "",
"praw_id" : "",
"praw_secret" : "",
"praw_agent" : "script:com.stephen304.PostManager:v1.0 (by /u/St... | 120 | 30.25 | 127 | 19 | 968 | python | [{"finding_id": "semgrep_rules.python.lang.best-practice.open-never-closed_9a424c72921a811f_cdf13180", "tool_name": "semgrep", "rule_id": "rules.python.lang.best-practice.open-never-closed", "finding_type": "best-practice", "severity": "high", "confidence": "medium", "message": "file object opened without corresponding... | 5 | true | [
""
] | [
"rules.python.lang.correctness.file-object-redefined-before-close"
] | [
"correctness"
] | [
"MEDIUM"
] | [
"MEDIUM"
] | [
33
] | [
35
] | [
3
] | [
42
] | [
""
] | [
"Detected a file object that is redefined and never closed. This could leak file descriptors and unnecessarily consume system resources."
] | [
5
] | [
""
] | [
""
] | postmanager.py | /postmanager.py | stephen304/postmanager | MIT | |
2024-11-19T02:17:36.799154+00:00 | 1,570,961,651,000 | 6f7061a19a7eff0b0821b2719448de7fe6693016 | 3 | {
"blob_id": "6f7061a19a7eff0b0821b2719448de7fe6693016",
"branch_name": "refs/heads/master",
"committer_date": 1570961651000,
"content_id": "a36644db198fbccc02b82594ea19be1466723151",
"detected_licenses": [
"MIT"
],
"directory_id": "6f557203aa404e4d4c2ab392ac2cebb14fd3443f",
"extension": "py",
"fi... | 2.890625 | stackv2 | import sqlite3
import os
fileDir = os.path.dirname(os.path.realpath(__file__))
filename = os.path.join(fileDir, 'time_vortex.db')
class DatabaseConnection:
def __init__(self):
self.conn = None
def __enter__(self): # Enter the Context Manager --> Do this ...
self.conn = sqlite3.connect(file... | 46 | 30.3 | 115 | 13 | 342 | python | [{"finding_id": "semgrep_rules.python.lang.security.audit.formatted-sql-query_bb7e29567462bd59_b792fa5d", "tool_name": "semgrep", "rule_id": "rules.python.lang.security.audit.formatted-sql-query", "finding_type": "security", "severity": "medium", "confidence": "low", "message": "Detected possible formatted SQL query. U... | 2 | true | [
"CWE-89",
"CWE-89"
] | [
"rules.python.lang.security.audit.formatted-sql-query",
"rules.python.sqlalchemy.security.sqlalchemy-execute-raw-query"
] | [
"security",
"security"
] | [
"LOW",
"LOW"
] | [
"MEDIUM",
"HIGH"
] | [
45,
45
] | [
45,
45
] | [
9,
9
] | [
38,
38
] | [
"A01:2017 - Injection",
"A01:2017 - Injection"
] | [
"Detected possible formatted SQL query. Use parameterized queries instead.",
"Avoiding SQL string concatenation: untrusted input concatenated with raw SQL query can result in SQL Injection. In order to execute raw query safely, prepared statement should be used. SQLAlchemy provides TextualSQL to easily used prepa... | [
5,
7.5
] | [
"LOW",
"LOW"
] | [
"HIGH",
"HIGH"
] | Connector.py | /DatabaseManagement/Connector.py | ByteAbyss/Doctor_Who_Collection_Management | MIT | |
2024-11-19T02:17:37.456629+00:00 | 1,521,935,384,000 | c91209ca0e68bc64ca45fbaf3e344039228da527 | 2 | {
"blob_id": "c91209ca0e68bc64ca45fbaf3e344039228da527",
"branch_name": "refs/heads/master",
"committer_date": 1521935384000,
"content_id": "a5f595013437fa7e3a15d1d1c743c3d1d32ce726",
"detected_licenses": [
"MIT"
],
"directory_id": "16c5ef885a3854509cbc3799fc66e754aa4207c5",
"extension": "py",
"fi... | 2.453125 | stackv2 | #!/usr/bin/env python2.7
# -*- coding: utf-8 -*
import imageio
imageio.plugins.ffmpeg.download()
from moviepy.editor import *
from InstagramAPI import InstagramAPI
import RPi.GPIO as GPIO
import time
from datetime import datetime
from PIL import Image
import pygame
from pygame.locals import *
from quotes import get_quo... | 162 | 35.56 | 141 | 14 | 1,537 | python | [{"finding_id": "semgrep_rules.python.lang.security.audit.dangerous-system-call-audit_d4bd7ca72fb1b039_425d0d1c", "tool_name": "semgrep", "rule_id": "rules.python.lang.security.audit.dangerous-system-call-audit", "finding_type": "security", "severity": "high", "confidence": "low", "message": "Found dynamic content used... | 7 | true | [
"CWE-78",
"CWE-78"
] | [
"rules.python.lang.security.audit.dangerous-system-call-audit",
"rules.python.lang.security.audit.dangerous-system-call-audit"
] | [
"security",
"security"
] | [
"LOW",
"LOW"
] | [
"HIGH",
"HIGH"
] | [
34,
46
] | [
34,
46
] | [
5,
5
] | [
39,
23
] | [
"A01:2017 - Injection",
"A01:2017 - Injection"
] | [
"Found dynamic content used in a system call. This is dangerous if external data can reach this function call because it allows a malicious actor to execute commands. Use the 'subprocess' module instead, which is easier to use without accidentally exposing a command injection vulnerability.",
"Found dynamic conte... | [
7.5,
7.5
] | [
"LOW",
"LOW"
] | [
"HIGH",
"HIGH"
] | main.py | /photomaton/main.py | damioune123/livrogne_backup | MIT | |
2024-11-19T02:17:37.701033+00:00 | 1,391,687,031,000 | 8c0b4113a3f1ceb244c37de916eebb33b55e91cf | 3 | {
"blob_id": "8c0b4113a3f1ceb244c37de916eebb33b55e91cf",
"branch_name": "refs/heads/master",
"committer_date": 1391687031000,
"content_id": "ed319f09a46f75652e9b56eeb1bf96864039d8f4",
"detected_licenses": [
"BSD-3-Clause"
],
"directory_id": "5fc15086f412c20849b12f93475f702cc342b473",
"extension": "p... | 3.125 | stackv2 | from django.http import HttpResponse
from functools import wraps
import json
def json_response(func):
"""
Decorator function that when applied to a function which
returns some json data will be turned into a HttpResponse
This is useful because the call site can literally just
call the funct... | 31 | 24.74 | 65 | 14 | 154 | python | [{"finding_id": "semgrep_rules.python.django.security.audit.xss.direct-use-of-httpresponse_f59d1e4ffaa0e0a7_c2f34a43", "tool_name": "semgrep", "rule_id": "rules.python.django.security.audit.xss.direct-use-of-httpresponse", "finding_type": "security", "severity": "medium", "confidence": "low", "message": "Detected data ... | 1 | true | [
"CWE-79"
] | [
"rules.python.django.security.audit.xss.direct-use-of-httpresponse"
] | [
"security"
] | [
"LOW"
] | [
"MEDIUM"
] | [
29
] | [
30
] | [
16
] | [
57
] | [
"A07:2017 - Cross-Site Scripting (XSS)"
] | [
"Detected data rendered directly to the end user via 'HttpResponse' or a similar object. This bypasses Django's built-in cross-site scripting (XSS) defenses and could result in an XSS vulnerability. Use Django's template engine to safely render HTML."
] | [
5
] | [
"LOW"
] | [
"MEDIUM"
] | decorators.py | /core/decorators.py | MattBlack85/dunning-cruncher | BSD-3-Clause | |
2024-11-19T02:17:38.714868+00:00 | 1,593,523,464,000 | 4a12c77b56e04d4d8e6ab686d9fd35e152beacd6 | 3 | {
"blob_id": "4a12c77b56e04d4d8e6ab686d9fd35e152beacd6",
"branch_name": "refs/heads/master",
"committer_date": 1593523464000,
"content_id": "60056c911ad3c97864cd3c76f5a8a71864db2c4f",
"detected_licenses": [
"MIT"
],
"directory_id": "250ddda9e64e82c3bc90c21335ee20dc73563b59",
"extension": "py",
"fi... | 2.765625 | stackv2 | """
BaseClss for Optimizers
Suggestion, feel free to propose new things/changes
"""
import typing, numbers, copy
from tequila.utils.exceptions import TequilaException
from tequila.simulators.simulator_api import compile, pick_backend
from tequila.objective import Objective
from tequila.circuit.gradient import grad
fro... | 402 | 38.19 | 151 | 22 | 3,393 | python | [{"finding_id": "semgrep_rules.python.lang.security.deserialization.avoid-pickle_2c5a344cdecf2084_a024247e", "tool_name": "semgrep", "rule_id": "rules.python.lang.security.deserialization.avoid-pickle", "finding_type": "security", "severity": "medium", "confidence": "low", "message": "Avoid using `pickle`, which is kno... | 1 | true | [
"CWE-502"
] | [
"rules.python.lang.security.deserialization.avoid-pickle"
] | [
"security"
] | [
"LOW"
] | [
"MEDIUM"
] | [
154
] | [
154
] | [
13
] | [
63
] | [
"A08:2017 - Insecure Deserialization"
] | [
"Avoid using `pickle`, which is known to lead to code execution vulnerabilities. When unpickling, the serialized data could be manipulated to run arbitrary code. Instead, consider serializing the relevant data as JSON or a similar text-based serialization format."
] | [
5
] | [
"LOW"
] | [
"MEDIUM"
] | optimizer_base.py | /src/tequila/optimizers/optimizer_base.py | snc2/tequila | MIT | |
2024-11-19T02:17:39.679447+00:00 | 1,532,486,050,000 | 46f72a5ac3ccbb8284874e24d78919583d8e20aa | 3 | {
"blob_id": "46f72a5ac3ccbb8284874e24d78919583d8e20aa",
"branch_name": "refs/heads/master",
"committer_date": 1532486050000,
"content_id": "a211972483deac5e9b3dc9f3614e3aea82efd4c6",
"detected_licenses": [
"Apache-2.0"
],
"directory_id": "89c0ffc249cb9df44040841f5b639c4487aa0a74",
"extension": "py"... | 2.515625 | stackv2 | from django.db import models
from django.utils import timezone
from django.utils.text import slugify
# Create your models here.
class Event(models.Model):
title = models.CharField(max_length=200, default=None)
slug = models.SlugField(max_length=200, unique=True, default=None)
description = models.TextFi... | 99 | 36.4 | 83 | 16 | 819 | python | [{"finding_id": "semgrep_rules.python.django.correctness.no-null-string-field_b10a6bc6885da412_48f0dc15", "tool_name": "semgrep", "rule_id": "rules.python.django.correctness.no-null-string-field", "finding_type": "correctness", "severity": "medium", "confidence": "medium", "message": "Avoid using null on string-based f... | 4 | true | [
"",
"",
"",
""
] | [
"rules.python.django.correctness.no-null-string-field",
"rules.python.django.correctness.no-null-string-field",
"rules.python.django.correctness.no-null-string-field",
"rules.python.django.correctness.no-null-string-field"
] | [
"correctness",
"correctness",
"correctness",
"correctness"
] | [
"MEDIUM",
"MEDIUM",
"MEDIUM",
"MEDIUM"
] | [
"MEDIUM",
"MEDIUM",
"MEDIUM",
"MEDIUM"
] | [
14,
62,
63,
64
] | [
14,
62,
63,
64
] | [
5,
5,
5,
5
] | [
84,
84,
81,
82
] | [
"",
"",
"",
""
] | [
"Avoid using null on string-based fields such as CharField and TextField. If a string-based field has null=True, that means it has two possible values for \"no data\": NULL, and the empty string. In most cases, it's redundant to have two possible values for \"no data;\" the Django convention is to use the empty str... | [
5,
5,
5,
5
] | [
"",
"",
"",
""
] | [
"",
"",
"",
""
] | models.py | /web/events/models.py | vtalks/vtalks.net | Apache-2.0 | |
2024-11-19T02:17:40.567608+00:00 | 1,372,702,838,000 | f3024b092febfa1eae03060d6279214be4853ec6 | 2 | {
"blob_id": "f3024b092febfa1eae03060d6279214be4853ec6",
"branch_name": "refs/heads/master",
"committer_date": 1372702838000,
"content_id": "766b89b27a300c26ea4f8086b1af5d219ee8de5b",
"detected_licenses": [
"Apache-2.0"
],
"directory_id": "b0ed9d4a276f4fbb23584a45560c759645dbca7a",
"extension": "py"... | 2.34375 | stackv2 | # coding: utf-8
#
# Copyright 2013 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by ... | 60 | 32.85 | 76 | 12 | 449 | python | [{"finding_id": "semgrep_rules.python.lang.maintainability.is-function-without-parentheses_fe2c80a27b84d03e_17cff6d0", "tool_name": "semgrep", "rule_id": "rules.python.lang.maintainability.is-function-without-parentheses", "finding_type": "maintainability", "severity": "medium", "confidence": "medium", "message": "Is \... | 1 | true | [
""
] | [
"rules.python.lang.maintainability.is-function-without-parentheses"
] | [
"maintainability"
] | [
"MEDIUM"
] | [
"MEDIUM"
] | [
46
] | [
46
] | [
16
] | [
37
] | [
""
] | [
"Is \"is_public\" a function or an attribute? If it is a function, you may have meant Exploration.is_public() because Exploration.is_public is always true."
] | [
5
] | [
""
] | [
""
] | services.py | /apps/exploration/services.py | paulproteus/oppia-test-3 | Apache-2.0 | |
2024-11-19T02:17:41.264338+00:00 | 1,512,636,831,000 | 7345b598537affac7647317d5b0f42a97ffedf1a | 3 | {
"blob_id": "7345b598537affac7647317d5b0f42a97ffedf1a",
"branch_name": "refs/heads/master",
"committer_date": 1512636831000,
"content_id": "9a0e58751d8e731ca463df2ed9340bfa1b3556f8",
"detected_licenses": [
"MIT"
],
"directory_id": "a7266d9ac3d895a0e9113178916e70fd6107767f",
"extension": "py",
"fi... | 2.96875 | stackv2 | # -*- coding: utf-8 -*-
"""
:Author: Jaekyoung Kim
:Date: 2017. 11. 16.
"""
import traceback
import numpy as np
import pandas as pd
from sqlalchemy.exc import SQLAlchemyError
from utils.db import get_connection
def get_stock_master():
"""
Get stock masters from MySQL and return them.
:return stock_mas... | 218 | 38.14 | 119 | 22 | 1,799 | python | [{"finding_id": "semgrep_rules.python.lang.security.audit.formatted-sql-query_9116d86aa53b587e_7ea1aff4", "tool_name": "semgrep", "rule_id": "rules.python.lang.security.audit.formatted-sql-query", "finding_type": "security", "severity": "medium", "confidence": "low", "message": "Detected possible formatted SQL query. U... | 4 | true | [
"CWE-89",
"CWE-89",
"CWE-89",
"CWE-89"
] | [
"rules.python.lang.security.audit.formatted-sql-query",
"rules.python.sqlalchemy.security.sqlalchemy-execute-raw-query",
"rules.python.lang.security.audit.formatted-sql-query",
"rules.python.sqlalchemy.security.sqlalchemy-execute-raw-query"
] | [
"security",
"security",
"security",
"security"
] | [
"LOW",
"LOW",
"LOW",
"LOW"
] | [
"MEDIUM",
"HIGH",
"MEDIUM",
"HIGH"
] | [
122,
122,
159,
159
] | [
127,
127,
161,
161
] | [
9,
9,
17,
17
] | [
57,
57,
105,
105
] | [
"A01:2017 - Injection",
"A01:2017 - Injection",
"A01:2017 - Injection",
"A01:2017 - Injection"
] | [
"Detected possible formatted SQL query. Use parameterized queries instead.",
"Avoiding SQL string concatenation: untrusted input concatenated with raw SQL query can result in SQL Injection. In order to execute raw query safely, prepared statement should be used. SQLAlchemy provides TextualSQL to easily used prepa... | [
5,
7.5,
5,
7.5
] | [
"LOW",
"LOW",
"LOW",
"LOW"
] | [
"HIGH",
"HIGH",
"HIGH",
"HIGH"
] | data_reader.py | /data/data_reader.py | willbelucky/FE538_2017F | MIT | |
2024-11-19T02:17:46.850793+00:00 | 1,436,798,206,000 | c4eca93f4806027d6deaa34de5d4da862e51e5e3 | 3 | {
"blob_id": "c4eca93f4806027d6deaa34de5d4da862e51e5e3",
"branch_name": "refs/heads/master",
"committer_date": 1436798206000,
"content_id": "afeb0e7025e12720e2041c55130abf119ca92da6",
"detected_licenses": [
"MIT"
],
"directory_id": "d511ede4d15c1b7b49eddfa2119d6f0ca0a83313",
"extension": "py",
"fi... | 3.25 | stackv2 | from chain import Chain
import cPickle
from collections import OrderedDict
import pandas as pd
class Cluster(OrderedDict):
"""
Container class in form of an OrderedDict of Chains.
It is possible to interact with individual Chains through the Cluster
object. Clusters are mainly used to prepare aggregat... | 87 | 32.09 | 102 | 20 | 612 | python | [{"finding_id": "semgrep_rules.python.lang.security.deserialization.avoid-cPickle_699b9ee0fbaca6a0_82a8fb4b", "tool_name": "semgrep", "rule_id": "rules.python.lang.security.deserialization.avoid-cPickle", "finding_type": "security", "severity": "medium", "confidence": "low", "message": "Avoid using `cPickle`, which is ... | 2 | true | [
"CWE-502",
"CWE-502"
] | [
"rules.python.lang.security.deserialization.avoid-cPickle",
"rules.python.lang.security.deserialization.avoid-cPickle"
] | [
"security",
"security"
] | [
"LOW",
"LOW"
] | [
"MEDIUM",
"MEDIUM"
] | [
69,
85
] | [
69,
85
] | [
9,
15
] | [
56,
30
] | [
"A08:2017 - Insecure Deserialization",
"A08:2017 - Insecure Deserialization"
] | [
"Avoid using `cPickle`, which is known to lead to code execution vulnerabilities. When unpickling, the serialized data could be manipulated to run arbitrary code. Instead, consider serializing the relevant data as JSON or a similar text-based serialization format.",
"Avoid using `cPickle`, which is known to lead ... | [
5,
5
] | [
"LOW",
"LOW"
] | [
"MEDIUM",
"MEDIUM"
] | cluster.py | /core/cluster.py | sd2k/quantipy | MIT | |
2024-11-19T02:17:47.470045+00:00 | 1,572,236,592,000 | b3d23a961965b78989dce949558a7e11a696cce5 | 3 | {
"blob_id": "b3d23a961965b78989dce949558a7e11a696cce5",
"branch_name": "refs/heads/master",
"committer_date": 1572236592000,
"content_id": "ac55db9b6d6d6cbbb1af0db5e0acd6837e080967",
"detected_licenses": [
"MIT"
],
"directory_id": "3e2c59eb9c56abcfaf84a77ce3e41f169c2fd45f",
"extension": "py",
"fi... | 2.953125 | stackv2 | #!/usr/bin/env python3
from nodelist import public_nodes
from get_active_nodes import wss_test, py_version_check
from tqdm import tqdm
from itertools import repeat
from multiprocessing import freeze_support
import multiprocessing as mp
import platform
import subprocess
max_timeout = 2.0 # max ping time is set to 2... | 107 | 28.28 | 111 | 18 | 739 | python | [{"finding_id": "semgrep_rules.python.lang.security.audit.dangerous-subprocess-use-audit_7116d9ac809ff9c4_dcb72c25", "tool_name": "semgrep", "rule_id": "rules.python.lang.security.audit.dangerous-subprocess-use-audit", "finding_type": "security", "severity": "high", "confidence": "low", "message": "Detected subprocess ... | 2 | true | [
"CWE-78",
"CWE-78"
] | [
"rules.python.lang.security.audit.dangerous-subprocess-use-audit",
"rules.python.lang.security.audit.dangerous-subprocess-use-audit"
] | [
"security",
"security"
] | [
"LOW",
"LOW"
] | [
"HIGH",
"HIGH"
] | [
36,
40
] | [
36,
40
] | [
22,
13
] | [
79,
45
] | [
"A01:2017 - Injection",
"A01:2017 - Injection"
] | [
"Detected subprocess function 'run' without a static string. If this data can be controlled by a malicious actor, it may be an instance of command injection. Audit the use of this call to ensure it is not controllable by an external resource. You may consider using 'shlex.escape()'.",
"Detected subprocess functio... | [
7.5,
7.5
] | [
"LOW",
"LOW"
] | [
"HIGH",
"HIGH"
] | node_manager.py | /node_manager.py | thehapax/node-pinger | MIT | |
2024-11-19T02:17:48.130653+00:00 | 1,503,274,215,000 | b5d477e9ad45a422a2b9cfa60f38207d054584a4 | 2 | {
"blob_id": "b5d477e9ad45a422a2b9cfa60f38207d054584a4",
"branch_name": "refs/heads/master",
"committer_date": 1503274215000,
"content_id": "e841d036ca0c388ded178274e8a26069cd2039f7",
"detected_licenses": [
"MIT"
],
"directory_id": "00ea4201e4a3eae9a70ee18d060803e818a615ba",
"extension": "py",
"fi... | 2.484375 | stackv2 | import web
import pygame
import time
import random
import glob
import clint
# VARS
global currentSong
global songThread
global mixer_init
global randomSongNext
global pauseStatus
global playStatus
global songList
global playPause
songListMusic = sorted(glob.glob("music/*.ogg"))
randomSongNext = "Nothing"
currentSong ... | 97 | 21.68 | 147 | 16 | 587 | python | [{"finding_id": "semgrep_rules.python.lang.best-practice.arbitrary-sleep_29f2d0f142bdb561_bd169fa2", "tool_name": "semgrep", "rule_id": "rules.python.lang.best-practice.arbitrary-sleep", "finding_type": "best-practice", "severity": "high", "confidence": "medium", "message": "time.sleep() call; did you mean to leave thi... | 3 | true | [
""
] | [
"rules.python.lang.correctness.useless-eqeq"
] | [
"correctness"
] | [
"MEDIUM"
] | [
"LOW"
] | [
80
] | [
80
] | [
12
] | [
28
] | [
""
] | [
"This expression is always True: `pauseStatus == pauseStatus` or `pauseStatus != pauseStatus`. If testing for floating point NaN, use `math.isnan(pauseStatus)`, or `cmath.isnan(pauseStatus)` if the number is complex."
] | [
3
] | [
""
] | [
""
] | box.py | /box.py | monoxane/schooltu2aos1jukebox | MIT | |
2024-11-19T02:17:49.126012+00:00 | 1,613,742,039,000 | 38fe7d307bed2e296d7855accff0fa620eed1da3 | 2 | {
"blob_id": "38fe7d307bed2e296d7855accff0fa620eed1da3",
"branch_name": "refs/heads/main",
"committer_date": 1613742039000,
"content_id": "709da38907e4464c027c159d4345680c12a87a85",
"detected_licenses": [
"MIT"
],
"directory_id": "269c90230bb695843007d9ec14cd64f2b3c79720",
"extension": "py",
"file... | 2.3125 | stackv2 | import torch
from PIL import Image
from torch.utils.data import Dataset, DataLoader,random_split
import torchvision
from torchvision import datasets, models, transforms
import numpy as np
import matplotlib.pyplot as plt
import time
import os
import PIL
import pickle
device = torch.device("cuda" if torch.cuda.is_avail... | 175 | 36.45 | 117 | 17 | 1,562 | python | [{"finding_id": "semgrep_rules.python.lang.best-practice.open-never-closed_6e08a424a298ffab_258328b0", "tool_name": "semgrep", "rule_id": "rules.python.lang.best-practice.open-never-closed", "finding_type": "best-practice", "severity": "high", "confidence": "medium", "message": "file object opened without corresponding... | 7 | true | [
"CWE-95",
"CWE-95",
"CWE-502",
"CWE-95",
"CWE-502"
] | [
"rules.python.lang.security.audit.eval-detected",
"rules.python.lang.security.audit.eval-detected",
"rules.python.lang.security.deserialization.avoid-pickle",
"rules.python.lang.security.audit.eval-detected",
"rules.python.lang.security.deserialization.avoid-pickle"
] | [
"security",
"security",
"security",
"security",
"security"
] | [
"LOW",
"LOW",
"LOW",
"LOW",
"LOW"
] | [
"MEDIUM",
"MEDIUM",
"MEDIUM",
"MEDIUM",
"MEDIUM"
] | [
26,
35,
52,
61,
64
] | [
26,
35,
52,
61,
64
] | [
21,
21,
16,
21,
17
] | [
31,
31,
116,
31,
113
] | [
"A03:2021 - Injection",
"A03:2021 - Injection",
"A08:2017 - Insecure Deserialization",
"A03:2021 - Injection",
"A08:2017 - Insecure Deserialization"
] | [
"Detected the use of eval(). eval() can be dangerous if used to evaluate dynamic content. If this content can be input from outside the program, this may be a code injection vulnerability. Ensure evaluated content is not definable by external sources.",
"Detected the use of eval(). eval() can be dangerous if used... | [
5,
5,
5,
5,
5
] | [
"LOW",
"LOW",
"LOW",
"LOW",
"LOW"
] | [
"HIGH",
"HIGH",
"MEDIUM",
"HIGH",
"MEDIUM"
] | LoadData.py | /LoadData.py | ZLJ2015106/pytorch-multimodal_sarcasm_detection | MIT | |
2024-11-19T02:17:49.501065+00:00 | 1,633,003,892,000 | e6d5bda9e6b173b9faea1bdac3e7c6bd2c028512 | 4 | {
"blob_id": "e6d5bda9e6b173b9faea1bdac3e7c6bd2c028512",
"branch_name": "refs/heads/master",
"committer_date": 1633003892000,
"content_id": "1e9a6d77fd1cc0d217dfb3954e98a4dfdfa6abfc",
"detected_licenses": [
"CC0-1.0"
],
"directory_id": "63ba933a294865f65409635f62e0f1d59f725f37",
"extension": "py",
... | 4 | stackv2 | """
Sort Array By Parity
https://leetcode.com/explore/challenge/card/august-leetcoding-challenge/551/week-3-august-15th-august-21st/3431/
Given an array A of non-negative integers, return an array consisting of all the even elements of A, followed by all the odd elements of A.
You may return any answer array that sati... | 68 | 21.44 | 139 | 14 | 470 | python | [{"finding_id": "semgrep_rules.python.lang.maintainability.code-after-unconditional-return_66d1eab5e36aad0a_54f6b35f", "tool_name": "semgrep", "rule_id": "rules.python.lang.maintainability.code-after-unconditional-return", "finding_type": "maintainability", "severity": "medium", "confidence": "medium", "message": "code... | 1 | true | [
""
] | [
"rules.python.lang.maintainability.code-after-unconditional-return"
] | [
"maintainability"
] | [
"MEDIUM"
] | [
"MEDIUM"
] | [
49
] | [
62
] | [
9
] | [
12
] | [
""
] | [
"code after return statement will not be executed"
] | [
5
] | [
""
] | [
""
] | sortArrayByParity.py | /src/arrays/sortArrayByParity.py | way2arun/datastructures_algorithms | CC0-1.0 | |
2024-11-19T02:18:03.182622+00:00 | 1,687,675,916,000 | 157a5be73a8be189c54f2ba153dbb0cab9d6e297 | 3 | {
"blob_id": "157a5be73a8be189c54f2ba153dbb0cab9d6e297",
"branch_name": "refs/heads/master",
"committer_date": 1687675916000,
"content_id": "fc69ca3aa7486306f757d13b2c7a3c1efbc6fdc2",
"detected_licenses": [
"Apache-2.0"
],
"directory_id": "8cae186abe4880375ccbea9b404a2f5f349a40ab",
"extension": "py"... | 2.625 | stackv2 | import uvicorn
import os
from diskcache import Cache
from fastapi import FastAPI
from starlette.middleware.cors import CORSMiddleware
from starlette.responses import FileResponse
from starlette.requests import Request
from helpers.milvus_helpers import MilvusHelper
from helpers.mysql_helpers import MySQLHelper
from con... | 124 | 29.88 | 96 | 16 | 960 | python | [{"finding_id": "semgrep_rules.python.fastapi.security.wildcard-cors_adadd1661d756e79_0cc1ce3f", "tool_name": "semgrep", "rule_id": "rules.python.fastapi.security.wildcard-cors", "finding_type": "security", "severity": "medium", "confidence": "medium", "message": "CORS policy allows any origin (using wildcard '*'). Thi... | 2 | true | [
"CWE-942",
"CWE-918"
] | [
"rules.python.fastapi.security.wildcard-cors",
"rules.python.django.security.injection.tainted-url-host"
] | [
"security",
"security"
] | [
"MEDIUM",
"LOW"
] | [
"MEDIUM",
"MEDIUM"
] | [
23,
88
] | [
23,
88
] | [
19,
19
] | [
24,
75
] | [
"A05:2021 - Security Misconfiguration",
"A10:2021 - Server-Side Request Forgery (SSRF)"
] | [
"CORS policy allows any origin (using wildcard '*'). This is insecure and should be avoided.",
"User data flows into the host portion of this manually-constructed URL. This could allow an attacker to send data to their own server, potentially exposing sensitive data such as cookies or authorization information se... | [
5,
5
] | [
"HIGH",
"LOW"
] | [
"LOW",
"MEDIUM"
] | main.py | /solutions/medical/molecular_similarity_search/quick_deploy/server/src/main.py | shiyu22/bootcamp | Apache-2.0 | |
2024-11-19T02:18:03.547587+00:00 | 1,607,557,886,000 | 0a35ec78f7e95b1f1df19e1d4a376f7f48a8a73a | 2 | {
"blob_id": "0a35ec78f7e95b1f1df19e1d4a376f7f48a8a73a",
"branch_name": "refs/heads/master",
"committer_date": 1607557886000,
"content_id": "d5350adfd78eb0cb6d90b13b108396fad4f8e8f5",
"detected_licenses": [
"Apache-2.0"
],
"directory_id": "338ecd2f05a887a160afd7828b486326fb4fcb9b",
"extension": "py"... | 2.421875 | stackv2 | import json
import demjson
from datetime import datetime, timedelta
from item import Item
import slumber
import pprint
import json
import requests
class Project(object):
"""
This is the Project class.
"""
account_uri = ""
boxFolderID = None
colorFirstQuadrant = {0, 0, 0, 0}
colorFourthQuad... | 406 | 22.43 | 133 | 16 | 2,138 | python | [{"finding_id": "semgrep_rules.python.lang.maintainability.is-function-without-parentheses_5cc5d22b94be27af_c4a2617d", "tool_name": "semgrep", "rule_id": "rules.python.lang.maintainability.is-function-without-parentheses", "finding_type": "maintainability", "severity": "medium", "confidence": "medium", "message": "Is \... | 1 | true | [
""
] | [
"rules.python.lang.maintainability.is-function-without-parentheses"
] | [
"maintainability"
] | [
"MEDIUM"
] | [
"MEDIUM"
] | [
181
] | [
181
] | [
16
] | [
36
] | [
""
] | [
"Is \"is_team_project\" a function or an attribute? If it is a function, you may have meant self.is_team_project() because self.is_team_project is always true."
] | [
5
] | [
""
] | [
""
] | project.py | /pmatrix/project.py | isabella232/prioritymatrix-python | Apache-2.0 | |
2024-11-19T02:18:03.613985+00:00 | 1,341,338,487,000 | a647e56c76eed88bccc56bfda1d577712097053f | 3 | {
"blob_id": "a647e56c76eed88bccc56bfda1d577712097053f",
"branch_name": "refs/heads/master",
"committer_date": 1341338487000,
"content_id": "4a3eea3ebe0a41823e8c518ba931ba25fb6542cd",
"detected_licenses": [
"BSD-3-Clause"
],
"directory_id": "57c613c52e5a7aa340ade47ca5665269b7fde984",
"extension": "p... | 3.203125 | stackv2 | "Response writers, which take a template context and return a string."
import json
import mimetypes
import types
from flask import render_template
class BaseWriter(object):
"""A response writer, given a template context.
Initialize an instance of a BaseWriter subclass, then call it.
writer = Write... | 157 | 28.79 | 79 | 15 | 1,051 | python | [{"finding_id": "semgrep_rules.python.lang.maintainability.return-not-in-function_d4b8525cc8a27c8d_e44ea1b6", "tool_name": "semgrep", "rule_id": "rules.python.lang.maintainability.return-not-in-function", "finding_type": "maintainability", "severity": "medium", "confidence": "medium", "message": "`return` only makes se... | 1 | true | [
""
] | [
"rules.python.lang.maintainability.return-not-in-function"
] | [
"maintainability"
] | [
"MEDIUM"
] | [
"MEDIUM"
] | [
157
] | [
157
] | [
37
] | [
41
] | [
""
] | [
"`return` only makes sense inside a function"
] | [
5
] | [
""
] | [
""
] | writers.py | /tango/writers.py | teebes/tango-core | BSD-3-Clause | |
2024-11-19T02:18:07.838968+00:00 | 1,570,563,284,000 | 20791a957599086a42a9baacee7c1fd017fcfd94 | 3 | {
"blob_id": "20791a957599086a42a9baacee7c1fd017fcfd94",
"branch_name": "refs/heads/master",
"committer_date": 1570563284000,
"content_id": "257b4ab9822e9951b94173983a9d0e5990ddba14",
"detected_licenses": [
"Apache-2.0"
],
"directory_id": "0f242ebd3f5a4e672871554ae712040130170f68",
"extension": "py"... | 2.6875 | stackv2 | #!/usr/bin/env python
""" Web app for dosna over ceph to see and display objects"""
from flask import Flask, render_template
import argparse
import re
import numpy as np
import rados
import dosna as dn
import matplotlib.image as plt
import matplotlib
BACKEND = 'ceph'
ERROR = 'Object not found'
def parse_args():
... | 205 | 34.27 | 78 | 29 | 1,698 | python | [{"finding_id": "semgrep_rules.python.flask.security.injection.raw-html-format_0e81066f1e3afcf5_ef495adb", "tool_name": "semgrep", "rule_id": "rules.python.flask.security.injection.raw-html-format", "finding_type": "security", "severity": "medium", "confidence": "medium", "message": "Detected user input flowing into a ... | 3 | true | [
"CWE-79"
] | [
"rules.python.flask.security.injection.raw-html-format"
] | [
"security"
] | [
"MEDIUM"
] | [
"MEDIUM"
] | [
49
] | [
56
] | [
28
] | [
62
] | [
"A07:2017 - Cross-Site Scripting (XSS)"
] | [
"Detected user input flowing into a manually constructed HTML string. You may be accidentally bypassing secure methods of rendering HTML by manually constructing HTML and this could create a cross-site scripting vulnerability, which could let attackers steal sensitive user data. To be sure this is safe, check that ... | [
5
] | [
"MEDIUM"
] | [
"MEDIUM"
] | webapp.py | /dosna/webapp/webapp.py | DiamondLightSource/DosNa | Apache-2.0 | |
2024-11-19T02:18:08.976718+00:00 | 1,447,779,855,000 | 6a72ae4c155b0b00c9fc8adfb951e424fe939494 | 2 | {
"blob_id": "6a72ae4c155b0b00c9fc8adfb951e424fe939494",
"branch_name": "refs/heads/master",
"committer_date": 1447779855000,
"content_id": "3a5f97e250fe5338034e70e1b471daedcf092958",
"detected_licenses": [
"Unlicense",
"BSD-3-Clause"
],
"directory_id": "d072b72a28103044bd83644d58126c44f2d03464",
... | 2.40625 | stackv2 | from sys import argv
from xml.dom import minidom
import csv
stem = argv[1][:-4] if argv[1].endswith('.xml') else argv[1]
xmldoc = minidom.parse('%s.xml'%stem)
labellist = xmldoc.getElementsByTagName('label')
labels = [l.attributes['name'].value for l in labellist]
labelset = set(labels)
for split in 'train','test':
... | 24 | 33.54 | 70 | 14 | 243 | python | [{"finding_id": "semgrep_rules.python.lang.security.use-defused-xml_4324c7e9e6f9f074_5b51cfb1", "tool_name": "semgrep", "rule_id": "rules.python.lang.security.use-defused-xml", "finding_type": "security", "severity": "high", "confidence": "low", "message": "The Python documentation recommends using `defusedxml` instead... | 3 | true | [
"CWE-611"
] | [
"rules.python.lang.security.use-defused-xml"
] | [
"security"
] | [
"LOW"
] | [
"HIGH"
] | [
2
] | [
2
] | [
1
] | [
28
] | [
"A04:2017 - XML External Entities (XXE)"
] | [
"The Python documentation recommends using `defusedxml` instead of `xml` because the native Python `xml` library is vulnerable to XML External Entity (XXE) attacks. These attacks can leak confidential data and \"XML bombs\" can cause denial of service."
] | [
7.5
] | [
"LOW"
] | [
"MEDIUM"
] | xmlcsv2xy.py | /mulan/xmlcsv2xy.py | pmineiro/randembed | Unlicense,BSD-3-Clause | |
2024-11-19T02:18:09.418555+00:00 | 1,502,221,415,000 | 02009846cdc3adee1831ce727853066f1d59c2b4 | 3 | {
"blob_id": "02009846cdc3adee1831ce727853066f1d59c2b4",
"branch_name": "refs/heads/master",
"committer_date": 1502221415000,
"content_id": "4a1305a44cb22b0ff8c9aea59c06d7be304e0dfb",
"detected_licenses": [
"Apache-2.0"
],
"directory_id": "86f034c5ea5c240f9fba3da368e797b555075b83",
"extension": "py"... | 2.9375 | stackv2 |
IDLE = 0
OFFLINE = 1
INGAME = 2
class User(object):
def __init__(self, username, uid, point=0, status=IDLE):
self.username = username
self.uid = uid
self.point = point
self.status = status
def ___str__(self):
return '{} {} {} {}'.format(self.username, self.uid, self.... | 20 | 21.25 | 86 | 10 | 117 | python | [{"finding_id": "semgrep_rules.python.lang.maintainability.is-function-without-parentheses_0429bc8713fd25fc_7275cc01", "tool_name": "semgrep", "rule_id": "rules.python.lang.maintainability.is-function-without-parentheses", "finding_type": "maintainability", "severity": "medium", "confidence": "medium", "message": "Is \... | 1 | true | [
""
] | [
"rules.python.lang.maintainability.is-function-without-parentheses"
] | [
"maintainability"
] | [
"MEDIUM"
] | [
"MEDIUM"
] | [
16
] | [
16
] | [
74
] | [
86
] | [
""
] | [
"Is \"is_idle\" a function or an attribute? If it is a function, you may have meant self.is_idle() because self.is_idle is always true."
] | [
5
] | [
""
] | [
""
] | user.py | /server/model/user.py | dyf102/Gomoku-online | Apache-2.0 | |
2024-11-19T02:18:09.471050+00:00 | 1,558,455,168,000 | 4d090767e57b53cd2d02a0be4c3b2e68fd425914 | 3 | {
"blob_id": "4d090767e57b53cd2d02a0be4c3b2e68fd425914",
"branch_name": "refs/heads/master",
"committer_date": 1558455168000,
"content_id": "8df33f720d60b36895e3ed7391fc4f2b6c7e3b77",
"detected_licenses": [
"BSD-3-Clause"
],
"directory_id": "2b11f834d52e09414f1b498e5dcfe4f794689f89",
"extension": "p... | 2.90625 | stackv2 | #Imports.
import RPi.GPIO as GPIO
from sense_hat import SenseHat
class Light_switch:
def __init__(self, channel1, channel2, channel3, id):
self.name = "light_switch/" + id
self.settings_topic = "settings/" + self.name
self.last_color = "[255,255,255]"
self.topic = "" # topic, which... | 61 | 35.07 | 101 | 13 | 525 | python | [{"finding_id": "semgrep_rules.python.lang.security.audit.eval-detected_05448442ff64a943_37946e7b", "tool_name": "semgrep", "rule_id": "rules.python.lang.security.audit.eval-detected", "finding_type": "security", "severity": "medium", "confidence": "low", "message": "Detected the use of eval(). eval() can be dangerous ... | 1 | true | [
"CWE-95"
] | [
"rules.python.lang.security.audit.eval-detected"
] | [
"security"
] | [
"LOW"
] | [
"MEDIUM"
] | [
34
] | [
34
] | [
25
] | [
40
] | [
"A03:2021 - Injection"
] | [
"Detected the use of eval(). eval() can be dangerous if used to evaluate dynamic content. If this content can be input from outside the program, this may be a code injection vulnerability. Ensure evaluated content is not definable by external sources."
] | [
5
] | [
"LOW"
] | [
"HIGH"
] | light_switch.py | /light_switch/light_switch.py | milosferencik/bachelor-thesis-smart-home-components | BSD-3-Clause | |
2024-11-19T02:18:10.892113+00:00 | 1,613,742,190,000 | 80006f407dc1aee34799a1ac7f54d783d7c2fe84 | 3 | {
"blob_id": "80006f407dc1aee34799a1ac7f54d783d7c2fe84",
"branch_name": "refs/heads/main",
"committer_date": 1614083458000,
"content_id": "fd5c64f7c1a8d8de43aeb17ee2996fb43242a157",
"detected_licenses": [
"MIT"
],
"directory_id": "0ebcaae68cb1c3c586bdadbba5daf104e50d5f41",
"extension": "py",
"file... | 3.203125 | stackv2 | #!/usr/bin/env python3
"""
Usage:
./line_bisect.py [options] <commands-file> <test>
Options:
--good=<line> The line number of a line where the test succeeds.
--bad=<line> The line number of a line where the test fails.
"""
import os
import sys
from dataclasses import dataclass
from pathlib import Path
from ... | 191 | 25.29 | 95 | 18 | 1,188 | python | [{"finding_id": "semgrep_rules.python.lang.security.audit.dangerous-system-call-audit_bcb94ec2f6a7dd9a_52f499a8", "tool_name": "semgrep", "rule_id": "rules.python.lang.security.audit.dangerous-system-call-audit", "finding_type": "security", "severity": "high", "confidence": "low", "message": "Found dynamic content used... | 1 | true | [
"CWE-78"
] | [
"rules.python.lang.security.audit.dangerous-system-call-audit"
] | [
"security"
] | [
"LOW"
] | [
"HIGH"
] | [
147
] | [
147
] | [
12
] | [
30
] | [
"A01:2017 - Injection"
] | [
"Found dynamic content used in a system call. This is dangerous if external data can reach this function call because it allows a malicious actor to execute commands. Use the 'subprocess' module instead, which is easier to use without accidentally exposing a command injection vulnerability."
] | [
7.5
] | [
"LOW"
] | [
"HIGH"
] | line_bisect.py | /line_bisect.py | davidparsson/line-bisect | MIT | |
2024-11-19T02:18:11.263980+00:00 | 1,584,356,704,000 | 3a72fb8eca3e78fafbf512307546b7410242c546 | 2 | {
"blob_id": "3a72fb8eca3e78fafbf512307546b7410242c546",
"branch_name": "refs/heads/master",
"committer_date": 1584356704000,
"content_id": "dc755df516d2b3fdedf52e3ab16301af47f8df0c",
"detected_licenses": [
"BSD-3-Clause"
],
"directory_id": "ce5afd47b46daec8db26876c46b40f8ff59535f1",
"extension": "p... | 2.390625 | stackv2 | import copy
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import config
settings = config.dics_settings
settings_columns = ['reg', 'sensor_type', 'pick_ori', 'inversion',
'weight_norm', 'normalize_fwd', 'real_filter',
'use_noise_cov', 'reduce_rank', 'n... | 190 | 38.31 | 138 | 12 | 2,090 | python | [{"finding_id": "semgrep_rules.python.lang.correctness.useless-eqeq_c99e962e612ffae8_b2fe50b2", "tool_name": "semgrep", "rule_id": "rules.python.lang.correctness.useless-eqeq", "finding_type": "correctness", "severity": "low", "confidence": "medium", "message": "This expression is always True: `plot_type == plot_type` ... | 1 | true | [
""
] | [
"rules.python.lang.correctness.useless-eqeq"
] | [
"correctness"
] | [
"MEDIUM"
] | [
"LOW"
] | [
43
] | [
43
] | [
6
] | [
24
] | [
""
] | [
"This expression is always True: `plot_type == plot_type` or `plot_type != plot_type`. If testing for floating point NaN, use `math.isnan(plot_type)`, or `cmath.isnan(plot_type)` if the number is complex."
] | [
3
] | [
""
] | [
""
] | plot_results_dics2.py | /plot_results_dics2.py | gitter-badger/beamformer_simulation | BSD-3-Clause | |
2024-11-19T02:18:11.899473+00:00 | 1,582,682,238,000 | 9b74fc26b8761a0929bfc5409e1e48f4cf100a63 | 2 | {
"blob_id": "9b74fc26b8761a0929bfc5409e1e48f4cf100a63",
"branch_name": "refs/heads/master",
"committer_date": 1582682238000,
"content_id": "bbf4628e2abb914b1aff9bf2bc03b950927d096c",
"detected_licenses": [
"MIT"
],
"directory_id": "65ef662ff94c102975bc54bb03c1e9f1ea1a1dca",
"extension": "py",
"fi... | 2.40625 | stackv2 | # src/models/score_models.py
import json
from pathlib import Path
import pickle
import sys
from typing import Any, Dict, NoReturn, Optional, Tuple, Union
from src.models.base_tuner import BaseTuner
from src.models.model_tuners import LassoRidgeTuner, ElasticNetTuner, RFRTuner, XGBRTuner
import pandas as pd
from skle... | 126 | 31.28 | 100 | 14 | 1,076 | python | [{"finding_id": "semgrep_rules.python.lang.security.deserialization.avoid-pickle_ded365fd99c9e73d_f0120c99", "tool_name": "semgrep", "rule_id": "rules.python.lang.security.deserialization.avoid-pickle", "finding_type": "security", "severity": "medium", "confidence": "low", "message": "Avoid using `pickle`, which is kno... | 3 | true | [
"CWE-502",
"CWE-502",
"CWE-502"
] | [
"rules.python.lang.security.deserialization.avoid-pickle",
"rules.python.lang.security.deserialization.avoid-pickle",
"rules.python.lang.security.deserialization.avoid-pickle"
] | [
"security",
"security",
"security"
] | [
"LOW",
"LOW",
"LOW"
] | [
"MEDIUM",
"MEDIUM",
"MEDIUM"
] | [
34,
35,
36
] | [
34,
35,
38
] | [
5,
5,
5
] | [
91,
99,
6
] | [
"A08:2017 - Insecure Deserialization",
"A08:2017 - Insecure Deserialization",
"A08:2017 - Insecure Deserialization"
] | [
"Avoid using `pickle`, which is known to lead to code execution vulnerabilities. When unpickling, the serialized data could be manipulated to run arbitrary code. Instead, consider serializing the relevant data as JSON or a similar text-based serialization format.",
"Avoid using `pickle`, which is known to lead to... | [
5,
5,
5
] | [
"LOW",
"LOW",
"LOW"
] | [
"MEDIUM",
"MEDIUM",
"MEDIUM"
] | score_models.py | /src/models/score_models.py | theLongLab/phx-parameter-map | MIT | |
2024-11-19T02:18:12.076830+00:00 | 1,602,190,441,000 | 4530d17ba27bc5c845ff0c9ecc66071ad3f2b8f4 | 3 | {
"blob_id": "4530d17ba27bc5c845ff0c9ecc66071ad3f2b8f4",
"branch_name": "refs/heads/master",
"committer_date": 1602190441000,
"content_id": "a8ef48200e40a8d79bd8296f034a79c01a05d94b",
"detected_licenses": [
"MIT"
],
"directory_id": "ad6bd9d14919a88ff86436983b6bfa4638ed111f",
"extension": "py",
"fi... | 3.203125 | stackv2 | import sys
class MissingVariableError(Exception):
pass
class BraceExpressionMissesVariable(Exception):
pass
class WrongTokenType(Exception):
pass
class WrongNumberOfParenthesses(Exception):
pass
class WrongArrayExpressionError(Exception):
pass
class MissingArrayError(Exception):
pass
clas... | 414 | 31.83 | 118 | 28 | 3,106 | python | [{"finding_id": "semgrep_rules.python.lang.security.audit.eval-detected_7a62f21d4a962d5a_0eb7cfc7", "tool_name": "semgrep", "rule_id": "rules.python.lang.security.audit.eval-detected", "finding_type": "security", "severity": "medium", "confidence": "low", "message": "Detected the use of eval(). eval() can be dangerous ... | 3 | true | [
"CWE-95",
"CWE-95"
] | [
"rules.python.lang.security.audit.eval-detected",
"rules.python.lang.security.audit.eval-detected"
] | [
"security",
"security"
] | [
"LOW",
"LOW"
] | [
"MEDIUM",
"MEDIUM"
] | [
100,
105
] | [
100,
105
] | [
20,
20
] | [
29,
29
] | [
"A03:2021 - Injection",
"A03:2021 - Injection"
] | [
"Detected the use of eval(). eval() can be dangerous if used to evaluate dynamic content. If this content can be input from outside the program, this may be a code injection vulnerability. Ensure evaluated content is not definable by external sources.",
"Detected the use of eval(). eval() can be dangerous if used... | [
5,
5
] | [
"LOW",
"LOW"
] | [
"HIGH",
"HIGH"
] | pilang.py | /pilang.py | paulinia/pilang | MIT | |
2024-11-19T02:18:15.565073+00:00 | 1,594,485,456,000 | c03ef4f0483bedf46a6a3aa7e3d37d7ca3cca0b5 | 3 | {
"blob_id": "c03ef4f0483bedf46a6a3aa7e3d37d7ca3cca0b5",
"branch_name": "refs/heads/master",
"committer_date": 1594485456000,
"content_id": "87347a6dab8f105b23fc3dd82ac5a16b31a37a7f",
"detected_licenses": [
"MIT"
],
"directory_id": "b140633e3638744577dc86ba7931d5724d4ecd46",
"extension": "py",
"fi... | 2.828125 | stackv2 | # -*- coding: utf-8 -*-
"""
Created on Tue Oct 22 06:58:17 2019
@author: ankit
"""
from bs4 import BeautifulSoup as soup # HTML data structure
from urllib.request import urlopen as uReq # Web client
import os, ssl
if (not os.environ.get('PYTHONHTTPSVERIFY', '') and
getattr(ssl, '_create_unverified_context', No... | 60 | 33.48 | 134 | 12 | 563 | python | [{"finding_id": "semgrep_rules.python.lang.security.unverified-ssl-context_ed15240358c44c26_a277fd83", "tool_name": "semgrep", "rule_id": "rules.python.lang.security.unverified-ssl-context", "finding_type": "security", "severity": "high", "confidence": "medium", "message": "Unverified SSL context detected. This will pe... | 1 | true | [
"CWE-295"
] | [
"rules.python.lang.security.unverified-ssl-context"
] | [
"security"
] | [
"MEDIUM"
] | [
"HIGH"
] | [
14
] | [
14
] | [
5
] | [
71
] | [
"A03:2017 - Sensitive Data Exposure"
] | [
"Unverified SSL context detected. This will permit insecure connections without verifying SSL certificates. Use 'ssl.create_default_context' instead."
] | [
7.5
] | [
"LOW"
] | [
"MEDIUM"
] | flipkart scrapping.py | /flipkart scrapping.py | ankitnayan12/Web-Scrapping-using-BeautifulSoup2 | MIT | |
2024-11-19T02:18:17.556907+00:00 | 1,678,636,281,000 | 48bae552fa85929b0163c1e3076f3619d26eb3b6 | 3 | {
"blob_id": "48bae552fa85929b0163c1e3076f3619d26eb3b6",
"branch_name": "refs/heads/master",
"committer_date": 1678636281000,
"content_id": "3518dcfbe59879a85fd68ed02743501e9c88d306",
"detected_licenses": [
"MIT"
],
"directory_id": "718eb53bc772791c73d5a75347a680528bbe2253",
"extension": "py",
"fi... | 2.9375 | stackv2 | import pandas as pd
from sklearn.preprocessing import LabelEncoder
df = pd.read_csv('primaryschool.csv', sep='\t',
header=None,
names=['timestamp', 'node_a', 'node_b', 'class_a', 'class_b'])
df['timestamp'] = pd.to_datetime(df['timestamp'], unit='s')
df['day'] = df['timestamp'].app... | 44 | 32.84 | 84 | 12 | 474 | python | [{"finding_id": "semgrep_rules.python.lang.maintainability.return-not-in-function_300fcbf59cce40c7_0c632c32", "tool_name": "semgrep", "rule_id": "rules.python.lang.maintainability.return-not-in-function", "finding_type": "maintainability", "severity": "medium", "confidence": "medium", "message": "`return` only makes se... | 3 | true | [
"",
"",
""
] | [
"rules.python.lang.maintainability.return-not-in-function",
"rules.python.lang.maintainability.return-not-in-function",
"rules.python.lang.maintainability.return-not-in-function"
] | [
"maintainability",
"maintainability",
"maintainability"
] | [
"MEDIUM",
"MEDIUM",
"MEDIUM"
] | [
"MEDIUM",
"MEDIUM",
"MEDIUM"
] | [
11,
12,
13
] | [
11,
12,
13
] | [
46,
47,
48
] | [
51,
53,
56
] | [
"",
"",
""
] | [
"`return` only makes sense inside a function",
"`return` only makes sense inside a function",
"`return` only makes sense inside a function"
] | [
5,
5,
5
] | [
"",
"",
""
] | [
"",
"",
""
] | process_edgelist.py | /multidynet/datasets/raw_data/primaryschool/process_edgelist.py | joshloyal/multidynet | MIT | |
2024-11-19T02:18:19.856572+00:00 | 1,479,921,604,000 | 81f6c9fe239ab1ef68cc59243247652f9d15af4b | 2 | {
"blob_id": "81f6c9fe239ab1ef68cc59243247652f9d15af4b",
"branch_name": "refs/heads/master",
"committer_date": 1479921604000,
"content_id": "2862088870030e1b506ac7e10dff65b01743065e",
"detected_licenses": [
"MIT"
],
"directory_id": "61551b2b8d76587357ed6e32b16aea6adeeab902",
"extension": "py",
"fi... | 2.40625 | stackv2 | from __future__ import print_function
import tensorflow as tf
import argparse
import os
from six.moves import cPickle
from model import Model
sess = None
with open(os.path.join('save/save', 'config.pkl'), 'rb') as f:
saved_args = cPickle.load(f)
with open(os.path.join('save/save', 'words_vocab.pkl'), 'rb') as f:
... | 43 | 32.44 | 113 | 11 | 334 | python | [{"finding_id": "semgrep_rules.python.lang.security.deserialization.avoid-cPickle_f28f48cea8110a5c_b2831bb8", "tool_name": "semgrep", "rule_id": "rules.python.lang.security.deserialization.avoid-cPickle", "finding_type": "security", "severity": "medium", "confidence": "low", "message": "Avoid using `cPickle`, which is ... | 2 | true | [
"CWE-502",
"CWE-502"
] | [
"rules.python.lang.security.deserialization.avoid-cPickle",
"rules.python.lang.security.deserialization.avoid-cPickle"
] | [
"security",
"security"
] | [
"LOW",
"LOW"
] | [
"MEDIUM",
"MEDIUM"
] | [
10,
12
] | [
10,
12
] | [
18,
20
] | [
33,
35
] | [
"A08:2017 - Insecure Deserialization",
"A08:2017 - Insecure Deserialization"
] | [
"Avoid using `cPickle`, which is known to lead to code execution vulnerabilities. When unpickling, the serialized data could be manipulated to run arbitrary code. Instead, consider serializing the relevant data as JSON or a similar text-based serialization format.",
"Avoid using `cPickle`, which is known to lead ... | [
5,
5
] | [
"LOW",
"LOW"
] | [
"MEDIUM",
"MEDIUM"
] | sample.py | /word-rnn-tensorflow-master/sample.py | PorkShoulderHolder/battlebots | MIT | |
2024-11-19T02:18:21.895518+00:00 | 1,537,447,319,000 | dd2a1e190911a62325b13fe2f1eca70eaffabd3c | 3 | {
"blob_id": "dd2a1e190911a62325b13fe2f1eca70eaffabd3c",
"branch_name": "refs/heads/master",
"committer_date": 1537447319000,
"content_id": "c3132dc315c6905cfee2b491d069dd467c43e10b",
"detected_licenses": [
"Apache-2.0"
],
"directory_id": "8f52a8a38b9a7a1d58d46b3149b595d43697c82a",
"extension": "py"... | 2.578125 | stackv2 | import argparse
import pickle
import os
import numpy as np
from numpy import zeros, ones, array, arange, copy, ravel_multi_index, unravel_index
from numpy import setdiff1d, hstack, hsplit, vsplit, sort, prod, lexsort, unique, bincount
from numpy import dot, zeros, array, eye, kron, prod
from scipy.sparse import lil_mat... | 92 | 34.07 | 126 | 11 | 832 | python | [{"finding_id": "semgrep_rules.python.lang.best-practice.python-debugger-found_467928382576f5b3_4f65dd88", "tool_name": "semgrep", "rule_id": "rules.python.lang.best-practice.python-debugger-found", "finding_type": "best-practice", "severity": "medium", "confidence": "medium", "message": "Importing the python debugger;... | 5 | true | [
"CWE-502",
"CWE-502",
"CWE-502",
"CWE-502"
] | [
"rules.python.lang.security.deserialization.avoid-pickle",
"rules.python.lang.security.deserialization.avoid-pickle",
"rules.python.lang.security.deserialization.avoid-pickle",
"rules.python.lang.security.deserialization.avoid-pickle"
] | [
"security",
"security",
"security",
"security"
] | [
"LOW",
"LOW",
"LOW",
"LOW"
] | [
"MEDIUM",
"MEDIUM",
"MEDIUM",
"MEDIUM"
] | [
26,
32,
74,
84
] | [
26,
32,
74,
84
] | [
9,
5,
1,
1
] | [
32,
28,
41,
41
] | [
"A08:2017 - Insecure Deserialization",
"A08:2017 - Insecure Deserialization",
"A08:2017 - Insecure Deserialization",
"A08:2017 - Insecure Deserialization"
] | [
"Avoid using `pickle`, which is known to lead to code execution vulnerabilities. When unpickling, the serialized data could be manipulated to run arbitrary code. Instead, consider serializing the relevant data as JSON or a similar text-based serialization format.",
"Avoid using `pickle`, which is known to lead to... | [
5,
5,
5,
5
] | [
"LOW",
"LOW",
"LOW",
"LOW"
] | [
"MEDIUM",
"MEDIUM",
"MEDIUM",
"MEDIUM"
] | dataCoherence.py | /src/dataCoherence.py | HarshitaD/sictf | Apache-2.0 | |
2024-11-19T02:18:26.077125+00:00 | 1,506,496,145,000 | b6d4efb9d2a301bbbe9ad45b0ed103b94abbd067 | 3 | {
"blob_id": "b6d4efb9d2a301bbbe9ad45b0ed103b94abbd067",
"branch_name": "refs/heads/master",
"committer_date": 1506496145000,
"content_id": "ea2e3699993224470338164607e89a6aac2e8c8b",
"detected_licenses": [
"MIT"
],
"directory_id": "168cd01de19a61dcda5782800e12bba09ab234ec",
"extension": "py",
"fi... | 2.53125 | stackv2 | """Example running MemN2N on a single bAbI task.
Download tasks from facebook.ai/babi """
from __future__ import absolute_import
from __future__ import print_function
from data_utils import load_task, vectorize_data
from sklearn import cross_validation, metrics
from memn2n import MemN2N
from itertools import chain
fro... | 187 | 43.64 | 136 | 19 | 2,033 | python | [{"finding_id": "semgrep_rules.python.lang.maintainability.return-not-in-function_ef056f82416814a7_ceb70b7e", "tool_name": "semgrep", "rule_id": "rules.python.lang.maintainability.return-not-in-function", "finding_type": "maintainability", "severity": "medium", "confidence": "medium", "message": "`return` only makes se... | 1 | true | [
""
] | [
"rules.python.lang.maintainability.return-not-in-function"
] | [
"maintainability"
] | [
"MEDIUM"
] | [
"MEDIUM"
] | [
70
] | [
70
] | [
40
] | [
45
] | [
""
] | [
"`return` only makes sense inside a function"
] | [
5
] | [
""
] | [
""
] | single.py | /single.py | emmayangemma/memn2n-1 | MIT | |
2024-11-19T02:29:48.484239+00:00 | 1,409,677,563,000 | 370be0cc7a9dce761b52d6c6745c4ea6f702a91b | 2 | {
"blob_id": "370be0cc7a9dce761b52d6c6745c4ea6f702a91b",
"branch_name": "refs/heads/master",
"committer_date": 1409677563000,
"content_id": "763c230adb9b02ccbade97a01e707cac05772a9a",
"detected_licenses": [
"MIT"
],
"directory_id": "65d582c5c324c04eb31074fa26895701161822c1",
"extension": "py",
"fi... | 2.40625 | stackv2 | from PySide import QtCore, QtGui
from .qt_util import read_qt_image
from .graphics import GraphicsView, GraphicsScene, BoxResizable
from segment import segment_edges, segment_intensity
from multiprocessing import Process, Queue
import os
import sys
import csv
import cv2
class ImageViewer(QtGui.QMainWindow):
d... | 286 | 37.37 | 79 | 19 | 2,236 | python | [{"finding_id": "semgrep_rules.python.lang.best-practice.unspecified-open-encoding_05436581882f98eb_311ffce8", "tool_name": "semgrep", "rule_id": "rules.python.lang.best-practice.unspecified-open-encoding", "finding_type": "best-practice", "severity": "medium", "confidence": "medium", "message": "Missing 'encoding' par... | 4 | true | [
""
] | [
"rules.python.lang.maintainability.code-after-unconditional-return"
] | [
"maintainability"
] | [
"MEDIUM"
] | [
"MEDIUM"
] | [
283
] | [
286
] | [
9
] | [
24
] | [
""
] | [
"code after return statement will not be executed"
] | [
5
] | [
""
] | [
""
] | image_viewer.py | /inselect/image_viewer.py | holtzhau/inselect | MIT | |
2024-11-19T02:29:53.265240+00:00 | 1,688,638,399,000 | a59331c69784f0b2258b87a112606bdf56f0a17a | 3 | {
"blob_id": "a59331c69784f0b2258b87a112606bdf56f0a17a",
"branch_name": "refs/heads/main",
"committer_date": 1688638399000,
"content_id": "a948034373554ed21f486b8df3d47332f0d7026a",
"detected_licenses": [
"MIT"
],
"directory_id": "a3dba99fe81504c27d1cb369c1dcb90863a01a80",
"extension": "py",
"file... | 2.84375 | stackv2 | from ..models import Account, User
from . import FetchError
from .fetchers import PhotosetsFetcher, RecentPhotosFetcher
from .filesfetchers import OriginalFilesFetcher
# Classes for fetching data from the API for ONE OR MORE Accounts.
# These are wrappers for other classes which do the heavy lifting.
# These call thos... | 139 | 31.43 | 88 | 17 | 930 | python | [{"finding_id": "semgrep_rules.python.lang.maintainability.is-function-without-parentheses_87f9920d89cadd39_7c645403", "tool_name": "semgrep", "rule_id": "rules.python.lang.maintainability.is-function-without-parentheses", "finding_type": "maintainability", "severity": "medium", "confidence": "medium", "message": "Is \... | 2 | true | [
""
] | [
"rules.python.lang.maintainability.is-function-without-parentheses"
] | [
"maintainability"
] | [
"MEDIUM"
] | [
"MEDIUM"
] | [
67
] | [
67
] | [
16
] | [
33
] | [
""
] | [
"Is \"is_active\" a function or an attribute? If it is a function, you may have meant account.is_active() because account.is_active is always true."
] | [
5
] | [
""
] | [
""
] | multifetchers.py | /ditto/flickr/fetch/multifetchers.py | philgyford/django-ditto | MIT | |
2024-11-19T02:29:54.215582+00:00 | 1,539,025,636,000 | 1140e300735677598cd5f886191d8951e42873d3 | 3 | {
"blob_id": "1140e300735677598cd5f886191d8951e42873d3",
"branch_name": "refs/heads/master",
"committer_date": 1539025636000,
"content_id": "27d866f56de9edecf078f24ea21e7069c8618390",
"detected_licenses": [
"Apache-2.0"
],
"directory_id": "443721b65b3ee5236d2ab67cccd623ae736f74d5",
"extension": "py"... | 2.609375 | stackv2 | #!/usr/bin/env python
import subprocess
import yaml
import fileinput
import requests
import sys
import json
#Set your config file route here:
config = "/route/to/your/config/goes/here/config.yml"
#This is the subdirectory that your tests live in amongst the code in your git repository.
test_subdirectory = "subdir... | 92 | 32.24 | 117 | 17 | 715 | python | [{"finding_id": "semgrep_rules.python.lang.security.audit.dangerous-subprocess-use-audit_bc195d52b119c409_008ff928", "tool_name": "semgrep", "rule_id": "rules.python.lang.security.audit.dangerous-subprocess-use-audit", "finding_type": "security", "severity": "high", "confidence": "low", "message": "Detected subprocess ... | 10 | true | [
"CWE-78",
"CWE-78",
"CWE-78",
"CWE-78",
"CWE-78",
"CWE-78"
] | [
"rules.python.lang.security.audit.dangerous-subprocess-use-audit",
"rules.python.lang.security.audit.subprocess-shell-true",
"rules.python.lang.security.audit.dangerous-subprocess-use-audit",
"rules.python.lang.security.audit.subprocess-shell-true",
"rules.python.lang.security.audit.dangerous-subprocess-use... | [
"security",
"security",
"security",
"security",
"security",
"security"
] | [
"LOW",
"MEDIUM",
"LOW",
"MEDIUM",
"LOW",
"MEDIUM"
] | [
"HIGH",
"HIGH",
"HIGH",
"HIGH",
"HIGH",
"HIGH"
] | [
22,
22,
24,
24,
35,
35
] | [
22,
22,
24,
24,
35,
35
] | [
9,
112,
9,
113,
17,
77
] | [
117,
116,
118,
117,
82,
81
] | [
"A01:2017 - Injection",
"A01:2017 - Injection",
"A01:2017 - Injection",
"A01:2017 - Injection",
"A01:2017 - Injection",
"A01:2017 - Injection"
] | [
"Detected subprocess function 'Popen' without a static string. If this data can be controlled by a malicious actor, it may be an instance of command injection. Audit the use of this call to ensure it is not controllable by an external resource. You may consider using 'shlex.escape()'.",
"Found 'subprocess' functi... | [
7.5,
7.5,
7.5,
7.5,
7.5,
7.5
] | [
"LOW",
"HIGH",
"LOW",
"HIGH",
"LOW",
"HIGH"
] | [
"HIGH",
"LOW",
"HIGH",
"LOW",
"HIGH",
"LOW"
] | apif-git.py | /apif-git.py | jioanni/apif-git | Apache-2.0 | |
2024-11-19T02:29:58.730850+00:00 | 1,687,936,235,000 | 449c8597440cf24a81ccc941e6199c7a34cfc3c3 | 2 | {
"blob_id": "449c8597440cf24a81ccc941e6199c7a34cfc3c3",
"branch_name": "refs/heads/master",
"committer_date": 1687938634000,
"content_id": "e71a1236dcced7e64875374925c418e068729223",
"detected_licenses": [
"Apache-2.0"
],
"directory_id": "6da842ed788ef50c6b9d040f5ec8cf0a082af420",
"extension": "py"... | 2.3125 | stackv2 | # Copyright (C) 2015 Yahoo! Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required... | 498 | 30.48 | 79 | 17 | 3,455 | python | [{"finding_id": "semgrep_rules.python.lang.security.use-defused-xmlrpc_5b7763a2d9a1f37f_08209c6a", "tool_name": "semgrep", "rule_id": "rules.python.lang.security.use-defused-xmlrpc", "finding_type": "security", "severity": "high", "confidence": "low", "message": "Detected use of xmlrpc. xmlrpc is not inherently safe fr... | 1 | true | [
"CWE-776"
] | [
"rules.python.lang.security.use-defused-xmlrpc"
] | [
"security"
] | [
"LOW"
] | [
"HIGH"
] | [
35
] | [
35
] | [
1
] | [
39
] | [
"A04:2017 - XML External Entities (XXE)"
] | [
"Detected use of xmlrpc. xmlrpc is not inherently safe from vulnerabilities. Use defusedxml.xmlrpc instead."
] | [
7.5
] | [
"LOW"
] | [
"MEDIUM"
] | msgpackutils.py | /oslo_serialization/msgpackutils.py | openstack/oslo.serialization | Apache-2.0 | |
2024-11-19T02:30:05.369608+00:00 | 1,545,747,860,000 | 99c4449526e112b0b6ccb34fe9552768ea08a28e | 3 | {
"blob_id": "99c4449526e112b0b6ccb34fe9552768ea08a28e",
"branch_name": "refs/heads/master",
"committer_date": 1545747860000,
"content_id": "5e9fad0053c246ebe44534e0bed9d9d1ba3376b9",
"detected_licenses": [
"Apache-2.0"
],
"directory_id": "85c1aa2c9b3b60237e58a438193484600f39584d",
"extension": "py"... | 2.953125 | stackv2 | import os, time, itertools, imageio, pickle
import numpy as np
import matplotlib.pyplot as plt
import tensorflow as tf
from tensorflow.examples.tutorials.mnist import input_data
class GAN:
#GAN Generator and Discriminator hidden layer config
Generator_config = {"layer_1":256,"layer_2":512,"layer_3":1024,"layer... | 297 | 36.76 | 153 | 17 | 3,143 | python | [{"finding_id": "semgrep_rules.python.lang.security.deserialization.avoid-pickle_fc44eed4659fd366_81df4185", "tool_name": "semgrep", "rule_id": "rules.python.lang.security.deserialization.avoid-pickle", "finding_type": "security", "severity": "medium", "confidence": "low", "message": "Avoid using `pickle`, which is kno... | 1 | true | [
"CWE-502"
] | [
"rules.python.lang.security.deserialization.avoid-pickle"
] | [
"security"
] | [
"LOW"
] | [
"MEDIUM"
] | [
250
] | [
250
] | [
13
] | [
39
] | [
"A08:2017 - Insecure Deserialization"
] | [
"Avoid using `pickle`, which is known to lead to code execution vulnerabilities. When unpickling, the serialized data could be manipulated to run arbitrary code. Instead, consider serializing the relevant data as JSON or a similar text-based serialization format."
] | [
5
] | [
"LOW"
] | [
"MEDIUM"
] | GAN.py | /GANNet/GAN.py | zhaoqiange/GAN_tensorflow | Apache-2.0 | |
2024-11-19T02:30:07.083497+00:00 | 1,671,947,122,000 | a81791146a6621b18678ab1d4108e2242696a05e | 3 | {
"blob_id": "a81791146a6621b18678ab1d4108e2242696a05e",
"branch_name": "refs/heads/master",
"committer_date": 1671947122000,
"content_id": "701d483422326b231679bb6f2f1f316a02ff8b70",
"detected_licenses": [
"MIT"
],
"directory_id": "2fc372b0e902b11adbeb656bfabf482c1f5d1191",
"extension": "py",
"fi... | 2.875 | stackv2 | with open("input.txt") as f:
data = f.read().strip()
intcode = [int(a) for a in data.split(",")]
from collections import defaultdict
import sys
def run_yield(nums, get_input):
ops = {
1: {
'in': 2,
'out': 1,
'op': lambda a, b: a+b,
},
2: {
... | 348 | 38.49 | 144 | 23 | 3,411 | python | [{"finding_id": "semgrep_rules.python.lang.best-practice.unspecified-open-encoding_ab6e544fe7c41af0_3fbbb8c7", "tool_name": "semgrep", "rule_id": "rules.python.lang.best-practice.unspecified-open-encoding", "finding_type": "best-practice", "severity": "medium", "confidence": "medium", "message": "Missing 'encoding' par... | 2 | true | [
""
] | [
"rules.python.lang.maintainability.useless-if-body"
] | [
"maintainability"
] | [
"MEDIUM"
] | [
"MEDIUM"
] | [
312
] | [
315
] | [
17
] | [
52
] | [
""
] | [
"Useless if statement; both blocks have the same body"
] | [
5
] | [
""
] | [
""
] | solve.py | /2019/25/solve.py | lamperi/aoc | MIT | |
2024-11-19T02:30:07.489956+00:00 | 1,631,186,224,000 | 280500afb9feb4366766f10845dddbc2a9784b55 | 3 | {
"blob_id": "280500afb9feb4366766f10845dddbc2a9784b55",
"branch_name": "refs/heads/master",
"committer_date": 1631186224000,
"content_id": "05913f5b0f1a63567de73b5bf9462cd9cd9d1466",
"detected_licenses": [
"MIT",
"BSD-3-Clause"
],
"directory_id": "0b087e08ff1413a4f31debc081c9499a82870cb5",
"ext... | 2.515625 | stackv2 | """Tool for translating Knossos .ks file into Python .py file.
"""
import sys
import argparse
from collections import namedtuple
import ksc.backends
from ksc.backends import specs
from ksc.type import Type
from ksc.expr import Def, EDef, GDef, Rule, Const, Var, Lam, Call, Let, If
from ksc.parse_ks import parse_ks_stri... | 356 | 30.83 | 88 | 21 | 2,626 | python | [{"finding_id": "semgrep_rules.python.lang.maintainability.is-function-without-parentheses_9ed198b8cf015cd5_187d2629", "tool_name": "semgrep", "rule_id": "rules.python.lang.maintainability.is-function-without-parentheses", "finding_type": "maintainability", "severity": "medium", "confidence": "medium", "message": "Is \... | 5 | true | [
"",
"",
""
] | [
"rules.python.lang.maintainability.is-function-without-parentheses",
"rules.python.lang.maintainability.is-function-without-parentheses",
"rules.python.lang.maintainability.is-function-without-parentheses"
] | [
"maintainability",
"maintainability",
"maintainability"
] | [
"MEDIUM",
"MEDIUM",
"MEDIUM"
] | [
"MEDIUM",
"MEDIUM",
"MEDIUM"
] | [
48,
61,
75
] | [
48,
61,
75
] | [
10,
8,
8
] | [
28,
26,
26
] | [
"",
"",
""
] | [
"Is \"is_tensor\" a function or an attribute? If it is a function, you may have meant arg_type.is_tensor() because arg_type.is_tensor is always true.",
"Is \"is_tensor\" a function or an attribute? If it is a function, you may have meant arg_type.is_tensor() because arg_type.is_tensor is always true.",
"Is \"is... | [
5,
5,
5
] | [
"",
"",
""
] | [
"",
"",
""
] | translate.py | /src/python/ksc/translate.py | tomjaguarpaw/knossos-ksc | MIT,BSD-3-Clause | |
2024-11-19T02:30:11.203871+00:00 | 1,577,102,916,000 | 9b7ca7a28d8c5cd817b5f8f4cbe88843724226bf | 3 | {
"blob_id": "9b7ca7a28d8c5cd817b5f8f4cbe88843724226bf",
"branch_name": "refs/heads/master",
"committer_date": 1577102916000,
"content_id": "5dcaf791382959aaa01d991c4bdf8fc4610f1620",
"detected_licenses": [
"MIT"
],
"directory_id": "9f1bfeeebdbc1c2fb951775e4820786efec8d093",
"extension": "py",
"fi... | 2.828125 | stackv2 | from common.intcode import IntcodeComputer
from itertools import permutations
with open("input/star13", "r") as input_file:
amplifier_program = input_file.read().strip()
def setup_amplifier_chain(phase_settings, daisy_chain=False):
amplifiers = []
for amplifier_index in range(5):
input_array = [... | 42 | 34.81 | 81 | 14 | 359 | python | [{"finding_id": "semgrep_rules.python.lang.best-practice.unspecified-open-encoding_93becf99ef44969a_a7ca65b3", "tool_name": "semgrep", "rule_id": "rules.python.lang.best-practice.unspecified-open-encoding", "finding_type": "best-practice", "severity": "medium", "confidence": "medium", "message": "Missing 'encoding' par... | 2 | true | [
""
] | [
"rules.python.lang.maintainability.is-function-without-parentheses"
] | [
"maintainability"
] | [
"MEDIUM"
] | [
"MEDIUM"
] | [
37
] | [
37
] | [
19
] | [
47
] | [
""
] | [
"Is \"is_terminated\" a function or an attribute? If it is a function, you may have meant amplifiers[-1].is_terminated() because amplifiers[-1].is_terminated is always true."
] | [
5
] | [
""
] | [
""
] | star13and14.py | /stars/star13and14.py | xheory/advent-of-code-2019 | MIT | |
2024-11-19T02:30:17.095399+00:00 | 1,555,857,142,000 | 9e70e206b5f19add0f613ac0a0a94a14ebfad7f1 | 4 | {
"blob_id": "9e70e206b5f19add0f613ac0a0a94a14ebfad7f1",
"branch_name": "refs/heads/master",
"committer_date": 1555857142000,
"content_id": "e90b074c1615f337635473c5acc761d1eac089b5",
"detected_licenses": [
"MIT"
],
"directory_id": "c097e75cb898d5702d8ea966ec33ec27ca3619aa",
"extension": "py",
"fi... | 3.96875 | stackv2 | # 12-3 map
# 12-4 map和lambda
list_x = [1,2,3,4,5,6,7,8]
list_y = [1,2,3,4,5,6]
def square(x):
return x * x
r = map(square, list_x)
# map + lambda: 使用lambda替换square函数
# 注意lambda传入的参数有几个,后面的列表参数就要有几个,也就是x对应list_x, y对应list_y
# 计算的结果的个数和参数列表中个数最少的那个长度一样
r = map(lambda x,y: x*x+y, list_x, list_y)
print(list(r))
| 19 | 15.79 | 55 | 9 | 150 | python | [{"finding_id": "semgrep_rules.python.lang.maintainability.return-not-in-function_6a19cfa2664b0146_e9b042ae", "tool_name": "semgrep", "rule_id": "rules.python.lang.maintainability.return-not-in-function", "finding_type": "maintainability", "severity": "medium", "confidence": "medium", "message": "`return` only makes se... | 1 | true | [
""
] | [
"rules.python.lang.maintainability.return-not-in-function"
] | [
"maintainability"
] | [
"MEDIUM"
] | [
"MEDIUM"
] | [
15
] | [
15
] | [
21
] | [
26
] | [
""
] | [
"`return` only makes sense inside a function"
] | [
5
] | [
""
] | [
""
] | map_learn_1203.py | /12函数式编:匿名函数,高阶函数,装饰器/map_learn_1203.py | FrancisJen/pythonic | MIT | |
2024-11-19T02:30:17.273859+00:00 | 1,457,809,852,000 | 7ef8cbccc55b265717eb77dd711502cb62fb1488 | 2 | {
"blob_id": "7ef8cbccc55b265717eb77dd711502cb62fb1488",
"branch_name": "refs/heads/master",
"committer_date": 1457809852000,
"content_id": "d005472e6695a9e73248b17932da614e978c9dd8",
"detected_licenses": [
"MIT"
],
"directory_id": "52eb0c33bf2b6ff210d915801fd2f7a6025743a9",
"extension": "py",
"fi... | 2.34375 | stackv2 | from flask import Flask, request, jsonify, redirect, url_for
from newspaper import Article
from xml.etree import ElementTree
from BeautifulSoup import BeautifulSoup
from flask.ext.cors import CORS, cross_origin
from urlparse import urljoin
app = Flask(__name__)
cors = CORS(app)
app.config['CORS_HEADERS'] = 'Content-... | 98 | 22.63 | 68 | 17 | 586 | python | [{"finding_id": "semgrep_rules.python.lang.security.use-defused-xml_e006f994880901df_2f041323", "tool_name": "semgrep", "rule_id": "rules.python.lang.security.use-defused-xml", "finding_type": "security", "severity": "high", "confidence": "low", "message": "The Python documentation recommends using `defusedxml` instead... | 1 | true | [
"CWE-611"
] | [
"rules.python.lang.security.use-defused-xml"
] | [
"security"
] | [
"LOW"
] | [
"HIGH"
] | [
3
] | [
3
] | [
1
] | [
35
] | [
"A04:2017 - XML External Entities (XXE)"
] | [
"The Python documentation recommends using `defusedxml` instead of `xml` because the native Python `xml` library is vulnerable to XML External Entity (XXE) attacks. These attacks can leak confidential data and \"XML bombs\" can cause denial of service."
] | [
7.5
] | [
"LOW"
] | [
"MEDIUM"
] | __init__.py | /abstract/__init__.py | aredotna/abstract | MIT | |
2024-11-19T02:30:17.832444+00:00 | 1,582,517,208,000 | b0d835861617e6b5a4c56422320eaa30364c9ed4 | 3 | {
"blob_id": "b0d835861617e6b5a4c56422320eaa30364c9ed4",
"branch_name": "refs/heads/master",
"committer_date": 1582517208000,
"content_id": "e29dbf41b9bd198e6e7bda3044c3ab6b833ef7e6",
"detected_licenses": [
"BSD-3-Clause"
],
"directory_id": "3348fd7a98ab72cdc6f62c192284e99f04a5dbc5",
"extension": "p... | 2.734375 | stackv2 | """
Convert data tables from linear iq,diq to log(iq), diq/iq
"""
from __future__ import print_function
import argparse
import sys
from contextlib import closing
import numpy as np
from .. import sas_io
from ..sas_io import asblob, asdata
parser = argparse.ArgumentParser()
parser.add_argument(
"--database", typ... | 46 | 27.91 | 70 | 17 | 331 | python | [{"finding_id": "semgrep_rules.python.lang.security.audit.formatted-sql-query_e5b38a00f0680c89_603ca0fb", "tool_name": "semgrep", "rule_id": "rules.python.lang.security.audit.formatted-sql-query", "finding_type": "security", "severity": "medium", "confidence": "low", "message": "Detected possible formatted SQL query. U... | 4 | true | [
"CWE-89",
"CWE-89",
"CWE-89",
"CWE-89"
] | [
"rules.python.lang.security.audit.formatted-sql-query",
"rules.python.sqlalchemy.security.sqlalchemy-execute-raw-query",
"rules.python.sqlalchemy.security.sqlalchemy-execute-raw-query",
"rules.python.sqlalchemy.security.sqlalchemy-execute-raw-query"
] | [
"security",
"security",
"security",
"security"
] | [
"LOW",
"LOW",
"LOW",
"LOW"
] | [
"MEDIUM",
"HIGH",
"HIGH",
"HIGH"
] | [
34,
34,
36,
41
] | [
34,
34,
38,
43
] | [
9,
9,
13,
13
] | [
56,
56,
26,
34
] | [
"A01:2017 - Injection",
"A01:2017 - Injection",
"A01:2017 - Injection",
"A01:2017 - Injection"
] | [
"Detected possible formatted SQL query. Use parameterized queries instead.",
"Avoiding SQL string concatenation: untrusted input concatenated with raw SQL query can result in SQL Injection. In order to execute raw query safely, prepared statement should be used. SQLAlchemy provides TextualSQL to easily used prepa... | [
5,
7.5,
7.5,
7.5
] | [
"LOW",
"LOW",
"LOW",
"LOW"
] | [
"HIGH",
"HIGH",
"HIGH",
"HIGH"
] | logsql.py | /sasnets/util/logsql.py | scattering/sasnets | BSD-3-Clause | |
2024-11-19T02:30:17.960779+00:00 | 1,543,716,429,000 | d0fd8833cf99057e2a44214431db634c62dd457c | 2 | {
"blob_id": "d0fd8833cf99057e2a44214431db634c62dd457c",
"branch_name": "refs/heads/master",
"committer_date": 1543716429000,
"content_id": "dde8bb85e42e1e0b4461f38148de765b6fd74573",
"detected_licenses": [
"Apache-2.0"
],
"directory_id": "c627d118bfbdbd1e1a64c9d43c49e3d74b3a3fd2",
"extension": "py"... | 2.484375 | stackv2 | import numpy as np
import os
import pickle
import string
import sys
import torch
import torch.nn as nn
import torch.nn.functional as F
import pdb
from IPython import embed
from torch.utils.data import Dataset
import click
from flask import Flask, jsonify, request
from qanta.dataset import QuizBowlDataset
DAN_MODEL_... | 523 | 30.52 | 91 | 20 | 3,763 | python | [{"finding_id": "semgrep_rules.python.lang.best-practice.python-debugger-found_dd36e6ddc49d5321_91c4c400", "tool_name": "semgrep", "rule_id": "rules.python.lang.best-practice.python-debugger-found", "finding_type": "best-practice", "severity": "medium", "confidence": "medium", "message": "Importing the python debugger;... | 11 | true | [
"CWE-502",
"CWE-502",
"CWE-502",
"",
"",
"",
""
] | [
"rules.python.lang.security.deserialization.avoid-pickle",
"rules.python.lang.security.deserialization.avoid-pickle",
"rules.python.lang.security.deserialization.avoid-pickle",
"rules.python.lang.maintainability.useless-inner-function",
"rules.python.lang.maintainability.useless-inner-function",
"rules.py... | [
"security",
"security",
"security",
"maintainability",
"maintainability",
"maintainability",
"best-practice"
] | [
"LOW",
"LOW",
"LOW",
"MEDIUM",
"MEDIUM",
"MEDIUM",
"MEDIUM"
] | [
"MEDIUM",
"MEDIUM",
"MEDIUM",
"HIGH",
"HIGH",
"HIGH",
"MEDIUM"
] | [
192,
194,
342,
472,
478,
486,
498
] | [
192,
194,
342,
476,
484,
492,
500
] | [
52,
45,
20,
5,
5,
5,
1
] | [
66,
59,
34,
74,
11,
11,
9
] | [
"A08:2017 - Insecure Deserialization",
"A08:2017 - Insecure Deserialization",
"A08:2017 - Insecure Deserialization",
"",
"",
"",
""
] | [
"Avoid using `pickle`, which is known to lead to code execution vulnerabilities. When unpickling, the serialized data could be manipulated to run arbitrary code. Instead, consider serializing the relevant data as JSON or a similar text-based serialization format.",
"Avoid using `pickle`, which is known to lead to... | [
5,
5,
5,
7.5,
7.5,
7.5,
5
] | [
"LOW",
"LOW",
"LOW",
"",
"",
"",
""
] | [
"MEDIUM",
"MEDIUM",
"MEDIUM",
"",
"",
"",
""
] | hao-dan.py | /src/qanta/hao-dan.py | haochen-rye/qanta | Apache-2.0 | |
2024-11-19T02:30:19.176411+00:00 | 1,541,707,607,000 | ae0e0c49d136aa034c96a52932639c956d277c82 | 3 | {
"blob_id": "ae0e0c49d136aa034c96a52932639c956d277c82",
"branch_name": "refs/heads/master",
"committer_date": 1541707607000,
"content_id": "fba45834281ef3bddbd7d0d9bd023529b061ae7d",
"detected_licenses": [
"MIT"
],
"directory_id": "2cf00705308bee55e291e6fe6e35204fee4ccd36",
"extension": "py",
"fi... | 3.296875 | stackv2 | '''
A class that uses a serial port to command the telescope's
stamp controller. Handles both movement and measurement commands.
Author: Nathan Rowley
Date: June 2018
'''
from astropy.coordinates import SkyCoord, EarthLocation, AltAz
from astropy.time import Time
import time
import sqlite3
import serial
import math
... | 292 | 26.18 | 131 | 29 | 2,346 | python | [{"finding_id": "semgrep_rules.python.lang.maintainability.useless-if-body_cfe49f81199757c9_2ea62f46", "tool_name": "semgrep", "rule_id": "rules.python.lang.maintainability.useless-if-body", "finding_type": "maintainability", "severity": "medium", "confidence": "medium", "message": "Useless if statement; both blocks ha... | 1 | true | [
""
] | [
"rules.python.lang.maintainability.useless-if-body"
] | [
"maintainability"
] | [
"MEDIUM"
] | [
"MEDIUM"
] | [
155
] | [
161
] | [
6
] | [
60
] | [
""
] | [
"Useless if statement; both blocks have the same body"
] | [
5
] | [
""
] | [
""
] | CommandStation.py | /srtcontroller/CommandStation.py | rowleyn/srt-code | MIT | |
2024-11-19T02:30:24.510315+00:00 | 1,593,723,056,000 | 3a558750e4b5b73c9a1d902618f1f240583d52b7 | 3 | {
"blob_id": "3a558750e4b5b73c9a1d902618f1f240583d52b7",
"branch_name": "refs/heads/master",
"committer_date": 1593723056000,
"content_id": "f302bfca369b12e46aac629f852220ac0213a9e0",
"detected_licenses": [
"AFL-3.0"
],
"directory_id": "4de0c6d3a820d7669fcef5fd035416cf85b35f23",
"extension": "py",
... | 2.671875 | stackv2 | from flask import Flask,render_template,redirect,request,jsonify,make_response,Markup
app = Flask(__name__)
@app.template_global()
def sbbbbbbb(a1, a2):
"""
每个模板中可以调用的函数
:param a1:
:param a2:
:return:
"""
return a1 + a2
def gen_input(value):
# return "<input value='%s'/>" %value
r... | 45 | 18.2 | 85 | 12 | 279 | python | [{"finding_id": "semgrep_rules.python.flask.security.xss.audit.explicit-unescape-with-markup_3154deb4313f4c64_6afa7f9b", "tool_name": "semgrep", "rule_id": "rules.python.flask.security.xss.audit.explicit-unescape-with-markup", "finding_type": "security", "severity": "medium", "confidence": "low", "message": "Detected e... | 1 | true | [
"CWE-79"
] | [
"rules.python.flask.security.xss.audit.explicit-unescape-with-markup"
] | [
"security"
] | [
"LOW"
] | [
"MEDIUM"
] | [
17
] | [
17
] | [
12
] | [
48
] | [
"A07:2017 - Cross-Site Scripting (XSS)"
] | [
"Detected explicitly unescaped content using 'Markup()'. This permits the unescaped data to include unescaped HTML which could result in cross-site scripting. Ensure this data is not externally controlled, or consider rewriting to not use 'Markup()'."
] | [
5
] | [
"LOW"
] | [
"MEDIUM"
] | s1.py | /ITcoach/flask框架/Flask WEB框架全套剖析2/Flask WEB框架全套剖析2/day123/6. 模板/s1.py | ww35133634/chenxusheng | AFL-3.0 | |
2024-11-19T02:30:24.995437+00:00 | 1,568,189,732,000 | 1010a524db5b294ad6f992544bb9ef600d1af5bd | 4 | {
"blob_id": "1010a524db5b294ad6f992544bb9ef600d1af5bd",
"branch_name": "refs/heads/master",
"committer_date": 1568189732000,
"content_id": "663327b4b1ac6cbdfdb501b8c457a2a468ccafaa",
"detected_licenses": [
"MIT"
],
"directory_id": "178231e653e89c26b61ccfdc2cf0df36e81ff2d8",
"extension": "py",
"fi... | 4.125 | stackv2 | # Row Wise Matrix Print
row=eval(input("Enter No. Of Rows:- "))
col=eval(input("Enter No. Of Columns:- "))
def row_matrix():
Matrix=[]
a=row
b=col
for r in range(a):
Matrix.append([])
for r in range(a):
for c in range(b):
value=eval(input("Enter Value Row Wise :- ... | 36 | 17.86 | 57 | 15 | 178 | python | [{"finding_id": "semgrep_rules.python.lang.security.audit.eval-detected_7e093c7f11813034_f771d81d", "tool_name": "semgrep", "rule_id": "rules.python.lang.security.audit.eval-detected", "finding_type": "security", "severity": "medium", "confidence": "low", "message": "Detected the use of eval(). eval() can be dangerous ... | 3 | true | [
"CWE-95",
"CWE-95",
"CWE-95"
] | [
"rules.python.lang.security.audit.eval-detected",
"rules.python.lang.security.audit.eval-detected",
"rules.python.lang.security.audit.eval-detected"
] | [
"security",
"security",
"security"
] | [
"LOW",
"LOW",
"LOW"
] | [
"MEDIUM",
"MEDIUM",
"MEDIUM"
] | [
4,
5,
16
] | [
4,
5,
16
] | [
5,
5,
19
] | [
40,
43,
58
] | [
"A03:2021 - Injection",
"A03:2021 - Injection",
"A03:2021 - Injection"
] | [
"Detected the use of eval(). eval() can be dangerous if used to evaluate dynamic content. If this content can be input from outside the program, this may be a code injection vulnerability. Ensure evaluated content is not definable by external sources.",
"Detected the use of eval(). eval() can be dangerous if used... | [
5,
5,
5
] | [
"LOW",
"LOW",
"LOW"
] | [
"HIGH",
"HIGH",
"HIGH"
] | Row Wise Matrix.py | /Class 12/Python Programs/Row Wise Matrix.py | edwardmasih/Python-School-Level | MIT | |
2024-11-19T02:30:25.050216+00:00 | 1,540,395,140,000 | 505cd3a93da2430cff704a14f102b2b1fdacb08c | 3 | {
"blob_id": "505cd3a93da2430cff704a14f102b2b1fdacb08c",
"branch_name": "refs/heads/master",
"committer_date": 1540395140000,
"content_id": "89d57f9e07620cbd5c503c206e71cdc5a69986d3",
"detected_licenses": [
"BSD-3-Clause"
],
"directory_id": "8591417d7ce6c147eaf2667061406051ec750a01",
"extension": "p... | 3.390625 | stackv2 | from torchtext.data import Field
def _depth(obj):
"""Helper function to determine the depth of a nested list structure."""
return isinstance(obj, (list, tuple)) and max(map(_depth, obj)) + 1
class WrapIterator(object):
"""
Wraps a `torchtext.data.Iterator` to be used as data generator with Keras.
... | 115 | 47.57 | 118 | 21 | 1,111 | python | [{"finding_id": "semgrep_rules.python.lang.maintainability.is-function-without-parentheses_723804c7eaabd599_e13781b0", "tool_name": "semgrep", "rule_id": "rules.python.lang.maintainability.is-function-without-parentheses", "finding_type": "maintainability", "severity": "medium", "confidence": "medium", "message": "Is \... | 1 | true | [
""
] | [
"rules.python.lang.maintainability.is-function-without-parentheses"
] | [
"maintainability"
] | [
"MEDIUM"
] | [
"MEDIUM"
] | [
47
] | [
47
] | [
24
] | [
39
] | [
""
] | [
"Is \"is_target\" a function or an attribute? If it is a function, you may have meant field.is_target() because field.is_target is always true."
] | [
5
] | [
""
] | [
""
] | __init__.py | /kltt/__init__.py | kklemon/keras-loves-torchtext | BSD-3-Clause | |
2024-11-19T02:30:25.662054+00:00 | 1,563,385,246,000 | 0bf3aa88eb98954392ebe4ae4b61e3560cb01959 | 3 | {
"blob_id": "0bf3aa88eb98954392ebe4ae4b61e3560cb01959",
"branch_name": "refs/heads/master",
"committer_date": 1563385246000,
"content_id": "58b63107bdb56f4d061615e3de29daee27610e21",
"detected_licenses": [
"MIT"
],
"directory_id": "e464bbd380ad86d5b2cb2a3c668e73ebba8692cb",
"extension": "py",
"fi... | 2.8125 | stackv2 | #################################################################################################
# This file contains the functions to be used to compute the site accessibility of the mRNA.
# In order to compute this value a region of size equal to the FOLDING_CHUNK_LEN parameter is
# extracted from the 3'UTR and pass... | 72 | 47.85 | 106 | 14 | 832 | python | [{"finding_id": "semgrep_rules.python.lang.security.audit.dangerous-subprocess-use-audit_62e291ba9b142c7a_952587c9", "tool_name": "semgrep", "rule_id": "rules.python.lang.security.audit.dangerous-subprocess-use-audit", "finding_type": "security", "severity": "high", "confidence": "low", "message": "Detected subprocess ... | 1 | true | [
"CWE-78"
] | [
"rules.python.lang.security.audit.dangerous-subprocess-use-audit"
] | [
"security"
] | [
"LOW"
] | [
"HIGH"
] | [
39
] | [
39
] | [
14
] | [
79
] | [
"A01:2017 - Injection"
] | [
"Detected subprocess function 'check_output' without a static string. If this data can be controlled by a malicious actor, it may be an instance of command injection. Audit the use of this call to ensure it is not controllable by an external resource. You may consider using 'shlex.escape()'."
] | [
7.5
] | [
"LOW"
] | [
"HIGH"
] | site_accessibility.py | /src/deepmirna/site_accessibility.py | simosini/deepmiRNA | MIT | |
2024-11-19T02:30:26.499778+00:00 | 1,606,833,284,000 | a882552264df285d060e7073814eb45810a6e116 | 2 | {
"blob_id": "a882552264df285d060e7073814eb45810a6e116",
"branch_name": "refs/heads/master",
"committer_date": 1606833284000,
"content_id": "a2b1fc8c327a0935ecb6f1f00aa3f8a3a656e183",
"detected_licenses": [
"MIT"
],
"directory_id": "adc9728a98e10bed75df1fdcbc8bd3d08ea953d9",
"extension": "py",
"fi... | 2.40625 | stackv2 | import logging
import itertools
import json
from django import forms
from utils.forms import BaseFormHelper
from . import models
logger = logging.getLogger(__name__)
class BaseFormMixin:
"""Form mixin to generate basic layout and set owner if available."""
CREATE_LEGEND = None
CREATE_HELP_TEXT = None
... | 302 | 33.63 | 142 | 15 | 2,138 | python | [{"finding_id": "semgrep_rules.python.lang.maintainability.is-function-without-parentheses_6ce36d0e306ba13e_804f79cc", "tool_name": "semgrep", "rule_id": "rules.python.lang.maintainability.is-function-without-parentheses", "finding_type": "maintainability", "severity": "medium", "confidence": "medium", "message": "Is \... | 1 | true | [
""
] | [
"rules.python.lang.maintainability.is-function-without-parentheses"
] | [
"maintainability"
] | [
"MEDIUM"
] | [
"MEDIUM"
] | [
84
] | [
84
] | [
47
] | [
72
] | [
""
] | [
"Is \"is_stranded\" a function or an attribute? If it is a function, you may have meant self.instance.is_stranded() because self.instance.is_stranded is always true."
] | [
5
] | [
""
] | [
""
] | forms.py | /project/analysis/forms.py | shunsunsun/orio-web | MIT | |
2024-11-19T02:30:27.413509+00:00 | 1,642,379,085,000 | 296cae67b48cfc497937be64f3efabe3690068f8 | 3 | {
"blob_id": "296cae67b48cfc497937be64f3efabe3690068f8",
"branch_name": "refs/heads/master",
"committer_date": 1642379085000,
"content_id": "cb4d2b43cdf72219cb8fdac45e3ec1f96f612aec",
"detected_licenses": [
"BSD-3-Clause",
"BSD-2-Clause"
],
"directory_id": "46409c390d5f0f62b7a7c9861eaef2104f7634a1... | 3.046875 | stackv2 | #! /usr/bin/python
"""Retrieve the weather report for the requested location."""
__author__ = 'Ken Andrews <paddlebike@google.com>'
__copyright__ = 'Copyright (c) 2013'
__license__ = 'Apache License, Version 2.0'
import logging
import requests
from xml.dom import minidom
class NoaaClass:
"""A class for SOAP in... | 156 | 31.67 | 129 | 19 | 1,248 | python | [{"finding_id": "semgrep_rules.python.lang.security.use-defused-xml_856f790068fe15cf_92b0d07a", "tool_name": "semgrep", "rule_id": "rules.python.lang.security.use-defused-xml", "finding_type": "security", "severity": "high", "confidence": "low", "message": "The Python documentation recommends using `defusedxml` instead... | 4 | true | [
"CWE-611"
] | [
"rules.python.lang.security.use-defused-xml"
] | [
"security"
] | [
"LOW"
] | [
"HIGH"
] | [
10
] | [
10
] | [
1
] | [
28
] | [
"A04:2017 - XML External Entities (XXE)"
] | [
"The Python documentation recommends using `defusedxml` instead of `xml` because the native Python `xml` library is vulnerable to XML External Entity (XXE) attacks. These attacks can leak confidential data and \"XML bombs\" can cause denial of service."
] | [
7.5
] | [
"LOW"
] | [
"MEDIUM"
] | noaa.py | /noaa/noaa.py | paddlebike/Noaa | BSD-3-Clause,BSD-2-Clause | |
2024-11-19T02:30:29.806377+00:00 | 1,547,580,696,000 | a70e01dd55ca044dfff49914fe1e9c1d73f8ebf3 | 3 | {
"blob_id": "a70e01dd55ca044dfff49914fe1e9c1d73f8ebf3",
"branch_name": "refs/heads/master",
"committer_date": 1547580696000,
"content_id": "d5c86423726af8591f787be95974e9635201103f",
"detected_licenses": [
"MIT"
],
"directory_id": "e776e45ae9f78765fb11e3e8cf5c87a0a1b9f0da",
"extension": "py",
"fi... | 2.734375 | stackv2 | import weakref
from pprint import pformat
from copy import deepcopy
from .. import Wrapper
class SchemaWrapper(Wrapper):
_update_hook = None
_parent = lambda self: None
def __init__(self, _parent, _dict, _update_hook):
if _parent is not None:
super().__setattr__("_parent", weakref.ref(_... | 96 | 32.31 | 70 | 14 | 673 | python | [{"finding_id": "semgrep_rules.python.lang.maintainability.return-not-in-function_0c595dc569ee836e_e61fc233", "tool_name": "semgrep", "rule_id": "rules.python.lang.maintainability.return-not-in-function", "finding_type": "maintainability", "severity": "medium", "confidence": "medium", "message": "`return` only makes se... | 1 | true | [
""
] | [
"rules.python.lang.maintainability.return-not-in-function"
] | [
"maintainability"
] | [
"MEDIUM"
] | [
"MEDIUM"
] | [
8
] | [
8
] | [
28
] | [
32
] | [
""
] | [
"`return` only makes sense inside a function"
] | [
5
] | [
""
] | [
""
] | schemawrapper.py | /seamless/silk/schemawrapper.py | mvandepanne/seamless | MIT | |
2024-11-19T02:30:33.962447+00:00 | 1,592,857,164,000 | 1a1cfbb3baaada23cdb309b81d84f7c50f81469f | 3 | {
"blob_id": "1a1cfbb3baaada23cdb309b81d84f7c50f81469f",
"branch_name": "refs/heads/master",
"committer_date": 1592857164000,
"content_id": "cb2f94037465795bf48eb2fc52582140ef1b403b",
"detected_licenses": [
"MIT"
],
"directory_id": "a89729c6211755491b8eba3c4035b14a0152f472",
"extension": "py",
"fi... | 2.515625 | stackv2 | import matplotlib.pyplot as plt
import numpy as np
import lmfit
from labfis import labfloat
r4, vg = np.loadtxt('ponte').T
print(r4)
print(vg)
ponte = lambda R4,ar,R3,V: (ar-R3/(R3+R4))*V
pmodel = lmfit.Model(ponte)
params = pmodel.make_params(ar=0.7,R3=222,V=10)
result = pmodel.fit(vg, params, R4=r4)
res = resu... | 64 | 25.16 | 115 | 13 | 682 | python | [{"finding_id": "semgrep_rules.python.lang.maintainability.return-not-in-function_1b6f47b3d147667e_30fd998b", "tool_name": "semgrep", "rule_id": "rules.python.lang.maintainability.return-not-in-function", "finding_type": "maintainability", "severity": "medium", "confidence": "medium", "message": "`return` only makes se... | 2 | true | [
"",
"CWE-95"
] | [
"rules.python.lang.maintainability.return-not-in-function",
"rules.python.lang.security.audit.eval-detected"
] | [
"maintainability",
"security"
] | [
"MEDIUM",
"LOW"
] | [
"MEDIUM",
"MEDIUM"
] | [
11,
59
] | [
11,
59
] | [
28,
1
] | [
45,
109
] | [
"",
"A03:2021 - Injection"
] | [
"`return` only makes sense inside a function",
"Detected the use of eval(). eval() can be dangerous if used to evaluate dynamic content. If this content can be input from outside the program, this may be a code injection vulnerability. Ensure evaluated content is not definable by external sources."
] | [
5,
5
] | [
"",
"LOW"
] | [
"",
"HIGH"
] | wheensone.py | /pra2/wheensone.py | hlouzada/labfis3 | MIT | |
2024-11-19T02:30:34.931378+00:00 | 1,599,584,714,000 | 0c592931a42534c2b5c0afd970566ac253ef6c08 | 3 | {
"blob_id": "0c592931a42534c2b5c0afd970566ac253ef6c08",
"branch_name": "refs/heads/master",
"committer_date": 1599584714000,
"content_id": "847c67ddbdb56b32b2506beb359e1de1f4f46fad",
"detected_licenses": [
"MIT"
],
"directory_id": "4c4ee8c527076b44c641f368b6173b91426a8360",
"extension": "py",
"fi... | 3.078125 | stackv2 | import math
import glob
import os
import uuid
import itertools
import pandas as pd
import numpy as np
import datetime as dt
class GSTools(object):
@staticmethod
def load_csv_files(dir_str):
'''
This function reads all csv from the given directory, stores them in a dictionary and returns it.
- dir_str should... | 136 | 22.12 | 99 | 17 | 857 | python | [{"finding_id": "semgrep_rules.python.lang.maintainability.useless-assignment-keyed_7845dcead4cd6db4_670e1e7c", "tool_name": "semgrep", "rule_id": "rules.python.lang.maintainability.useless-assignment-keyed", "finding_type": "maintainability", "severity": "low", "confidence": "medium", "message": "key `key` in `data` i... | 2 | true | [
"",
""
] | [
"rules.python.lang.maintainability.useless-assignment-keyed",
"rules.python.lang.maintainability.useless-assignment-keyed"
] | [
"maintainability",
"maintainability"
] | [
"MEDIUM",
"MEDIUM"
] | [
"LOW",
"LOW"
] | [
79,
101
] | [
82,
104
] | [
4,
5
] | [
48,
49
] | [
"",
""
] | [
"key `key` in `data` is assigned twice; the first assignment is useless",
"key `key` in `data` is assigned twice; the first assignment is useless"
] | [
3,
3
] | [
"",
""
] | [
"",
""
] | grid_search_tools.py | /jupyter_py/grid_search_tools.py | cgurkan/pairstrade-fyp-2019 | MIT | |
2024-11-19T02:30:35.267175+00:00 | 1,594,932,891,000 | 8f4c4800feabfb1b9907819c17279ea459607e4c | 2 | {
"blob_id": "8f4c4800feabfb1b9907819c17279ea459607e4c",
"branch_name": "refs/heads/master",
"committer_date": 1594932891000,
"content_id": "dcd07240e4a6206b9fc3d199149d8400897ffdda",
"detected_licenses": [
"MIT"
],
"directory_id": "4e6dcb09ac3dc0bb71daa14cbeab057dd0ebf439",
"extension": "py",
"fi... | 2.328125 | stackv2 | from django import template
from django.utils.safestring import mark_safe
from private_sharing.models import DataRequestProject
register = template.Library()
@register.simple_tag()
def erasure_requested_checkbox(object):
"""
If a Data Request Project supports member data erasure, then return the
html to... | 28 | 26.82 | 75 | 14 | 156 | python | [{"finding_id": "semgrep_rules.python.django.security.audit.avoid-mark-safe_e72c282b1a7c05f0_49aa668d", "tool_name": "semgrep", "rule_id": "rules.python.django.security.audit.avoid-mark-safe", "finding_type": "security", "severity": "medium", "confidence": "low", "message": "'mark_safe()' is used to mark a string as \"... | 1 | true | [
"CWE-79"
] | [
"rules.python.django.security.audit.avoid-mark-safe"
] | [
"security"
] | [
"LOW"
] | [
"MEDIUM"
] | [
26
] | [
26
] | [
16
] | [
64
] | [
"A07:2017 - Cross-Site Scripting (XSS)"
] | [
"'mark_safe()' is used to mark a string as \"safe\" for HTML output. This disables escaping and could therefore subject the content to XSS attacks. Use 'django.utils.html.format_html()' to build HTML for rendering instead."
] | [
5
] | [
"LOW"
] | [
"MEDIUM"
] | private_sharing.py | /private_sharing/templatetags/private_sharing.py | madprime/open-humans | MIT | |
2024-11-19T02:30:36.588417+00:00 | 1,687,128,638,000 | b24555f767a92fc77391c214de697211d7176608 | 2 | {
"blob_id": "b24555f767a92fc77391c214de697211d7176608",
"branch_name": "refs/heads/master",
"committer_date": 1687128638000,
"content_id": "dbf34c8ef5032663659adf0e461cceb288dd3ee3",
"detected_licenses": [
"BSD-3-Clause"
],
"directory_id": "6d07867541482d00710a8a7bd4316b52ebffd72e",
"extension": "p... | 2.40625 | stackv2 | import re
import pandas as pd
import plotly.graph_objs as go
from dash.dependencies import Input, Output
from openml import evaluations, tasks
from .dash_config import DASH_CACHING
from openml.tasks import TaskType
TIMEOUT = 5 * 60 if DASH_CACHING else 0
def register_flow_callbacks(app, cache):
@app.callback(
... | 154 | 32.35 | 87 | 22 | 1,105 | python | [{"finding_id": "semgrep_rules.python.lang.maintainability.useless-inner-function_e473b74846d2fb68_361ae0d7", "tool_name": "semgrep", "rule_id": "rules.python.lang.maintainability.useless-inner-function", "finding_type": "maintainability", "severity": "high", "confidence": "medium", "message": "function `update_flow_pl... | 1 | true | [
""
] | [
"rules.python.lang.maintainability.useless-inner-function"
] | [
"maintainability"
] | [
"MEDIUM"
] | [
"HIGH"
] | [
15
] | [
154
] | [
5
] | [
19
] | [
""
] | [
"function `update_flow_plots` is defined inside a function but never used"
] | [
7.5
] | [
""
] | [
""
] | flow_callbacks.py | /server/src/dashboard/flow_callbacks.py | openml/openml.org | BSD-3-Clause | |
2024-11-19T02:30:39.084842+00:00 | 1,618,282,512,000 | 9e34070f85a3aa2c0a3b22b29d4adf4c6eea40bb | 3 | {
"blob_id": "9e34070f85a3aa2c0a3b22b29d4adf4c6eea40bb",
"branch_name": "refs/heads/main",
"committer_date": 1618282512000,
"content_id": "1223d36e6cd18f06d9ed517b0eb3cb52820f708c",
"detected_licenses": [
"Apache-2.0"
],
"directory_id": "da85d4caf3e5e1c9df8839fafd51f960f02daadd",
"extension": "py",
... | 2.5625 | stackv2 | #!/usr/bin/python
# -*- coding: utf-8 -*-
'''
Created on 03.09.2021
Updated on 03.11.2021
Author: haoshuai@handaotech.com
'''
import os
import sys
import cv2
import time
import copy
import numpy as np
def preprocessResults(results, index=0):
boxes = results['boxes']
labels = results['labels']
box... | 190 | 30.63 | 96 | 16 | 1,442 | python | [{"finding_id": "semgrep_rules.python.lang.maintainability.is-function-without-parentheses_5d2c0bee6e489998_cb677dfb", "tool_name": "semgrep", "rule_id": "rules.python.lang.maintainability.is-function-without-parentheses", "finding_type": "maintainability", "severity": "medium", "confidence": "medium", "message": "Is \... | 10 | true | [
"",
"",
"",
"",
"",
"",
"",
"",
"",
""
] | [
"rules.python.lang.maintainability.is-function-without-parentheses",
"rules.python.lang.maintainability.is-function-without-parentheses",
"rules.python.lang.maintainability.is-function-without-parentheses",
"rules.python.lang.maintainability.is-function-without-parentheses",
"rules.python.lang.maintainabili... | [
"maintainability",
"maintainability",
"maintainability",
"maintainability",
"maintainability",
"maintainability",
"maintainability",
"maintainability",
"maintainability",
"maintainability"
] | [
"MEDIUM",
"MEDIUM",
"MEDIUM",
"MEDIUM",
"MEDIUM",
"MEDIUM",
"MEDIUM",
"MEDIUM",
"MEDIUM",
"MEDIUM"
] | [
"MEDIUM",
"MEDIUM",
"MEDIUM",
"MEDIUM",
"MEDIUM",
"MEDIUM",
"MEDIUM",
"MEDIUM",
"MEDIUM",
"MEDIUM"
] | [
63,
68,
72,
86,
100,
105,
108,
112,
183,
185
] | [
63,
68,
72,
86,
100,
105,
108,
112,
183,
185
] | [
9,
9,
9,
17,
16,
13,
16,
39,
16,
18
] | [
23,
27,
22,
30,
34,
31,
34,
53,
29,
32
] | [
"",
"",
"",
"",
"",
"",
"",
"",
"",
""
] | [
"Is \"is_record\" a function or an attribute? If it is a function, you may have meant self.is_record() because self.is_record is always true.",
"Is \"is_def_appear\" a function or an attribute? If it is a function, you may have meant self.is_def_appear() because self.is_def_appear is always true.",
"Is \"is_sta... | [
5,
5,
5,
5,
5,
5,
5,
5,
5,
5
] | [
"",
"",
"",
"",
"",
"",
"",
"",
"",
""
] | [
"",
"",
"",
"",
"",
"",
"",
"",
"",
""
] | pattern_recorder.py | /FabricUI/pattern/pattern_recorder.py | shuaih7/FabricUI | Apache-2.0 | |
2024-11-19T02:30:39.314758+00:00 | 1,619,811,130,000 | cd45a9ec26d56850c2ac439370d88b021064349f | 3 | {
"blob_id": "cd45a9ec26d56850c2ac439370d88b021064349f",
"branch_name": "refs/heads/main",
"committer_date": 1619811130000,
"content_id": "db42796e80c9bd885ff142888ce5915e498dbedc",
"detected_licenses": [
"MIT"
],
"directory_id": "d97e5da2f7819e3f805dcdf5d6515a6853d915e6",
"extension": "py",
"file... | 2.734375 | stackv2 | """
Markdown extension that supports tufte-style side and margin notes.
Supports multi-block notes (e.g. embedded paragraphs), but doing so requires
the additional use of an extension to convert paragraphs to divs.
Syntax:
this is a ->[margin note,
which can span multiple lines
and be embedded within a p... | 128 | 35.08 | 110 | 20 | 1,041 | python | [{"finding_id": "semgrep_rules.python.lang.security.use-defused-xml_1ac235703fc32896_a3d886c8", "tool_name": "semgrep", "rule_id": "rules.python.lang.security.use-defused-xml", "finding_type": "security", "severity": "high", "confidence": "low", "message": "The Python documentation recommends using `defusedxml` instead... | 1 | true | [
"CWE-611"
] | [
"rules.python.lang.security.use-defused-xml"
] | [
"security"
] | [
"LOW"
] | [
"HIGH"
] | [
21
] | [
21
] | [
1
] | [
38
] | [
"A04:2017 - XML External Entities (XXE)"
] | [
"The Python documentation recommends using `defusedxml` instead of `xml` because the native Python `xml` library is vulnerable to XML External Entity (XXE) attacks. These attacks can leak confidential data and \"XML bombs\" can cause denial of service."
] | [
7.5
] | [
"LOW"
] | [
"MEDIUM"
] | tufte.py | /tufte.py | ttrefren/tufte-css-markdown-python | MIT | |
2024-11-19T02:41:38.168980+00:00 | 1,624,190,216,000 | 2916ac28f30620d0f67d3feeb5bc06a0def02f01 | 3 | {
"blob_id": "2916ac28f30620d0f67d3feeb5bc06a0def02f01",
"branch_name": "refs/heads/master",
"committer_date": 1624190216000,
"content_id": "35e69f826df2d90f9085eac980905173b4fc6dba",
"detected_licenses": [
"BSD-2-Clause"
],
"directory_id": "f5528bc666c8321825e7435382db227330fe7d67",
"extension": "p... | 2.515625 | stackv2 | #!/usr/bin/env python3
import argparse
import inspect
import json
import os
import webbrowser
from jinja2 import Environment
from jinja2 import FileSystemLoader
from analyzer import analyze
def main(args=None):
if not args:
module_path = os.path.dirname(inspect.getfile(analyze))
arg_parser = a... | 52 | 34.83 | 107 | 18 | 389 | python | [{"finding_id": "semgrep_rules.python.flask.security.xss.audit.direct-use-of-jinja2_d1cd699dc71d7f3a_ca07127a", "tool_name": "semgrep", "rule_id": "rules.python.flask.security.xss.audit.direct-use-of-jinja2", "finding_type": "security", "severity": "medium", "confidence": "low", "message": "Detected direct use of jinja... | 5 | true | [
"CWE-79",
"CWE-116",
"CWE-79"
] | [
"rules.python.flask.security.xss.audit.direct-use-of-jinja2",
"rules.python.jinja2.security.audit.missing-autoescape-disabled",
"rules.python.flask.security.xss.audit.direct-use-of-jinja2"
] | [
"security",
"security",
"security"
] | [
"LOW",
"MEDIUM",
"LOW"
] | [
"MEDIUM",
"MEDIUM",
"MEDIUM"
] | [
34,
34,
36
] | [
34,
34,
36
] | [
19,
19,
43
] | [
95,
95,
73
] | [
"A07:2017 - Cross-Site Scripting (XSS)",
"A03:2021 - Injection",
"A07:2017 - Cross-Site Scripting (XSS)"
] | [
"Detected direct use of jinja2. If not done properly, this may bypass HTML escaping which opens up the application to cross-site scripting (XSS) vulnerabilities. Prefer using the Flask method 'render_template()' and templates with a '.html' extension in order to prevent XSS.",
"Detected a Jinja2 environment witho... | [
5,
5,
5
] | [
"LOW",
"LOW",
"LOW"
] | [
"MEDIUM",
"MEDIUM",
"MEDIUM"
] | __main__.py | /seoanalyzer/__main__.py | sparshvrao/python-seo-analyzer | BSD-2-Clause | |
2024-11-19T02:41:38.617026+00:00 | 1,603,076,026,000 | 43c945070a855518a0569b51f99be632b00dda8b | 3 | {
"blob_id": "43c945070a855518a0569b51f99be632b00dda8b",
"branch_name": "refs/heads/master",
"committer_date": 1603076026000,
"content_id": "4a4a5db670cfc9f7b2261f1da195e4755fa5e176",
"detected_licenses": [
"MIT"
],
"directory_id": "9aec1b91b9a6dba8c4cae83bbfe1d67885562abc",
"extension": "py",
"fi... | 3.0625 | stackv2 |
# Standard Library Dependencies
import os # Used for path validation
import logging # Used for optional logging details
import subprocess # Used to invoke installer binaries
from shutil import copyfile # Used to copy files between directories
from sys import pla... | 208 | 43.31 | 143 | 15 | 2,253 | python | [{"finding_id": "semgrep_rules.python.requests.best-practice.use-raise-for-status_0f0668355af9d148_ab0f7e7e", "tool_name": "semgrep", "rule_id": "rules.python.requests.best-practice.use-raise-for-status", "finding_type": "best-practice", "severity": "medium", "confidence": "medium", "message": "There's an HTTP request ... | 26 | true | [
"CWE-78",
"",
"CWE-78",
"",
"CWE-78",
"CWE-78",
"",
"CWE-78",
"CWE-78",
"",
"CWE-78",
"CWE-78",
"",
"CWE-78",
"CWE-78",
"CWE-78",
"",
"CWE-78",
"CWE-78",
"",
"",
"CWE-78",
"",
"CWE-78"
] | [
"rules.python.lang.security.audit.dangerous-subprocess-use-audit",
"rules.python.lang.correctness.unchecked-subprocess-call",
"rules.python.lang.security.audit.subprocess-shell-true",
"rules.python.lang.correctness.unchecked-subprocess-call",
"rules.python.lang.security.audit.subprocess-shell-true",
"rule... | [
"security",
"correctness",
"security",
"correctness",
"security",
"security",
"correctness",
"security",
"security",
"correctness",
"security",
"security",
"correctness",
"security",
"security",
"security",
"correctness",
"security",
"security",
"correctness",
"correctness",
... | [
"LOW",
"MEDIUM",
"MEDIUM",
"MEDIUM",
"MEDIUM",
"LOW",
"MEDIUM",
"MEDIUM",
"LOW",
"MEDIUM",
"MEDIUM",
"LOW",
"MEDIUM",
"MEDIUM",
"MEDIUM",
"LOW",
"MEDIUM",
"MEDIUM",
"MEDIUM",
"MEDIUM",
"MEDIUM",
"LOW",
"MEDIUM",
"MEDIUM"
] | [
"HIGH",
"MEDIUM",
"HIGH",
"MEDIUM",
"HIGH",
"HIGH",
"MEDIUM",
"HIGH",
"HIGH",
"MEDIUM",
"HIGH",
"HIGH",
"MEDIUM",
"HIGH",
"HIGH",
"HIGH",
"MEDIUM",
"HIGH",
"HIGH",
"MEDIUM",
"MEDIUM",
"HIGH",
"MEDIUM",
"HIGH"
] | [
71,
71,
71,
94,
94,
107,
107,
107,
112,
112,
112,
115,
115,
115,
115,
120,
120,
120,
120,
132,
133,
139,
139,
139
] | [
71,
71,
71,
94,
94,
107,
107,
107,
112,
112,
112,
115,
115,
115,
115,
120,
120,
120,
120,
132,
133,
139,
139,
139
] | [
5,
16,
42,
20,
77,
5,
16,
85,
9,
20,
69,
5,
16,
21,
116,
9,
20,
25,
136,
20,
20,
5,
16,
104
] | [
47,
20,
46,
24,
81,
90,
20,
89,
74,
24,
73,
121,
20,
108,
120,
141,
24,
128,
140,
24,
24,
109,
20,
108
] | [
"A01:2017 - Injection",
"",
"A01:2017 - Injection",
"",
"A01:2017 - Injection",
"A01:2017 - Injection",
"",
"A01:2017 - Injection",
"A01:2017 - Injection",
"",
"A01:2017 - Injection",
"A01:2017 - Injection",
"",
"A01:2017 - Injection",
"A01:2017 - Injection",
"A01:2017 - Injection",
... | [
"Detected subprocess function 'call' without a static string. If this data can be controlled by a malicious actor, it may be an instance of command injection. Audit the use of this call to ensure it is not controllable by an external resource. You may consider using 'shlex.escape()'.",
"This is not checking the r... | [
7.5,
5,
7.5,
5,
7.5,
7.5,
5,
7.5,
7.5,
5,
7.5,
7.5,
5,
7.5,
7.5,
7.5,
5,
7.5,
7.5,
5,
5,
7.5,
5,
7.5
] | [
"LOW",
"",
"HIGH",
"",
"HIGH",
"LOW",
"",
"HIGH",
"LOW",
"",
"HIGH",
"LOW",
"",
"MEDIUM",
"HIGH",
"LOW",
"",
"MEDIUM",
"HIGH",
"",
"",
"LOW",
"",
"HIGH"
] | [
"HIGH",
"",
"LOW",
"",
"LOW",
"HIGH",
"",
"LOW",
"HIGH",
"",
"LOW",
"HIGH",
"",
"MEDIUM",
"LOW",
"HIGH",
"",
"MEDIUM",
"LOW",
"",
"",
"HIGH",
"",
"LOW"
] | install.py | /install.py | Schulich-Ignite/installation-script | MIT | |
2024-11-19T02:41:38.658398+00:00 | 1,562,583,427,000 | f6740b22af9790e32653fe86be5ed3739f0f1733 | 3 | {
"blob_id": "f6740b22af9790e32653fe86be5ed3739f0f1733",
"branch_name": "refs/heads/master",
"committer_date": 1562583427000,
"content_id": "b171efb63688ee4fa9588d5732e71a8d42580be1",
"detected_licenses": [
"MIT"
],
"directory_id": "33ca9a21a1ac99b02413dd9b32c49042a7427001",
"extension": "py",
"fi... | 2.53125 | stackv2 | import os
import pickle
import numpy as np
import torch
from torch.utils.data import DataLoader, Dataset
from .hyperparams import hyperparams as hp
from .utils import mulaw_quantize, inv_mulaw_quantize
class AudiobookDataset(Dataset):
def __init__(self, data_path):
self.path = os.path.join(data_path, ""... | 146 | 31.87 | 95 | 15 | 1,323 | python | [{"finding_id": "semgrep_rules.python.lang.security.deserialization.avoid-pickle_b639b253a7f9ca84_5cd8679f", "tool_name": "semgrep", "rule_id": "rules.python.lang.security.deserialization.avoid-pickle", "finding_type": "security", "severity": "medium", "confidence": "low", "message": "Avoid using `pickle`, which is kno... | 3 | true | [
"CWE-502",
"CWE-502",
"CWE-502"
] | [
"rules.python.lang.security.deserialization.avoid-pickle",
"rules.python.lang.security.deserialization.avoid-pickle",
"rules.python.lang.security.deserialization.avoid-pickle"
] | [
"security",
"security",
"security"
] | [
"LOW",
"LOW",
"LOW"
] | [
"MEDIUM",
"MEDIUM",
"MEDIUM"
] | [
16,
106,
128
] | [
16,
106,
128
] | [
29,
23,
23
] | [
43,
37,
37
] | [
"A08:2017 - Insecure Deserialization",
"A08:2017 - Insecure Deserialization",
"A08:2017 - Insecure Deserialization"
] | [
"Avoid using `pickle`, which is known to lead to code execution vulnerabilities. When unpickling, the serialized data could be manipulated to run arbitrary code. Instead, consider serializing the relevant data as JSON or a similar text-based serialization format.",
"Avoid using `pickle`, which is known to lead to... | [
5,
5,
5
] | [
"LOW",
"LOW",
"LOW"
] | [
"MEDIUM",
"MEDIUM",
"MEDIUM"
] | dataset.py | /wavernn/dataset.py | m-toman/tacorn | MIT | |
2024-11-19T02:41:38.764032+00:00 | 1,435,530,678,000 | e4bd8171471adb7c6e136c2ee36b5db3ba590921 | 3 | {
"blob_id": "e4bd8171471adb7c6e136c2ee36b5db3ba590921",
"branch_name": "refs/heads/master",
"committer_date": 1435530678000,
"content_id": "4d0063e857240e5175b2045897da249ed992a972",
"detected_licenses": [
"MIT"
],
"directory_id": "8ef21c0efa61d77beb7633643f38704d980dba2a",
"extension": "py",
"fi... | 3.421875 | stackv2 |
# encoding: utf-8
__author__ = "Nils Tobias Schmidt"
__email__ = "schmidt89 at informatik.uni-marburg.de"
import collections
from copy import deepcopy
from os.path import join
def get_apk_path(package_name, version_name, _hash):
'''
Returns the sub path structure by supplying all arguments needed for it.
... | 121 | 25.3 | 113 | 20 | 704 | python | [{"finding_id": "semgrep_rules.python.lang.correctness.dict-del-while-iterate_8aa7c46bcf00da29_77530d80", "tool_name": "semgrep", "rule_id": "rules.python.lang.correctness.dict-del-while-iterate", "finding_type": "correctness", "severity": "medium", "confidence": "medium", "message": "It appears that `_dict[key]` is a ... | 1 | true | [
""
] | [
"rules.python.lang.correctness.dict-del-while-iterate"
] | [
"correctness"
] | [
"MEDIUM"
] | [
"MEDIUM"
] | [
90
] | [
113
] | [
13
] | [
41
] | [
""
] | [
"It appears that `_dict[key]` is a dict with items being deleted while in a for loop. This is usually a bad idea and will likely lead to a RuntimeError: dictionary changed size during iteration"
] | [
5
] | [
""
] | [
""
] | Util.py | /androlyze/storage/Util.py | nachtmaar/androlyze | MIT | |
2024-11-19T02:41:39.165517+00:00 | 1,692,356,071,000 | f9793983bbaa6d8591659681e4cee07fe1416a65 | 3 | {
"blob_id": "f9793983bbaa6d8591659681e4cee07fe1416a65",
"branch_name": "refs/heads/master",
"committer_date": 1692356071000,
"content_id": "3bd2fed03622966cb590acd865f68730b840da68",
"detected_licenses": [
"Apache-2.0"
],
"directory_id": "4091caecbc727e6d6ae0d827afce11c5979a84fd",
"extension": "py"... | 2.671875 | stackv2 | """
Copyright (C) 2020-2023 Intel Corporation
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to i... | 213 | 33.08 | 112 | 16 | 1,888 | python | [{"finding_id": "semgrep_rules.python.lang.maintainability.is-function-without-parentheses_9aed123bcefe8775_8e26c06f", "tool_name": "semgrep", "rule_id": "rules.python.lang.maintainability.is-function-without-parentheses", "finding_type": "maintainability", "severity": "medium", "confidence": "medium", "message": "Is \... | 3 | true | [
"",
""
] | [
"rules.python.lang.maintainability.is-function-without-parentheses",
"rules.python.lang.maintainability.is-function-without-parentheses"
] | [
"maintainability",
"maintainability"
] | [
"MEDIUM",
"MEDIUM"
] | [
"MEDIUM",
"MEDIUM"
] | [
90,
95
] | [
90,
95
] | [
9,
12
] | [
24,
27
] | [
"",
""
] | [
"Is \"is_trivial\" a function or an attribute? If it is a function, you may have meant self.is_trivial() because self.is_trivial is always true.",
"Is \"is_trivial\" a function or an attribute? If it is a function, you may have meant self.is_trivial() because self.is_trivial is always true."
] | [
5,
5
] | [
"",
""
] | [
"",
""
] | utils.py | /demos/common/python/openvino/model_zoo/model_api/models/utils.py | openvinotoolkit/open_model_zoo | Apache-2.0 | |
2024-11-19T02:41:39.355130+00:00 | 1,615,379,551,000 | 719b8eba4a74da31d38be94ab6730e0f8d3c4f2c | 3 | {
"blob_id": "719b8eba4a74da31d38be94ab6730e0f8d3c4f2c",
"branch_name": "refs/heads/main",
"committer_date": 1615379551000,
"content_id": "ffb16a85aa5bcc8c86964a6b688a115a505ae86b",
"detected_licenses": [
"BSD-3-Clause"
],
"directory_id": "d4a625abcbb4917bb38e0e09f8fb3a89e0a42787",
"extension": "py"... | 2.671875 | stackv2 | import os.path
import pickle
import requests
import torch
FILE_NAME = 'decays.pkl'
def download_data(path: str = 'https://bwsyncandshare.kit.edu/s/xDm7iBdKBZKYoJG/download') -> torch.Tensor:
"""
Download the data containing particle decays simulated with phasespace
"""
if not os.path.exists(FILE_NAM... | 23 | 25.35 | 107 | 13 | 155 | python | [{"finding_id": "semgrep_rules.python.requests.best-practice.use-raise-for-status_e7e94f9b7c78a5ed_486961e2", "tool_name": "semgrep", "rule_id": "rules.python.requests.best-practice.use-raise-for-status", "finding_type": "best-practice", "severity": "medium", "confidence": "medium", "message": "There's an HTTP request ... | 3 | true | [
"CWE-502"
] | [
"rules.python.lang.security.deserialization.avoid-pickle"
] | [
"security"
] | [
"LOW"
] | [
"MEDIUM"
] | [
20
] | [
20
] | [
16
] | [
35
] | [
"A08:2017 - Insecure Deserialization"
] | [
"Avoid using `pickle`, which is known to lead to code execution vulnerabilities. When unpickling, the serialized data could be manipulated to run arbitrary code. Instead, consider serializing the relevant data as JSON or a similar text-based serialization format."
] | [
5
] | [
"LOW"
] | [
"MEDIUM"
] | util.py | /notebooks/util.py | Helmholtz-AI-Energy/kseta_2021 | BSD-3-Clause | |
2024-11-19T02:41:39.521465+00:00 | 1,688,398,223,000 | 984ac80298359b90cbcc935546bcc8c3baa50c2f | 2 | {
"blob_id": "984ac80298359b90cbcc935546bcc8c3baa50c2f",
"branch_name": "refs/heads/master",
"committer_date": 1688398223000,
"content_id": "5ac9146e571a85e32b31aacbd6c3e8e8b8d55e4f",
"detected_licenses": [
"MIT"
],
"directory_id": "bee4b8a10d36f6b9a2b9ec860129b4754449330c",
"extension": "py",
"fi... | 2.421875 | stackv2 | #! /usr/bin/env python3
import argparse
from pathlib import Path
import shutil
import subprocess
import sys
from armory import __version__ as armory_version
script_dir = Path(__file__).parent
root_dir = script_dir.parent
armory_frameworks = ["armory", "pytorch-deepspeech", "yolo"]
# NOTE: Podman is not officially ... | 150 | 28.56 | 85 | 14 | 1,004 | python | [{"finding_id": "semgrep_rules.python.lang.security.audit.dangerous-subprocess-use-audit_8523c57c9f726e9c_b390e0db", "tool_name": "semgrep", "rule_id": "rules.python.lang.security.audit.dangerous-subprocess-use-audit", "finding_type": "security", "severity": "high", "confidence": "low", "message": "Detected subprocess ... | 1 | true | [
"CWE-78"
] | [
"rules.python.lang.security.audit.dangerous-subprocess-use-audit"
] | [
"security"
] | [
"LOW"
] | [
"HIGH"
] | [
111
] | [
111
] | [
16
] | [
45
] | [
"A01:2017 - Injection"
] | [
"Detected subprocess function 'run' without a static string. If this data can be controlled by a malicious actor, it may be an instance of command injection. Audit the use of this call to ensure it is not controllable by an external resource. You may consider using 'shlex.escape()'."
] | [
7.5
] | [
"LOW"
] | [
"HIGH"
] | build.py | /docker/build.py | twosixlabs/armory | MIT | |
2024-11-19T02:41:40.073977+00:00 | 1,623,155,211,000 | d4095c573b96b59d471e66a0698d54c38e02fb87 | 3 | {
"blob_id": "d4095c573b96b59d471e66a0698d54c38e02fb87",
"branch_name": "refs/heads/master",
"committer_date": 1623155211000,
"content_id": "8acc0481843cafe3aa7cd8bf25b775d926242647",
"detected_licenses": [
"MIT"
],
"directory_id": "b22fa833a2b6138df6ffa3faaf0f28d45dad8161",
"extension": "py",
"fi... | 2.796875 | stackv2 | #!/usr/bin/python3
# -*- coding: utf-8 -*-
import requests
import urllib.request
import re
import xlsxwriter
import json
import os
def getHTMLText(url):
response = urllib.request.urlopen(url)
myjson = json.loads(response.read().decode())
return myjson
# try:
# r = requests.get(url)
# ... | 101 | 26.5 | 76 | 15 | 739 | python | [{"finding_id": "semgrep_rules.python.lang.security.audit.dynamic-urllib-use-detected_88cd526059ad3e12_b825309a", "tool_name": "semgrep", "rule_id": "rules.python.lang.security.audit.dynamic-urllib-use-detected", "finding_type": "security", "severity": "medium", "confidence": "low", "message": "Detected a dynamic value... | 3 | true | [
"CWE-78"
] | [
"rules.python.lang.security.audit.dangerous-system-call-audit"
] | [
"security"
] | [
"LOW"
] | [
"HIGH"
] | [
33
] | [
33
] | [
9
] | [
36
] | [
"A01:2017 - Injection"
] | [
"Found dynamic content used in a system call. This is dangerous if external data can reach this function call because it allows a malicious actor to execute commands. Use the 'subprocess' module instead, which is easier to use without accidentally exposing a command injection vulnerability."
] | [
7.5
] | [
"LOW"
] | [
"HIGH"
] | splider.py | /app-store/splider.py | wangwanjie/fetch-appstore-comments | MIT | |
2024-11-19T02:41:42.242728+00:00 | 1,551,849,181,000 | 0e38c8932ad1503aa537838803b573298cd5c96b | 3 | {
"blob_id": "0e38c8932ad1503aa537838803b573298cd5c96b",
"branch_name": "refs/heads/master",
"committer_date": 1551849181000,
"content_id": "e7513092411b3d33da658b9ea64f572741f15f1e",
"detected_licenses": [
"MIT"
],
"directory_id": "96c54aa3e990e8ff35fcce597c9c6ae3f84969b6",
"extension": "py",
"fi... | 2.953125 | stackv2 | """
The algorithm could speed up by memorizing some calculating results
"""
from scipy import stats
import numpy as np
import random
import math
import logging
def getDistance(p1, p2):
x1, y1, x2, y2 = p1['lat'], p1['lng'], p2['lat'], p2['lng']
return math.sqrt(math.pow(x1 - x2, 2) + math.pow(y1 - y2, 2))
... | 231 | 32.11 | 91 | 19 | 2,022 | python | [{"finding_id": "semgrep_rules.python.lang.correctness.list-modify-while-iterate_dfb22edd60727f4b_60a5bbdc", "tool_name": "semgrep", "rule_id": "rules.python.lang.correctness.list-modify-while-iterate", "finding_type": "correctness", "severity": "high", "confidence": "medium", "message": "It appears that `overlapDict` ... | 1 | true | [
""
] | [
"rules.python.lang.correctness.list-modify-while-iterate"
] | [
"correctness"
] | [
"MEDIUM"
] | [
"HIGH"
] | [
25
] | [
28
] | [
5
] | [
35
] | [
""
] | [
"It appears that `overlapDict` is a list that is being modified while in a for loop. This will likely cause a runtime error or an infinite loop."
] | [
7.5
] | [
""
] | [
""
] | blue_noise.py | /blue_noise.py | locknono/blue-noise | MIT | |
2024-11-19T02:41:42.644078+00:00 | 1,447,915,974,000 | a40086c12c94d2f5e99f8ed1854de777928740b2 | 4 | {
"blob_id": "a40086c12c94d2f5e99f8ed1854de777928740b2",
"branch_name": "refs/heads/master",
"committer_date": 1447915974000,
"content_id": "4e4b0a0d59ca38b376844596d93a69bc4d3765e4",
"detected_licenses": [
"MIT"
],
"directory_id": "10476139fc50177fcc34da0890fd7c8f35e57eed",
"extension": "py",
"fi... | 3.5625 | stackv2 | # Import required libraries
import os
#
# Open Text file with host list
with open('device_file1.txt') as fname:
# Set Variable Switches to read each line int file we opened
switches = fname.read().splitlines()
# Create a for loop named switch that iterates throug the lines in switches
for switch in switches:
# R... | 17 | 31.65 | 77 | 10 | 142 | python | [{"finding_id": "semgrep_rules.python.lang.best-practice.unspecified-open-encoding_282247f20cde4011_02f23e9b", "tool_name": "semgrep", "rule_id": "rules.python.lang.best-practice.unspecified-open-encoding", "finding_type": "best-practice", "severity": "medium", "confidence": "medium", "message": "Missing 'encoding' par... | 2 | true | [
"CWE-78"
] | [
"rules.python.lang.security.audit.dangerous-system-call-audit"
] | [
"security"
] | [
"LOW"
] | [
"HIGH"
] | [
11
] | [
11
] | [
13
] | [
45
] | [
"A01:2017 - Injection"
] | [
"Found dynamic content used in a system call. This is dangerous if external data can reach this function call because it allows a malicious actor to execute commands. Use the 'subprocess' module instead, which is easier to use without accidentally exposing a command injection vulnerability."
] | [
7.5
] | [
"LOW"
] | [
"HIGH"
] | ping.py | /A Few Easy Steps/multi device ping tool/ping.py | joshobrien77/staticnat | MIT | |
2024-11-19T02:41:49.777913+00:00 | 1,630,135,665,000 | e68689af490d7df7beb05005ae70abdb9276b409 | 3 | {
"blob_id": "e68689af490d7df7beb05005ae70abdb9276b409",
"branch_name": "refs/heads/main",
"committer_date": 1630135665000,
"content_id": "b1269bd13d09091c833f35c1b6a580de7094fc8d",
"detected_licenses": [
"Apache-2.0"
],
"directory_id": "6d52ef583ee949fb4233c3a590c32dda1019d0fc",
"extension": "py",
... | 2.640625 | stackv2 | from django.shortcuts import render
from rest_framework.views import APIView
import pickle, base64
from rest_framework.response import Response
from rest_framework import status
from django_redis import get_redis_connection
from .serializers import CartSerializer, SKUCartSerializer, CartDeletedSerializer, CartSelected... | 352 | 32.01 | 108 | 19 | 3,033 | python | [{"finding_id": "semgrep_rules.python.lang.maintainability.is-function-without-parentheses_7bbb6d380a111518_bdf80714", "tool_name": "semgrep", "rule_id": "rules.python.lang.maintainability.is-function-without-parentheses", "finding_type": "maintainability", "severity": "medium", "confidence": "medium", "message": "Is \... | 26 | true | [
"",
"CWE-502",
"CWE-502",
"CWE-502",
"CWE-502",
"CWE-614",
"",
"CWE-502",
"CWE-502",
"",
"CWE-502",
"CWE-502",
"CWE-502",
"CWE-614",
"",
"CWE-502",
"CWE-502",
"CWE-502",
"CWE-502",
"CWE-614",
"",
"CWE-502",
"CWE-502",
"CWE-502",
"CWE-502",
"CWE-614"
] | [
"rules.python.lang.maintainability.is-function-without-parentheses",
"rules.python.django.security.audit.avoid-insecure-deserialization",
"rules.python.lang.security.deserialization.avoid-pickle",
"rules.python.django.security.audit.avoid-insecure-deserialization",
"rules.python.lang.security.deserializatio... | [
"maintainability",
"security",
"security",
"security",
"security",
"security",
"maintainability",
"security",
"security",
"maintainability",
"security",
"security",
"security",
"security",
"maintainability",
"security",
"security",
"security",
"security",
"security",
"maintai... | [
"MEDIUM",
"MEDIUM",
"LOW",
"MEDIUM",
"LOW",
"LOW",
"MEDIUM",
"MEDIUM",
"LOW",
"MEDIUM",
"MEDIUM",
"LOW",
"LOW",
"LOW",
"MEDIUM",
"MEDIUM",
"LOW",
"MEDIUM",
"LOW",
"LOW",
"MEDIUM",
"MEDIUM",
"LOW",
"MEDIUM",
"LOW",
"LOW"
] | [
"MEDIUM",
"HIGH",
"MEDIUM",
"HIGH",
"MEDIUM",
"MEDIUM",
"MEDIUM",
"HIGH",
"MEDIUM",
"MEDIUM",
"HIGH",
"MEDIUM",
"MEDIUM",
"MEDIUM",
"MEDIUM",
"HIGH",
"MEDIUM",
"HIGH",
"MEDIUM",
"MEDIUM",
"MEDIUM",
"HIGH",
"MEDIUM",
"HIGH",
"MEDIUM",
"MEDIUM"
] | [
39,
79,
79,
98,
98,
107,
119,
149,
149,
187,
215,
215,
226,
230,
249,
271,
271,
282,
282,
284,
314,
338,
338,
348,
348,
350
] | [
39,
79,
79,
98,
98,
107,
119,
149,
149,
187,
215,
215,
226,
230,
249,
271,
271,
282,
282,
284,
314,
338,
338,
348,
348,
350
] | [
21,
29,
29,
26,
26,
13,
21,
29,
29,
21,
29,
29,
41,
13,
21,
29,
29,
45,
45,
17,
21,
29,
29,
41,
41,
13
] | [
42,
53,
53,
49,
49,
50,
42,
53,
53,
42,
78,
78,
64,
50,
42,
78,
78,
68,
68,
54,
42,
78,
78,
64,
64,
50
] | [
"",
"A08:2017 - Insecure Deserialization",
"A08:2017 - Insecure Deserialization",
"A08:2017 - Insecure Deserialization",
"A08:2017 - Insecure Deserialization",
"A05:2021 - Security Misconfiguration",
"",
"A08:2017 - Insecure Deserialization",
"A08:2017 - Insecure Deserialization",
"",
"A08:2017 ... | [
"Is \"is_authenticated\" a function or an attribute? If it is a function, you may have meant user.is_authenticated() because user.is_authenticated is always true.",
"Avoid using insecure deserialization library, backed by `pickle`, `_pickle`, `cpickle`, `dill`, `shelve`, or `yaml`, which are known to lead to remo... | [
5,
7.5,
5,
7.5,
5,
5,
5,
7.5,
5,
5,
7.5,
5,
5,
5,
5,
7.5,
5,
7.5,
5,
5,
5,
7.5,
5,
7.5,
5,
5
] | [
"",
"MEDIUM",
"LOW",
"MEDIUM",
"LOW",
"LOW",
"",
"MEDIUM",
"LOW",
"",
"MEDIUM",
"LOW",
"LOW",
"LOW",
"",
"MEDIUM",
"LOW",
"MEDIUM",
"LOW",
"LOW",
"",
"MEDIUM",
"LOW",
"MEDIUM",
"LOW",
"LOW"
] | [
"",
"MEDIUM",
"MEDIUM",
"MEDIUM",
"MEDIUM",
"LOW",
"",
"MEDIUM",
"MEDIUM",
"",
"MEDIUM",
"MEDIUM",
"MEDIUM",
"LOW",
"",
"MEDIUM",
"MEDIUM",
"MEDIUM",
"MEDIUM",
"LOW",
"",
"MEDIUM",
"MEDIUM",
"MEDIUM",
"MEDIUM",
"LOW"
] | views.py | /meiduo_mall/meiduo_mall/apps/carts/views.py | rishinkaku/Django_html_vue.js | Apache-2.0 | |
2024-11-19T02:41:53.103851+00:00 | 1,597,848,929,000 | e69000991d91978876708ad677741dea10e604c2 | 3 | {
"blob_id": "e69000991d91978876708ad677741dea10e604c2",
"branch_name": "refs/heads/master",
"committer_date": 1597848929000,
"content_id": "961dcb03fb5587ac9cc75f5eb6acabed1cab0dcf",
"detected_licenses": [
"MIT"
],
"directory_id": "7acf5c54793e93a3f2f40784f14e97035dca6afe",
"extension": "py",
"fi... | 3.140625 | stackv2 | import sqlite3
import hashlib
def _hash(password):
return hashlib.sha256(password).hexdigest()
def init():
try:
open("Userdb.db", "r")
created = True
except:
created = False
conn = sqlite3.connect("Userdb.db")
cur = conn.cursor()
cur.execute(
"CREATE TABLE ... | 58 | 17.86 | 77 | 10 | 251 | python | [{"finding_id": "semgrep_rules.python.lang.best-practice.unspecified-open-encoding_60b302e4b8dd1246_3d72fd79", "tool_name": "semgrep", "rule_id": "rules.python.lang.best-practice.unspecified-open-encoding", "finding_type": "best-practice", "severity": "medium", "confidence": "medium", "message": "Missing 'encoding' par... | 5 | true | [
"CWE-89",
"CWE-89",
"CWE-89",
"CWE-89"
] | [
"rules.python.lang.security.audit.formatted-sql-query",
"rules.python.sqlalchemy.security.sqlalchemy-execute-raw-query",
"rules.python.lang.security.audit.formatted-sql-query",
"rules.python.sqlalchemy.security.sqlalchemy-execute-raw-query"
] | [
"security",
"security",
"security",
"security"
] | [
"LOW",
"LOW",
"LOW",
"LOW"
] | [
"MEDIUM",
"HIGH",
"MEDIUM",
"HIGH"
] | [
34,
34,
53,
53
] | [
34,
34,
53,
53
] | [
5,
5,
5,
5
] | [
78,
78,
76,
76
] | [
"A01:2017 - Injection",
"A01:2017 - Injection",
"A01:2017 - Injection",
"A01:2017 - Injection"
] | [
"Detected possible formatted SQL query. Use parameterized queries instead.",
"Avoiding SQL string concatenation: untrusted input concatenated with raw SQL query can result in SQL Injection. In order to execute raw query safely, prepared statement should be used. SQLAlchemy provides TextualSQL to easily used prepa... | [
5,
7.5,
5,
7.5
] | [
"LOW",
"LOW",
"LOW",
"LOW"
] | [
"HIGH",
"HIGH",
"HIGH",
"HIGH"
] | login.py | /login.py | bigboy32/RaspiNetworkStore | MIT | |
2024-11-19T02:41:54.063359+00:00 | 1,306,341,454,000 | ef15c9de765311e63633c6e5bb8cacca4450dba2 | 3 | {
"blob_id": "ef15c9de765311e63633c6e5bb8cacca4450dba2",
"branch_name": "refs/heads/master",
"committer_date": 1306341454000,
"content_id": "d1cae6c1bff9b47f464e16589c5db065f56d460a",
"detected_licenses": [
"MIT"
],
"directory_id": "defba0f8cc8021feded115473d800f94abe19cc7",
"extension": "py",
"fi... | 3.09375 | stackv2 | import xmlrpclib
import collections
import types
class Client(object):
"""
Connection to a WordPress XML-RPC API endpoint.
To execute XML-RPC methods, pass an instance of an
`XmlrpcMethod`-derived class to `Client`'s `call` method.
"""
def __init__(self, url, username, password, blog_id=0):
... | 129 | 32.78 | 130 | 16 | 897 | python | [{"finding_id": "semgrep_rules.python.lang.security.use-defused-xmlrpc_fd87d24b275807cc_7ac1efec", "tool_name": "semgrep", "rule_id": "rules.python.lang.security.use-defused-xmlrpc", "finding_type": "security", "severity": "high", "confidence": "low", "message": "Detected use of xmlrpc. xmlrpc is not inherently safe fr... | 1 | true | [
"CWE-776"
] | [
"rules.python.lang.security.use-defused-xmlrpc"
] | [
"security"
] | [
"LOW"
] | [
"HIGH"
] | [
1
] | [
1
] | [
1
] | [
17
] | [
"A04:2017 - XML External Entities (XXE)"
] | [
"Detected use of xmlrpc. xmlrpc is not inherently safe from vulnerabilities. Use defusedxml.xmlrpc instead."
] | [
7.5
] | [
"LOW"
] | [
"MEDIUM"
] | base.py | /wordpress_xmlrpc/base.py | onyxfish/python-wordpress-xmlrpc | MIT | |
2024-11-19T02:41:54.486807+00:00 | 1,597,068,473,000 | 0a0a52f7f4d1a9b69e8f88b8dc8e0defb769a91b | 2 | {
"blob_id": "0a0a52f7f4d1a9b69e8f88b8dc8e0defb769a91b",
"branch_name": "refs/heads/master",
"committer_date": 1597068473000,
"content_id": "f4259f4650043ee7a6f25812ae630ed64f489977",
"detected_licenses": [
"BSD-3-Clause"
],
"directory_id": "ff2ad26504b3ea709b11213cb23d26c5f9435b76",
"extension": "p... | 2.46875 | stackv2 | # -*- coding: utf-8 -*-
from dataclasses import dataclass
from datetime import datetime, timedelta
from enum import unique
from typing import Optional
from eduid_common.api.messages import TranslatableMsg, error_response, success_response
from eduid_common.api.utils import get_short_hash
from eduid_userdb import User
... | 160 | 41.16 | 120 | 14 | 1,562 | python | [{"finding_id": "semgrep_rules.python.lang.maintainability.is-function-without-parentheses_5776174d70b265e2_23f8f30a", "tool_name": "semgrep", "rule_id": "rules.python.lang.maintainability.is-function-without-parentheses", "finding_type": "maintainability", "severity": "medium", "confidence": "medium", "message": "Is \... | 2 | true | [
"",
""
] | [
"rules.python.lang.maintainability.is-function-without-parentheses",
"rules.python.lang.maintainability.is-function-without-parentheses"
] | [
"maintainability",
"maintainability"
] | [
"MEDIUM",
"MEDIUM"
] | [
"MEDIUM",
"MEDIUM"
] | [
59,
76
] | [
59,
76
] | [
90,
12
] | [
105,
41
] | [
"",
""
] | [
"Is \"is_expired\" a function or an attribute? If it is a function, you may have meant self.is_expired() because self.is_expired is always true.",
"Is \"is_sent\" a function or an attribute? If it is a function, you may have meant state.proofing_letter.is_sent() because state.proofing_letter.is_sent is always tru... | [
5,
5
] | [
"",
""
] | [
"",
""
] | helpers.py | /src/eduid_webapp/letter_proofing/helpers.py | lamlion/eduid-webapp | BSD-3-Clause | |
2024-11-19T02:41:55.117326+00:00 | 1,412,824,523,000 | 049a2dd9dd3e5e24242dee0e90a0270af7e76091 | 3 | {
"blob_id": "049a2dd9dd3e5e24242dee0e90a0270af7e76091",
"branch_name": "refs/heads/master",
"committer_date": 1412824523000,
"content_id": "52ba39cbc7fb572147ab2b78903b1a54e6357b9c",
"detected_licenses": [
"ISC"
],
"directory_id": "3e04ea60aa8a7b48ad7f89f9f7a08f93a18af529",
"extension": "py",
"fi... | 3.125 | stackv2 | import collections
import logging
import StringIO
from . import exc, Request, Expression
logger = logging.getLogger(__name__)
class CompiledRule(object):
"""
Compiled version of a routing rule.
`symbols`
A `rump.fields.Symbols` table used to store symbolic information used
in the compi... | 369 | 29.04 | 80 | 19 | 2,310 | python | [{"finding_id": "semgrep_rules.python.lang.security.audit.eval-detected_5a89899e6ff86834_41954f33", "tool_name": "semgrep", "rule_id": "rules.python.lang.security.audit.eval-detected", "finding_type": "security", "severity": "medium", "confidence": "low", "message": "Detected the use of eval(). eval() can be dangerous ... | 1 | true | [
"CWE-95"
] | [
"rules.python.lang.security.audit.eval-detected"
] | [
"security"
] | [
"LOW"
] | [
"MEDIUM"
] | [
55
] | [
55
] | [
19
] | [
61
] | [
"A03:2021 - Injection"
] | [
"Detected the use of eval(). eval() can be dangerous if used to evaluate dynamic content. If this content can be input from outside the program, this may be a code injection vulnerability. Ensure evaluated content is not definable by external sources."
] | [
5
] | [
"LOW"
] | [
"HIGH"
] | rule.py | /rump/rule.py | bninja/rump | ISC | |
2024-11-19T02:41:55.372889+00:00 | 1,579,010,758,000 | 6571f46829af9fe50f6a2ce0e08f64e2b4305168 | 3 | {
"blob_id": "6571f46829af9fe50f6a2ce0e08f64e2b4305168",
"branch_name": "refs/heads/master",
"committer_date": 1579010758000,
"content_id": "9f462990dabe71a2e185b85859985659683d6e14",
"detected_licenses": [
"MIT"
],
"directory_id": "847f8aec3d3b75fb12eb45fdcfbfea515ee90f4e",
"extension": "py",
"fi... | 2.96875 | stackv2 | from django.db import models
from typing import Optional
# Create your models here.
class Nutrient(models.Model):
"""
TODO: Implement a translation dictionary
"""
nutrient = models.CharField(max_length=60)
units = models.CharField(max_length=20)
@property
def nutrient_long(self) -> str:
... | 153 | 29.4 | 147 | 19 | 1,189 | python | [{"finding_id": "semgrep_rules.python.django.correctness.no-null-string-field_59263357005d9ff1_dd077d55", "tool_name": "semgrep", "rule_id": "rules.python.django.correctness.no-null-string-field", "finding_type": "correctness", "severity": "medium", "confidence": "medium", "message": "Avoid using null on string-based f... | 4 | true | [
"",
"",
"",
""
] | [
"rules.python.django.correctness.no-null-string-field",
"rules.python.django.correctness.no-null-string-field",
"rules.python.django.correctness.no-null-string-field",
"rules.python.django.correctness.no-null-string-field"
] | [
"correctness",
"correctness",
"correctness",
"correctness"
] | [
"MEDIUM",
"MEDIUM",
"MEDIUM",
"MEDIUM"
] | [
"MEDIUM",
"MEDIUM",
"MEDIUM",
"MEDIUM"
] | [
62,
84,
109,
117
] | [
62,
84,
109,
117
] | [
5,
5,
5,
5
] | [
73,
73,
101,
97
] | [
"",
"",
"",
""
] | [
"Avoid using null on string-based fields such as CharField and TextField. If a string-based field has null=True, that means it has two possible values for \"no data\": NULL, and the empty string. In most cases, it's redundant to have two possible values for \"no data;\" the Django convention is to use the empty str... | [
5,
5,
5,
5
] | [
"",
"",
"",
""
] | [
"",
"",
"",
""
] | models.py | /infobasenutritiondb/api/models.py | bfssi-forest-dussault/infobasenutritiondb | MIT | |
2024-11-19T02:41:57.945150+00:00 | 1,617,762,973,000 | 6c76268b07f7547cc8f3da767d994339764055c1 | 3 | {
"blob_id": "6c76268b07f7547cc8f3da767d994339764055c1",
"branch_name": "refs/heads/master",
"committer_date": 1617762973000,
"content_id": "bd4b5106103392140c7d1174f08fa8bdf0e7ca0d",
"detected_licenses": [
"Apache-2.0"
],
"directory_id": "7eb116be67f178f50181b89efcbf58cce4ff9530",
"extension": "py"... | 2.5625 | stackv2 | # AUTOGENERATED! DO NOT EDIT! File to edit: 00_srag_data.ipynb (unless otherwise specified).
__all__ = ['get_last_bd_srag_csv_url', 'get_srag_data', 'get_cities_states_dictionaries', 'treat_srag_data']
# Cell
def get_last_bd_srag_csv_url(year=2021):
available_years = (2020,2021)
if year not in available_year... | 131 | 37.24 | 127 | 16 | 1,430 | python | [{"finding_id": "semgrep_rules.python.lang.security.unverified-ssl-context_c1161a2078ea04d3_da9e5391", "tool_name": "semgrep", "rule_id": "rules.python.lang.security.unverified-ssl-context", "finding_type": "security", "severity": "high", "confidence": "medium", "message": "Unverified SSL context detected. This will pe... | 1 | true | [
"CWE-295"
] | [
"rules.python.lang.security.unverified-ssl-context"
] | [
"security"
] | [
"MEDIUM"
] | [
"HIGH"
] | [
16
] | [
16
] | [
15
] | [
47
] | [
"A03:2017 - Sensitive Data Exposure"
] | [
"Unverified SSL context detected. This will permit insecure connections without verifying SSL certificates. Use 'ssl.create_default_context' instead."
] | [
7.5
] | [
"LOW"
] | [
"MEDIUM"
] | srag_data.py | /srag_data/srag_data.py | victor-marchesini/opendatasus | Apache-2.0 | |
2024-11-19T02:41:58.332394+00:00 | 1,634,143,656,000 | 2ce91bf93a30616d7f079e0e3fc9eadcd2f9080e | 3 | {
"blob_id": "2ce91bf93a30616d7f079e0e3fc9eadcd2f9080e",
"branch_name": "refs/heads/main",
"committer_date": 1634143656000,
"content_id": "f3512ec8e837ec5b7446b4633c6a4a543c61a80d",
"detected_licenses": [
"MIT"
],
"directory_id": "3cad56e3105d23a7894698df18042cd15a3565ae",
"extension": "py",
"file... | 2.765625 | stackv2 | import binascii
import os
import warnings
with warnings.catch_warnings():
warnings.simplefilter('ignore', DeprecationWarning)
from cryptography.exceptions import InvalidSignature
from cryptography.hazmat.backends import default_backend
from cryptography.hazmat.primitives import hashes, padding
from cryptography.ha... | 162 | 30.62 | 80 | 15 | 1,448 | python | [{"finding_id": "semgrep_rules.python.cryptography.security.crypto-mode-without-authentication_e0f28fae7705591f_3194e3d3", "tool_name": "semgrep", "rule_id": "rules.python.cryptography.security.crypto-mode-without-authentication", "finding_type": "security", "severity": "high", "confidence": "medium", "message": "An en... | 1 | true | [
"CWE-327"
] | [
"rules.python.cryptography.security.crypto-mode-without-authentication"
] | [
"security"
] | [
"MEDIUM"
] | [
"HIGH"
] | [
139
] | [
140
] | [
14
] | [
42
] | [
"A03:2017 - Sensitive Data Exposure"
] | [
"An encryption mode of operation is being used without proper message authentication. This can potentially result in the encrypted content to be decrypted by an attacker. Consider instead use an AEAD mode of operation like GCM. "
] | [
7.5
] | [
"LOW"
] | [
"MEDIUM"
] | ciphers.py | /ansible_vault/ciphers.py | AchieveGoals/ansible-vault-win | MIT | |
2024-11-19T02:42:00.089798+00:00 | 1,620,699,120,000 | 8113e84bb14d195f201a00438bb4b5ce66974a38 | 3 | {
"blob_id": "8113e84bb14d195f201a00438bb4b5ce66974a38",
"branch_name": "refs/heads/master",
"committer_date": 1620699120000,
"content_id": "940c624e73fc840afeea44eb9bcf8758e67ff935",
"detected_licenses": [
"MIT"
],
"directory_id": "109a58d8d5f1616d4013ca530326d7e903af13cf",
"extension": "py",
"fi... | 2.53125 | stackv2 | r"""find aligned pairs
Given: nll matrix: nll_matrix
Output: aligned pairs and confidence level
Refer to C:\dl\Dropbox\mat-dir\myapps\pytorch-nlp\rnn_embed\heatmap_nll.py
"""
import sys
import logging
import pickle
# import inspect
import numpy as np
import pytest
LOGGER = logging.getLogger(__name__)
LOGGER.addHand... | 222 | 29.87 | 80 | 17 | 1,960 | python | [{"finding_id": "semgrep_rules.python.lang.security.deserialization.avoid-pickle_69fa8dc9bb0ff9d1_86aba027", "tool_name": "semgrep", "rule_id": "rules.python.lang.security.deserialization.avoid-pickle", "finding_type": "security", "severity": "medium", "confidence": "low", "message": "Avoid using `pickle`, which is kno... | 4 | true | [
"CWE-502",
"CWE-502",
"CWE-502",
"CWE-502"
] | [
"rules.python.lang.security.deserialization.avoid-pickle",
"rules.python.lang.security.deserialization.avoid-pickle",
"rules.python.lang.security.deserialization.avoid-pickle",
"rules.python.lang.security.deserialization.avoid-pickle"
] | [
"security",
"security",
"security",
"security"
] | [
"LOW",
"LOW",
"LOW",
"LOW"
] | [
"MEDIUM",
"MEDIUM",
"MEDIUM",
"MEDIUM"
] | [
154,
166,
180,
194
] | [
154,
166,
180,
194
] | [
22,
22,
22,
22
] | [
42,
42,
42,
42
] | [
"A08:2017 - Insecure Deserialization",
"A08:2017 - Insecure Deserialization",
"A08:2017 - Insecure Deserialization",
"A08:2017 - Insecure Deserialization"
] | [
"Avoid using `pickle`, which is known to lead to code execution vulnerabilities. When unpickling, the serialized data could be manipulated to run arbitrary code. Instead, consider serializing the relevant data as JSON or a similar text-based serialization format.",
"Avoid using `pickle`, which is known to lead to... | [
5,
5,
5,
5
] | [
"LOW",
"LOW",
"LOW",
"LOW"
] | [
"MEDIUM",
"MEDIUM",
"MEDIUM",
"MEDIUM"
] | find_aligned_pairs.py | /light_aligner/find_aligned_pairs.py | ffreemt/light-aligner | MIT | |
2024-11-19T02:42:00.629782+00:00 | 1,692,724,461,000 | 68662d5cf355ed3062664272684daa9529f229b8 | 2 | {
"blob_id": "68662d5cf355ed3062664272684daa9529f229b8",
"branch_name": "refs/heads/master",
"committer_date": 1692724461000,
"content_id": "c5cef68ef6996e1d1de4ce9ffabb0f36bf53c765",
"detected_licenses": [
"BSD-2-Clause"
],
"directory_id": "305d26e6cb4929e36fd333362be006edf46401cd",
"extension": "p... | 2.5 | stackv2 | import logging
from cle.backends.symbol import Symbol, SymbolType
log = logging.getLogger(name=__name__)
class WinSymbol(Symbol):
"""
Represents a symbol for the PE format.
"""
def __init__(self, owner, name, addr, is_import, is_export, ordinal_number, forwarder):
super().__init__(owner, na... | 39 | 31.23 | 93 | 14 | 272 | python | [{"finding_id": "semgrep_rules.python.lang.maintainability.is-function-without-parentheses_7f05132dd570a881_be3dc4f5", "tool_name": "semgrep", "rule_id": "rules.python.lang.maintainability.is-function-without-parentheses", "finding_type": "maintainability", "severity": "medium", "confidence": "medium", "message": "Is \... | 4 | true | [
"",
"",
"",
""
] | [
"rules.python.lang.maintainability.is-function-without-parentheses",
"rules.python.lang.maintainability.is-function-without-parentheses",
"rules.python.lang.maintainability.is-function-without-parentheses",
"rules.python.lang.maintainability.is-function-without-parentheses"
] | [
"maintainability",
"maintainability",
"maintainability",
"maintainability"
] | [
"MEDIUM",
"MEDIUM",
"MEDIUM",
"MEDIUM"
] | [
"MEDIUM",
"MEDIUM",
"MEDIUM",
"MEDIUM"
] | [
15,
16,
19,
27
] | [
15,
16,
19,
27
] | [
9,
9,
9,
35
] | [
23,
23,
24,
49
] | [
"",
"",
"",
""
] | [
"Is \"is_import\" a function or an attribute? If it is a function, you may have meant self.is_import() because self.is_import is always true.",
"Is \"is_export\" a function or an attribute? If it is a function, you may have meant self.is_export() because self.is_export is always true.",
"Is \"is_forward\" a fun... | [
5,
5,
5,
5
] | [
"",
"",
"",
""
] | [
"",
"",
"",
""
] | symbol.py | /cle/backends/pe/symbol.py | angr/cle | BSD-2-Clause | |
2024-11-19T02:42:06.117128+00:00 | 1,404,137,262,000 | ef851f2fc76077c01beb7eacb33d4d92cef8b3a3 | 3 | {
"blob_id": "ef851f2fc76077c01beb7eacb33d4d92cef8b3a3",
"branch_name": "refs/heads/master",
"committer_date": 1404137262000,
"content_id": "4b71471a1e9211ef11d063cc73ede8192de33498",
"detected_licenses": [
"Apache-2.0"
],
"directory_id": "0827b9cb904ac1c8be15374fe48c368a517d4ab5",
"extension": "py"... | 2.75 | stackv2 | from mainapp.models import Course, CourseGroup, Semester, Trajectory # import more
### common functionality
def programCourses(program):
courses = []
requirements = program.requirements
for requirement in requirements.all():
for course in requirement.courses.all():
courses.append(cour... | 323 | 28.21 | 83 | 18 | 1,985 | python | [{"finding_id": "semgrep_rules.python.lang.correctness.list-modify-while-iterate_7382b693bb1a3396_a4af8a22", "tool_name": "semgrep", "rule_id": "rules.python.lang.correctness.list-modify-while-iterate", "finding_type": "correctness", "severity": "high", "confidence": "medium", "message": "It appears that `courses` is a... | 1 | true | [
""
] | [
"rules.python.lang.correctness.list-modify-while-iterate"
] | [
"correctness"
] | [
"MEDIUM"
] | [
"HIGH"
] | [
16
] | [
29
] | [
9
] | [
30
] | [
""
] | [
"It appears that `courses` is a list that is being modified while in a for loop. This will likely cause a runtime error or an infinite loop."
] | [
7.5
] | [
""
] | [
""
] | utils.py | /advisor/mainapp/utils.py | srct/advisor | Apache-2.0 | |
2024-11-19T02:42:20.986954+00:00 | 1,692,531,188,000 | 66e0b44e75ef35d4d02b046fea4bca7c50377ede | 3 | {
"blob_id": "66e0b44e75ef35d4d02b046fea4bca7c50377ede",
"branch_name": "refs/heads/main",
"committer_date": 1692531188000,
"content_id": "da3d4329b2f1419fd9d44c2e24a5fb3ca6f4002b",
"detected_licenses": [
"MIT"
],
"directory_id": "b6530510b7a074a3e8254be2159198b11e54f748",
"extension": "py",
"file... | 2.8125 | stackv2 | import logging
import subprocess
from subprocess import PIPE, Popen
from threading import Lock
from typing import List, Optional, Union
from rhoknp.processors.processor import Processor
from rhoknp.units import Document, Morpheme, Sentence
from rhoknp.utils.comment import is_comment_line
logger = logging.getLogger(__... | 180 | 34.79 | 115 | 25 | 1,442 | python | [{"finding_id": "semgrep_rules.python.lang.compatibility.python36-compatibility-Popen2_75c5eb4b72b6aa23_8ad5aa7d", "tool_name": "semgrep", "rule_id": "rules.python.lang.compatibility.python36-compatibility-Popen2", "finding_type": "compatibility", "severity": "high", "confidence": "medium", "message": "the `encoding` a... | 3 | true | [
"CWE-78",
"CWE-78"
] | [
"rules.python.lang.security.audit.dangerous-subprocess-use-audit",
"rules.python.lang.security.audit.dangerous-subprocess-use-audit"
] | [
"security",
"security"
] | [
"LOW",
"LOW"
] | [
"HIGH",
"HIGH"
] | [
56,
169
] | [
56,
169
] | [
26,
13
] | [
105,
88
] | [
"A01:2017 - Injection",
"A01:2017 - Injection"
] | [
"Detected subprocess function 'Popen' without a static string. If this data can be controlled by a malicious actor, it may be an instance of command injection. Audit the use of this call to ensure it is not controllable by an external resource. You may consider using 'shlex.escape()'.",
"Detected subprocess funct... | [
7.5,
7.5
] | [
"LOW",
"LOW"
] | [
"HIGH",
"HIGH"
] | kwja.py | /src/rhoknp/processors/kwja.py | ku-nlp/rhoknp | MIT | |
2024-11-19T02:50:54.707713+00:00 | 1,669,137,292,000 | b247476d74acbac01f025726b816e27b9fbcdec5 | 3 | {
"blob_id": "b247476d74acbac01f025726b816e27b9fbcdec5",
"branch_name": "refs/heads/master",
"committer_date": 1669137292000,
"content_id": "2257002ec776ceacaa370a9ec05f38308ec198d1",
"detected_licenses": [
"MIT"
],
"directory_id": "26aa5596094db02ce142c281f340d989cf102acd",
"extension": "py",
"fi... | 2.6875 | stackv2 | """
The script demonstrates a simple example of using ART with YOLO (versions 3 and 5).
The example loads a YOLO model pretrained on the COCO dataset
and creates an adversarial example using Projected Gradient Descent method.
- To use Yolov3, run:
pip install pytorchyolo
- To use Yolov5, run:
pip inst... | 297 | 25.13 | 118 | 17 | 2,014 | python | [{"finding_id": "semgrep_rules.python.lang.correctness.useless-eqeq_1592ccb8794be2b4_0bdcf7d7", "tool_name": "semgrep", "rule_id": "rules.python.lang.correctness.useless-eqeq", "finding_type": "correctness", "severity": "low", "confidence": "medium", "message": "This expression is always True: `MODEL == MODEL` or `MODE... | 3 | true | [
""
] | [
"rules.python.lang.correctness.useless-eqeq"
] | [
"correctness"
] | [
"MEDIUM"
] | [
"LOW"
] | [
192
] | [
192
] | [
4
] | [
21
] | [
""
] | [
"This expression is always True: `MODEL == MODEL` or `MODEL != MODEL`. If testing for floating point NaN, use `math.isnan(MODEL)`, or `cmath.isnan(MODEL)` if the number is complex."
] | [
3
] | [
""
] | [
""
] | get_started_yolo.py | /examples/get_started_yolo.py | davidslater/adversarial-robustness-toolbox | MIT |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.