source
stringlengths
4.8k
15.8k
file_name
stringlengths
9
9
cwe
listlengths
1
1
""" Callback handler for storing generation data in OpenInference format. OpenInference is an open standard for capturing and storing AI model inferences. It enables production LLMapp servers to seamlessly integrate with LLM observability solutions such as Arize and Phoenix. For more information on the specification, ...
910790.py
[ "CWE-706: Use of Incorrectly-Resolved Name or Reference" ]
# Copyright (c) Microsoft Corporation. # SPDX-License-Identifier: Apache-2.0 # DeepSpeed Team import importlib import inspect from .abstract_accelerator import DeepSpeedAccelerator # During setup stage torch may not be installed, pass on no torch will # allow op builder related API to be executed. try: import tor...
181714.py
[ "CWE-706: Use of Incorrectly-Resolved Name or Reference" ]
# Copyright (c) Microsoft Corporation. # SPDX-License-Identifier: Apache-2.0 # DeepSpeed Team import torch from deepspeed.accelerator.abstract_accelerator import DeepSpeedAccelerator import intel_extension_for_pytorch as ipex # noqa: F401 # type: ignore import oneccl_bindings_for_pytorch # noqa: F401 # type: ignore...
190570.py
[ "CWE-706: Use of Incorrectly-Resolved Name or Reference" ]
# Copyright (c) Microsoft Corporation. # SPDX-License-Identifier: Apache-2.0 # DeepSpeed Team import os import re import torch import types from typing import List, Tuple, Union from dataclasses import dataclass from .constants import (FP32_WEIGHT_KEY, PARAM, VOCAB_TENSOR, CAT_DIM, PARAM_N_SUB_PARAMS, SUB_PARAM_SHAPE...
252141.py
[ "CWE-502: Deserialization of Untrusted Data" ]
from collections import Counter from typing import Union, List, Callable, Tuple import torch import penman from penman import Graph from hanlp.common.dataset import TransformableDataset from hanlp.components.amr.seq2seq.dataset.IO import read_raw_amr_data from hanlp.components.amr.seq2seq.dataset.penman import role_is_...
310532.py
[ "CWE-502: Deserialization of Untrusted Data" ]
import os import tempfile import time import requests from unittest import mock from urllib.request import urlopen import pytest from requests.structures import CaseInsensitiveDict from httpie.downloads import ( parse_content_range, filename_from_content_disposition, filename_from_url, get_unique_filename, Co...
087698.py
[ "CWE-939: Improper Authorization in Handler for Custom URL Scheme" ]
#!/usr/bin/env python3 """Extract Mel spectrograms with teacher forcing.""" import argparse import os import numpy as np import torch from torch.utils.data import DataLoader from tqdm import tqdm from TTS.config import load_config from TTS.tts.datasets import TTSDataset, load_tts_samples from TTS.tts.models import s...
614629.py
[ "CWE-676: Use of Potentially Dangerous Function" ]
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import os import sys import time import traceback import torch from torch.utils.data import DataLoader from trainer.io import copy_model_files, save_best_model, save_checkpoint from trainer.torch import NoamLR from trainer.trainer_utils import get_optimizer from TTS.enc...
588795.py
[ "CWE-676: Use of Potentially Dangerous Function" ]
import os from glob import glob from typing import Dict, List import librosa import numpy as np import torch import torchaudio from scipy.io.wavfile import read from TTS.utils.audio.torch_transforms import TorchSTFT def load_wav_to_torch(full_path): sampling_rate, data = read(full_path) if data.dtype == np....
779518.py
[ "CWE-502: Deserialization of Untrusted Data" ]
import re import importlib import inspect from enum import Enum from dataclasses import dataclass from typing import Optional, List, Tuple, Set, Dict _SPHINX_AUTOSUMMARY_HEADER = ".. autosummary::" _SPHINX_AUTOCLASS_HEADER = ".. autoclass::" # This is a special character used in autosummary to render only the api sh...
210196.py
[ "CWE-706: Use of Incorrectly-Resolved Name or Reference" ]
import os.path import subprocess import platform from PyQt5 import QtGui from PyQt5.QtCore import QSize, pyqtSignal, Qt, QThread from PyQt5.QtGui import QPainter, QFont, QColor, QPixmap, QPolygon, QFontMetrics from PyQt5.QtWidgets import QWidget, QLabel, QHBoxLayout, QSizePolicy, QVBoxLayout, QSpacerItem, \ QScrol...
494330.py
[ "CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')" ]
# -*- coding: utf-8 -*- """ emoji.py !!!声明: 由于表情包并不属于个人,并且其可能具有版权风险,你只有浏览权没有拥有权 另外访问腾讯API可能会给腾讯服务器造成压力 所以禁止任何人以任何方式修改或间接修改该文件,违者后果自负 """ import os import re import traceback import xml.etree.ElementTree as ET import sqlite3 import threading from PyQt5.QtGui import QPixmap import requests from app.log import log, log...
095146.py
[ "CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')" ]
#!/usr/bin/env python """ Copyright (c) 2006-2024 sqlmap developers (https://sqlmap.org/) See the file 'LICENSE' for copying permission """ import glob import os import re import shutil import subprocess import time import zipfile from lib.core.common import dataToStdout from lib.core.common import extractRegexResul...
782536.py
[ "CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')" ]