source
string
points
list
n_points
int64
path
string
repo
string
""" Copyright 2020 The OneFlow Authors. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agr...
[ { "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
oneflow/python/test/ops/test_gelu.py
wanghongsheng01/framework_enflame
from .conf import lya_data_path class Data: def __init__(self, filename): self.filename = filename self.k, self.Pk, self.Pk_err = self.load_lya_data() def load_lya_data(self): """Load lyman-alpha data Parameters ---------- filename...
[ { "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
lya/data.py
aryanrahimieh/usc-cosmolab-hackspace
# -*- coding: UTF-8 -*- import os import sys DIR = os.path.dirname(os.path.realpath(__file__)) sys.path.insert(0, os.path.join(DIR, '../../limbo/plugins')) from help import on_message import limbo def test_basic(): hooks = {"help": {"test": "!test help system"}} server = limbo.FakeServer(hooks=hooks) ret...
[ { "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
test/test_plugins/test_help.py
fenwar/limbo
# Demonstrate the use of acceleration test import sys import os import numpy as np from fastsim import simdrive, vehicle, cycle def create_accel_cyc(length_in_seconds=300, spd_mph=89.48, grade=0.0, hz=10): """ Create a synthetic Drive Cycle for acceleration targeting. Defaults to a 15 second acceleration...
[ { "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
fastsim-2021a/fastsim/tests/accel_test.py
DIRECTLab/EVPRE
from enum import Enum from dataclasses import dataclass class TokenType(Enum): #TYPES INT = 0 FLOAT = 1 #OPERATORS PLUS = 2 MINUS = 3 DIVIDE = 4 MULTIPLY = 5 #PARENTHESES LPAREN = 6 RPAREN = 7 #SQUARE BRACKETS L_SQUAREBRACKET = 8 R_SQ...
[ { "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
tokens.py
cattoware/Math-Interpreter
import sys, inspect, re from os.path import basename, split __all__ = ['this_tests'] class RegisterTestsPerAPI: apiTestsMap = dict() @staticmethod def this_tests(testedapi): prev_frame = inspect.currentframe().f_back.f_back pathfilename, line_number, test_function_name, lines, index = ins...
[ { "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
fastai/gen_doc/doctest.py
heye0507/fastai
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.utils.translation import ugettext_lazy as _ from django_fsm import transition from .base import ShippingProvider class DefaultShippingProvider(ShippingProvider): """ Default shipping provider for items without explicit shipping. ...
[ { "point_num": 1, "id": "every_function_has_docstring", "question": "Does every function in this file have a docstring?", "answer": true }, { "point_num": 2, "id": "every_class_has_docstring", "question": "Does every class in this file have a docstring?", "answer": true }, { ...
3
shop/shipping/defaults.py
taime/django-shop
import json import logging from typing import Dict, Union, List, Optional from fastapi import APIRouter, HTTPException from pydantic import BaseModel, Field from rest_api.controller.search import PIPELINE import langid langid.set_languages(['de', 'en']) # ISO 639-1 codes router = APIRouter() logger = logging.getLogg...
[ { "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
rest_api/controller/autocomplete.py
rvenu-gop/haystack
import click import subprocess import os @click.group() def cli(): ... @cli.command() def deploy(): click.echo("Running chalice deploy") output = subprocess.check_output(f"source {os.environ['VIRTUAL_ENV']}/bin/activate && chalice deploy",shell=True) click.echo(output) click.echo(os.environ["VIRT...
[ { "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/whatsup.py
foretheta/whatsup
import math import numpy as np import vsketch class RandomFlowerSketch(vsketch.SketchClass): num_line = vsketch.Param(200, 1) point_per_line = vsketch.Param(100, 1) rdir_range = vsketch.Param(math.pi / 6) def draw(self, vsk: vsketch.Vsketch) -> None: vsk.size("a4", landscape=True) v...
[ { "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_return_types_annotated", "question": "Does every function in this file have a return type annotation?", "answe...
3
examples/random_flower/sketch_random_flower.py
hishamsajid/vsketch
#!/usr/bin/env python import sys import string import random import hashlib import re alpha = string.ascii_lowercase + string.ascii_uppercase + string.digits def rand_string(length): return ''.join([random.choice(alpha) for _ in range(length)]) def solve(prefix): while True: attempt = rand_string(5) ...
[ { "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
web/secret_note_keeper/pow-solver.py
cclauss/fbctf-2019-challenges
f1 = 1.0 dict tuple i1 = 0 s = () def func(): pass class C(object): pass def vararg_kwarg(*t, **d): t d def multi_loop(seq): x = None for x, y in seq: x def with_definition(x): with x as y: y def multi_loop_in_try(x): try: # This causes additional exception edges, ...
[ { "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
python/ql/test/library-tests/PointsTo/new/code/a_simple.py
vadi2/codeql
from typing import Optional from inan.types.blockchain_format.coin import Coin from inan.types.blockchain_format.program import Program from inan.types.blockchain_format.sized_bytes import bytes32 from inan.wallet.puzzles.load_clvm import load_clvm MOD = load_clvm("genesis-by-coin-id-with-0.clvm", package_or_requirem...
[ { "point_num": 1, "id": "all_params_annotated", "question": "Does every function parameter in this file have a type annotation (excluding self/cls)?", "answer": true }, { "point_num": 2, "id": "all_function_names_snake_case", "question": "Are all function names in this file written i...
3
inan/wallet/puzzles/genesis_by_coin_id_with_0.py
inan0812/chia-blockchain
import unittest import numpy import os import raviewer.image.image as image import raviewer.image.color_format as cf from raviewer.src.core import load_image class TestImageClass(unittest.TestCase): def setUp(self): self.TEST_FILE_BGR = os.path.join(os.path.dirname(__file__), ...
[ { "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/image_test.py
antmicro/raviewer
import numpy as np #test inputs inputs = [1, 2, 3, 2.5] weights = [[0.2, 0.8, -0.5, 1], [0.5, -0.91, 0.26, -0.5], [-0.26, -0.27, 0.17, 0.87]] biases = [2, 3, 0.5] def neuron_output(inputs, weights,bias): return sum(inputs[i] * weights[i] for i in range(len(inputs)))+ bias #this can also be done with numpy becau...
[ { "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
main.py
beetrandahiya/project-Zurich
import os import cv2 from PIL import Image import torch import mmcv import numpy as np from torch.utils.data import Dataset import torchvision.transforms as T from torchvision.datasets import ImageFolder class ImageNetDataset(Dataset): def __init__(self, data_root, test_mode=Fa...
[ { "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
mmdet/datasets/classify/imagenet.py
anorthman/mmdetection
import logging import sys from flask import Flask, request, jsonify import markov logging.basicConfig(stream=sys.stdout, level=logging.DEBUG) LOG = logging.getLogger('markov:main') app = Flask(__name__) @app.route('/gen', methods=['POST']) def generate(): params = request.json if 'dictionary' not in param...
[ { "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
markov/main.py
pepyakasoftware/zhazha
# Funcoes servem para quando tivermos coisas repetitivas poder simplificar o programa def lin(): # para definir um afuncao ela tem que ter parenteses no finalk print('=-'*30) lin() print('Bem Vindo') lin() nome = str(input('Qual seu nome? ')) lin() print(f'Tenha um otimo dia {nome}!') lin() def mensagem(msg):...
[ { "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
modulo 3/aulas/4.0 - Funcoes.py
GabrielBrotas/Python
from django.test import TestCase import datetime as dt # Create your tests here. from .models import Photos, categories, Location class LocationTestClass(TestCase): def setUp(self): self.location = Location(name = 'Nairobi') def test_instance(self): self.assertTrue(isinstance(self.location, Lo...
[ { "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
pictures/tests.py
leezichanga/gallery
import requests def get_method(): r = requests.get('https://en.wikipedia.org/wiki/Cat') print(r.status_code) print(r.headers['Content-Type']) print(r.text) # Save an image from an URL def save_image(): image = requests.get('https://imgs.xkcd.com/comics/making_progress.png') with open('/Users/m...
[ { "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
Laborator/lab01/demo.py
mihai-constantin/SPRC
from numbers import Number from typing import * import nuke from . import * class ParticleChannels_Knob(Knob): """ ParticleChannels_Knob """ def __hash__(self, ): """ Return hash(self). """ return None def __init__(self, *args, **kwargs): """ Initi...
[ { "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": true },...
3
nuke_stubs/nuke/nuke_classes/ParticleChannels_Knob.py
sisoe24/Nuke-Python-Stubs
from datetime import datetime from django.contrib.auth.models import AbstractUser from django.db import models def current_year(): return datetime.now().year class User(AbstractUser): telegram_user = models.CharField('usuario de telegram', max_length=64, blank=True) telegram_id = models.IntegerField('I...
[ { "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
users/models.py
DarkoR12/dafi-system
"""this is a migration Revision ID: 3aa95a42561c Revises: 98fef64846fe Create Date: 2021-10-04 10:49:46.832296 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = "3aa95a42561c" down_revision = "98fef64846fe" 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/3aa95a42561c_this_is_a_migration.py
rice0208/Flog
# python3 """ Task: Count the number of inversions of a given sequence """ def merge(left, right): i, j, inversion_counter = 0, 0, 0 final = list() while i < len(left) and j< len(right): if left[i] <= right[j]: final.append(left[i]) i += 1 else: final.ap...
[ { "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
4.4 inversions.py
syeddabeer/Algorithms-Datastructures
from typing import Any from .config_base import ConfigBase class ConfigDict(ConfigBase): def __init__(self, data): # type: (dict) -> None self.__conf = data def get(self, key): # type: (str) -> Any return self.__conf.get(key)
[ { "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
confobj/config_dict.py
datasets-org/config
#!/usr/bin/env python # -*- coding: utf-8 -*- from runner.koan import * import random class DiceSet: def __init__(self): self._values = None @property def values(self): return self._values def roll(self, n): # Needs implementing! # Tip: random.randint(min, max) can ...
[ { "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
python3/koans/about_dice_project.py
benrki/python_koans
# -*- coding: utf-8 -*- from __future__ import division, print_function import numpy as np __all__ = ["Move"] class Move(object): def tune(self, state, accepted): pass def update(self, old_state, new_state, accepted, subset=None): ...
[ { "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
my_emcee/moves/move.py
s-ilic/emcee
import dash from dash.dependencies import Input, Output from dash.exceptions import PreventUpdate import dash_core_components as dcc import dash_html_components as html import flask import time def test_llgo001_location_logout(dash_dcc): app = dash.Dash(__name__) @app.server.route("/_logout", methods=["POST"...
[ { "point_num": 1, "id": "any_function_over_40_lines", "question": "Is any function in this file longer than 40 lines?", "answer": true }, { "point_num": 2, "id": "all_function_names_snake_case", "question": "Are all function names in this file written in snake_case?", "answer": t...
3
tests/integration/location/test_location_logout.py
Joeyt1008/dash-core-components
from sanic import Blueprint from sanic.response import json from sanic_openapi import doc from ..model.database import User from ..service.auth_helper import Auth from ..util.dto import AuthDto, json_response from ..util.response import response_message, USER_NOT_EXIST, SUCCESS user_auth = AuthDto.user_auth bp = Blu...
[ { "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
webserver/app/main/controller/auth_controller.py
pansila/Auto-Test-System
# External Libraries from essentia.standard import FFT, IFFT import numpy as np # IzunaDSP from izunadsp import DSPPart, AudioSequence class ApplyEQ(DSPPart): def __init__(self): super().__init__() self._eq = np.array([1]) self.eq = [1] self.fft = FFT() self.ifft = IFFT() ...
[ { "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
izunadsp/parts/apply_eq.py
keyboardbear/IzunaDSP
from nelpy.utils import PrettyDuration class TestPrettyDuration: def test_1(self): t = PrettyDuration(180) assert str(t) == '3:00 minutes' def test_2(self): t = PrettyDuration(179.999999) assert str(t) == '3:00 minutes' def test_3(self): t = PrettyDur...
[ { "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
tests/test_PrettyDuration.py
ryanharvey1/nelpy
from testcontainers.core.container import DockerContainer from testcontainers.core.waiting_utils import wait_container_is_ready from requests import get, post, Response import os class RabbitMQContainer(DockerContainer): def __init__(self, image="rabbitmq:3.7.17-management"): super(RabbitMQContainer, 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
testcontainer_python_rabbitmq/rabbitmq.py
Serviceware/testcontainer-python-rabbitmq
# # Created on Sun Dec 12 2021 # # The MIT License (MIT) # Copyright (c) 2021 Maatuq # # 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 ri...
[ { "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
DynamicProgramming/CommonPatterns/word_break.py
mamoudmatook/Leetcode
# python3 from collections import namedtuple from sys import stdin from typing import List from unittest import TestCase test = namedtuple('test', 'seq_a seq_b seq_c expected') def lcs3(seq_a: List[int], seq_b: List[int], seq_c: List[int]) -> int: m, n, o = len(seq_a) + 1, len(seq_b) + 1, len(seq_c) + 1 tab...
[ { "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
coursera/algorithmic-toolbox/week-5/dynamic-programming/5_longest_common_subsequence_of_three_sequences/solution.py
kamilsk/algo
from django.test import TestCase from django.core.files.uploadedfile import SimpleUploadedFile from simpleApi.models import Teacher, Student, Gradeable class TeacherTestCase(TestCase): def setUp(self): s = Student.objects.create(username="student1", password="student", first_name="student") Teacher...
[ { "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
school/simpleApi/tests.py
kiarashplusplus/PaperPileSchool
#!/usr/bin/env python3 # Copyright (c) Meta Platforms, Inc. and affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. import json from argparse import ArgumentParser, Namespace from idb.cli import ClientCommand from idb.common.types i...
[ { "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
idb/cli/commands/dsym.py
asafkorem/idb
def open_input(): with open("input.txt") as fd: array = fd.read().splitlines() array = list(map(int, array)) return array def part_one(array): lenght = len(array) increased = 0 for i in range(0, lenght - 1): if array[i] < array[i + 1]: increased += 1 print("part...
[ { "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
day01_Sonar_Sweep/day01.py
anolivei/advent_of_code_2021
import pymysql from database import db import asyncio import aiomysql class local_mysql(): def __init__(self): self.host = db['host'] self.user = db['user'] self.password = db['password'] self.database = db['database'] self.db = pymysql.connect(self.host, self.user, self.pa...
[ { "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
local_mysql.py
wjhtime/region_spider
def leiaint(n): while True: try: n = int(input(n)) except(ValueError, TypeError): print('ERRO: Informe um valor inteiro valido!') continue else: return n def leiafloat(n): while True: try: n = float(input(n)) e...
[ { "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
ex113.py
thiagobachiega/python
# Clase 20. Curso Píldoras Informáticas. # Control de Flujo. Generadores 2. # Instrucción yield from: simplifica el código para bucles anidados. # El asterisco es un número indeterminado de elementos dados en forma de tupla. def Cities(*ciudades): for i in ciudades: yield i Ciudades = Cities("Madri...
[ { "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
Python_PI/Clase20.py
Alex8Navas/PythonPI
"""Representation of a WeMo Motion device.""" from .api.long_press import LongPressMixin from .switch import Switch class LightSwitch(Switch, LongPressMixin): """Representation of a WeMo Motion device.""" def __repr__(self): """Return a string representation of the device.""" return '<WeMo Li...
[ { "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
pywemo/ouimeaux_device/lightswitch.py
esev/pywemo
# Copyright 2021 Research Institute of Systems Planning, 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 applica...
[ { "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
ros2caret/verb/message_flow.py
tier4/ros2caret
from model import features as f import pymongo import time from datetime import datetime client = pymongo.MongoClient() db = client['cryptobot'] books_db = db['btcc_btccny_books'] def append_df_to_csv(df, csvFilePath, sep=","): import os if not os.path.isfile(csvFilePath): df.to_csv(csvFilePath, mode=...
[ { "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
app/create_live_features.py
ajit2688/crypto
import unittest import json import requests from pystexchapi.response import StockExchangeResponseParser, APIResponse from pystexchapi.exc import APIDataException, APIResponseParsingException from tests import TICKER_RESPONSE, GENERIC_ERROR_RESPONSE def raise_value_error(): raise ValueError() class TestStockEx...
[ { "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_response.py
Vlsarro/pystexchapi
from conans.model.conan_file import ConanFile from conans import CMake import os #This easily allows to copy the package in other user or channel channel = os.getenv("CONAN_CHANNEL", "testing") username = os.getenv("CONAN_USERNAME", "sunside") class DefaultNameConan(ConanFile): name = "DefaultName" version = ...
[ { "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_package/conanfile.py
sunsided/lmdb-conan
import aioredis import pytest from aioredis import Redis @pytest.fixture async def redis_connection_string(request, worker_id): base_connection_string = request.config.getoption("redis_connection_string") number = 0 if worker_id == "master" else int(worker_id[2:]) return f"{base_connection_string}/{numbe...
[ { "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
tests/fixtures/redis.py
ReeceHoffmann/virtool
from .. import testing class DoubleMinusTest(testing.FunctionalTestCase): filename = "double_minus.xlsx" def test_evaluation_double_unary_A_eq_B(self): excel_value = self.evaluator.get_cell_value('Sheet1!A1') value = self.evaluator.evaluate('Sheet1!A1') self.assertEqual(excel_value, v...
[ { "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/xlfunctions_vs_excel/double_minus_test.py
ckp95/xlcalculator
from flask_restful import abort, Resource from flask import request, g, session from flask.json import jsonify from whistle_server.models.user import User def verify_password(password, hashed): from werkzeug.security import check_password_hash return check_password_hash(hashed, password) class LoginEndpoint(R...
[ { "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
server/whistle_server/endpoints/login.py
Sailer43/Whistle
import pytest import pandas as pd from sklearn.model_selection import train_test_split TEST_SIZE = 0.33 RANDOM_STATE = 42 @pytest.fixture(scope="module") def binary_dataset(): df = pd.read_csv("./resources/heart.csv") features = df.iloc[0:, :-1] labels = df.iloc[0:, -1].values.ravel() X_train, X_tes...
[ { "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
tests/svm/conftest.py
mdietrichstein/skpredict
#!/usr/bin/env python from __future__ import print_function import os import re import codecs from setuptools import setup, find_packages def read(*parts): filename = os.path.join(os.path.dirname(__file__), *parts) with codecs.open(filename, encoding="utf-8") as fp: return fp.read() def find_vers...
[ { "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
setup.py
okfde/froide-fax
import graphene from graphene_django.types import DjangoObjectType from tiveU.news.models import News from tiveU.helpers import paginate_data class NewsType(DjangoObjectType): """DjangoObjectType to acces the News model.""" count_thread = graphene.Int() count_likers = graphene.Int() class Meta: ...
[ { "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_class_has_docstring", "question": "Does every class in this file have a docstring?"...
3
tiveU/news/schema.py
rds0751/newtiveu
""" Unit test for the data check endpoint """ # Import from libraries import json # Import from internal modules from cornflow.models import ExecutionModel, InstanceModel from cornflow.tests.const import ( INSTANCE_PATH, EXECUTION_PATH, EXECUTION_URL_NORUN, DATA_CHECK_URL_NORUN, INSTANCE_URL, ) fr...
[ { "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
cornflow-server/cornflow/tests/unit/test_data_checks.py
ggsdc/corn
import os import logging import matplotlib.pyplot as plt logger = logging.getLogger(__name__) path = os.path.dirname(os.path.realpath(__file__)) path = os.path.join(path, 'Data') COLORTEFF_PATH = os.path.join(path, 'ColorTeff') MODATM_PATH = os.path.join(path, 'ModelAtmospheres') ISOCHRONES_PATH = ...
[ { "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": true...
3
config.py
LucaMalavolta/q2
from bottle import route, run import RPi.GPIO as GPIO host = '192.168.1.8' GPIO.setmode(GPIO.BCM) led_pins = [18, 23, 24] led_states = [0, 0, 0] switch_pin = 25 GPIO.setup(led_pins[0], GPIO.OUT) GPIO.setup(led_pins[1], GPIO.OUT) GPIO.setup(led_pins[2], GPIO.OUT) GPIO.setup(switch_pin, GPIO.IN, pull_up_down=GPIO.PUD_...
[ { "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
web_control.py
czzz0813/raspberrypi_cookbook_ed2
import gd from starlette.requests import Request from starlette.responses import JSONResponse, RedirectResponse from starlette.routing import Mount, Route from gdrest.levels.level import Level from auth import auth_client async def get_level(request: Request): client = auth_client(request.user) lid: int = re...
[ { "point_num": 1, "id": "all_params_annotated", "question": "Does every function parameter in this file have a type annotation (excluding self/cls)?", "answer": true }, { "point_num": 2, "id": "no_function_exceeds_5_params", "question": "Does every function in this file take 5 or few...
3
gdrest/levels/routes.py
Silverflower67/GDRest
# Generated file, please do not change!!! import typing from ...models.error import ErrorResponse from ...models.shipping_method import ShippingMethodPagedQueryResponse if typing.TYPE_CHECKING: from ...base_client import BaseClient class ByProjectKeyShippingMethodsMatchingCartRequestBuilder: _client: "Base...
[ { "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
src/commercetools/platform/client/matching_cart/by_project_key_shipping_methods_matching_cart_request_builder.py
lime-green/commercetools-python-sdk
# Copyright 2014 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. from telemetry.page import page as page_module from telemetry.page import page_set as page_set_module class IntlJaZhPage(page_module.Page): def __init__(...
[ { "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": "has_multiple_inheritance", "question": "Does any class in this file use multiple inheritance?", "answer": fals...
3
tools/perf/page_sets/intl_ja_zh.py
kjthegod/chromium
"""HTTP host header exceptions.""" from starlette import status class HTTPHostHeaderError(Exception): """Generic HTTP host header error.""" pass class HTTPHostHeaderDomainInvalidError(HTTPHostHeaderError): """Domain in HTTP host header is invalid.""" def __init__(self) -> None: """Set att...
[ { "point_num": 1, "id": "every_function_has_docstring", "question": "Does every function in this file have a docstring?", "answer": true }, { "point_num": 2, "id": "more_functions_than_classes", "question": "Does this file define more functions than classes?", "answer": false }...
4
fast_redirect/exceptions/http_host_header.py
CyberfusionNL/Fast-Redirect
import time import json import requests import urllib3 from random import randint from bs4 import BeautifulSoup from threading import Thread urllib3.disable_warnings() BASE_URL = "https://jobs.ksl.com/search/posted/last-7-days" HEADERS = { "User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_5) AppleWebKit/...
[ { "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": "no_function_exceeds_5_params", "question": "Does every function in this file take 5 or fewer parameters (excl...
3
src/ksl.py
adnan007d/scraping-jobs-for-alex
# pylint: disable=redefined-outer-name import pytest from unittest.mock import Mock from bentoml.adapters import DefaultOutput from bentoml.service import InferenceAPI @pytest.fixture(params=(True, False)) def batch_mode(request): return request.param @pytest.fixture() def make_api(batch_mode): service_m...
[ { "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
tests/adapters/conftest.py
henrywu2019/BentoML
from PyQt6.QtWidgets import * from example_window import Ui_MainWindow from colorpicker import ColorPicker # Basic Window class using QtDesigner & pyuic5 class My_Window(QMainWindow): def __init__(self, *args, **kwargs): super(My_Window, self).__init__(*args, **kwargs) # set up your custom UI...
[ { "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_multiple_inheritance", "question": "Does any class in this file use multiple inheritance?", "answer":...
3
PyQt6/example.py
avazevfx/pyqt-colorpicker-widget
# A script to update the version in config files. import sys import re vers = sys.argv[1] def helper(filename: str, startswith: str, quotes: bool): data = "" with open(filename) as f: for line in f.readlines(): if line.startswith(startswith): vers2 = f'"{vers}"' if quotes e...
[ { "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
update_version.py
yawara/pyflow
""" Test file for database methods written in db.py All test methods must receive client as an argument, otherwise the database variable won't be configured correctly """ from mflix.db import add_comment, update_comment, delete_comment, get_movie from mflix.api.user import User from pymongo.results import InsertOneRes...
[ { "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
M220P - MongoDB for Python Developers/Files/tests/test_create_update_comments.py
ReynerGonzalez/mongodb-university-course
from pandas import read_csv from IPython.display import display import numpy as np import sys import math ############################### ####Maria Eugenia Lopez ##### ############################### def fully_grown_depuration(number_to_remove=0.50): return plants.loc[plants.height_m > number_to_remove] def con...
[ { "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
Assignment/Environmental_Project/part_A.py
Maruja/Maruja-ILAS-Python
"""Add comments table Revision ID: 83dce15c3d36 Revises: 75844bac4c9d Create Date: 2019-06-10 15:23:11.647466 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = '83dce15c3d36' down_revision = '75844bac4c9d' 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/83dce15c3d36_add_comments_table.py
apwao/blog
import os from glob import glob from setuptools import setup, find_packages def read(fname): with open(os.path.join(os.path.dirname(__file__), fname)) as f: return f.read() def recursive_include(module): module_path = module.replace(".", "/") + "/" files = glob(f"{module_path}**", recursive=True...
[ { "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_return_types_annotated", "question": "Does every function in this file have a return type annotation?", "answe...
3
setup.py
timgates42/kivy-ios
__author__ = '1' from model.project import Project import pytest import random import string def random_string(prefix, maxlen): symbols = string.ascii_letters + string.digits + string.punctuation + " "*10 return prefix + "".join([random.choice(symbols) for i in range(random.randrange(maxlen))]) testdata =[ ...
[ { "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
test/test_add_project.py
liliasapurina/python_training_mantiss
from abc import ABC, abstractmethod from django import forms from django.core.management import BaseCommand class AdminCommand(BaseCommand, ABC): name = None template = "admintool_command/command.html" class Form(forms.Form): pass def init_context(self, request=None, **kwargs): retu...
[ { "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
build/lib/admintool_command/command.py
jayvdb/django-admintool-command
"""Add user table Revision ID: 3b121603bb7c Revises: Create Date: 2020-07-20 16:52:16.928316 """ from alembic import op import sqlalchemy as sa from sqlalchemy.schema import Sequence, CreateSequence, DropSequence # revision identifiers, used by Alembic. revision = '3b121603bb7c' down_revision = None branch_labels ...
[ { "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
server/alembic/versions/3b121603bb7c_add_user_table.py
josenava/meal-calendar
# 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_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
tests/stats_logger_tests.py
Manikantan22/incubator-superset
import json import pymysql import argparse def InsertToMySQL(conn, record): cursor = conn.cursor() cursor.execute( "INSERT business values (%s,%s,%s,%s,%s,%s,%s,%s,%s,%s)", [record['business_id'],record['name'].encode('utf-8'),record['full_address'].encode('utf-8'),record['city'].encode('utf-8'),reco...
[ { "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
datascripts/load_business.py
zhewang/RestaurantHunter
# -*- coding: utf-8 -*- ''' Use `Varstack <https://github.com/conversis/varstack>`_ data as a Pillar source Configuring Varstack ==================== Using varstack in Salt is fairly simple. Just put the following into the config file of your master: .. code-block:: yaml ext_pillar: - varstack: /etc/varst...
[ { "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
salt/pillar/varstack_pillar.py
preoctopus/salt
#!/usr/bin/env python # -*- coding: utf-8 -*- import os from google.appengine.ext import webapp from google.appengine.ext.webapp import util import wsgiref.handlers from google.appengine.ext.webapp import template import handler def create_app(debug=True): return webapp.WSGIApplication( [ ('/'...
[ { "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
main.py
akiraak/gae-twitter-bot
from autoPyTorch.utils.config.config_option import ConfigOption, to_bool from autoPyTorch.utils.config.config_file_parser import ConfigFileParser from autoPyTorch.pipeline.base.pipeline_node import PipelineNode class SetAutoNetConfig(PipelineNode): def fit(self, pipeline_config, autonet, autonet_config_file, dat...
[ { "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
autoPyTorch/utils/benchmarking/benchmark_pipeline/set_autonet_config.py
thomascherickal/Auto-PyTorch
def turn_right(): turn_left() turn_left() turn_left() def jump(): turn_left() while wall_on_right(): move() turn_right() move() turn_right() while front_is_clear(): move() turn_left() while not at_goal(): if wall_in_front(): jump() else: ...
[ { "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
Courses/100 Days of Code The Complete Python Pro Bootcamp/Day 6/Hurdle 4.py
edaaydinea/365-days-of-coding-challenge
import threading import time class PyMbsThread(threading.Thread): def __init__(self, function, realTime=False): threading.Thread.__init__(self) self.execute = False self.function = function self.realTime = realTime self.scaling = 1 # Start-Time (Model) self...
[ { "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
pymbs/ui/thread.py
brutzl/pymbs
# Copyright 2008-2015 Nokia Networks # Copyright 2016- Robot Framework Foundation # # 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 ...
[ { "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
src/robot/version.py
KenzK/robotframework
from django.contrib import admin # Register your models here. from .models import OAuthUser, OAuthConfig from django.urls import reverse from django.utils.html import format_html import logging logger = logging.getLogger(__name__) class OAuthUserAdmin(admin.ModelAdmin): search_fields = ('nikename', 'email') ...
[ { "point_num": 1, "id": "every_class_has_docstring", "question": "Does every class 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": true...
3
oauth/admin.py
qq605085370/DjangoBlog
import re import operator def f_and(*args): for i in args: if not i: return False return True def f_or(*args): for i in args: if i: return True return False def f_like(s, p): p = '^{}$'.format(p.replace('%', '[\s\S]*')) return re.match(p, s) is not ...
[ { "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
mindsdb/api/mysql/mysql_proxy/classes/com_operators.py
yarenty/mindsdb
# Copyright 2019-2020 Not Just A Toy Corp. # # 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": "all_return_types_annotated", "question": "Does every function in this file have a return type annotation?", "answer"...
3
falcon_heavy/core/types/errors.py
NotJustAToy/falcon-heavy
from parallelm.components import ConnectableComponent from parallelm.mlops import mlops class StringSink(ConnectableComponent): def __init__(self, engine): super(self.__class__, self).__init__(engine) def _materialize(self, parent_data_objs, user_data): expected_str_value = self._params.get(...
[ { "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
reflex-algos/components/Python/string-sink/string_sink.py
mlpiper/mlpiper
import itertools def analyseLine(l): x = l.split() amount = (int(x[3]) * -1) if (x[2] == 'lose') else int(x[3]) return(x[0], amount, x[-1].replace('.', '')) def getPairs(names): names = list(names) names.append(names[0]) r = [] for i in range(len(names) - 1): r.append((names[i], names[i+1])) r.append((nam...
[ { "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
13/solution.py
studiosi/AoC2015
_backendsNames = ("bouncyCastle", "pgpy") from pathlib import Path from os.path import expanduser from enum import IntFlag from abc import ABC, abstractmethod keyringPath = Path(expanduser("~/.gnupg/pubring.kbx")) class SecurityIssues(IntFlag): OK = 0 wrongSig = (1 << 0) expired = (1 << 1) disabled = (1 << 2) r...
[ { "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
OpenPGPAbs/gpgBackends/__init__.py
KOLANICH/OpenPGPAbs
import re import shutil import os class FileRenamer: def __init__(self, text): self.text = text self.processed = self.text def reset(self): self.processed = self.text def replace_tag(self, tag, value): if value is None: value = '' pattern = re.compile(...
[ { "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
discogstagger/renamer.py
makzyt4/discogs-tagger
#! /usr/bin/python3 import os import sys import argparse import time import signal from ivy.std_api import * import logging PPRZ_HOME = os.getenv("PAPARAZZI_HOME", os.path.normpath(os.path.join(os.path.dirname(os.path.abspath(__file__)), '../../../'))) sys.path.append(PPRZ_HOME + "/var/lib/python") from pprzlink.iv...
[ { "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
tests/pprzlink01.py
pnarvor/nephelae_paparazzi
from django.contrib.auth import get_user_model, authenticate from django.utils.translation import ugettext_lazy as _ from rest_framework import serializers class UserSerializer(serializers.ModelSerializer): '''Serializer for the users object''' class Meta: model = get_user_model() fields = ('email', 'password',...
[ { "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
app/user/serializers.py
antoanish/recipe-app-api
import math import random import torch class KMeans: """Test""" def __init__(self, k: int, distance_fn=None, dim_size: int = 2, nstart: int = 2): # TODO use nstart assert distance_fn is not None, "please provide a distance function" self._params = torch.empty(k, dim_size, dtype=torc...
[ { "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
fastface/utils/cluster.py
mdornseif/fastface
from glove_tf_21.utils.file_utils import save_labels import numpy as np import os def test_cooc_count(preprocessing_glove, ix_sequences_full, cooc_dict): output_cooc = dict() for ix_seq in ix_sequences_full: output_cooc = preprocessing_glove.cooc_count(output_cooc, ix_seq) assert len(output_cooc...
[ { "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
tests/test_preprocessing_glove.py
bbreton3/glove_tf_21
class Solution: def fib(self, n: int) -> int: memo = {} def inner(n: int) -> int: if n == 0: return 0 if n == 1: return 1 if n in memo: return memo[n] else: val = inner(n - 1) + inner(n - 2) ...
[ { "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_under_20_lines", "question": "Is every function in this file shorter than 20 lines?", "...
3
T509_Fib.py
zoubohao/LeetCodes
# Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
[ { "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
lite/tests/unittest_py/op/backends/x86/test_gelu_op.py
laiou/Paddle-Lite
import os import pymongo from pymongo import MongoClient from dotenv import load_dotenv from pprint import pprint load_dotenv() CONNECT_URL = os.getenv("CONNECT_URL") cluster = MongoClient(CONNECT_URL) ''' db = cluster.ctox serverStatusResult = db.command("serverStatus") pprint(serverStatusResult) ''' db = cluster["...
[ { "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
database.py
c-arvind/Valo-discord.py
# Copyright 2014 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. # pylint: disable=W0212 import os import sys import unittest sys.path.append(os.path.join(os.path.dirname(__file__), '..', '..')) from devil.android 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_has_docstring", "question": "Does every function in this file have a docstring?", "answer": false }...
3
platform-tools/systrace/catapult/devil/devil/android/perf/perf_control_devicetest.py
NBPS-Robotics/FTC-Code-Team-9987---2022
from github import Github import os class GithubSingleton: __instance = None @staticmethod def get(): """ Static access method. """ if GithubSingleton.__instance is None: GithubSingleton() return GithubSingleton.__instance def __init__(self): """ Virtually...
[ { "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
backend/core/github_utils.py
SiddharthSham/flowie
# Copyright (C) 2018 Henrique Pereira Coutada Miranda # All rights reserved. # # This file is part of phononwebsite # from __future__ import print_function import unittest import os from phononweb.phonondb import PhononDB2015 class TestPhononDB2015(unittest.TestCase): def test_phonondb_2015(self): pdb = Ph...
[ { "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
phononweb/tests/test_phonondb.py
ttadano/phononwebsite
from .._toolchain.yosys import * from . import rtlil __all__ = ["YosysError", "convert", "convert_fragment"] def _convert_rtlil_text(rtlil_text, black_boxes, *, src_loc_at=0): if black_boxes is not None: if not isinstance(black_boxes, dict): raise TypeError("CXXRTL black boxes must be a dict...
[ { "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
nmigen/back/cxxrtl.py
jeanthom/nmigen
"""Clean Code in Python - Chapter 3: General Traits of Good Code """ import unittest from unittest.mock import Mock, patch from exceptions_1 import DataTransport, Event class FailsAfterNTimes: def __init__(self, n_times: int, with_exception) -> None: self._remaining_failures = n_times self._exc...
[ { "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
books/PythonCleanCode/ch3_good_code/test_exceptions_1.py
zeroam/TIL
#!/usr/bin/env python3 from copy import deepcopy class Vector2D: def __init__(self, x, y): self.x = x self.y = y def __truediv__(self, other): answer = deepcopy(self) answer.x = self.x / other answer.y = self.y / other return answer def __sub__(...
[ { "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
world_creator/data_structures.py
lilSpeedwagon/zaWRka-project
import unittest import solution_one import solution_two class MyTestCase(unittest.TestCase): def test_solution_one(self): self.assertEqual(solution_one.velocity("input_demo.txt"), 198) self.assertEqual(solution_one.velocity("input.txt"), 845186) def test_solution_two(self): self.asse...
[ { "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
year_2021/day_03_binary_diagnostic/tests.py
aleattene/advent-of-code-2021
r""" Basic tests of RCA1 algorithm in :class:`multidim.PointCloud` Copyright --------- - This file is part of https://github.com/geomdata/gda-public/ - 2015, 2016, 2017 by Geometric Data Analytics, Inc. (http://geomdata.com) - AGPL license. See `LICENSE` or https://github.com/geomdata/gda-public/blob/master/LICENSE...
[ { "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
gda-public/multidim/test_rca1.py
drkostas/tda_examples
from raytkUtil import ROPInfo, InputInfo # noinspection PyUnreachableCode if False: # noinspection PyUnresolvedReferences from _stubs import * from _typeAliases import * class _InspectorCorePars(ParCollection): Hastarget: 'BoolParamT' Definitiontable: 'DatParamT' Targetcomp: 'CompParamT' ipar.inspectorCore...
[ { "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": false...
3
devel/toolkitEditor/ropEditor/inputsPanel/inputsPanel.py
t3kt/raytk