max_stars_repo_path stringlengths 6 149 | max_stars_repo_name stringclasses 629
values | max_stars_count int64 2.02k 191k | id stringlengths 3 8 | content stringlengths 15 158k | violations stringclasses 51
values | bugs stringclasses 11
values | duplicated_lines_density stringclasses 46
values | cognitive_complexity stringclasses 117
values | vulnerabilities stringclasses 3
values | code_smells stringclasses 50
values | sqale_rating stringclasses 4
values | security_hotspots stringclasses 17
values | complexity stringclasses 112
values | issues listlengths 0 100 | __index_level_0__ int64 2 13.3k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
src/python/grpcio_tests/tests/unit/_cython/_server_test.py | warlock135/grpc | 36,552 | 8047522 | # Copyright 2017 gRPC authors.
#
# 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 in writing... | 5 | 0 | 0.0 | 1 | 0 | 5 | 1.0 | 0 | 2 | [
{
"impacts": [
{
"severity": "LOW",
"softwareQuality": "MAINTAINABILITY"
}
],
"line": 31,
"message": "Remove the unused local variable \"port\".",
"textRange": {
"endLine": 31,
"endOffset": 12,
"startLine": 31,
"startOffset": 8
},
"type... | 4,926 |
desktop/core/ext-py/nose-1.3.7/examples/plugin/plug.py | kokosing/hue | 5,079 | 3381786 | <filename>desktop/core/ext-py/nose-1.3.7/examples/plugin/plug.py
from nose.plugins import Plugin
class ExamplePlugin(Plugin):
pass
| null | null | null | null | null | null | null | null | null | [] | 2,918 |
tests/db_functions/math/test_log.py | Lord-Elrond/django | 61,676 | 140063 | <reponame>Lord-Elrond/django
import math
from decimal import Decimal
from django.db.models.functions import Log
from django.test import TestCase
from ..models import DecimalModel, FloatModel, IntegerModel
class LogTests(TestCase):
def test_null(self):
IntegerModel.objects.create(big=100)
obj = ... | 0 | 0 | 0.0 | 0 | 0 | 0 | 1.0 | 0 | 4 | [] | 863 |
sklearn/gaussian_process/tests/_mini_sequence_kernel.py | MaiRajborirug/scikit-learn | 50,961 | 91634 | from sklearn.gaussian_process.kernels import Kernel, Hyperparameter
from sklearn.gaussian_process.kernels import GenericKernelMixin
from sklearn.gaussian_process.kernels import StationaryKernelMixin
import numpy as np
from sklearn.base import clone
class MiniSeqKernel(GenericKernelMixin, StationaryKernelMixin, Kernel... | 3 | 0 | 0.0 | 5 | 0 | 3 | 1.0 | 0 | 11 | [
{
"impacts": [
{
"severity": "LOW",
"softwareQuality": "MAINTAINABILITY"
}
],
"line": 32,
"message": "Rename this parameter \"X\" to match the regular expression ^[_a-z][a-z0-9_]*$.",
"textRange": {
"endLine": 32,
"endOffset": 24,
"startLine": 32,
... | 585 |
python/tvm/relay/op/vm/vm.py | XiaoSong9905/tvm | 4,640 | 11348370 | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 0 | 0 | 0.0 | 0 | 0 | 0 | 1.0 | 0 | 4 | [] | 7,172 |
tests/sanic/conftest.py | TheVinhLuong102/Strawberry | 2,062 | 11458546 | <gh_stars>1000+
import pytest
from .app import create_app
@pytest.fixture
def sanic_client():
yield create_app()
| null | null | null | null | null | null | null | null | null | [] | 9,616 |
libs/boxes/roi.py | wesen/FastMaskRCNN | 3,509 | 11339840 | <gh_stars>1000+
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import functools
import numpy as np
import tensorflow as tf
import tensorflow.contrib.slim as slim
def roi_align(feat, boxes):
"""Given features and boxes, This function crops feature """
r... | 8 | 0 | 0.0 | 0 | 0 | 8 | 2.0 | 0 | 2 | [
{
"impacts": [
{
"severity": "MEDIUM",
"softwareQuality": "MAINTAINABILITY"
}
],
"line": 10,
"message": "Remove the unused function parameter \"feat\".",
"textRange": {
"endLine": 10,
"endOffset": 18,
"startLine": 10,
"startOffset": 14
},
... | 7,121 |
desktop/core/ext-py/repoze.who-2.3/repoze/who/plugins/auth_tkt.py | kokosing/hue | 5,079 | 1667072 | import datetime
from codecs import utf_8_decode
from codecs import utf_8_encode
import hashlib
import os
import time
from wsgiref.handlers import _monthname # Locale-independent, RFC-2616
from wsgiref.handlers import _weekdayname # Locale-independent, RFC-2616
try:
from urllib.parse import urlencode, parse_qs... | 3 | 0 | 0.0 | 48 | 0 | 3 | 1.0 | 0 | 44 | [
{
"impacts": [
{
"severity": "MEDIUM",
"softwareQuality": "MAINTAINABILITY"
}
],
"line": 106,
"message": "Remove the unused function parameter \"identity\".",
"textRange": {
"endLine": 106,
"endOffset": 38,
"startLine": 106,
"startOffset": 30
... | 1,454 |
bokeh/server/django/__init__.py | g-parki/bokeh | 15,193 | 6771486 | <filename>bokeh/server/django/__init__.py
# Bokeh imports
from bokeh.util.dependencies import import_required
# Bokeh imports
from .apps import DjangoBokehConfig
from .routing import autoload, directory, document
from .static import static_extensions
import_required("django", "django is required by bokeh.server.djang... | 0 | 0 | 0.0 | 0 | 0 | 0 | 1.0 | 0 | 0 | [] | 9,179 |
packages/python/plotly/plotly/tests/test_optional/test_px/test_colors.py | mastermind88/plotly.py | 11,750 | 4327666 | <gh_stars>1000+
import plotly.express as px
def test_reversed_colorscale():
fig1 = px.scatter(
x=[1, 2], y=[2, 3], color=[3, 4], color_continuous_scale="plasma_r"
)
fig2 = px.scatter(x=[1, 2], y=[2, 3], color=[3, 4], color_continuous_scale="plasma")
colors1 = [val[1] for val in fig1.layout.col... | 0 | 0 | 0.0 | 0 | 0 | 0 | 1.0 | 0 | 1 | [] | 13,235 |
apps/opencv_stitching_tool/opencv_stitching/image_handler.py | nowireless/opencv | 56,632 | 11523688 | <reponame>nowireless/opencv
import cv2 as cv
from .megapix_downscaler import MegapixDownscaler
from .stitching_error import StitchingError
class ImageHandler:
DEFAULT_MEDIUM_MEGAPIX = 0.6
DEFAULT_LOW_MEGAPIX = 0.1
DEFAULT_FINAL_MEGAPIX = -1
def __init__(self,
medium_megapix=DEFAULT_... | 0 | 0 | 0.0 | 8 | 0 | 0 | 1.0 | 0 | 23 | [] | 9,912 |
poem/cv_mim/pipelines.py | DionysisChristopoulos/google-research | 23,901 | 11274825 | # coding=utf-8
# Copyright 2021 The Google Research Authors.
#
# 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 applicab... | 1 | 0 | 0.0 | 7 | 0 | 1 | 1.0 | 0 | 8 | [
{
"impacts": [
{
"severity": "MEDIUM",
"softwareQuality": "MAINTAINABILITY"
}
],
"line": 29,
"message": "Function \"create_dataset_from_tables\" has 18 parameters, which is greater than the 13 authorized.",
"textRange": {
"endLine": 46,
"endOffset": 13,
... | 6,733 |
torch_geometric/nn/acts.py | NucciTheBoss/pytorch_geometric | 12,651 | 178744 | <reponame>NucciTheBoss/pytorch_geometric<gh_stars>1000+
def swish(x):
return x * x.sigmoid()
| 0 | 0 | 0.0 | 0 | 0 | 0 | 1.0 | 0 | 1 | [] | 1,099 |
recipes/Python/578535_lndirpy_short_pythversiBSDX11_lndir/recipe-578535.py | tdiprima/code | 2,023 | 4071122 | #!/usr/bin/env python
################################################################################
# #
# Copyright (c) 2013, Mike 'Fuzzy' Partin <<EMAIL>> #
# All rights reserved. ... | 1 | 0 | 0.0 | 39 | 0 | 1 | 1.0 | 0 | 10 | [
{
"impacts": [
{
"severity": "LOW",
"softwareQuality": "MAINTAINABILITY"
}
],
"line": 74,
"message": "Use `endswith` here.",
"textRange": {
"endLine": 74,
"endOffset": 26,
"startLine": 74,
"startOffset": 11
},
"type": "CODE_SMELL"
}
] | 12,834 |
tests/components/image_processing/test_init.py | MrDelik/core | 30,023 | 6472508 | <reponame>MrDelik/core<gh_stars>1000+
"""The tests for the image_processing component."""
from unittest.mock import PropertyMock, patch
import pytest
import homeassistant.components.http as http
import homeassistant.components.image_processing as ip
from homeassistant.const import ATTR_ENTITY_PICTURE
from homeassista... | 8 | 5 | 0.0 | 0 | 0 | 3 | 1.0 | 0 | 19 | [
{
"impacts": [
{
"severity": "HIGH",
"softwareQuality": "MAINTAINABILITY"
}
],
"line": 90,
"message": "Define a constant instead of duplicating this literal \"image_processing.test\" 4 times.",
"textRange": {
"endLine": 90,
"endOffset": 61,
"startLin... | 4,150 |
pipenv/patched/piptools/repositories/__init__.py | Enzime/pipenv | 18,636 | 9671823 | <gh_stars>1000+
# flake8: noqa
from .local import LocalRequirementsRepository
from .pypi import PyPIRepository
| 0 | 0 | 0.0 | 0 | 0 | 0 | 1.0 | 0 | 0 | [] | 5,906 |
torch/autograd/profiler.py | xiaohanhuang/pytorch | 60,067 | 11457937 | <gh_stars>1000+
from torch.autograd.profiler_util import (
EventList, FunctionEvent, MemRecordsAcc, MEMORY_EVENT_NAME,
_filter_name, _filter_stack_entry, _rewrite_name
)
from torch.autograd import (
DeviceType, ProfilerActivity, ProfilerConfig, ProfilerState,
kineto_available, _ProfilerResult, _disable... | null | null | null | null | null | null | null | null | null | [] | 9,615 |
tests/validation/tests/v1_api/test_deployment.py | ursinnDev/rancher_rancher | 18,697 | 9768808 | from .common import * # NOQA
import pytest
namespace = {"client": None, "ns": None}
def test_namespace_create():
template = read_yaml_from_resource_dir("namespace.yaml")
template["metadata"]["name"] = random_test_name()
client = namespace["client"]
res = client.create_namespace(template)
# valid... | null | null | null | null | null | null | null | null | null | [] | 6,232 |
tests/components/motion_blinds/__init__.py | tbarbette/core | 30,023 | 8241861 | <reponame>tbarbette/core
"""Tests for the Motion Blinds integration."""
| 0 | 0 | 0.0 | 0 | 0 | 0 | 1.0 | 0 | 0 | [] | 9,202 |
posthog/settings/cloud.py | dorucioclea/posthog | 7,409 | 9633711 | # Overridden in posthog-cloud
import sys
from posthog.settings.utils import get_from_env, print_warning, str_to_bool
# Early exit to avoid issues with cloud not being properly included
if get_from_env("MULTI_TENANCY", False, type_cast=str_to_bool):
print_warning(("️Environment variable MULTI_TENANCY is set, but ... | null | null | null | null | null | null | null | null | null | [] | 5,668 |
xirl/xirl/evaluators/reward_visualizer.py | xxdreck/google-research | 23,901 | 10173439 | # coding=utf-8
# Copyright 2021 The Google Research Authors.
#
# 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 applicab... | null | null | null | null | null | null | null | null | null | [] | 11,923 |
python/paddle/fluid/tests/unittests/test_conv2d_transpose_op_depthwise_conv.py | zmxdream/Paddle | 17,085 | 10185976 | # Copyright (c) 2018 PaddlePaddle Authors. 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 app... | null | null | null | null | null | null | null | null | null | [] | 12,003 |
homeassistant/components/unifiprotect/light.py | liangleslie/core | 30,023 | 515251 | <gh_stars>1000+
"""This component provides Lights for UniFi Protect."""
from __future__ import annotations
import logging
from typing import Any
from pyunifiprotect.data import Light
from homeassistant.components.light import ATTR_BRIGHTNESS, ColorMode, LightEntity
from homeassistant.config_entries import ConfigEntr... | 0 | 0 | 0.0 | 1 | 0 | 0 | 1.0 | 0 | 7 | [] | 10,391 |
tests_django/test_settings.py | gugux289/chatterbot | 13,200 | 10102852 | <gh_stars>1000+
"""
Django settings for when tests are run.
"""
import os
from chatterbot import constants
DEBUG = True
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
SECRET_KEY = 'fake-key'
INSTALLED_APPS = [
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.... | null | null | null | null | null | null | null | null | null | [] | 11,633 |
configs/paa/paa_r50_fpn_1.5x_coco.py | evgps/mmdetection_trashcan | 20,190 | 11287256 | <gh_stars>1000+
_base_ = './paa_r50_fpn_1x_coco.py'
lr_config = dict(step=[12, 16])
runner = dict(type='EpochBasedRunner', max_epochs=18)
| null | null | null | null | null | null | null | null | null | [] | 6,811 |
homeassistant/components/fastdotcom/sensor.py | MrDelik/core | 30,023 | 405011 | <reponame>MrDelik/core
"""Support for Fast.com internet speed testing sensor."""
from __future__ import annotations
from typing import Any
from homeassistant.components.sensor import SensorEntity
from homeassistant.const import DATA_RATE_MEGABITS_PER_SECOND
from homeassistant.core import HomeAssistant, callback
from ... | null | null | null | null | null | null | null | null | null | [] | 10,193 |
tests/nlu/featurizers/test_regex_featurizer.py | Next-Trends/rasa | 3,603 | 6565391 | <gh_stars>1000+
from typing import Text, List, Any, Tuple, Callable, Dict, Optional
import dataclasses
import numpy as np
import pytest
from rasa.engine.graph import ExecutionContext
from rasa.engine.storage.resource import Resource
from rasa.engine.storage.storage import ModelStorage
from rasa.nlu.featurizers.sparse... | null | null | null | null | null | null | null | null | null | [] | 4,471 |
tests/components/eafm/__init__.py | tbarbette/core | 30,023 | 3327514 | """Tests for eafm."""
| 0 | 0 | 0.0 | 0 | 0 | 0 | 1.0 | 0 | 0 | [] | 2,608 |
OpenCorePkg/Debug/Scripts/gdb_uefi.py | CEOALT1/RefindPlusUDK | 10,125 | 11351705 | <gh_stars>1000+
"""
Allows loading TianoCore symbols into a GDB session attached to EFI
Firmware.
This is how it works: build GdbSyms - it's a dummy binary that
contains the relevant symbols needed to find and load image symbols.
$ gdb /path/to/GdbSyms.dll
(gdb) target remote ....
(gdb) source Scripts/gdb_uefi.py
(gd... | 12 | 0 | 0.0 | 81 | 0 | 12 | 1.0 | 0 | 80 | [
{
"impacts": [
{
"severity": "HIGH",
"softwareQuality": "MAINTAINABILITY"
}
],
"line": 35,
"message": "Import only needed names or import the module and then use its members.",
"textRange": {
"endLine": 35,
"endOffset": 25,
"startLine": 35,
"st... | 7,187 |
code/2.7/7_decorators_args.py | suqi/suqi-interpy-zh | 6,594 | 10218124 | from functools import wraps
def logit(logfile='out.log'):
def logging_decorator(func):
@wraps(func)
def wrapped_function(*args, **kwargs):
log_string = func.__name__ + ' was called'
print log_string
with open(logfile, 'a') as opened_file:
opened_file.write(log_string + '\n')
return func(*args, *... | null | null | null | null | null | null | null | null | null | [] | 12,178 |
tests/integration/test_disabled_access_control_improvements/test_row_policy.py | mrk-andreev/ClickHouse | 8,629 | 9674883 | import os
import pytest
from helpers.cluster import ClickHouseCluster
from helpers.test_tools import TSV
cluster = ClickHouseCluster(__file__)
node = cluster.add_instance(
"node",
main_configs=["configs/config.d/disable_access_control_improvements.xml"],
user_configs=[
"configs/users.d/row_policy.x... | 23 | 0 | 0.0 | 0 | 0 | 23 | 1.0 | 0 | 8 | [
{
"impacts": [
{
"severity": "HIGH",
"softwareQuality": "MAINTAINABILITY"
}
],
"line": 74,
"message": "Define a constant instead of duplicating this literal \"another ON mydb.filtered_table1\" 5 times.",
"textRange": {
"endLine": 74,
"endOffset": 45,
... | 5,922 |
recipes/Python/576505_Sudoku_solvercreator/recipe-576505.py | tdiprima/code | 2,023 | 515289 | <reponame>tdiprima/code<gh_stars>1000+
#!/usr/bin/python
# TODO: Make solve function faster!!! Have it check for singles, doubles,
# triples, and quads both naked and hidden
from random import random
def rand(lst):
"returns a random element in list or integer"
if type(lst)==type([]):
return lst[int(random()*len(... | 19 | 0 | 0.0 | 71 | 0 | 19 | 1.0 | 2 | 55 | [
{
"impacts": [
{
"severity": "LOW",
"softwareQuality": "MAINTAINABILITY"
}
],
"line": 3,
"message": "Complete the task associated to this \"TODO\" comment.",
"textRange": {
"endLine": 3,
"endOffset": 73,
"startLine": 3,
"startOffset": 0
},
... | 10,392 |
algorithms/tree/traversal/__init__.py | Heart-throb-Rajnish/algorithms | 22,426 | 3220141 | <reponame>Heart-throb-Rajnish/algorithms<filename>algorithms/tree/traversal/__init__.py<gh_stars>1000+
from .preorder import *
from .postorder import *
from .inorder import *
| null | null | null | null | null | null | null | null | null | [] | 2,144 |
End of preview. Expand in Data Studio
No dataset card yet
- Downloads last month
- 2