source
string
points
list
n_points
int64
path
string
repo
string
import num_check as pair import distribute as db def role_comment(): no = pair.check(db.cpu, db.cpu_num) if no == 0 : role = 'no role...' elif no == 1 : role = 'one pair!' elif no == 2 : role = 'two pair!' elif no == 3 : role = 'three card!' elif no == ...
[ { "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
python/cpu.py
flaireclair/AIPoker
import time import pigpio class OnkyoCommand(): def __init__(self, pi, gpio): self.pi = pi self.gpio = gpio pi.set_mode(gpio, pigpio.OUTPUT) def _create_header_wave(self): wf = [] wf.append(pigpio.pulse(1 << self.gpio, 0, 3000)) wf.append(pigpio.pulse(0, 1 << ...
[ { "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
onkyo-rpi/command.py
ahaack/onkyo-rpi
from __future__ import absolute_import from pants.base.build_environment import get_scm from pants.base.payload import Payload from pants.base.payload_field import PrimitiveField from pants.build_graph.target import Target class DockerTargetBase(Target): def __init__(self, address=None, payload=None, image_name=Non...
[ { "point_num": 1, "id": "more_functions_than_classes", "question": "Does this file define more functions than classes?", "answer": false }, { "point_num": 2, "id": "no_function_exceeds_5_params", "question": "Does every function in this file take 5 or fewer parameters (excluding self...
3
src/python/verst/pants/docker/target.py
ActionIQ-OSS/pants-plugins
def O_get_new_image_path(): from src.scripts.load_image import get_new_image_path new_image_path = get_new_image_path() return new_image_path def O_load_photo(path): from src.scripts.load_image import get_photo photo = get_photo(path) return photo def O_caption_image(image_name): from src....
[ { "point_num": 1, "id": "any_function_over_40_lines", "question": "Is any function in this file longer than 40 lines?", "answer": false }, { "point_num": 2, "id": "all_params_annotated", "question": "Does every function parameter in this file have a type annotation (excluding self/cl...
3
src/scripts/orchestrator.py
ai-adams/AVOCADO
from main import mxdiflg def test1(benchmark): assert benchmark(mxdiflg, ("hoqq", "bbllkw", "oox", "ejjuyyy", "plmiis", "xxxzgpsssa", "xxwwkktt", "znnnnfqknaz", "qqquuhii", "dvvvwz"), ("cccooommaaqqoxii", "gggqaffhhh", "tttoowwwmmww")) == 13 def test(benchmark): as...
[ { "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
codewars/7kyu/amrlotfy77/Maximum Length Difference/test_bench.py
ictcubeMENA/Training_one
# Copyright (c) 2020 Computer Vision Center (CVC) at the Universitat Autonoma de # Barcelona (UAB). # # This work is licensed under the terms of the MIT license. # For a copy, see <https://opensource.org/licenses/MIT>. from . import SyncSmokeTest import carla import time import math class Sensor(): def __init__(se...
[ { "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": "has_multiple_inheritance", "question": "Does any class in this file use multiple inherit...
3
PythonAPI/test/smoke/test_sensor_tick_time.py
xkcoke/carla
import threading, queue def run_thread_classes(thread_cls, num_of_threads, list_of_init_args=None): thread_classes = [] for i in range(num_of_threads): if list_of_init_args and i < len(list_of_init_args): thread_classes.append(thread_cls(*list_of_init_args[i]).start()) else...
[ { "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": "no_function_exceeds_5_params", "question": "Does every function in this file take 5 or fe...
3
source/threading_utils.py
Havivw/simple-aws
import scrapy from scrapy.crawler import CrawlerProcess # this doesn't work thanks seeking alpha, would need selenium # from nlp_articles.app.nlp import init_nlp settings = {} import os class ScraperForSeekingAlpha(scrapy.Spider): name = "seeking_alpha" start_urls = [ "https://seekingalpha.com/market-n...
[ { "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
scrappers/spiders/seeking_alpha.py
webclinic017/fin_news_nlp
from .user import User class Configuration: def __init__(self, url): self.url = url self._user = None self._testCase = None self._is_headless = False @property def is_headless(self): return self._is_headless @property def testCase(self): return sel...
[ { "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
src/models/configuration.py
lokarithm/PyWebTest
""" 面试题 55(一):二叉树的深度 题目:输入一棵二叉树的根结点,求该树的深度。从根结点到叶结点依次经过的 结点(含根、叶结点)形成树的一条路径,最长路径的长度为树的深度。 """ class BSTNode: """docstring for BSTNode""" def __init__(self, val): self.val = val self.left = None self.right = None def connect_bst_nodes(head: BSTNode, left: BSTNode, right: BSTNode) -> BS...
[ { "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
CodingInterview2/55_01_TreeDepth/tree_depth.py
hscspring/TheAlgorithms-Python
from django.urls import include, path, reverse from rest_framework.test import APITestCase, URLPatternsTestCase, APIRequestFactory from rest_framework import status from knox.models import AuthToken from django.contrib.auth.models import User class BookTicketsTest(APITestCase): def setUp(self): self.userna...
[ { "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
booking/api/tests.py
nightwarriorftw/bookTicket
#!/usr/bin/env python """ Copyright (c) 2006-2016 sqlmap developers (http://sqlmap.org/) See the file 'doc/COPYING' for copying permission """ import string from lib.core.enums import PRIORITY __priority__ = PRIORITY.LOW def dependencies(): pass def tamper(payload, **kwargs): """ Double url-encodes al...
[ { "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
tools/sqlmap/tamper/chardoubleencode.py
glaudsonml/kurgan-ai
class RMSD(): _explorer = None _initialized = False _selection = None _syntaxis = None _atom_indices = None def __init__(self, explorer): self._explorer=explorer def set_parameters(self, selection='atom_type!="H"', syntaxis='MolSysMT'): from molsysmt import select ...
[ { "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": "no_function_exceeds_5_params", "question": "Does every function in this file take 5 or fe...
3
openexplorer_old/tools/distance/rmsd.py
uibcdf/PELE-OpenMM
#!/usr/bin/env python """ Copyright (c) 2006-2018 sqlmap developers (http://sqlmap.org/) See the file 'LICENSE' for copying permission """ from plugins.generic.syntax import Syntax as GenericSyntax class Syntax(GenericSyntax): def __init__(self): GenericSyntax.__init__(self) @staticmethod def es...
[ { "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
.modules/.sqlmap/plugins/dbms/mssqlserver/syntax.py
termux-one/EasY_HaCk
from fastapi import FastAPI from pydantic import BaseModel app = FastAPI() @app.get('/') def main(): return 'root url' @app.get('/json') def json(): return { "result": "json", "sub_result": {"sub": "json"} } class Request(BaseModel): id: int body: str @app.po...
[ { "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": "has_multiple_inheritance", "question": "Does any class in this file use multiple inheritance?", "answer": ...
3
examples/fast_api/app.py
e-kor/yappa
# Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. from botbuilder.dialogs.memory import scope_path from .memory_scope import MemoryScope class SettingsMemoryScope(MemoryScope): def __init__(self): super().__init__(scope_path.SETTINGS) self._empty_setti...
[ { "point_num": 1, "id": "more_functions_than_classes", "question": "Does this file define more functions than classes?", "answer": true }, { "point_num": 2, "id": "has_nested_function_def", "question": "Does this file contain any function defined inside another function?", "answe...
3
libraries/botbuilder-dialogs/botbuilder/dialogs/memory/scopes/settings_memory_scope.py
Fl4v/botbuilder-python
""" In this exercise you are going to apply what you learned about stacks with a real world problem. We will be using stacks to make sure the parentheses are balanced in mathematical expressions such as: ((3^2 + 8)*(5/2))/(2+6) In real life you can see this extend to many things such as text editor plugins and...
[ { "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
3. data_structures/stack/balanced_parantheses.py
m-01101101/udacity-datastructures-algorithms
#! /usr/bin/env python #coding=utf-8 import ply.lex as lex # LEX for parsing Python # Tokens tokens=('VARIABLE','NUMBER', 'IF', 'ELIF', 'ELSE', 'WHILE', 'FOR', 'PRINT', 'INC', 'LEN', 'GDIV', 'BREAK', 'LET') literals=['=','+','-','*','(',')','{','}','<','>', ';', ',', '[', ']'] #Define of tokens def t...
[ { "point_num": 1, "id": "all_function_names_snake_case", "question": "Are all function names in this file written in snake_case?", "answer": false }, { "point_num": 2, "id": "has_nested_function_def", "question": "Does this file contain any function defined inside another function?",...
3
py_lex.py
Spico197/PythonCompilerPrinciplesExp
# Copyright 2020 Google LLC # # Use of this source code is governed by a BSD-style # license that can be found in the LICENSE file or at # https://developers.google.com/open-source/licenses/bsd import json from functools import partial import time import jax.numpy as np import jax.random as random from jax import jit...
[ { "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
benchmarks/python/microbench.py
cyntsh/dex-lang
#!/usr/bin/env python3 import fileutils def part1(lst): positions = parse_positions(lst) def calc(x, i): return abs(x - i) return get_min_fuel(positions, calc) def part2(lst): positions = parse_positions(lst) def calc(x, i): n = abs(x - i) return n * (n + 1) / 2 r...
[ { "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
aoc2021/day7.py
jonsth131/aoc
# http://wiki.glidernet.org/wiki:ogn-flavoured-aprs # For ADSB data type is always UNKNOWN label_by_type = { "UNKNOWN": "Unknown", "GLIDER": "Fixed wing aircraft", "TOWPLANE": "Fixed wing aircraft", "HELICOPTER": "Helicopter", "PARACHUTE": "Parachute", "DROPPLANE": "Fixed wing aircraft", "FI...
[ { "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
cvat/apps/engine/ddln/tasks/spotter/hints/models.py
daedaleanai/cvat
from django import forms from django.forms import ModelForm, TextInput from polls.models import Choice, Question class PollForm(forms.ModelForm): question_text = forms.CharField(widget=forms.TextInput(attrs={'class': 'form-control'})) class Meta: model = Question exclude = ['pub_date'] de...
[ { "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
polls/forms.py
raikasdev/app
from jax import numpy as jnp import jax def cr_fn(x, y): return x @ x + y * y cr_jac = jax.jacfwd(cr_fn, argnums=(0, 1)) cr_jac(jnp.eye(3), jnp.eye(3)) def cr_j(x, y): return cr_jac(x, y)
[ { "point_num": 1, "id": "every_function_has_docstring", "question": "Does every function in this file have a docstring?", "answer": false }, { "point_num": 2, "id": "no_function_exceeds_5_params", "question": "Does every function in this file take 5 or fewer parameters (excluding sel...
3
tensorflow/compiler/xla/libceed/example_program.py
DiffeoInvariant/tensorflow
from configparser import ConfigParser import psycopg2 import os DB_CONFIG_FILE = os.path.join((os.path.dirname(__file__)), 'database.ini') def config(filename=DB_CONFIG_FILE, section='postgresql'): # create a parser and read the configuration parser = ConfigParser() parser.read(filename) # get the s...
[ { "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
src/rds_postgres_instance/sql_with_rds.py
viclule/api_models_deployment_framework
import numpy as np from mher.common.schedules import ConstantSchedule, PiecewiseSchedule def test_piecewise_schedule(): ps = PiecewiseSchedule([(-5, 100), (5, 200), (10, 50), (100, 50), (200, -50)], outside_value=500) assert np.isclose(ps.value(-10), 500) assert np.isclose(ps.value(0), 150) assert n...
[ { "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
mher/common/tests/test_schedules.py
YangRui2015/Modular_HER
__all__ = ['setup_targets'] from pathlib import Path from typing import Final from build_system.build_target import * from build_system.compiler import * from ..meson import * def setup_targets(root_dir: Path, targets: list[CompilerInstanceTargets], cli_mode: bool) -> None: f...
[ { "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
conf/script/src/build_system/cmd/setup/_priv/setup_steps/step_setup_targets.py
benoit-dubreuil/template-repo-cpp-full-ecosystem
# header files and constant variables from mpl_toolkits.mplot3d import Axes3D import numpy as np from scipy.interpolate import RectBivariateSpline as RS from multiprocessing import Pool from functools import partial from pyswarm import pso import warnings warnings.filterwarnings("ignore") np.printoptions(precision=2) ...
[ { "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
20200616/functions/header.py
dongxulee/lifeCycle
import logging log = logging.getLogger(__name__) def traverse(data, path): """Method to traverse dictionary data and return element at given path. """ result = data # need to check path, in case of standalone function use if isinstance(path, str): path = [i.strip() for i in path.split("...
[ { "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
ttp/output/transform.py
danielolson13/ttp
# -*- coding: utf-8 -*- # Define your item pipelines here # # Don't forget to add your pipeline to the ITEM_PIPELINES setting # See: http://doc.scrapy.org/en/latest/topics/item-pipeline.html import json import pymysql.cursors class NovelPipeline(object): def __init__(self): self.file = open('items.jl', ...
[ { "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_class_has_docstring", "question": "Does every class in this file have a docstring?", "answer": ...
3
spider_scrapy/novel/pipelines.py
cnjack/novel-spider
from flask import current_app from app.models.accept_problem import AcceptProblem from app.models.user import User def submit_calculate_user_rating_task(username=None): from tasks import calculate_user_rating_task if username: user_list = [User.get_by_id(username)] else: user_list = User....
[ { "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
app/libs/service.py
Kyooooma/view-oj-backend
from commons import * import os def pgp_check(): init_directory('./temp') # gpg must exist on your system status = os.system('gpg --version') if status==0: print_up('gpg is found') else: print_err('can\'t find gpg') def verify_publickey_message(pk, msg): # obtain a temp filena...
[ { "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
pgp_stuff.py
d7d4af8/2047
# -*- coding: utf-8 -*- import hnswlib import numpy as np def buildIndex(X): dim = X.shape[1] num_elements = X.shape[0] data_labels = np.arange(num_elements) p = hnswlib.Index(space = 'cosine', dim = dim) p.init_index(max_elements = num_elements, ef_construction = 200, M = 16) p.add_items(X, 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": "all_params_annotated", "question": "Does every function parameter in this file have a type annotation (excluding self/...
3
MIPS.py
Stomach-ache/GLaS
import click from ...runner import events from . import default def handle_after_execution(context: events.ExecutionContext, event: events.AfterExecution) -> None: context.endpoints_processed += 1 default.display_execution_result(context, event) if context.endpoints_processed == event.schema.endpoints_co...
[ { "point_num": 1, "id": "all_return_types_annotated", "question": "Does every function in this file have a return type annotation?", "answer": true }, { "point_num": 2, "id": "all_params_annotated", "question": "Does every function parameter in this file have a type annotation (exclu...
3
src/schemathesis/cli/output/short.py
chr1st1ank/schemathesis
class animalShelter: def __init__(self) : self.cats = [] self.dogs = [] def enqueue(self,animal,type): if type == "cat": self.cats.append(animal) else: self.dogs.append(animal) def dequeueCat(self): if len(self.cats) == 0: return None els...
[ { "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
DS-ALGO/6. Queue/InterviewQuestions/animalShelter.py
arnabdutta2194/DS-ALGO-CP
from dis_snek.models import InteractionContext, OptionTypes, slash_command, slash_option from ElevatorBot.commandHelpers.subCommandTemplates import poll_sub_command from ElevatorBot.commands.base import BaseScale from ElevatorBot.core.misc.poll import Poll class PollRemove(BaseScale): @slash_command( **p...
[ { "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
ElevatorBot/commands/miscellaneous/poll/remove.py
LukasSchmid97/elevatorbot
class GridSegmentDirection(Enum,IComparable,IFormattable,IConvertible): """ Specify one of the four adjacent segments to a GridNode. See Autodesk.Revit.DB.DividedSurface. enum GridSegmentDirection,values: NegativeU (1),NegativeV (3),PositiveU (0),PositiveV (2) """ def __eq__(self,*args): """ x._...
[ { "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
stubs.min/Autodesk/Revit/DB/__init___parts/GridSegmentDirection.py
ricardyn/ironpython-stubs
import numpy as np from astropy.io import fits from scipy.interpolate import RectBivariateSpline def index_PSF(PSF, x, y): return PSF[x+y*3] def get_native_PSF(filt, x, y, the_path): x = float(np.clip(x, 0, 1014)) y = float(np.clip(y, 0, 1014)) f = fits.open("%sPSFSTD_WFC3IR_%s.fits" % (the_path, fil...
[ { "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
wfc3_psf.py
rubind/wfc3_psf
from dagster import SolidDefinition from dagster.core.definitions.dependency import Node from dagster.core.system_config.objects import ResolvedRunConfig from dagstermill.manager import MANAGER_FOR_NOTEBOOK_INSTANCE BARE_OUT_OF_PIPELINE_CONTEXT = MANAGER_FOR_NOTEBOOK_INSTANCE.get_context() def test_tags(): conte...
[ { "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
python_modules/libraries/dagstermill/dagstermill_tests/test_context.py
dbatten5/dagster
import unittest import puputin as pt class test_puputin(unittest.TestCase): def test_puptinluonti(self): tp = pt.Puputin("testipuputin") self.assertEqual(tp.nimi, "testipuputin", "Nimi property ei toimi") def test_lisaapuppu(self): self.assertEqual(1, 1, "Nimi property ei toimi")
[ { "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
test_puputin.py
VesaLauri/puputin
# (c) 2012-2019, Ansible by Red Hat # # This file is part of Ansible Galaxy # # Ansible Galaxy is free software: you can redistribute it and/or modify # it under the terms of the Apache License as published by # the Apache Software Foundation, either version 2 of the License, or # (at your option) any later version. #...
[ { "point_num": 1, "id": "more_functions_than_classes", "question": "Does this file define more functions than classes?", "answer": true }, { "point_num": 2, "id": "every_class_has_docstring", "question": "Does every class in this file have a docstring?", "answer": false }, { ...
3
galaxy_common/models/tag.py
alikins/galaxy-common-deprecated
import numpy as np import pandas as pd import pytest from afprop import afprop_vec # sample data with clusters for testing C1 = np.random.multivariate_normal(mean=[0, 0], cov=np.eye(2), size=30) C2 = np.random.multivariate_normal(mean=[4, 4], cov=np.eye(2), size=30) mydata = np.r_[C1, C2] def test_n_cluster(): ...
[ { "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
tests/test_afprop.py
yanhann10/afprop
# Copyright (c) SenseTime. All Rights Reserved. from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals import torch.nn as nn class AdjustLayer(nn.Module): def __init__(self, in_channels, out_channels, center_size=7): ...
[ { "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": false }, {...
3
pysot/models/neck/neck.py
TJUMMG/SiamDMU
import sys import unittest import unittest.mock as mock from imagemounter._util import check_output_ from imagemounter.parser import ImageParser from imagemounter.disk import Disk class PartedTest(unittest.TestCase): @unittest.skipIf(sys.version_info < (3, 6), "This test uses assert_called() which is not present...
[ { "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": "every_function_has_docstring", "question": "Does every function in this file have a docstring?", "answ...
3
tests/volume_system_test.py
pombredanne/imagemounter
# -*- coding: utf-8 -*- from ..base import Property from .array import StateVector from .base import Type class Particle(Type): """ Particle type A particle type which contains a state and weight """ state_vector: StateVector = Property(doc="State vector") weight: float = Property(doc='Weigh...
[ { "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
stonesoup/types/particle.py
Isaac-JenkinsRA/Stone-Soup
# Copyright (c) 2021 War-Keeper import discord from discord.ext import commands # ---------------------------------------------------------------------------------------------- # Returns the ping of the bot, useful for testing bot lag and as a simple functionality command # --------------------------------------------...
[ { "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
cogs/ping.py
Ashwinshankar98/ClassMateBot
import torch import torch.nn as nn class LabelSmoothingLoss(nn.Module): """ Provides Label-Smoothing loss. Args: class_num (int): the number of classfication ignore_index (int): Indexes that are ignored when calculating loss smoothing (float): ratio of smoothing (confidence = 1.0 -...
[ { "point_num": 1, "id": "every_function_has_docstring", "question": "Does every function in this file have a docstring?", "answer": false }, { "point_num": 2, "id": "no_function_exceeds_5_params", "question": "Does every function in this file take 5 or fewer parameters (excluding sel...
3
package/loss.py
ngbsLab/Korean-Speech-Recognition
import komand from .schema import CreateRecordInput, CreateRecordOutput # Custom imports below class CreateRecord(komand.Action): def __init__(self): super(self.__class__, self).__init__( name="create_record", description="Create a new SObject record", input=CreateReco...
[ { "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
plugins/salesforce/komand_salesforce/actions/create_record/action.py
lukaszlaszuk/insightconnect-plugins
from src.views.tests import BaseTest class TestDeleteDevice(BaseTest): """Tests to delete device from the list.""" def test_delete_device(self): self.register_device() res = self.test_app.delete('/device/{id}'.format(id=1)) self.assertEqual(res.status_code, 204) def test_delete_n...
[ { "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
server/src/views/tests/test_delete.py
budtmo/GIoT
# coding: utf-8 """ Kubernetes No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) OpenAPI spec version: v1.5.0-beta.1 Generated by: https://github.com/swagger-api/swagger-codegen.git Licensed under the Apache License, Version 2.0 (the "Lice...
[ { "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
kubernetes/test/test_v1beta1_ingress_tls.py
SEJeff/client-python
import logging from finorch.config.config import api_config_manager from finorch.sessions.cit.client import CITClient from finorch.sessions.abstract_session import AbstractSession from finorch.sessions.cit.wrapper import CITWrapper from finorch.transport.ssh import SshTransport class CITSession(AbstractSession): ...
[ { "point_num": 1, "id": "has_multiple_inheritance", "question": "Does any class in this file use multiple inheritance?", "answer": false }, { "point_num": 2, "id": "no_function_exceeds_5_params", "question": "Does every function in this file take 5 or fewer parameters (excluding self...
3
finorch/sessions/cit/session.py
ADACS-Australia/SS2021B-DBrown
############################################################################### # _*_ coding: utf-8 # # Tests for XlsxWriter. # # Copyright (c), 2013-2020, John McNamara, jmcnamara@cpan.org # from __future__ import unicode_literals from ..excel_comparsion_test import ExcelComparisonTest from ...workbook import Workbook...
[ { "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
xlsxwriter/test/comparison/test_utf8_07.py
timgates42/XlsxWriter
""" Definition of TreeNode: class TreeNode: def __init__(self, val): self.val = val self.left, self.right = None, None """ class Solution: """ @param inorder : A list of integers that inorder traversal of a tree @param postorder : A list of integers that postorder traversal of a tree ...
[ { "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": "more_functions_than_classes", "question": "Does this file define more functions than classes?", "answe...
3
files/sun/practice/binarytree.py
1ta/study_python
# -*- coding: utf-8 -*- # BioSTEAM: The Biorefinery Simulation and Techno-Economic Analysis Modules # Copyright (C) 2020, Yoel Cortes-Pena <yoelcortes@gmail.com> # # This module is under the UIUC open-source license. See # github.com/BioSTEAMDevelopmentGroup/biosteam/blob/master/LICENSE.txt # for license details. """...
[ { "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
biosteam/units/_clarifier.py
tylerhuntington222/biosteam
from iqa_metrics.tmqi_matlab.TMQI import TMQI, TMQIr_m import matlab_py.matlab_wrapper as mw import os from utils.image_processing.color_spaces import rgb2lum # singleton instance to not reinitialize every time TMQI is called tmqi_instance = None def init_instance_tmqi(**kwargs): global tmqi_instance matl...
[ { "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
iqa_metrics/tmqi_matlab/tmqi_wrapper.py
ch-andrei/L-IQA
#!/usr/bin/env python """ 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");...
[ { "point_num": 1, "id": "more_functions_than_classes", "question": "Does this file define more functions than classes?", "answer": true }, { "point_num": 2, "id": "every_class_has_docstring", "question": "Does every class in this file have a docstring?", "answer": false }, { ...
3
ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/hcat_client.py
nexr/ambari
#Author:Azrael import sys from PyQt5.QtWidgets import QApplication, QDialog, QStackedWidget,QListWidget,\ QTextEdit,QVBoxLayout,QListWidgetItem class MainPage(QDialog): def __init__(self, parent=None): super(MainPage, self).__init__(parent) self.initUI() def initUI(self): self.se...
[ { "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": "any_function_over_40_lines", "question": "Is any function in this file longer than 40 lines?", "answer": false...
3
MainPage.py
Azraelxx/easydownload_py
from typing import Callable try: # Assume we're a sub-module in a package. from utils import arguments as arg except ImportError: # Apparently no higher-level package has been imported, fall back to a local import. from ..utils import arguments as arg def maybe(*conditions) -> Callable: conditions = ar...
[ { "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_return_types_annotated", "question": "Does every function in this file have a return type annotation?", ...
3
functions/logic_functions.py
kefir/snakee
from rest_framework import serializers from profiles_api import models class HelloSerializer(serializers.Serializer): """serializes a name field for testing our APIView""" name = serializers.CharField(max_length = 10) class UserProfileSerializer(serializers.ModelSerializer): """serializes a user profile"...
[ { "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
profiles_api/serializer.py
harsha1406/profiles-rest-api
class Person: def __init__(self, name, age): self.name = name self.age = age def __str__(self): return "{" + self.name + " " + str(self.age) + "}" p1 = Person("John", 36) print(p1)
[ { "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": "more_functions_than_classes", "question": "Does this file define more functions than classes?", "answ...
3
basic-lang-fun/oop.py
diegopacheco/python-playground
from django.db import models from django.contrib.auth.models import AbstractBaseUser, BaseUserManager, \ PermissionsMixin class UserManager(BaseUserManager): def create_user(self, email, password, **extra_fields): if not email: raise ValueError("Users mu...
[ { "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": "no_function_exceeds_5_params", "question": "Does every function in this file take 5 or fe...
3
app/core/models.py
ikromjonxusanov/recipe-app-api
from typing import Tuple, Optional from torch import Tensor from torch.distributions import MultivariateNormal import numpy as np from torch.distributions.multivariate_normal import _batch_mv from torch.distributions.utils import _standard_normal def bmat_idx(*args) -> Tuple: """ Create indices for tensor a...
[ { "point_num": 1, "id": "all_return_types_annotated", "question": "Does every function in this file have a return type annotation?", "answer": true }, { "point_num": 2, "id": "every_function_under_20_lines", "question": "Is every function in this file shorter than 20 lines?", "an...
3
torch_kalman/state_belief/utils.py
Suhwan-Dev/torch-kalman
import sys from moviepy.editor import VideoFileClip import camera import image_thresholding import line_fitting import matplotlib.image as mpimg class Line(): def __init__(self): self.detected = False # lane line detected in previous iteration self.fit = None # most recent polynomial fit ...
[ { "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
lane_finder.py
desihsu/lane-finder
import os import uuid import yaml from sceptre_template_fetcher.cli import setup_logging def before_all(context): if context.config.wip: setup_logging(True) context.uuid = uuid.uuid1().hex context.project_code = "sceptre-integration-tests-{0}".format( context.uuid ) context.scept...
[ { "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
integration-tests/environment.py
oazmon/sceptre-template-fetcher
# -*- coding: utf-8 -*- from os.path import exists as path_exists from pyscaffold.api import create_project from pyscaffold.cli import parse_args, process_opts from pyscaffold.utils import chdir EXT_FLAG = "--dsproject-vscode" FLAKE8 = "flake8 --max-line-length=88" def test_add_custom_extension(tmpfolder): args...
[ { "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/test_custom_extension.py
avsolatorio/pyscaffoldext-dsproject-vscode
""" Project Euler - Problem Solution 016 Copyright (c) Justin McGettigan. All rights reserved. https://github.com/jwmcgettigan/project-euler-solutions """ def sum_digits(n): s = 0 while n: s, n = s + n % 10, n // 10 return s def power_digit_sum(power): return sum_digits(2**power) if __name__ == "__main__...
[ { "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
solutions/016/016.py
jwmcgettigan/project-euler-solutions
class NutritionInfo: def __init__(self, name, data): self.foodID = data['foodID'] self.allowed_cols = ['foodname', 'image', 'weight', 'weight_unit', 'calories', 'calfromfat', 'totalfat', 'saturatedfat', 'transfat', 'fat_poly', 'fat_mono', 'cholesterol', 'sodium', 'totalcarbs', 'dietaryfiber', 'sugar...
[ { "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
NutritionInfo.py
NoahSaffie/Etekcity-Nutrition-Scale-Batch-Food-Uploader
# -*- coding: UTF-8 -*- # # Copyright 2019-2022 Flávio Gonçalves Garcia # # 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 b...
[ { "point_num": 1, "id": "every_function_has_docstring", "question": "Does every function in this file have a docstring?", "answer": false }, { "point_num": 2, "id": "no_function_exceeds_5_params", "question": "Does every function in this file take 5 or fewer parameters (excluding sel...
3
tests/features/steps/call_steps.py
candango/taskio
""" asyncio socket server for handling messages """ import os import asyncio import logging from .parser import parse_message __all__ = ('runserver', ) LOG = logging.getLogger(__name__) class MessageProtocol(asyncio.Protocol): """ Takes the recv'd bytes and parses it with the message handler. In real 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": "more_functions_than_classes", "question": "Does this file define more functions than classes?", "answer": true...
3
msgparse/server.py
vengefuldrx/hipchat-msgparse
# 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. # Copyright (c) 2016-present, Facebook, Inc. # All rights reserved. # # This source code is licensed under the BSD-style li...
[ { "point_num": 1, "id": "more_functions_than_classes", "question": "Does this file define more functions than classes?", "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
projects/combinatory-chemistry/observable.py
germank/CommAI-env
# 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_PurgeResponse.py
Brantone/appcenter-sdks
#! /usr/bin/env python3 # counts the number of regions in a matrix # vertically and horizontally connected # e.g. # [1, 0, 1, 1] # [0, 1, 0, 0] # [1, 1, 0, 1] # has 4 regions class Patch(object): def __init__(self, visited, value): self.visited = visited self.value = value def __repr__(self)...
[ { "point_num": 1, "id": "all_function_names_snake_case", "question": "Are all function names in this file written in snake_case?", "answer": false }, { "point_num": 2, "id": "all_params_annotated", "question": "Does every function parameter in this file have a type annotation (exclud...
3
regions.py
nisstyre56/Interview-Problems
# -*- coding: utf-8 -*- # Generated by Django 1.9.10 on 2016-12-12 13:23 from __future__ import unicode_literals from django.db import migrations def create_project_locale_groups(apps, schema_editor): """Create translators groups for every project locale object.""" Group = apps.get_model('auth', '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": "every_function_under_20_lines", "question": "Is every function in this file shorter than...
3
pontoon/base/migrations/0075_create_project_locale_translators_groups.py
udacity/pontoon
from ..ServiceCore import Service from ...conf.ServiceConfig import ServiceConfig class IJob(Service): def __init__(self,jobConfig: ServiceConfig,services: [Service]): super().__init__(serviceConfig=jobConfig) #region Private Methods def _check_services(self, svcs: [Service]): pass ...
[ { "point_num": 1, "id": "more_functions_than_classes", "question": "Does this file define more functions than classes?", "answer": true }, { "point_num": 2, "id": "no_function_exceeds_5_params", "question": "Does every function in this file take 5 or fewer parameters (excluding self/...
3
src/core/service/job/IJobCore.py
xxdunedainxx/Z-Py
"""Test for word tokenizers""" import unittest from tiny_tokenizer.tiny_tokenizer_token import Token class TokenTest(unittest.TestCase): """Test ordinal word tokenizer.""" def test_token_without_feature(self): token = Token(surface="大崎") self.assertEqual("大崎", token.surface) self.ass...
[ { "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
tests/test_token.py
chie8842/tiny_tokenizer
# coding=utf8 # Copyright 2018 JDCLOUD.COM # # 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 ...
[ { "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_multiple_inheritance", "question": "Does any class in this file use multiple inherita...
3
jdcloud_sdk/services/ipanti/apis/DescribeConnStatGraphRequest.py
Tanc009/jdcloud-sdk-python
""" Copyright (c) 2020 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 in writin...
[ { "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_under_20_lines", "question": "Is every function in this file shorter than 20 lines?", "answer": true...
3
misc/pytorch_toolkit/machine_translation/core/dataset/text_container.py
dqawami/openvino_training_extensions
import os from celery import Celery from django.apps import apps, AppConfig from django.conf import settings if not settings.configured: # set the default Django settings module for the 'celery' program. os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'config.settings.local') # pragma: no cover app = Cele...
[ { "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
ticketflix/taskapp/celery.py
DSW-2018-2/Arquitetura-Desenho-2018-2
import logging from .config import is_configured, get_config __global_logger = None __loggers = {} def _reset(): """ This is only used for testing. To get a fresh session, we should reset `config`, `bundle` and `logger` modules by calling their `reset()`. """ global __global_logger, __loggers ...
[ { "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_function_names_snake_case", "question": "Are all function names in this file written in snake_case?", "ans...
3
stocklab/core/logger.py
hchsiao/stocklab
from django.db import models class Announcement(models.Model): title = models.CharField(max_length=100, null=False) text = models.TextField(null=False) date = models.DateTimeField(auto_now_add=True) @property def short_id(self): return self.title def __str__(self): return f"{...
[ { "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
server/booking_portal/models/announcement.py
ujjwal-raizada/lab-booking-system
import unittest from steem.utils import ( constructIdentifier, sanitizePermlink, derivePermlink, resolveIdentifier, yaml_parse_file, formatTime, ) class Testcases(unittest.TestCase) : def test_constructIdentifier(self): self.assertEqual(constructIdentifier("A", "B"), "@A/B") ...
[ { "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/test_utils.py
ausbitbank/piston
from torchvision import datasets, transforms def get_mnist(dataset_path): path_str = str(dataset_path.resolve()) transform = transforms.Compose([ transforms.ToTensor(), transforms.Normalize(mean=(0.5, ), std=(0.5, )), ]) train_data = datasets.MNIST(path_str, train=True, download=True, ...
[ { "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
datasets.py
bartwojcik/cifar-template
"""Module containing class `AudioFileReader`.""" class AudioFileReader: """Abstract base class for audio file readers.""" def __init__( self, file_path, file_type, num_channels, length, sample_rate, dtype, mono_1d=False): self._file_path = file_path ...
[ { "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_multiple_inheritance", "question": "Does any class in this file use multiple inherita...
3
vesper/signal/audio_file_reader.py
RichardLitt/Vesper
#!/usr/bin/env python from __future__ import print_function import freenect import cv import frame_convert import numpy as np threshold = 100 current_depth = 0 def change_threshold(value): global threshold threshold = value def change_depth(value): global current_depth current_depth = value def ...
[ { "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
scripts/install/win/OpenKinect/freenect-examples/demo_cv_threshold.py
tpltnt/SimpleCV
import pygame, time, sys class VirtualButton(object): def __init__(self, key, x, y): self.key = key self.down = False self.x = x self.y = y left = VirtualButton(pygame.K_LEFT, 0, 1) up = VirtualButton(pygame.K_UP, 1, 0) right = VirtualButton(pygame.K_RIGHT, 2, 1) down = VirtualButt...
[ { "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
comparison/without/buttons.py
cheery/elm-bonsai
class Argument(object): def __init__(self, argument = None, base: bool = False): self.arg = argument self.is_base = base def __repr__(self): return self.arg def __str__(self): return self.arg def is_pipe(self): return self.arg == ">>" or self.arg == "<<"
[ { "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": "has_multiple_inheritance", "question": "Does any class in this file use multiple inheritance?", "answer": ...
3
sprint/core/parser/args.py
ii-Python/Sprint-v2
from tfchain.polyfill.encoding.jsmods.ipaddrjs import api as ipaddrjs import tfchain.polyfill.array as jsarr class IPAddress: def __init__(self, value): if isinstance(value, str): v = None err = None __pragma__("js", "{}", """ try { v = ipaddr...
[ { "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": "has_multiple_inheritance", "question": "Does any class in this file use multiple inheritance?", "answer": ...
3
src/tfchain/polyfill/encoding/ipaddr.py
GlenDC/threefold-wallet-electron
from unittest import mock import click import io import pytest from pathlib import Path from elisctl.common import schema_content_factory from elisctl.schema.xlsx import XlsxToSchema def file_decorator(*_args, **_kwargs): def test_decorator(f): def test_wrapped(*args, **kwargs): return f(*ar...
[ { "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": "has_multiple_inheritance", "question": "Does any class in this file use multiple inheritance?", "answer": ...
3
tests/test_parameters.py
proste/elisctl
import logging import os import sys from datetime import datetime def setup_logger(name, save_dir, distributed_rank, filename="log.txt"): logger = logging.getLogger(name) logger.setLevel(logging.DEBUG) # DEBUG, INFO, ERROR, WARNING # don't log results for the non-master process if distributed_rank > 0: return lo...
[ { "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
lib/utils/logger.py
sangminwoo/Temporal-Span-Proposal-Network-VidVRD
#!/usr/bin/env python3 # Copyright (c) 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 resendwallettransactions RPC.""" from test_framework.test_framework import HodlCashTestFramework from ...
[ { "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
test/functional/wallet_resendwallettransactions.py
MichaelHDesigns/HodlCash
from graphene import relay, ObjectType from graphene_django import DjangoObjectType from graphene_django.filter import DjangoFilterConnectionField from .models import Colaborador class ColaboradorNode(DjangoObjectType): class Meta: model = Colaborador filter_fields = '__all__' interfaces ...
[ { "point_num": 1, "id": "more_functions_than_classes", "question": "Does this file define more functions than classes?", "answer": false }, { "point_num": 2, "id": "has_multiple_inheritance", "question": "Does any class in this file use multiple inheritance?", "answer": false }...
3
backend/colaboradores/schema.py
leonunesbs/medico
"""Tests for distutils.command.bdist.""" import os import unittest from test.support import run_unittest from distutils.command.bdist import bdist from distutils.tests import support class BuildTestCase(support.TempdirManager, unittest.TestCase): def test_formats(self): # let's creat...
[ { "point_num": 1, "id": "has_multiple_inheritance", "question": "Does any class in this file use multiple inheritance?", "answer": true }, { "point_num": 2, "id": "more_functions_than_classes", "question": "Does this file define more functions than classes?", "answer": true }, ...
3
Lib/distutils/tests/test_bdist.py
Hadron/python
# -*- coding: utf-8 -*- """ fedex.services.tracking ~~~~~~~~~~~~~~~~~~~~~~~ FedEx tracking web services. :copyright: 2014 by Jonathan Zempel. :license: BSD, see LICENSE for more details. """ from .commons import BaseService class TrackingService(BaseService): """Tracking service. :para...
[ { "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
fedex/services/tracking.py
jzempel/fedex
# -*- coding: utf-8 -*- from django.core.cache import get_cache from django.utils.functional import cached_property from jinja2 import BytecodeCache as _BytecodeCache class BytecodeCache(_BytecodeCache): """ A bytecode cache for Jinja2 that uses Django's caching framework. """ def __init__(self, cac...
[ { "point_num": 1, "id": "more_functions_than_classes", "question": "Does this file define more functions than classes?", "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
django_jinja/cache.py
hartym/django-jinja
class Employee: def setName(self,myname): # Mutator method self.myname=myname def getName(self): # Accessor method return self.myname def setStaffNumber(self,StaffNumber): # Mutator method self.StaffNumber=StaffNumber def getStaffNumber(self): # Acces...
[ { "point_num": 1, "id": "all_function_names_snake_case", "question": "Are all function names in this file written in snake_case?", "answer": false }, { "point_num": 2, "id": "more_functions_than_classes", "question": "Does this file define more functions than classes?", "answer":...
3
Chapter 08/Chap08_Example8.45.py
bpbpublications/Programming-Techniques-using-Python
######################################## #### Licensed under the MIT license #### ######################################## import torch import torch.nn as nn import torch.nn.functional as F from torch.autograd import Variable from numpy import prod import capsules as caps class CapsuleNetwork(nn.Module): def __init_...
[ { "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": "more_functions_than_classes", "question": "Does this file define more functions than cl...
3
model.py
richardsun-voyager/capsule-network
import pandas as pd import osmnx import numpy as np fix = {'西湖区,杭州市,浙江省,中国': 2} city_query = [ '杭州市,浙江省,中国', ] district_query = [ '上城区,杭州市,浙江省,中国', '下城区,杭州市,浙江省,中国', '江干区,杭州市,浙江省,中国', '西湖区,杭州市,浙江省,中国', '拱墅区,杭州市,浙江省,中国', '滨江区,杭州市,浙江省,中国', ] def query_str_to_dic(query_str): result = que...
[ { "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
algorithms/02-edge-subdivision/osmnx_hz/district.py
sunmengnan/city_brain
# https://leetcode.com/problems/decode-ways/ import string import fileinput from typing import Dict class Solution: MAPPING = dict(zip(map(str, range(1, 28)), string.ascii_uppercase)) def _numDecodings(self, s: str, mem: Dict[str, int]) -> int: if s in mem: return mem[s] mem[s]...
[ { "point_num": 1, "id": "has_multiple_inheritance", "question": "Does any class in this file use multiple inheritance?", "answer": false }, { "point_num": 2, "id": "all_params_annotated", "question": "Does every function parameter in this file have a type annotation (excluding self/c...
3
leetcode/algorithms/decode-ways.py
yasserglez/programming-problems
import math from classifier import Classifier class ROIRevisitClassifier(Classifier): def __init__(self,param): super(ROIRevisitClassifier,self).__init__(param) self.last_state = False def update(self,t,obj_dict): current_object = obj_dict['fly'] if current_object is not None:...
[ { "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
nodes/roi_revisit_classifier.py
willdickson/puzzleboxes
import asyncio import traceback from typing import Awaitable, Iterable, List def run_all(awaitables: Iterable[Awaitable[None]]) -> List[asyncio.Task]: """Asynchronously runs the run_forever method of each lifetime runnable. Creates and runs an asyncio task for the run_forever method of each lifetime runn...
[ { "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
tickit/core/runner.py
dls-controls/tickit
import pandas as pd import os import matplotlib.pyplot as plt import numpy as np from datetime import datetime from sklearn.base import BaseEstimator, TransformerMixin class ColumnTransformation(BaseEstimator, TransformerMixin): '''A class to run various column transformation steps to prepare the input until I...
[ { "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
metrix_ml/utils/ColumnTransformation.py
ccp4/metrix_ml