source
string
points
list
n_points
int64
path
string
repo
string
# (C) Datadog, Inc. 2020-present # All rights reserved # Licensed under a 3-clause BSD style license (see LICENSE) import json import re from ....trello import TrelloClient from ...console import abort, echo_info class RCBuildCardsUpdater: version_regex = r'(\d*)\.(\d*)\.(\d*)([-~])rc([\.-])(\d*)' def __in...
[ { "point_num": 1, "id": "more_functions_than_classes", "question": "Does this file define more functions than classes?", "answer": true }, { "point_num": 2, "id": "has_multiple_inheritance", "question": "Does any class in this file use multiple inheritance?", "answer": false },...
3
datadog_checks_dev/datadog_checks/dev/tooling/commands/release/trello/rc_build_cards_updater.py
vbarbaresi/integrations-core
import random, time def sum_with_for_loop(arr: "list"): total = 0 for i, v in enumerate(arr): total += arr[i] time.sleep(random.randint(0.0, 1.0)) return total def main(): numbers = [4, 10, 3] print(sum_with_for_loop(numbers)) return if __name__ == "__main__": main()
[ { "point_num": 1, "id": "has_nested_function_def", "question": "Does this file contain any function defined inside another function?", "answer": false }, { "point_num": 2, "id": "every_function_under_20_lines", "question": "Is every function in this file shorter than 20 lines?", ...
3
15_9cs_functions.py
oof2win2/cs_igcse
#!/usr/bin/env python """Extract final configurations for restarting serial runs.""" import argparse import pdb import sys from origamipy import files def main(): args = parse_args() for temp in args.temps: traj_inp_filename = '{}-{}.trj'.format(args.inp_filebase, temp) traj_file = files.Un...
[ { "point_num": 1, "id": "every_function_under_20_lines", "question": "Is every function in this file shorter than 20 lines?", "answer": true }, { "point_num": 2, "id": "every_function_has_docstring", "question": "Does every function in this file have a docstring?", "answer": fals...
3
scripts/simutils/extract_serial_restart_configs.py
acumb/LatticeDNAOrigami
# coding: utf-8 """ Copyright 2016 SmartBear Software 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 l...
[ { "point_num": 1, "id": "every_function_under_20_lines", "question": "Is every function in this file shorter than 20 lines?", "answer": true }, { "point_num": 2, "id": "more_functions_than_classes", "question": "Does this file define more functions than classes?", "answer": true ...
3
test/test_reports_threats_extended.py
Atomicology/isilon_sdk_python
import datetime from collections import defaultdict import matplotlib matplotlib.use('Qt5Agg') import matplotlib.pyplot as plt import matplotlib.dates as md from .i18n import _ from .bitcoin import COIN class NothingToPlotException(Exception): def __str__(self): return _("Nothing to plot.") def plot_h...
[ { "point_num": 1, "id": "more_functions_than_classes", "question": "Does this file define more functions than classes?", "answer": true }, { "point_num": 2, "id": "every_function_under_20_lines", "question": "Is every function in this file shorter than 20 lines?", "answer": false...
3
electrum_bynd/plot.py
beyondcoin-project/electrum-bynd
import time def find_closest(look_for, target_data): def whats_the_difference(first, second): if first == second: return(0) elif first > second: return(first - second) else: return(second - first) max_diff = 9999999 for each_thing in target_dat...
[ { "point_num": 1, "id": "no_function_exceeds_5_params", "question": "Does every function in this file take 5 or fewer parameters (excluding self/cls)?", "answer": true }, { "point_num": 2, "id": "all_function_names_snake_case", "question": "Are all function names in this file written...
3
hfpy_code/chapter11/find_it.py
leobarros/use_cabeca_python
# -*- encoding: utf-8 -*- from .. import db from .mobile_wallet import MobileWallet class UPI(db.Model): __tablename__ = "UPI" ID = db.Column(db.String(45), primary_key = True, nullable = False) ApplictionName = db.Column(db.String(45), nullable = False) WalletIdentifier = db.Column(db.String(45)...
[ { "point_num": 1, "id": "more_functions_than_classes", "question": "Does this file define more functions than classes?", "answer": true }, { "point_num": 2, "id": "every_function_has_docstring", "question": "Does every function in this file have a docstring?", "answer": false }...
3
app/main/models/UPI.py
pOrgz-dev/financial-api
from ctypes import windll from ... import output from accessible_output import paths from main import OutputError, ScreenreaderSpeechOutput class Dolphin (ScreenreaderSpeechOutput): """Supports dolphin products.""" name = 'Dolphin' def __init__(self, *args, **kwargs): super(Dolphin, self).__init__(*args, **kwa...
[ { "point_num": 1, "id": "every_function_under_20_lines", "question": "Is every function in this file shorter than 20 lines?", "answer": true }, { "point_num": 2, "id": "has_multiple_inheritance", "question": "Does any class in this file use multiple inheritance?", "answer": false...
3
accessible_output/speech/outputs/dolphin.py
Timtam/cards-against-humanity
import urllib.request from invoke import task import json import os import logging logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(name)s - %(levelname)s - %(message)s') logger = logging.getLogger(__name__) def download_releases(base_dir, repo, target_dir): if not base_dir: ...
[ { "point_num": 1, "id": "every_function_has_docstring", "question": "Does every function in this file have a docstring?", "answer": false }, { "point_num": 2, "id": "every_function_under_20_lines", "question": "Is every function in this file shorter than 20 lines?", "answer": fal...
3
src/tasks.py
newbe36524rclone/Newbe.ReleaseMirror
"""HelloWorld Middleware.""" from masonite.request import Request class HelloWorldMiddleware: """HelloWorld Middleware.""" def __init__(self, request: Request): """Inject Any Dependencies From The Service Container. Arguments: Request {masonite.request.Request} -- The Masonite r...
[ { "point_num": 1, "id": "every_function_under_20_lines", "question": "Is every function in this file shorter than 20 lines?", "answer": true }, { "point_num": 2, "id": "has_multiple_inheritance", "question": "Does any class in this file use multiple inheritance?", "answer": false...
3
app/http/middleware/HelloWorldMiddleware.py
llaski/masonite-tutorial
#!/usr/bin/env python3 import asyncio, asyncssh #Can be used for asynchronous remote shut down any number of linux machines in a network with same login credentials. async def run_client(host, command): # async with asyncssh.connect(host, username='username', password='password') as conn: async with asyncssh.co...
[ { "point_num": 1, "id": "every_function_under_20_lines", "question": "Is every function in this file shorter than 20 lines?", "answer": true }, { "point_num": 2, "id": "every_function_has_docstring", "question": "Does every function in this file have a docstring?", "answer": fals...
3
Misc/async_shutdown.py
sparkstark03/Awesome-Scripts
# 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, software # d...
[ { "point_num": 1, "id": "has_nested_function_def", "question": "Does this file contain any function defined inside another function?", "answer": false }, { "point_num": 2, "id": "every_function_under_20_lines", "question": "Is every function in this file shorter than 20 lines?", ...
3
nova/tests/unit/objects/test_numa.py
gabriel-samfira/nova
class SinglyLinkedListNode: def __init__(self, node_data): self.data = node_data self.next = None class SinglyLinkedList: def __init__(self): self.head = None self.tail = None def insert_node(self, node_data): node = SinglyLinkedListNode(node_data) if not s...
[ { "point_num": 1, "id": "no_function_exceeds_5_params", "question": "Does every function in this file take 5 or fewer parameters (excluding self/cls)?", "answer": true }, { "point_num": 2, "id": "every_function_under_20_lines", "question": "Is every function in this file shorter than...
3
Python/linkedlisthr.py
sockduct/Hackerrank
"""generate_user_tables Revision ID: 47e4599484a1 Revises: 89edb69f4be3 Create Date: 2018-05-10 21:33:01.943092 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = '47e4599484a1' down_revision = '89edb69f4be3' branch_labels = None depends_on = None def upgrade():...
[ { "point_num": 1, "id": "every_function_has_docstring", "question": "Does every function in this file have a docstring?", "answer": false }, { "point_num": 2, "id": "every_function_under_20_lines", "question": "Is every function in this file shorter than 20 lines?", "answer": tru...
3
migrations/versions/47e4599484a1_generate_user_tables.py
joostsijm/supremapy
import functools from teamiclink.slack.model import GoalContent from typing import Any, Dict from slack_bolt import Ack from slack_bolt.context import BoltContext from pydantic import ValidationError CREATE_GOAL_CALLBACK_ID = "create_goal_view_id" CREATE_GOAL_INPUT = "create_goal_action" CREATE_GOAL_INPUT_BLOCK = "cr...
[ { "point_num": 1, "id": "every_function_under_20_lines", "question": "Is every function in this file shorter than 20 lines?", "answer": false }, { "point_num": 2, "id": "all_params_annotated", "question": "Does every function parameter in this file have a type annotation (excluding s...
3
teamiclink/slack/view_goal_create.py
e1004/teamiclink
# !/usr/bin/env python # -*- coding: utf-8 -*- # # Filename: models.py # Project: tests # Author: Brian Cherinka # Created: Friday, 15th February 2019 2:44:13 pm # License: BSD 3-clause "New" or "Revised" License # Copyright (c) 2019 Brian Cherinka # Last Modified: Sunday, 3rd March 2019 4:47:18 pm # Modified By: Brian...
[ { "point_num": 1, "id": "has_nested_function_def", "question": "Does this file contain any function defined inside another function?", "answer": false }, { "point_num": 2, "id": "every_function_has_docstring", "question": "Does every function in this file have a docstring?", "ans...
3
tests/models.py
charkins/boolean_parser
from django.db import models from django.utils.timezone import now # Create your models here. class Gallery(models.Model): title = models.CharField(default='项目标题', max_length=100) description = models.CharField(default='项目简介', max_length=300) image = models.ImageField(default='default.png', upload_to='im...
[ { "point_num": 1, "id": "has_multiple_inheritance", "question": "Does any class in this file use multiple inheritance?", "answer": false }, { "point_num": 2, "id": "more_functions_than_classes", "question": "Does this file define more functions than classes?", "answer": false }...
3
ran-django-template/apps/gallery/models.py
nature1995/Face-Recognition-System
''' Descripttion: Automatically generated file comment version: Author: Wesley Date: 2021-07-27 09:53:43 LastEditors: Wesley LastEditTime: 2021-08-13 15:35:25 ''' from ctypes import cdll, c_char_p from .PlatformHelper import PlatformHelper as ph from wtpy.WtUtilDefs import singleton import os @singleton ...
[ { "point_num": 1, "id": "every_function_under_20_lines", "question": "Is every function in this file shorter than 20 lines?", "answer": true }, { "point_num": 2, "id": "all_params_annotated", "question": "Does every function parameter in this file have a type annotation (excluding se...
3
wtpy/wrapper/WtExecApi.py
systemtrader/wtpy
from network.loss import YoloLoss from unittest import TestCase import numpy as np import torch from network.dataset import VOCDataset import matplotlib.pyplot as plt import matplotlib.patches as patches import os torch.manual_seed(13) DATA_DIR = "data/pascal_voc_yolo/" IMG_DIR = DATA_DIR+"images/" LABEL_DIR = DATA...
[ { "point_num": 1, "id": "every_function_has_docstring", "question": "Does every function in this file have a docstring?", "answer": false }, { "point_num": 2, "id": "has_multiple_inheritance", "question": "Does any class in this file use multiple inheritance?", "answer": false ...
3
2D_ObjectDetectors/yolov1/network/test/test_loss.py
loaywael/ObjectDetection
import os import tempfile from bs4 import BeautifulSoup from PIL import Image from reportlab.pdfgen import canvas from manganelo import utils, siterequests def download_chapter(url, path): path = utils.validate_path(path) r = siterequests.get(url) soup = BeautifulSoup(r.content, "html.parser") urls = _get_...
[ { "point_num": 1, "id": "all_params_annotated", "question": "Does every function parameter in this file have a type annotation (excluding self/cls)?", "answer": false }, { "point_num": 2, "id": "has_nested_function_def", "question": "Does this file contain any function defined inside...
3
manganelo/chapterdownload.py
nixonjoshua98/manganelo
from TikTokApi import TikTokApi import os api = TikTokApi.get_instance(custom_verifyFp=os.environ.get("verifyFp", None)) def test_tiktok_object(): assert len(api.getTikTokById("6829267836783971589")) > 0 assert ( len( api.getTikTokByUrl( "https://www.tiktok.com/@therock/vi...
[ { "point_num": 1, "id": "every_function_has_docstring", "question": "Does every function in this file have a docstring?", "answer": false }, { "point_num": 2, "id": "all_function_names_snake_case", "question": "Are all function names in this file written in snake_case?", "answer"...
3
tests/test_getObjectRoutes.py
benjaminguinaudeau/TikTok-Api
""" Traditional pipeline in computer graphics renders images from the viewpoint of a virtual pin-hole camera by using the very frequent perspective projection. View direction is initially set along the negative z-axis in camera coordinate system. So, 3D content which we define needs a transformation from ordinary 3D c...
[ { "point_num": 1, "id": "every_function_has_docstring", "question": "Does every function in this file have a docstring?", "answer": false }, { "point_num": 2, "id": "all_params_annotated", "question": "Does every function parameter in this file have a type annotation (excluding self/...
3
code/camera/coordinate_system_transformation.py
ricklentz/2dimageto3dmodel
# -*- coding: utf-8 -*- """ Python FAT filesystem module with :doc:`PyFilesystem2 <pyfilesystem2:index>` \ compatibility. pyfatfs allows interaction with FAT12/16/32 filesystems, either via :doc:`PyFilesystem2 <pyfilesystem2:index>` for file-level abstraction or direct interaction with the filesystem for low-level ac...
[ { "point_num": 1, "id": "every_function_has_docstring", "question": "Does every function in this file have a docstring?", "answer": false }, { "point_num": 2, "id": "has_nested_function_def", "question": "Does this file contain any function defined inside another function?", "ans...
3
pyfatfs/__init__.py
abrasive/pyfatfs
# -*- coding: utf-8 -*- import os from flask.ext.script import Manager from polichart import create_app, polling from polichart.extensions import db from polichart.utils import MALE from flask import url_for app = create_app() manager = Manager(app) @app.context_processor def override_url_for(): return dict(u...
[ { "point_num": 1, "id": "has_nested_function_def", "question": "Does this file contain any function defined inside another function?", "answer": false }, { "point_num": 2, "id": "every_function_under_20_lines", "question": "Is every function in this file shorter than 20 lines?", ...
3
manage.py
cjmabry/PoliChart
from fabric.operations import local def debug(): local("sudo chmod +x ./tribblemaker.py") local("echo -n '{0}' | {1} tribblemaker.py".format( open("test_input.txt", "r").read(), open("interpreter.txt", "r").read())) def test(): local("sudo chmod +x ./tribblemaker.py") local("sudo bash test_cha...
[ { "point_num": 1, "id": "every_function_has_docstring", "question": "Does every function in this file have a docstring?", "answer": false }, { "point_num": 2, "id": "all_function_names_snake_case", "question": "Are all function names in this file written in snake_case?", "answer"...
3
tuenti/tuenti_challenge_4/qualification/5_tribblemaker/fabfile.py
GMadorell/programming-challenges
from mqfactory import Message from mqfactory.message.security import Signing, Signature from mqfactory.tools import Policy, Rule def test_signing_setup(mq, transport, signature): Signing( mq, adding=signature ) mq.before_sending.append.assert_called_with(signature.sign) mq.before_han...
[ { "point_num": 1, "id": "no_function_exceeds_5_params", "question": "Does every function in this file take 5 or fewer parameters (excluding self/cls)?", "answer": true }, { "point_num": 2, "id": "more_functions_than_classes", "question": "Does this file define more functions than cla...
3
tests/test_Signing.py
christophevg/py-mqfactory
class Counter(object): def __init__(self): self.cnt = 0 def count(self): self.cnt += 1 def doublecount(self): self.cnt += 2 def reset(self): self.cnt = 0 def show(self): print(self.cnt) def __repr__(self): return str(cnt.sel...
[ { "point_num": 1, "id": "has_nested_function_def", "question": "Does this file contain any function defined inside another function?", "answer": false }, { "point_num": 2, "id": "has_multiple_inheritance", "question": "Does any class in this file use multiple inheritance?", "answ...
3
counter.py
mo981222/chibi
#!/usr/bin/env python3 """ 4-bayes_opt.py """ import numpy as np from scipy.stats import norm GP = __import__('2-gp').GaussianProcess class BayesianOptimization: """ Class that instantiates a Bayesian optimization on a noiseless 1D Gaussian process """ def __init__(self, f, X_init, Y_init, bounds...
[ { "point_num": 1, "id": "no_function_exceeds_5_params", "question": "Does every function in this file take 5 or fewer parameters (excluding self/cls)?", "answer": false }, { "point_num": 2, "id": "all_params_annotated", "question": "Does every function parameter in this file have a t...
3
unsupervised_learning/0x03-hyperparameter_tuning/4-bayes_opt.py
cbarros7/holbertonschool-machine_learning
def invert_binary_tree(node): if node: node.left, node.right = invert_binary_tree(node.right), invert_binary_tree(node.left) return node class BinaryTreeNode(object): def __init__(self, value, left=None, right=None): self.value = value self.left = None self.right = None...
[ { "point_num": 1, "id": "all_return_types_annotated", "question": "Does every function in this file have a return type annotation?", "answer": false }, { "point_num": 2, "id": "more_functions_than_classes", "question": "Does this file define more functions than classes?", "answer...
3
practice_problems/trees_graphs/invert_binary_tree.py
YazzyYaz/codinginterviews
"""empty message Revision ID: 6aa1a423eb00 Revises: Create Date: 2020-12-03 13:47:02.155535 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = '6aa1a423eb00' down_revision = None branch_labels = None depends_on = None def upgrade(): # ### commands auto gene...
[ { "point_num": 1, "id": "every_function_under_20_lines", "question": "Is every function in this file shorter than 20 lines?", "answer": true }, { "point_num": 2, "id": "every_function_has_docstring", "question": "Does every function in this file have a docstring?", "answer": fals...
3
7a/migrations/versions/6aa1a423eb00_.py
fredsonchaves07/flask-course
#!/usr/bin/env python3 # Copyright (c) 2015-2018 The Vendetta Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test a node with the -disablewallet option. - Test that validateaddress RPC works when running with -...
[ { "point_num": 1, "id": "every_function_under_20_lines", "question": "Is every function in this file shorter than 20 lines?", "answer": true }, { "point_num": 2, "id": "every_function_has_docstring", "question": "Does every function in this file have a docstring?", "answer": fals...
3
test/functional/wallet_disable.py
AndreyVen/7wuU0x
import pandas as pd import xlrd class xlsFetcher(object): """ xlsFetcher: fetches xls files """ def __init__(self): self.flag_final = True def parse_xls(self, url): """ parses data from url to dataframe PARAMETERS: ----------- url: String ...
[ { "point_num": 1, "id": "every_function_under_20_lines", "question": "Is every function in this file shorter than 20 lines?", "answer": true }, { "point_num": 2, "id": "more_functions_than_classes", "question": "Does this file define more functions than classes?", "answer": true ...
3
opencity/fetcher/xls_fetcher.py
birkealine/konstanz-open-data-api
import json import uuid class Job: def __init__(self, name): self.jobId = str(uuid.uuid4()) self.jobName = name self.appName = None self.globalParameters = {} self.enabled = True self.executeBatch = 0 self.crontab = '*/5 * * * * ?' self.tasks = [] ...
[ { "point_num": 1, "id": "every_function_under_20_lines", "question": "Is every function in this file shorter than 20 lines?", "answer": true }, { "point_num": 2, "id": "every_function_has_docstring", "question": "Does every function in this file have a docstring?", "answer": fals...
3
pdr_python_sdk/pdr_python_sdk/schedue/job.py
wyanlord/pandora-python-sdk.v2
import cadquery from cadquery import BoxSelector from math import pi, cos, sqrt from cqparts.params import * from .base import ScrewDrive, register class AcentricWedgesScrewDrive(ScrewDrive): count = IntRange(1, None, 4) width = PositiveFloat(0.5) acentric_radius = PositiveFloat(None) # defaults to wid...
[ { "point_num": 1, "id": "more_functions_than_classes", "question": "Does this file define more functions than classes?", "answer": false }, { "point_num": 2, "id": "every_class_has_docstring", "question": "Does every class in this file have a docstring?", "answer": false }, {...
3
src/cqparts_fasteners/solidtypes/screw_drives/tamper_resistant.py
luzpaz/cqparts
# ############################################################ # Importing - Same For All Render Layer Tests # ############################################################ import unittest import os import sys from view_layer_common import * # ############################################################ # Testing # ...
[ { "point_num": 1, "id": "more_functions_than_classes", "question": "Does this file define more functions than classes?", "answer": true }, { "point_num": 2, "id": "every_function_has_docstring", "question": "Does every function in this file have a docstring?", "answer": false }...
3
tests/python/view_layer/test_move_into_scene_collection_sync_h.py
rbabari/blender
from girder.exceptions import ValidationException from girder.utility import setting_utilities class PluginSettings: AUTO_COMPUTE = 'hashsum_download.auto_compute' @setting_utilities.default(PluginSettings.AUTO_COMPUTE) def _defaultAutoCompute(): return False @setting_utilities.validator(PluginSettings.AU...
[ { "point_num": 1, "id": "has_multiple_inheritance", "question": "Does any class in this file use multiple inheritance?", "answer": false }, { "point_num": 2, "id": "more_functions_than_classes", "question": "Does this file define more functions than classes?", "answer": true },...
3
plugins/hashsum_download/girder_hashsum_download/settings.py
JKitok/girder
import ast import sys from abc import ABC, abstractmethod from typing import List, Type if sys.version_info >= (3, 8): from typing import Protocol else: from typing_extensions import Protocol from tryceratops.processors import Processor from tryceratops.violations import Violation from .exceptions import Ana...
[ { "point_num": 1, "id": "has_multiple_inheritance", "question": "Does any class in this file use multiple inheritance?", "answer": true }, { "point_num": 2, "id": "all_function_names_snake_case", "question": "Are all function names in this file written in snake_case?", "answer": ...
3
src/tryceratops/analyzers/base.py
sbrugman/tryceratops
# 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...
[ { "point_num": 1, "id": "every_function_has_docstring", "question": "Does every function in this file have a docstring?", "answer": false }, { "point_num": 2, "id": "has_multiple_inheritance", "question": "Does any class in this file use multiple inheritance?", "answer": false ...
3
aliyun-python-sdk-live/aliyunsdklive/request/v20161101/ApplyRecordTokenRequest.py
yndu13/aliyun-openapi-python-sdk
# -*- coding: utf-8 -*- from model.group import Group def test_add_group(app, data_groups): group = data_groups #загружаем данные из файла C:\python_traning\python_traning\data\groups.py но через conftest old_groups = app.group.get_group_list() #[TEST] app.group.create(group) assert len(old_group...
[ { "point_num": 1, "id": "no_function_exceeds_5_params", "question": "Does every function in this file take 5 or fewer parameters (excluding self/cls)?", "answer": true }, { "point_num": 2, "id": "all_params_annotated", "question": "Does every function parameter in this file have a ty...
3
test/test_add_group.py
maximencia/python_traning
import discord import os import json import sqlite3 import aiohttp from discord.ext import commands COGS = [path.split(os.sep)[-1][:-3] for path in glob("./cogs/*.py")] def load_config(): """ This Is to load the configs for the bot so people can customize it """ with open("creds.json", "r") as cf: ...
[ { "point_num": 1, "id": "all_function_names_snake_case", "question": "Are all function names in this file written in snake_case?", "answer": true }, { "point_num": 2, "id": "every_function_has_docstring", "question": "Does every function in this file have a docstring?", "answer":...
3
bot.py
palmtrwwpy/Shark-Bot
# https://deeplearningcourses.com/c/data-science-supervised-machine-learning-in-python # https://www.udemy.com/data-science-supervised-machine-learning-in-python from __future__ import print_function, division from builtins import range, input # Note: you may need to update your version of future # sudo pip install -U ...
[ { "point_num": 1, "id": "every_function_under_20_lines", "question": "Is every function in this file shorter than 20 lines?", "answer": true }, { "point_num": 2, "id": "all_function_names_snake_case", "question": "Are all function names in this file written in snake_case?", "answ...
3
util.py
marcelkotze007/mk007---ML-Python-library
import warnings import pytest from matplotlib.testing.decorators import check_figures_equal @pytest.mark.xfail( strict=True, reason="testing that warnings fail tests" ) def test_warn_to_fail(): warnings.warn("This should fail the test") @pytest.mark.parametrize("a", [1]) @check_figures_equal(extensions=["pn...
[ { "point_num": 1, "id": "every_function_has_docstring", "question": "Does every function in this file have a docstring?", "answer": false }, { "point_num": 2, "id": "all_function_names_snake_case", "question": "Are all function names in this file written in snake_case?", "answer"...
3
Funções Analíticas/Virtualenv/Lib/site-packages/matplotlib/tests/test_testing.py
Leonardo-Maciel/PSO_Maciel
from __future__ import unicode_literals from dvc.exceptions import DvcException class DependencyDoesNotExistError(DvcException): def __init__(self, path): msg = "dependency '{}' does not exist".format(path) super(DependencyDoesNotExistError, self).__init__(msg) class DependencyIsNotFileOrDirErr...
[ { "point_num": 1, "id": "more_functions_than_classes", "question": "Does this file define more functions than classes?", "answer": false }, { "point_num": 2, "id": "all_function_names_snake_case", "question": "Are all function names in this file written in snake_case?", "answer":...
3
dvc/dependency/base.py
kss682/dvc
from . import * import asyncio import datetime from datetime import datetime from telethon import events from telethon.tl import functions, types from beastx import CMD_HELP, lang @beast.on(beastx_cmd(pattern="hello")) async def hello(bst): await bst.edit(''' ╔┓┏╦━╦┓╔┓╔━━╗ ║┗┛║┗╣┃║┃║X X║ ║┏┓║┏╣┗╣┗╣╰╯║ ╚┛┗╩━╩━╩━╩━━╝...
[ { "point_num": 1, "id": "all_params_annotated", "question": "Does every function parameter in this file have a type annotation (excluding self/cls)?", "answer": false }, { "point_num": 2, "id": "every_function_has_docstring", "question": "Does every function in this file have a docst...
3
beastx/modules/chit_chat.py
Digasi123percy/Beast-X
from collections import namedtuple from string import Formatter from django.utils.translation import ugettext as _ import re from corehq.apps.performance_sms.exceptions import InvalidParameterException GLOBAL_NAMESPACE = 'global' USER_NAMESPACE = 'user' GROUP_NAMESPACE = 'group' VALID_NAMESPACES = (GLOBAL_NAMESPACE, U...
[ { "point_num": 1, "id": "no_function_exceeds_5_params", "question": "Does every function in this file take 5 or fewer parameters (excluding self/cls)?", "answer": true }, { "point_num": 2, "id": "all_function_names_snake_case", "question": "Are all function names in this file written...
3
corehq/apps/performance_sms/parser.py
johan--/commcare-hq
from typing import List, Union from sympy import Symbol def apply_add_mul_operator(operator: str, operand_1, operand_2): if operator == "*": return operand_1 * operand_2 elif operator == "+": return operand_1 + operand_2 def postfix_tokens_to_symbol(postfix_token_symbols: List[Union[str, Sy...
[ { "point_num": 1, "id": "every_function_under_20_lines", "question": "Is every function in this file shorter than 20 lines?", "answer": true }, { "point_num": 2, "id": "no_function_exceeds_5_params", "question": "Does every function in this file take 5 or fewer parameters (excluding ...
3
src/autoks/symbolic/util.py
lschlessinger1/MS-project
class Point: def __init__(self, x=0, y=0): self.x = x self.y = y def __str__(self): return "({0},{1})".format(self.x, self.y) def __add__(self, other): x = self.x + other.x y = self.y + other.y return Point(x, y)
[ { "point_num": 1, "id": "more_functions_than_classes", "question": "Does this file define more functions than classes?", "answer": true }, { "point_num": 2, "id": "every_function_has_docstring", "question": "Does every function in this file have a docstring?", "answer": false }...
3
class.py
maverick1599/CodeShot
""" MIT License Copyright (c) 2021 SaidBySolo Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, di...
[ { "point_num": 1, "id": "no_function_exceeds_5_params", "question": "Does every function in this file take 5 or fewer parameters (excluding self/cls)?", "answer": true }, { "point_num": 2, "id": "all_return_types_annotated", "question": "Does every function in this file have a return...
3
heliotrope/abc/task.py
Saebasol/Heliotrope
#!/usr/bin/env python import datetime import json from eumssi_converter import EumssiConverter import click def transf_date(x): '''convert from string in DD.MM.YYYY (or YYYY-MM-DD) format''' try: return datetime.datetime.strptime(x, "%d.%m.%Y") except ValueError: return datetime.datetime.s...
[ { "point_num": 1, "id": "all_params_annotated", "question": "Does every function parameter in this file have a type annotation (excluding self/cls)?", "answer": false }, { "point_num": 2, "id": "every_function_under_20_lines", "question": "Is every function in this file shorter than ...
3
preprocess/source_DW-video.py
EUMSSI/EUMSSI-platform
import requests from time import sleep api_key = '' # https://pro.coinmarketcap.com/account bot_key = '' # botFather HTTP API: price_limit = 70000 time_interval = 60 telegram_chat_ids = ['', '', ] # IDBot def get_price(): url = 'https://pro-api.coinmarketcap.com/v1/cryptocurrency/listings/latest' parameters = { ...
[ { "point_num": 1, "id": "every_function_under_20_lines", "question": "Is every function in this file shorter than 20 lines?", "answer": true }, { "point_num": 2, "id": "every_function_has_docstring", "question": "Does every function in this file have a docstring?", "answer": fals...
3
telegram_bot_bitcoin_price.py
OSAMAMOHAMED1234/python_projects
from social_core.backends.oauth import BaseOAuth2 class AtlassianOAuth2(BaseOAuth2): name = 'atlassian' AUTHORIZATION_URL = 'https://auth.atlassian.com/authorize' ACCESS_TOKEN_METHOD = 'POST' ACCESS_TOKEN_URL = 'https://auth.atlassian.com/oauth/token' DEFAULT_SCOPE = ['read:jira-user', 'offline_ac...
[ { "point_num": 1, "id": "every_function_under_20_lines", "question": "Is every function in this file shorter than 20 lines?", "answer": true }, { "point_num": 2, "id": "all_params_annotated", "question": "Does every function parameter in this file have a type annotation (excluding se...
3
social_core/backends/atlassian.py
rameshananth/social-core
# File: util.py # Audiophiler utility functions # Credit to Liam Middlebrook and Ram Zallan # https://github.com/liam-middlebrook/gallery from functools import wraps from flask import session from audiophiler.models import Tour def audiophiler_auth(func): @wraps(func) def wrapped_function(*args, **kwargs): ...
[ { "point_num": 1, "id": "every_function_under_20_lines", "question": "Is every function in this file shorter than 20 lines?", "answer": true }, { "point_num": 2, "id": "all_function_names_snake_case", "question": "Are all function names in this file written in snake_case?", "answ...
3
audiophiler/util.py
Mstrodl/audiophiler
##################### Dependency Inversion Violation #################### # class TensorFlowEvaluator: # # def evaluate(self): # print("Evaluating with TensorFlow.") # # # class MLPipeline: # # def __init__(self): # self.evaluator = TensorFlowEvaluator() # # def evaluate(self): # sel...
[ { "point_num": 1, "id": "has_nested_function_def", "question": "Does this file contain any function defined inside another function?", "answer": false }, { "point_num": 2, "id": "all_function_names_snake_case", "question": "Are all function names in this file written in snake_case?",...
3
solidforml/06 Depndency Inversion Principle/dependencyinversion.py
musikalkemist/solidforml
""" This file implements the smooth gating/split function including the linear combination of features. If given, the features are sent through a non linear module first, which may also be optimized thanks to autograd.. """ import torch.nn as nn class Gate(nn.Module): def __init__(self, input_size, initial_steepness...
[ { "point_num": 1, "id": "every_function_under_20_lines", "question": "Is every function in this file shorter than 20 lines?", "answer": true }, { "point_num": 2, "id": "no_function_exceeds_5_params", "question": "Does every function in this file take 5 or fewer parameters (excluding ...
3
e2edt/gate.py
tomsal/endtoenddecisiontrees
import math class Player: def __init__(self): pass # self.most_common = lambda : self.numbers.index(max(self.numbers)) + 1 def initcards(self,num1,num2,num3,num4,num_all): self.numbers = [num1,num2,num3,num4] self.num_all = num_all self.common = self.numbers.index(...
[ { "point_num": 1, "id": "all_function_names_snake_case", "question": "Are all function names in this file written in snake_case?", "answer": true }, { "point_num": 2, "id": "more_functions_than_classes", "question": "Does this file define more functions than classes?", "answer": ...
3
strategic.py
rayanf/Liars-Dice
import discord, sqlite3 from discord.ext import commands import modules.member_helper as helper import modules.sql_init as sqlinit sql = sqlinit.SQLInit() class Quote(): def __init__(self, bot): self.bot = bot @commands.command() async def quote(self, *, author : str = "Mitt Romney"):...
[ { "point_num": 1, "id": "all_function_names_snake_case", "question": "Are all function names in this file written in snake_case?", "answer": true }, { "point_num": 2, "id": "no_function_exceeds_5_params", "question": "Does every function in this file take 5 or fewer parameters (exclu...
3
cogs/quote.py
everettsouthwick/politics-bot
#!/usr/bin/env python # coding=utf-8 import tensorflow as tf #============================ setting =========================================== tf.logging.set_verbosity(tf.logging.INFO) #layers = tf.layers layer = tf.contrib.framework.add_arg_scope(tf.layers.conv1d) slim = tf.contrib.slim print_fn = tf.logging.info # ...
[ { "point_num": 1, "id": "all_function_names_snake_case", "question": "Are all function names in this file written in snake_case?", "answer": true }, { "point_num": 2, "id": "all_params_annotated", "question": "Does every function parameter in this file have a type annotation (excludi...
3
model/model_base.py
POFK/tftool
""" KMP pattern matching algorithm. Finds matching patterns in text in linear time. Text: A longer string of length n. (n > m) Pattern: Substring to be searched for of length m. Works by precompiling the pattern string to create a LPS string array. LPS: Longest Proper Prefix. Longest prefix string that is also a suffix...
[ { "point_num": 1, "id": "no_function_exceeds_5_params", "question": "Does every function in this file take 5 or fewer parameters (excluding self/cls)?", "answer": true }, { "point_num": 2, "id": "all_params_annotated", "question": "Does every function parameter in this file have a ty...
3
algorithms/pattern_matching/kmp.py
rrwt/daily-coding-challenge
from django.shortcuts import render from .models import Blog, BlogCategory #import pagination stuff from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger # Create your views here. def Blogview(request): #Set up Pagination p = Paginator(Blog.objects.all(), 6) page = request.GET.get('page...
[ { "point_num": 1, "id": "no_function_exceeds_5_params", "question": "Does every function in this file take 5 or fewer parameters (excluding self/cls)?", "answer": true }, { "point_num": 2, "id": "every_function_under_20_lines", "question": "Is every function in this file shorter than...
3
pisr_info/views.py
sling254/PISR
__all__ = [ "prototype", ] import sys from inspect import ( signature, ) from typing import ( TypeVar, Callable, ) from .exceptions import ( PrototypeError, ) if sys.version_info >= (3, 10): from typing import ParamSpec else: from typing_extensions import ParamSpec # pragma: no cover ...
[ { "point_num": 1, "id": "has_nested_function_def", "question": "Does this file contain any function defined inside another function?", "answer": true }, { "point_num": 2, "id": "all_params_annotated", "question": "Does every function parameter in this file have a type annotation (exc...
3
src/prototypes/prototypes.py
kprzybyla/prototypes
#!/usr/bin/env python3 # Copyright (c) 2015-2017 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test a node with the -disablewallet option. - Test that validateaddress RPC works when running with -d...
[ { "point_num": 1, "id": "has_multiple_inheritance", "question": "Does any class in this file use multiple inheritance?", "answer": false }, { "point_num": 2, "id": "every_function_has_docstring", "question": "Does every function in this file have a docstring?", "answer": false ...
3
test/functional/wallet_disable.py
odinyblockchain/odinycoin
from dataclasses import dataclass from typing import TypeVar from pyckaxe.lib.pack.abc.resource import Resource from pyckaxe.lib.pack.physical_resource_location import PhysicalResourceLocation from pyckaxe.lib.pack.resource_dumper.common_resource_dumper import CommonResourceDumper from pyckaxe.lib.types import JsonVal...
[ { "point_num": 1, "id": "more_functions_than_classes", "question": "Does this file define more functions than classes?", "answer": true }, { "point_num": 2, "id": "has_multiple_inheritance", "question": "Does any class in this file use multiple inheritance?", "answer": false },...
3
pyckaxe/lib/pack/resource_dumper/json_resource_dumper.py
Arcensoth/pyckaxe
from apitax.drivers.Driver import Driver from apitax.utilities.Files import getAllFiles from pathlib import Path class ApitaxTestsDriver(Driver): def isApiAuthenticated(self): return False def isTokenable(self): return False def getScriptsCatalog(self): files = getAllFiles(self.c...
[ { "point_num": 1, "id": "every_function_has_docstring", "question": "Does every function in this file have a docstring?", "answer": false }, { "point_num": 2, "id": "more_functions_than_classes", "question": "Does this file define more functions than classes?", "answer": true }...
3
apitaxdrivers/ApitaxTests.py
Apitax/Drivers
import csv from django import forms delimiters = ",;|:" quotes = "\"'`" escapechars = " \\" class ExportForm(forms.Form): ''' Let an admin user customize a CSV export. ''' header = forms.BooleanField(required=False, initial=True) totals = forms.BooleanField(required=False, initial=True) delimiter...
[ { "point_num": 1, "id": "has_nested_function_def", "question": "Does this file contain any function defined inside another function?", "answer": false }, { "point_num": 2, "id": "all_function_names_snake_case", "question": "Are all function names in this file written in snake_case?",...
3
admin_reports/forms.py
mohitgoel188/django-admin-reports
from utils_lll import create_dataloader, QADataset from settings_lll import args, TASK_DICT import pickle as pkl import re import os import json from multiprocessing import Pool def serialize_data(redo=True): print("serializing data ...") for t in ["train", "eval", "test"]: for task in TASK_DICT.key...
[ { "point_num": 1, "id": "all_params_annotated", "question": "Does every function parameter in this file have a type annotation (excluding self/cls)?", "answer": false }, { "point_num": 2, "id": "every_function_under_20_lines", "question": "Is every function in this file shorter than ...
3
preprocess.py
jojotenya/LAMOL
# Copyright (c) Facebook, Inc. and its affiliates. # All rights reserved. # # This source code is licensed under the license found in the # LICENSE file in the root directory of this source tree. from .base_weapon import Weapon from ... import dice as D, material as M class BaseClub(Weapon): pass class Club(Ba...
[ { "point_num": 1, "id": "every_function_has_docstring", "question": "Does every function in this file have a docstring?", "answer": false }, { "point_num": 2, "id": "has_nested_function_def", "question": "Does this file contain any function defined inside another function?", "ans...
3
datasets/RTFM/rtfm/dynamics/item/weapon/clubs.py
kapikantzari/MultiBench
import os.path import sys from nose.tools import assert_raises from cx_Freeze.common import ConfigError, process_path_specs rootdir = "C:\\" if sys.platform == "win32" else "/" def test_process_path_specs(): inp = [ os.path.join(rootdir, "foo", "bar"), (os.path.join(rootdir, "foo", "qux"), os.p...
[ { "point_num": 1, "id": "every_function_under_20_lines", "question": "Is every function in this file shorter than 20 lines?", "answer": true }, { "point_num": 2, "id": "has_nested_function_def", "question": "Does this file contain any function defined inside another function?", "...
3
test/test_misc.py
lexa/cx_Freeze
#!/usr/bin/env python import sys import os import configparser import subprocess ## Django Setup import django import pymysql pymysql.install_as_MySQLdb() conffile = os.path.join(os.path.dirname(__file__), "../conf/hunter.conf") conf = configparser.SafeConfigParser() conf.read(conffile) sys.path.append(conf.get('exis...
[ { "point_num": 1, "id": "every_function_under_20_lines", "question": "Is every function in this file shorter than 20 lines?", "answer": true }, { "point_num": 2, "id": "every_function_has_docstring", "question": "Does every function in this file have a docstring?", "answer": fals...
3
scripts/hunter/twitter/tw_watchhunter.py
macdaliot/exist
import os import multiprocessing bind = '0.0.0.0:5700' backlog = 2048 worker_class = 'gevent' workers = 1 threads = 1 worker_connections = 1000 timeout = 30 keepalive = 2 max_requests = 1000 max_requests_jitter = 50 spew = False daemon = False pidfile = None umask = 666 user = os.getenv('USER') group = os.getenv('U...
[ { "point_num": 1, "id": "every_function_has_docstring", "question": "Does every function in this file have a docstring?", "answer": false }, { "point_num": 2, "id": "all_function_names_snake_case", "question": "Are all function names in this file written in snake_case?", "answer"...
3
gunicorn.py
Skydipper/gee-tiles
"""Support for ASUSWRT devices.""" from homeassistant.config_entries import ConfigEntry from homeassistant.const import EVENT_HOMEASSISTANT_STOP, Platform from homeassistant.core import HomeAssistant from .const import DATA_ASUSWRT, DOMAIN from .router import AsusWrtRouter PLATFORMS = [Platform.DEVICE_TRACKER, Platf...
[ { "point_num": 1, "id": "has_nested_function_def", "question": "Does this file contain any function defined inside another function?", "answer": true }, { "point_num": 2, "id": "all_function_names_snake_case", "question": "Are all function names in this file written in snake_case?", ...
3
homeassistant/components/asuswrt/__init__.py
MrDelik/core
# Copyright 2019 Extreme Networks, Inc. # # 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...
[ { "point_num": 1, "id": "every_function_has_docstring", "question": "Does every function in this file have a docstring?", "answer": false }, { "point_num": 2, "id": "all_function_names_snake_case", "question": "Are all function names in this file written in snake_case?", "answer"...
3
st2exporter/st2exporter/cmd/st2exporter_starter.py
tirkarthi/st2
#!/usr/bin/env -S python3 -u import argparse import os import random import shutil import signal import subprocess import sys N_SIMPLE = 10 DEFAULT_TIMEOUT = 40 REPEAT = 5 def setup_terminal(): cols, rows = shutil.get_terminal_size(fallback=(132, 43)) os.environ['COLUMNS'] = str(cols) os.environ['LINE...
[ { "point_num": 1, "id": "no_function_exceeds_5_params", "question": "Does every function in this file take 5 or fewer parameters (excluding self/cls)?", "answer": true }, { "point_num": 2, "id": "all_params_annotated", "question": "Does every function parameter in this file have a ty...
3
run_tests.py
pj1031999/mimiker
# coding: utf-8 """ Text2Label by word vector APIs Text to label by word2vec of contents.<BR />[Endpoint] https://api.apitore.com/api/19 # noqa: E501 OpenAPI spec version: 0.0.1 Generated by: https://github.com/swagger-api/swagger-codegen.git """ from __future__ import absolute_import import...
[ { "point_num": 1, "id": "more_functions_than_classes", "question": "Does this file define more functions than classes?", "answer": true }, { "point_num": 2, "id": "every_function_under_20_lines", "question": "Is every function in this file shorter than 20 lines?", "answer": true ...
3
19/test/test_label_response_entity.py
apitore/apitore-sdk-python
# -*- coding: utf-8 -*- # @Time : 2019/8/27 14:14 # @Author : Max # @FileName: Configuration.py # @IDE: PyCharm import yaml import sys import codecs input_path = None output_path = None ending = None starting = None remove = None # ---------------------------通用模塊------------------------------ # [通用] - 顯示數據,添加管道下支持 d...
[ { "point_num": 1, "id": "every_function_under_20_lines", "question": "Is every function in this file shorter than 20 lines?", "answer": true }, { "point_num": 2, "id": "any_function_over_40_lines", "question": "Is any function in this file longer than 40 lines?", "answer": false ...
3
Configuration.py
0xC000005/MineTube
# References : https://github.com/erik/alexandra import sys import alexandra import click import pychromecast device_name = None cast = None app = alexandra.Application() @click.command() @click.option('--device', help='name of chromecast device', required=True) def server(device): global cast global devi...
[ { "point_num": 1, "id": "all_params_annotated", "question": "Does every function parameter in this file have a type annotation (excluding self/cls)?", "answer": false }, { "point_num": 2, "id": "all_function_names_snake_case", "question": "Are all function names in this file written ...
3
server.py
MananUpadhyay/alexacast
import logging import uuid class Box: def __init__( self, box_header, box_contents, top_left, top_right, bottom_right, bottom_left, input_data_flow_ports, input_control_flow_ports, output_data_flow_ports, output_control_flow_p...
[ { "point_num": 1, "id": "no_function_exceeds_5_params", "question": "Does every function in this file take 5 or fewer parameters (excluding self/cls)?", "answer": false }, { "point_num": 2, "id": "every_function_under_20_lines", "question": "Is every function in this file shorter tha...
3
src/box/box.py
p-ranav/box
import os.path import shutil from string import Template PIKE_DIR = os.path.dirname(__file__) SAMPLES_DIR = os.path.join(PIKE_DIR, 'samples') def sample_path(sample): path = os.path.join(SAMPLES_DIR, sample) return os.path.realpath(path) def copy_sample(sample, target): source = os.path.join(SAMPLES_D...
[ { "point_num": 1, "id": "all_params_annotated", "question": "Does every function parameter in this file have a type annotation (excluding self/cls)?", "answer": false }, { "point_num": 2, "id": "has_nested_function_def", "question": "Does this file contain any function defined inside...
3
foster/utils.py
hugollm/pak
import sys class LongestPath: def solve (self, N, M, x, y, a, b): ret = [a[0], b[0]] return ret def main(): N,M = map(int, input().split()) x = [] y = [] a = [] b = [] for i in range(N): xt,yt = map(int,input().split()) x.append(xt) y.append(yt) ...
[ { "point_num": 1, "id": "more_functions_than_classes", "question": "Does this file define more functions than classes?", "answer": true }, { "point_num": 2, "id": "has_multiple_inheritance", "question": "Does any class in this file use multiple inheritance?", "answer": false },...
3
LongestPath/solver/python/main.py
buyoh/mm-tester
from unittest.mock import patch, MagicMock import pytest from requests import HTTPError, Response from operatorcert import iib def test_get_session() -> None: session = iib.get_session() assert isinstance(session.auth, iib.HTTPKerberosAuth) @patch("operatorcert.iib.get_session") def test_add_builds(mock_s...
[ { "point_num": 1, "id": "every_function_under_20_lines", "question": "Is every function in this file shorter than 20 lines?", "answer": true }, { "point_num": 2, "id": "all_function_names_snake_case", "question": "Are all function names in this file written in snake_case?", "answ...
3
operator-pipeline-images/tests/test_iib.py
mgreczi/operator-pipelines
""" Date : 2018. 9. 1 Author : Jiwoo Park """ import time import threading import itertools import sys class Spinner(): spinner_char = itertools.cycle(['-','/','|','\\']) def __init__(self): self.stop_running = threading.Event() self.spin_thread = threading.Thread(target=self.init_spin) d...
[ { "point_num": 1, "id": "every_function_has_docstring", "question": "Does every function in this file have a docstring?", "answer": false }, { "point_num": 2, "id": "has_nested_function_def", "question": "Does this file contain any function defined inside another function?", "ans...
3
ksif/util/spinner.py
MingyoJung/ksif
from scapy.all import * def basic_flows(): flow_numbers = [ #1, #100, #5000, 10000, 50000, 75000, 85000, 95000, #100000 ] for f_n in flow_numbers: pkts = [] rules = [] for i in range(f_n): a, b, c ...
[ { "point_num": 1, "id": "every_function_under_20_lines", "question": "Is every function in this file shorter than 20 lines?", "answer": false }, { "point_num": 2, "id": "every_function_has_docstring", "question": "Does every function in this file have a docstring?", "answer": fal...
3
benchmarks/pcap_gen.py
Nic30/pclass-vectorized
from django.contrib import admin from django.contrib import admin from .models import TranslationKey, Translation from .forms import AtLeastOneRequiredInlineFormSet # Register your models here. class TranslationInline(admin.TabularInline): model = Translation formset = AtLeastOneRequiredInlineFormSet class ...
[ { "point_num": 1, "id": "has_multiple_inheritance", "question": "Does any class in this file use multiple inheritance?", "answer": false }, { "point_num": 2, "id": "every_class_has_docstring", "question": "Does every class in this file have a docstring?", "answer": false }, {...
3
translation/admin.py
geeksplus-dev/django-backendtranslation
# -*- coding: utf-8 -*- # @Author: jankincai # @Date: 2021-01-26 23:18:43 # @Last Modified by: jankincai # @Last Modified time: 2021-01-26 23:27:01 class LibpcapError(Exception): """Exception raised for errors in the libpcap. """ def __init__(self, message): """init """ self....
[ { "point_num": 1, "id": "more_functions_than_classes", "question": "Does this file define more functions than classes?", "answer": true }, { "point_num": 2, "id": "every_function_under_20_lines", "question": "Is every function in this file shorter than 20 lines?", "answer": true ...
3
pylibpcap/exception.py
smn-3-14/python-libpcap
import json from zope import interface from twisted.internet import defer from piped.plugins.status_testing import statustest, processors from piped import processing class TestClientProcessor(processors.StatusTestProcessor): interface.classProvides(processing.IProcessor) name = 'test-client' class Tes...
[ { "point_num": 1, "id": "no_function_exceeds_5_params", "question": "Does every function in this file take 5 or fewer parameters (excluding self/cls)?", "answer": true }, { "point_num": 2, "id": "every_function_under_20_lines", "question": "Is every function in this file shorter than...
3
doc/tutorials/distributing/4/rpc_tutorial/test_client.py
alexbrasetvik/Piped
#! /usr/bin/python # Copyright 2019 Nokia # # 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 ...
[ { "point_num": 1, "id": "more_functions_than_classes", "question": "Does this file define more functions than classes?", "answer": true }, { "point_num": 2, "id": "every_function_has_docstring", "question": "Does every function in this file have a docstring?", "answer": false }...
3
activators/src/motdactivator.py
alexandruavadanii/cm-plugins
from util.inputReader import read_as_strings LENGTH = 12 def part1(list_of_strings): one_count = [0] * LENGTH zero_count = [0] * LENGTH for string in list_of_strings: for i, val in enumerate(string): if val == '0': zero_count[i] += 1 else: ...
[ { "point_num": 1, "id": "every_function_has_docstring", "question": "Does every function in this file have a docstring?", "answer": false }, { "point_num": 2, "id": "every_function_under_20_lines", "question": "Is every function in this file shorter than 20 lines?", "answer": fal...
3
2021/day03.py
sree-cfa/adventOfCode
"""Adding softDelete for gallery table Revision ID: ad1ce6a264f7 Revises: e19b09b1fb9c Create Date: 2018-08-25 12:53:35.972210 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = 'ad1ce6a264f7' down_revision = 'e19b09b1fb9c' branch_labels = None depends_on = None ...
[ { "point_num": 1, "id": "all_return_types_annotated", "question": "Does every function in this file have a return type annotation?", "answer": false }, { "point_num": 2, "id": "every_function_has_docstring", "question": "Does every function in this file have a docstring?", "answe...
3
migrations/versions/ad1ce6a264f7_adding_softdelete_for_gallery_table.py
TopKeingt/MHS-code
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (c) 2021 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 # # Unl...
[ { "point_num": 1, "id": "more_functions_than_classes", "question": "Does this file define more functions than classes?", "answer": true }, { "point_num": 2, "id": "all_params_annotated", "question": "Does every function parameter in this file have a type annotation (excluding self/cl...
3
engine/compile/ops/onnx_input.py
kevinintel/neural-compressor
# This example requires the 'message_content' privileged intent to function. import discord class MyClient(discord.Client): async def on_ready(self): print(f'Logged in as {self.user} (ID: {self.user.id})') print('------') async def on_message(self, message): # we do not want the bot t...
[ { "point_num": 1, "id": "more_functions_than_classes", "question": "Does this file define more functions than classes?", "answer": true }, { "point_num": 2, "id": "has_multiple_inheritance", "question": "Does any class in this file use multiple inheritance?", "answer": false },...
3
examples/reply.py
quesera2/discord.py
""" Python 'raw-unicode-escape' Codec Written by Marc-Andre Lemburg (mal@lemburg.com). (c) Copyright CNRI, All Rights Reserved. NO WARRANTY. """ import codecs ### Codec APIs class Codec(codecs.Codec): # Note: Binding these as C functions will result in the class not # converting them to methods. This is ...
[ { "point_num": 1, "id": "every_class_has_docstring", "question": "Does every class in this file have a docstring?", "answer": false }, { "point_num": 2, "id": "has_multiple_inheritance", "question": "Does any class in this file use multiple inheritance?", "answer": true }, { ...
3
lib-python/modified-2.4.1/encodings/raw_unicode_escape.py
camillobruni/pygirl
import torch def corner_to_center(xmin, ymin, xmax, ymax): cx, cy = (xmin + xmax) / 2, (ymin + ymax) / 2 w = xmax - xmin h = ymax - ymin return cx, cy, w, h def center_to_corner(cx, cy, w, h): xmin, ymin = cx - 0.5 * w, cy - 0.5 * h xmax, ymax = cx + 0.5 * w, cy + 0.5 * h return xmin, ymin...
[ { "point_num": 1, "id": "every_function_under_20_lines", "question": "Is every function in this file shorter than 20 lines?", "answer": false }, { "point_num": 2, "id": "no_function_exceeds_5_params", "question": "Does every function in this file take 5 or fewer parameters (excluding...
3
yolo/utils/utils.py
DavianYang/yolo.ai
from abc import ABCMeta class BaseEstimator(metaclass=ABCMeta): """ Abstract base class for all estimators in scikit-stan. """ def get_params(self, deep=True): """ Parameters ---------- deep Returns ------- """ pass @classmethod...
[ { "point_num": 1, "id": "more_functions_than_classes", "question": "Does this file define more functions than classes?", "answer": true }, { "point_num": 2, "id": "every_function_has_docstring", "question": "Does every function in this file have a docstring?", "answer": false }...
3
skstan/model/estimator.py
stenoritama/scikit-stan
# -*- coding: utf-8 -*- # --------------------------------------------------------------------- # UserContact model # --------------------------------------------------------------------- # Copyright (C) 2007-2019 The NOC Project # See LICENSE for details # --------------------------------------------------------------...
[ { "point_num": 1, "id": "has_multiple_inheritance", "question": "Does any class in this file use multiple inheritance?", "answer": false }, { "point_num": 2, "id": "more_functions_than_classes", "question": "Does this file define more functions than classes?", "answer": false }...
3
aaa/models/usercontact.py
xUndero/noc
#import ast from .translator import CrystalTranslator class PySys(CrystalTranslator): attribute_map = { "__stdin__": "PySys.__stdin__", "__stdout__": "PySys.__stdout__", "__stderr__": "PySys.__stderr__", "stdin": "PySys.stdin", "stdout": "PySys.stdout", "stderr": "Py...
[ { "point_num": 1, "id": "more_functions_than_classes", "question": "Does this file define more functions than classes?", "answer": true }, { "point_num": 2, "id": "every_function_has_docstring", "question": "Does every function in this file have a docstring?", "answer": false }...
3
py2cr/pysys.py
nanobowers/py2cr
# coding: utf-8 """ App Center Client Microsoft Visual Studio App Center API # noqa: E501 OpenAPI spec version: preview Contact: benedetto.abbenanti@gmail.com Project Repository: https://github.com/b3nab/appcenter-sdks """ from __future__ import absolute_import import unittest import appcente...
[ { "point_num": 1, "id": "every_function_under_20_lines", "question": "Is every function in this file shorter than 20 lines?", "answer": true }, { "point_num": 2, "id": "all_function_names_snake_case", "question": "Are all function names in this file written in snake_case?", "answ...
3
sdks/python/test/test_DistributionResponse.py
Brantone/appcenter-sdks
#!/usr/bin/env python3 # # MIT License # # Copyright (c) 2020-2021 EntySec # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to...
[ { "point_num": 1, "id": "every_function_has_docstring", "question": "Does every function in this file have a docstring?", "answer": false }, { "point_num": 2, "id": "every_function_under_20_lines", "question": "Is every function in this file shorter than 20 lines?", "answer": tru...
3
core/commands/clear.py
cluesblues/ZetaSploit
# Copyright (C) 2014, Red Hat, Inc. # # 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...
[ { "point_num": 1, "id": "every_class_has_docstring", "question": "Does every class in this file have a docstring?", "answer": false }, { "point_num": 2, "id": "more_functions_than_classes", "question": "Does this file define more functions than classes?", "answer": false }, {...
3
patronclient/v2/contrib/server_external_events.py
casbin/openstack-patron
from .station import consistant_typical_range_stations def stations_level_over_threshold(stations: list, tol: float) -> list: """function takes in stations and returns a list of tuples contating station and relative water lever where the relative water level greater than tol """ stations = consistant_ty...
[ { "point_num": 1, "id": "all_function_names_snake_case", "question": "Are all function names in this file written in snake_case?", "answer": true }, { "point_num": 2, "id": "every_function_under_20_lines", "question": "Is every function in this file shorter than 20 lines?", "answ...
3
floodsystem/flood.py
LakeeSiv/Flood
from __future__ import with_statement from sikuliwrapper import * #add custom image library addImagePath(common.cfgImageLibrary) Settings.MinSimilarity = common.imageMinSimilarity class XTest(BaseLogger): ROBOT_LIBRARY_SCOPE = 'TEST SUITE' def __init__(self): None #self....
[ { "point_num": 1, "id": "more_functions_than_classes", "question": "Does this file define more functions than classes?", "answer": true }, { "point_num": 2, "id": "has_multiple_inheritance", "question": "Does any class in this file use multiple inheritance?", "answer": false },...
3
Ch4/reference-test-original/testlib/2ndcase1staction.py
SumitBisht/RobotFrameworkTestAutomation
#!/usr/bin/env python2 # coding: utf-8 """Test immutable registers.""" import unittest import random from triton import * class TestImmutableAArch64Registers(unittest.TestCase): def setUp(self): """Define the arch.""" self.ctx = TritonContext() self.ctx.setArchitecture(ARCH.AARCH64) ...
[ { "point_num": 1, "id": "every_function_has_docstring", "question": "Does every function in this file have a docstring?", "answer": false }, { "point_num": 2, "id": "more_functions_than_classes", "question": "Does this file define more functions than classes?", "answer": true }...
3
src/testers/unittests/test_immutable_registers.py
Ahmadmansoor/Triton