source
string
points
list
n_points
int64
path
string
repo
string
#pylint: disable=missing-module-docstring,missing-function-docstring,missing-class-docstring,no-self-use,too-few-public-methods def first(): # First should be defined after second, too keep call order pass def second(): first() class Example: def first(self): # First should be defined after second, to...
[ { "point_num": 1, "id": "more_functions_than_classes", "question": "Does this file define more functions than classes?", "answer": true }, { "point_num": 2, "id": "every_function_under_20_lines", "question": "Is every function in this file shorter than 20 lines?", "answer": true ...
3
examples/example_function_order.py
leandroltavares/pylint-plus
import sys def convert(x): return 1 if x == "H" else 0 a, b = sys.stdin.readline().split() a = convert(a) b = convert(b) def main(): ans = "D" if a ^ b else "H" print(ans) if __name__ == "__main__": main()
[ { "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
jp.atcoder/abc056/abc056_a/11363140.py
kagemeka/atcoder-submissions
# # Testing DataSet # # Launch it by issuing: # python3 -m unittest test_dataset -v # import os, sys; sys.path.append(os.path.dirname(os.path.realpath(__file__))) import unittest from schema import ( Schema, #SchemaError, #Use, ) from dataset import DataSetRAM from . import app, log, create_app # creat...
[ { "point_num": 1, "id": "more_functions_than_classes", "question": "Does this file define more functions than classes?", "answer": true }, { "point_num": 2, "id": "every_function_under_20_lines", "question": "Is every function in this file shorter than 20 lines?", "answer": false...
3
05.pagination/farm/app/test_dataset.py
asokolsky/RESTing-with-Flask
VAR_ASSEM = \ """ # place address of {N}th local variable into {destreg} movq %rdi, {destreg} imulq $4, {destreg}, {destreg} addq $16, {destreg} imulq ${N}, {destreg}, {destreg} subq %rbp, {destreg} negq {destreg} andq $-16, {destreg} """ REGISTERS = ["%rdi", "%rsi", "%rdx", "%rcx", "%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": "no_function_exceeds_5_params", "question": "Does every function in this file take 5 or fewer parameters (exclu...
3
varparam.py
lamhacker/VPL-Compiler
""" Reads a file and returns the number of lines, words, and characters - similar to the UNIX wc utility """ from re import sub class TextAnilize: def __init__(self, **qwargs): self._file = 'file' in qwargs and qwargs['file'] or 'file' self._text = 'text' in qwargs and qwargs['text'] or '' ...
[ { "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
way/python/useful_py/funcs_py/py_wc.py
only-romano/junkyard
from sympy.utilities.pytest import raises from ignition.utils.iterators import (flatten, flatten_list, nested_list_idxs, UpdatingPermutationIterator) def test_flatten(): assert(flatten([0, [1, [2, 3], [4, [5, [6, 7]]]], 8]) == range(9)) assert(flatten([0, (1, 2), [3, 4]]...
[ { "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
ignition/utils/tests/test_iterators.py
IgnitionProject/ignition
import pytest from app.db import model, session_ctx from app.util import exceptions from app.server.routes import routes from app.server.requestutils import * import flask import flask.testing def test_pubsubify_excs(fake_import: model.Import, client_with_modifiable_routes: flask.testing.FlaskClient): client = ...
[ { "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
app/tests/test_requestutils.py
broadinstitute/import-service
# Date: 10/21/2017 # Author: Ethical-H4CK3R # Description: Pings Every Bot import time import socket import threading from Queue import Queue class Ping(object): ''' Disconnects dead connecetions ''' def __init__(self): self.dead = Queue() def connection(self, bot): try:bot.session.recv(1) except socket...
[ { "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
core/ping.py
johndemlon/c-and-c-server
import numpy as np import matplotlib.pyplot as plt import math import lidar_to_grid_map as lg from grid_mapping_for_a_star import OccupancyGridMap from a_star_for_ogm_testing import a_star f = "mesures.txt" def read_measures(file): measures = [line.split(",") for line in open(file)] angles = [] distances ...
[ { "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
Code/Mapping/ultrasound_mapping.py
XavierValParejo/SeedBot
""" Created by adam on 5/19/18 """ __author__ = 'adam' import json import xml.etree.ElementTree as ET import requests import environment def load_credentials_file( filepath=environment.SLACK_CREDENTIAL_FILE ): """ Opens the credentials file and loads the attributes """ return ET.parse( filepath ) ...
[ { "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
CommonTools/Loggers/SlackNotifications.py
AdamSwenson/TwitterProject
import numpy as np import pywt def damp_coefficient(coeff, sigma): """Filter DWT coefficients by performing an FFT and applying a Gaussian kernel. """ fft_coeff = np.fft.fft(coeff, axis=0) fft_coeff = np.fft.fftshift(fft_coeff, axes=[0]) ydim, _ = fft_coeff.shape gauss1d = 1 - np.exp(-np....
[ { "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
rmstripes/stripes.py
DHI-GRAS/rmstripes
import numpy as np import pickle import time from autogluon.core.space import Real from autogluon.core.scheduler import LocalSequentialScheduler def test_local_sequential_scheduler(): search_space = dict( lr=Real(1e-3, 1e-2, log=True), wd=Real(1e-3, 1e-2), epochs=10, ) def train_f...
[ { "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
core/tests/unittests/scheduler/test_scheduler.py
daobook/autogluon
# -*- encoding: utf-8 -*- import os from argparse import FileType from django.core.management import BaseCommand from ewaluacja2021.reports import load_data, rekordy from ewaluacja2021.util import autor2fn from ewaluacja2021.xlsy import AutorskiXLSX, CalosciowyXLSX from bpp.models import Autor from bpp.util import p...
[ { "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/ewaluacja2021/management/commands/raport_3n_to_xlsx.py
iplweb/bpp
import chainer from src.function.reshape import flatten from src.function.activation import relu from src.link.convolution_2d import Convolution2D from src.link.linear import Linear from src.link.last_linear import LastLinear class OuterPolytope(chainer.Chain): """Convolutional network with ReLU. We followed ...
[ { "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
src/model/outer_polytope.py
ytsmiling/lmt
import numpy as np import albumentations.augmentations.functional as af from albumentations.core.transforms_interface import DualTransform from allencv.data.transforms import _ImageTransformWrapper, ImageTransform class CourtKeypointFlip(DualTransform): """Flip the input horizontally around the y-axis. Arg...
[ { "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
deeptennis/data/transforms.py
sethah/deeptennis
from os import getenv from typing import Optional, Dict from flask import Flask TestConfig = Optional[Dict[str, bool]] def create_app(test_config: TestConfig = None) -> Flask: """ App factory method to initialize the application with given configuration """ app: Flask = Flask(__name__) if test_config ...
[ { "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_return_types_annotated", "question": "Does every function in this file have a return type annotation?", "a...
3
my_hello_world_app/web_api/router.py
gsjay980/data-science-IP
from typing import List from pyrep.backend import sim from pyrep.const import ObjectType from pyrep.objects.force_sensor import ForceSensor from pyrep.objects.object import Object from pyrep.objects.shape import Shape class Accelerometer(Object): """An object able to measure accelerations that are applied to it....
[ { "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
pyrep/sensors/accelerometer.py
WeiWeic6222848/PyRep
from dataset.electric_dataloader import ElectricDataloader from dataset.preprocessor import Preprocessor class WrappedDataloader: def __init__(self, dataloader, func): self.dataloader = dataloader self.func = func def __len__(self): return len(self.dataloader) def __iter__(self):...
[ { "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
dataset/wrapped_dataloader.py
Aquarium1222/Electricity-Forecasting
import sys from flask import Flask, render_template, jsonify, redirect import pymongo import scrape_mars sys.setrecursionlimit(2000) app = Flask(__name__) client = pymongo.MongoClient() db = client.mars_db collection = db.mars_facts @app.route('/scrape') def scrape(): # db.collection.remove() mars = scrape_...
[ { "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
app.py
rw576/web-scraping-challenge
#!/usr/bin/env python3 import sys, os, time, threading, signal import bot class Watcher(object): # Cf. http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/496735 def __init__(self): self.child = os.fork() if self.child != 0: self.watch() def watch(self): try: os.wai...
[ { "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
__init__.py
wolfy1339/Kenni
import argparse import mir3.data.score as score import mir3.module class Score2Label(mir3.module.Module): def get_help(self): return """convert the internal score representation to the 3 column text""" def build_arguments(self, parser): parser.add_argument('infile', type=argpar...
[ { "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
mir3/modules/tool/score2label.py
pymir3/pymir3
''' Class Name: File Purpose: The purpose of this class is represent data of a particular file in a file system. ''' class File: def __init__(self, name = None, directory = None, date = None, fId = None, folderId = None, extension = ""): self.__name = name self.__directory = directory self.__date = date ...
[ { "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
scripts/File.py
tanvirtin/Cloud-Backup
import yaml import os from abc import ABC, abstractmethod from pathlib import Path from klarify.Parser import YamlParser class Kustomizer(ABC): @abstractmethod def __init__(self): pass @abstractmethod def addDir(self, dir: str): pass @abstractmethod def generateKustomization...
[ { "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/klarify/Kustomizer.py
thetalorian/klarify
import unittest from config import Config from diploma import create_app, db from diploma.models import User class TestConfig(Config): TESTING = True SQLALCHEMY_DATABASE_URI = 'sqlite://' class UserModelCase(unittest.TestCase): def setUp(self): self.app = create_app(TestConfig) self.app...
[ { "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
tests.py
besmertn/diploma
"""Helper functions for using BeautifulSoup to work with FoLiA XML files. """ from bs4 import BeautifulSoup, Tag, NavigableString def tag_or_string(tag): """Depending on the type of the input, print the tag name (for Tags) or string (for NavigableStrings). Is used to print parts of the xml file that were...
[ { "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
embem/emotools/bs4_helpers.py
NLeSC/embodied-emotions-scripts
from flask import render_template from .import main @main.app_errorhandler(404) #if error handlers used instead app_errorhandler the instnace is available only for errors originate in blueprint def page_not_found(e): return render_template(''), 404 @main.app_errorhandler(500) def internal_server_error(e): re...
[ { "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
Flask/apps/main/errors.py
bkjml/online-bus-tickting-system
#!/usr/bin/env python # -*- coding: utf-8 -*- import json from alipay.aop.api.response.AlipayResponse import AlipayResponse class AlipayFundTransAuctionBalanceQueryResponse(AlipayResponse): def __init__(self): super(AlipayFundTransAuctionBalanceQueryResponse, self).__init__() self._balance_avail...
[ { "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": "more_functions_than_classes", "question": "Does this file define more functions than clas...
3
alipay/aop/api/response/AlipayFundTransAuctionBalanceQueryResponse.py
snowxmas/alipay-sdk-python-all
''' The salt api module loader interface ''' # Import python libs import os # Import Salt libs import salt.loader import saltapi def netapi(opts): ''' Return the network api functions ''' load = salt.loader._create_loader( opts, 'netapi', 'netapi', base...
[ { "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
saltapi/loader.py
techdragon/salt-api
"""Custom Exceptions.""" class HacsBaseException(Exception): """Super basic.""" class HacsUserScrewupException(HacsBaseException): """Raise this when the user does something they should not do.""" class HacsNotSoBasicException(HacsBaseException): """Not that basic.""" class HacsDataFileMissing(HacsB...
[ { "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": true }, { ...
3
custom_components/hacs/hacsbase/exceptions.py
rgruebel/hacs
from django.shortcuts import render from django.urls import reverse_lazy from django.views import generic from django.contrib.auth.forms import UserCreationForm from .models import Hall def home(request): return render(request, 'halls/home.html') class SignUp(generic.CreateView): form_class = UserCr...
[ { "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
halls/views.py
MsNahid/Youtube-Hall
from date_class import Date def test_init_repr(day, month, year): obj = Date(day, month, year) print(obj) def test_get_day(d, m, y): obj = Date(d, m, y) print(obj.get_day()) def test_set_day(d, m, y, day): obj = Date(d, m, y) obj.set_day(day) print(obj) def test_get_month(d, m, y): ...
[ { "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/date_class_test.py
MartinVardanyan/My-first-project-on-GitHub
# QEMU Monitor Protocol Lexer Extension # # Copyright (C) 2019, Red Hat Inc. # # Authors: # Eduardo Habkost <ehabkost@redhat.com> # John Snow <jsnow@redhat.com> # # This work is licensed under the terms of the GNU GPLv2 or later. # See the COPYING file in the top-level directory. """qmp_lexer is a Sphinx extension th...
[ { "point_num": 1, "id": "has_multiple_inheritance", "question": "Does any class in this file use multiple inheritance?", "answer": false }, { "point_num": 2, "id": "more_functions_than_classes", "question": "Does this file define more functions than classes?", "answer": false }...
3
qemu/docs/sphinx/qmp_lexer.py
hyunjoy/scripts
import unittest from text_preparation.framing_numbers.tests.fixtures import test_cases, test_texts from text_preparation.framing_numbers.framing_numbers import NumberWithSpacesCase class FramingNumbersTest(unittest.TestCase): def test_cases(self): for text, expected in test_cases: match_pos =...
[ { "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
espnet2/text/text_preparation/framing_numbers/tests/tests.py
texpomru13/espnet
from rastervision.pipeline.config import Config, register_config @register_config('label_source') class LabelSourceConfig(Config): def build(self, class_config, crs_transformer, extent, tmp_dir): raise NotImplementedError() def update(self, pipeline=None, scene=None): pass
[ { "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
rastervision_core/rastervision/core/data/label_source/label_source_config.py
theoway/raster-vision
#!/usr/bin/env python """Tests for `notion` package.""" import pytest from notion import notion @pytest.fixture def response(): """Sample pytest fixture. See more at: http://doc.pytest.org/en/latest/fixture.html """ # import requests # return requests.get('https://github.com/audreyr/cookiecut...
[ { "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_notion.py
tirkarthi/python-notion
from rest_framework import generics, permissions, pagination from django.db.models import Q from rest_framework.response import Response from datetime import date from .models import Post from .permissions import IsOwnerOrReadOnly from .serializers import PostSerializer class PostPageNumberPagination(pagination.Page...
[ { "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
src/posts/views.py
manuelbatres/reactify2
from mxnet import gluon def _make_conv_block(block_index, num_chan=32, num_layer=2, stride=1, pad=2): out = gluon.nn.HybridSequential(prefix='block_%d_' % block_index) with out.name_scope(): for _ in range(num_layer): out.add(gluon.nn.Conv2D(num_chan, kernel_size=3, strides=stride, padding...
[ { "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
dsne/networks/lenetplus.py
ShownX/d-SNE
import schedule import time def job01(): print('job01() working ....') # return def job02(param01, param02): print('job02() working ....',param01, param02) schedule.every(1).minutes.do(job01) schedule.every().day.at('14:30').do(job01) schedule.every(1).minutes.do(job02, 'p01', 'p02') while True: sche...
[ { "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
scraping/scheduling.py
mmeooo/test_django
from ..models import Blog from django.template import Library register = Library() @register.inclusion_tag('blog/feeds.html') def blog_feeds(): blogs = Blog.objects.all() return {'blogs': blogs} @register.inclusion_tag('blog/feeds.html') def blog_feed(blog): return {'blogs': (blog,)}
[ { "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
blog/templatetags/blog.py
mikespub-archive/wkornewald-allbuttonspressed
from eclcli.common import command from eclcli.common import utils from eclcli.bare import bare_utils class ShowZone(command.Lister): """Show availability zone details""" def get_parser(self, prog_name): parser = super(ShowZone, self).get_parser(prog_name) return parser def take_action(s...
[ { "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
eclcli/bare/v2/zone.py
hanasuke/eclcli
from . import api from flask import jsonify @api.app_errorhandler(404) def page_not_found(e): response = jsonify({ 'code': -100404, 'error': 'page not found' }) response.status_code = 404 return response @api.app_errorhandler(403) def forbidden(e): response = jsonify({ 'cod...
[ { "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
Python/flask_web/structure/app/api_1_0/errors.py
castial/CodeSnippets
import visvis as vv class VolViewer: """ VolViewer. View (CT) volume while scrolling through slices (z) """ def __init__(self, vol): # Store vol and init self.vol = vol self.z = 0 # Prepare figure and axex self.f = vv.figure(1001) self.f.Clear() ...
[ { "point_num": 1, "id": "every_function_under_20_lines", "question": "Is every function in this file shorter than 20 lines?", "answer": true }, { "point_num": 2, "id": "more_functions_than_classes", "question": "Does this file define more functions than classes?", "answer": true ...
3
stentseg/apps/sliceviewer.py
almarklein/stentseg
from context_free_algos.cfg import custom_CFG from utils.graph_utils import read_edges import pygraphblas as pgb def cfpq(edges, gram): n = 0 for edge in edges: n = max(n, edge[0], edge[2]) eps_productions, term_productions, norm_productions = gram.split_productions bool_ms = {} for nter...
[ { "point_num": 1, "id": "all_params_annotated", "question": "Does every function parameter in this file have a type annotation (excluding self/cls)?", "answer": false }, { "point_num": 2, "id": "every_function_has_docstring", "question": "Does every function in this file have a docst...
3
context_free_algos/cfpq/matmul.py
nikitavlaev/formal-languages
import os import cv2 import yaml from inference import Lanefinder def read_config(): if not os.path.isfile('config.yaml'): raise FileNotFoundError('Could not find config file') with open('config.yaml', 'r') as file: config = yaml.load(file) return config def main(): # set video str...
[ { "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_nested_function_def", "question": "Does this file contain any function defined inside another function?", ...
3
main.py
xadrianzetx/lanefinder
from django.contrib.sitemaps import Sitemap from main.models import Algo, Code class AlgoSitemap(Sitemap): changefreq = "daily" priority = 1 def items(self): return Algo.objects.all() def lastmod(self, obj): return obj.created_at def location(self, obj): return "/" + obj....
[ { "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
main/algoSitemap.py
algorithms-gad/algoBook
#!/usr/bin/env python """Tests for `calvestbr` package.""" import unittest from calvestbr import calvestbr class TestCalvestbr(unittest.TestCase): """Tests for `calvestbr` package.""" def setUp(self): """Set up test fixtures, if any.""" def tearDown(self): """Tear down test fixtures,...
[ { "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": true },...
3
tests/test_calvestbr.py
IsaacHiguchi/calvestbr
from django.template.defaulttags import register @register.filter def get_item(dictionary, key): return dictionary.get(key) @register.filter def understored_name(value): return value.replace("-", "_")
[ { "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
architecture_tool_django/common/templatetags/extra_filters.py
goldginkgo/architecture_tool_django
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! import grpc import analysis_pb2 as analysis__pb2 class AnalysisStub(object): """The analysis service definition. """ def __init__(self, channel): """Constructor. Args: channel: A grpc.Channel. """ self.RequireAnalysis...
[ { "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
analysis_pb2_grpc.py
charliezon/stock_success
import click from typer.testing import CliRunner import pytest import os from pathlib import Path from ..main import install from pytest_httpx import HTTPXMock runner = CliRunner() def get_test_resource(name: str) -> Path: return Path(os.path.join(os.path.dirname(__file__), "testresources", name)) def test_ins...
[ { "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
rhasspy_skills_cli/tests/test_app.py
razzo04/rhasspy-skills-cli
from rest_framework.response import Response from rest_framework import permissions from rest_framework.views import APIView from rest_framework.generics import ListAPIView, RetrieveAPIView from blog.models import BlogPost from blog.serializers import BlogPostSerializer class BlogPostListView(ListAPIView): queryse...
[ { "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/blog/views.py
vivek92-tech/django_react_blog
""" This module defines view function decorator to collect UWSGI metrics and expose them via an endpoint. """ import functools import os import time from werkzeug.exceptions import HTTPException from especifico.exceptions import ProblemException try: import uwsgi_metrics HAS_UWSGI_METRICS = True # pragma:...
[ { "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
especifico/decorators/metrics.py
athenianco/especifico
#!/usr/bin/python from __future__ import print_function import os, sys from SimpleCV import * from nose.tools import with_setup testoutput = "sampleimages/cam.jpg" def test_virtual_camera_constructor(): mycam = VirtualCamera(testoutput, 'image') props = mycam.getAllProperties() for i in props.keys():...
[ { "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
SimpleCV/tests/test_cameras.py
tpltnt/SimpleCV
# -*- coding: utf-8 -*- # Define your item pipelines here # # Don't forget to add your pipeline to the ITEM_PIPELINES setting # See: https://doc.scrapy.org/en/latest/topics/item-pipeline.html import pymysql import logging from zp58.settings import * class AbroadwebsitePipeline(object): def __init__(self): ...
[ { "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_nested_function_def", "question": "Does this file contain any function defined inside another function?", "answer": ...
3
job/zp58/zp58/pipelines.py
iznilul/Recruitment-spider
import time import logging from functools import wraps from collections import deque import numpy as np from spike_swarm_sim.globals import global_states def time_elapsed(func): """ Computes the amount of time that a function elapses. Only works in DEBUG mode. """ @wraps(func) def wrap...
[ { "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
spike_swarm_sim/utils/decorators.py
r-sendra/SpikeSwarmSim
import cv2 as cv from numpy import ndarray class AgentTransformers: @staticmethod async def transformer_color_BGR2GRAY(frame: ndarray) -> ndarray: resulting_frame = cv.cvtColor(frame, cv.COLOR_BGR2GRAY) return resulting_frame @staticmethod async def transformer_color_BGR2LAB(frame: n...
[ { "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
apps/backend/processor/processor/images/agents_transformer.py
jetoslabs/event-processor
#FUPQ tenha uma lista chamada nรบmeros e duas funรงรตes chamadas sorteio() e somaPar(). A primeira funรงรฃo vai sortear 5 nรบmeros e vai colocรก-las dentro da lista e a segunda funรงรฃo vai mostrar a soma entre todos os valores PARES sorteados pela funรงรฃo anterior. #def sorteio(numeros): # for i in range(0,5): # nume...
[ { "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
python3_exercicios_feitos/Desafio100.py
LouiMaxine/python3-exercicios-cursoemvideo
import os import torch class BaseModel(): def name(self): return 'BaseModel' def initialize(self): # self.opt = opt # self.gpu_ids = opt.gpu_ids # self.isTrain = opt.isTrain # self.Tensor = torch.cuda.FloatTensor if self.gpu_ids else torch.Tensor # self.save_dir...
[ { "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
models/base_model.py
brianchung0803/MegaDepth
#!/usr/bin/python3 import time import datetime from gpiozero import InputDevice, LED import subprocess import requests # RPI enumeration is: # pin 5 & 6 are used for the button (3 & ground) # pin 7 & 9 are used for the LED (4 & ground) button_pin = 3 led_pin = 4 button = InputDevice(button_pin, pull_up=True) last_ac...
[ { "point_num": 1, "id": "all_params_annotated", "question": "Does every function parameter in this file have a type annotation (excluding self/cls)?", "answer": false }, { "point_num": 2, "id": "every_function_has_docstring", "question": "Does every function in this file have a docst...
3
pi/button/button.py
kylemcdonald/bsp
#!/usr/bin/env python # BSD 3-Clause License; see https://github.com/scikit-hep/uproot-methods/blob/master/LICENSE import uproot_methods.base class Methods(uproot_methods.base.ROOTMethods): @property def xerrorshigh(self): return self._fEXhigh @property def xerrorslow(self): return self._fEXlow @pro...
[ { "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
uproot_methods/classes/TGraphAsymmErrors.py
jrueb/uproot-methods
from tf_explain.core.vanilla_gradients import VanillaGradients def test_should_explain_output(convolutional_model, random_data, mocker): mocker.patch( "tf_explain.core.vanilla_gradients.grid_display", side_effect=lambda x: x ) images, labels = random_data explainer = VanillaGradients() gri...
[ { "point_num": 1, "id": "all_params_annotated", "question": "Does every function parameter in this file have a type annotation (excluding self/cls)?", "answer": false }, { "point_num": 2, "id": "every_function_has_docstring", "question": "Does every function in this file have a docst...
3
tests/core/test_vanilla_gradients.py
Tauranis/tf-explain
import logging import argparse from pytouch.model import get_engine, Session, reset_db from pytouch.gui.tk import window def init_db(args): db_uri = getattr(args, 'database') logging.debug('Database URI: {}'.format(db_uri)) engine = get_engine({'sqlalchemy.url': db_uri}) Session.configure(bind=engine...
[ { "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
pytouch/main.py
aboutNisblee/PyTouch
from django.db import models from django.contrib.auth import get_user_model User = get_user_model() class Group(models.Model): title = models.CharField(max_length=200) slug = models.SlugField(unique=True) description = models.TextField() class Post(models.Model): text = models.TextField() pub_d...
[ { "point_num": 1, "id": "more_functions_than_classes", "question": "Does this file define more functions than classes?", "answer": false }, { "point_num": 2, "id": "has_nested_function_def", "question": "Does this file contain any function defined inside another function?", "answ...
3
posts/models.py
SergeyKorobenkov/hw05_final
from falcon.testing import Result, TestClient from sustainerds.api.entities.user.model import UserDbModel ############################################################################### # model tests ############################################################################### def test_something(): d = UserDbM...
[ { "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
sustainerds/api/entities/user/test_user.py
elbart/sustainerds
from flask import request, redirect from core.middleware import Middleware class AuthMiddleware(Middleware): def pre_check(self, *args, **kwargs): return request.headers.get('Authorization') == 'RANDOM API KEY' def default(self): return redirect('/')
[ { "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
middleware/auth.py
yukinotenshi/csl-revamp-backend
import uuid def test_exists_returns_false_when_the_file_does_not_exist(selectel_storage): non_existing_file = '{0}/non-exist.txt'.format(uuid.uuid4()) assert not selectel_storage.exists(non_existing_file) def test_exists_returns_true_when_the_file_exists( selectel_storage, create_file ): ...
[ { "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/storage_api_methods/test_exists.py
Stuvros/django-selectel-storage
from django.shortcuts import render, redirect from django.contrib.auth import update_session_auth_hash from bank.app.forms.register import RegisterForm from bank.app.forms.profile import ProfileForm, ChangePasswordForm def index(request): return render(request, 'app/index.html', {'request': request}) # Registr...
[ { "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
bank/bank/app/views.py
Christophedlr/bank-transactions
# coding: utf-8 import os import subprocess from scilib.iterlib import chunks BASE_DIR = os.path.dirname(__file__) CLI_PATH = os.path.join(BASE_DIR, 'cli.go') def batch_classify(names): first_names = [i.split()[0].replace(',', '') for i in names] output_results = {} for chunk in chunks(first_names, siz...
[ { "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
scilib/gender/go_gender/public.py
phyng/scilib
from flask_testing import LiveServerTestCase from selenium import webdriver from urllib.request import urlopen from flask import url_for from application import app, db from application.models import Players, Items class TestBase(LiveServerTestCase): def create_app(self): app.config["SQLALCHEMY_DATABASE_...
[ { "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
application/Tests/test_integration.py
AmirAR-QA/Project1
import time from config import CONFIG def float_range(values, start_key, end_key): start = 0 if values[start_key]: start = float(values[start_key]) end = 0 if values[end_key]: end = float(values[end_key]) return start, end def int_range(values, start_key, end_key): start =...
[ { "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/utils.py
DenX/pixyship
import pygame import neat import time import os import random window = pygame.display.set_mode((800, 500)) pygame.display.set_caption("Flappy Kotak") class Pipa: def __init__(self, posx, h): self.rect_atas = pygame.Rect(posx, 0, 40, h) self.rect_bawah = pygame.Rect(posx, 500, 40, - (...
[ { "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": "more_functions_than_classes", "question": "Does this file define more functions than clas...
3
Python/Flappy Kotak gagal/main.py
AnnasJK/annas
from logger import logger from perfrunner.helpers.cbmonitor import with_stats from perfrunner.tests.view import ViewIndexTest, ViewQueryTest class SpatialMixin(object): def __init__(self, cluster_spec, test_config, verbose, experiment=None): self._view_settings = test_config.spatial_settings supe...
[ { "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
perfrunner/tests/spatial.py
dkao-cb/perfrunner
""" A resource for holding game state. """ from .base import Resource, ResourceEvent class StateResource(Resource): """ A resource for holding game state. """ name = 'state' def __init__(self): self.state = {} self.state['ngn'] = { 'fps': 0.0, } def apply_set_eve...
[ { "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
ngn/resources/state.py
hodgestar/banjo
from unittest import TestCase from aspire.utils.random import randi class UtilsRandomTestCase(TestCase): def setUp(self): pass def tearDown(self): pass def testRandi(self): seq = list(randi(10, 10, seed=0)) # This should produce identical results to MATLAB `randi(10, 1, ...
[ { "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_random.py
PrincetonUniversity/ASPIRE-Python
from abc import ABC, abstractmethod from bobocep.rules.events.bobo_event import BoboEvent class IForwarderSubscriber(ABC): """An interface to subscribe to Forwarder events.""" @abstractmethod def on_forwarder_success_event(self, event: BoboEvent): """ Events that have been successfully f...
[ { "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": true },...
3
bobocep/forwarder/forwarder_subscriber.py
r3w0p/bobocep
import unittest import numpy as np import numpy.testing as npt from uts import sma class TestEMA(unittest.TestCase): def test_sma_last(self): values = np.array([[0.0, 0.0], [1.0, 2.0], [1.2, 4.0], [2.3, 6], [2.9, 8], [5, 10]]) result = sma.last(values, 2.5, 1.0) desire...
[ { "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
test/test_sma.py
Yifei-Liu/uts
from api import token from telegram import InlineKeyboardButton, InlineKeyboardMarkup from telegram.ext import Updater, CommandHandler, CallbackQueryHandler import logging logging.basicConfig(format='%(asctime)s - %(name)s - %(levelname)s - %(message)s', level=logging.INFO) logger = logging.getLog...
[ { "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
telegrambots/examples/telegram_1.py
carlfarterson/telegrambots
from django.http import HttpResponse, HttpResponseRedirect from django.template import loader, RequestContext from django.shortcuts import render from django.contrib.auth.decorators import login_required @login_required def member_index(request): t = loader.get_template('member/member-index.html') c = {} # {...
[ { "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_return_types_annotated", "question": "Does every function in this file have a return type annotation?...
3
allauthdemo/views.py
amangupta712/demo-allauth-bootstrap
from akagi.data_source import DataSource from akagi.data_file import DataFile class SpreadsheetDataSource(DataSource): '''SpreadsheetSource replesents a data on Google Spreadsheets ''' def __init__(self, sheet_id, sheet_range='A:Z', no_cache=False): self._sheet_id = sheet_id self._sheet_r...
[ { "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
akagi/data_sources/spreadsheet_data_source.py
pauchan/akagi
from django.db import models from django.db.models.query import QuerySet from model_utils.managers import PassThroughManagerMixin from .signals import publisher_pre_delete from .middleware import get_draft_status class PublisherQuerySet(QuerySet): def drafts(self): from .models import PublisherModelBas...
[ { "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
publisher/managers.py
akandada/django-model-publisher
# -*- coding: utf-8 -*- ''' Runs MultiprocessTest with all warnings including traceback... ''' # # https://stackoverflow.com/questions/22373927/get-traceback-of-warnings import traceback import warnings import sys from . import multiprocess def warn_with_traceback(message, category, filename, lineno, file=None, line...
[ { "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
dh_testers/warningMultiprocess.py
dhmit/dh_testers
# Definition for singly-linked list. class ListNode(object): def __init__(self, x): self.val = x self.next = None class LinkedList(object): def __init__(self): self.root = None def insert(self, node, new_node): if self.root is None: self...
[ { "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_nested_function_def", "question": "Does this file contain any function defined insid...
3
LeetCode/Medium/linked_list_mergeTwoLists.py
shrey199325/LeetCodeSolution
# -*- coding: utf-8 -*- import logging from ocp_resources.constants import PROTOCOL_ERROR_EXCEPTION_DICT from ocp_resources.resource import TIMEOUT, Resource from ocp_resources.utils import TimeoutSampler LOGGER = logging.getLogger(__name__) class CDIConfig(Resource): """ CDIConfig object. """ ap...
[ { "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
ocp_resources/cdi_config.py
ibesso-rh/openshift-python-wrapper
from getgauge.python import (before_step, step, after_step, before_scenario, after_scenario, before_spec, after_spec, before_suite, after_suite, custom_screen_grabber, continue_on_failure) @step("Step 1") def step1(): pass @c...
[ { "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
tests/test_data/impl_stubs.py
surevs/gauge-python
import rospy import os import ipfshttpclient #from urllib3.util.timeout import Timeout from urllib.parse import urlparse from tempfile import gettempdir IPFS_PROVIDER = rospy.get_param("/liability/listener/ipfs_http_provider", "/ip4/127.0.0.1/tcp/5001/http") def build_client(): rospy.loginfo("Build IPFS client: ...
[ { "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
src/helpers/ipfs.py
tubleronchik/liability_cacher
# coding: utf-8 """ Kubernetes No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501 OpenAPI spec version: v1.10.6 Generated by: https://github.com/swagger-api/swagger-codegen.git """ from __future__ import absolute_import import u...
[ { "point_num": 1, "id": "every_function_has_docstring", "question": "Does every function in this file have a docstring?", "answer": false }, { "point_num": 2, "id": "all_function_names_snake_case", "question": "Are all function names in this file written in snake_case?", "answer"...
3
test/test_v1beta1_custom_resource_definition_status.py
tantioch/aiokubernetes
#!/usr/bin/env python # -*- coding: utf-8 -*- """ test_cardsdsl ---------------------------------- Tests for `cardsdsl` module. """ import unittest from cardsdsl import cardsdsl class TestCardsdsl(unittest.TestCase): def setUp(self): pass def test_something(self): pass def tearDown(...
[ { "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
tests/test_cardsdsl.py
AGeekInside/cardsdsl
import re from typing import Any from typing import Awaitable from typing import Callable from typing import Dict from typing import List class CommandRouter: def __init__(self, subrouters: List["CommandRouter"] = []) -> None: self.command_handlers: Dict[str, Callable[..., Awaitable[Any]]] = dict() ...
[ { "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
marvin/command_router.py
bennyandresen/marvin-mk2
import sys import unittest from typing import List from unittest.mock import MagicMock from src.dayof.day_8.model import random_gift_text sys.modules['telegram'] = MagicMock() sys.modules['telegram.ext'] = MagicMock() sys.modules['src.commands'] = MagicMock() sys.modules['src.config'] = MagicMock() sys.modules['src.c...
[ { "point_num": 1, "id": "every_function_has_docstring", "question": "Does every function in this file have a docstring?", "answer": false }, { "point_num": 2, "id": "has_nested_function_def", "question": "Does this file contain any function defined inside another function?", "ans...
3
tests/plugins/test_8_day.py
slimsevernake/osbb-bot
from flask_wtf import FlaskForm from wtforms import StringField,PasswordField,BooleanField ,SubmitField,TextAreaField from wtforms.validators import Required, Email, EqualTo from ..models import User from wtforms import ValidationError class RegistrationForm(FlaskForm): email = StringField('Your Email Address',val...
[ { "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_class_has_docstring", "question": "Does every class in this file have a docstring?", "answer": false }, ...
3
app/auth/forms.py
HenryKanyoro/Pitch
from decimal import Decimal import pytest from ledger.balance import Balance from ledger.transaction import IrrelevantTransactionError class TestBalance: def test_init(self): balance = Balance(entity="mike", total="1.123") assert balance.entity == "mike" assert balance.total == Decimal("...
[ { "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
tests/unit/test_balance.py
lukka5/ledger
from pytube import YouTube from tkinter import * main = Tk() class Funcionalidades(): def baixar(self): yt = YouTube(self.entry.get()) self.alert['text'] = (yt.title + ' - Baixado') yt.streams.first().download() class Aplicacao(Funcionalidades): def __init__(self): self.main...
[ { "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
main.py
santosgv/donwloadYT
from bearlibterminal import terminal def draw_page(tx, ty, page): for y in range(16): for x in range(16): terminal.put((x * 2) + tx, y + ty, page + (16 * y) + x) def main(): terminal.open() terminal.set("window: title='Test!', size=80x25, cellsize=16x32;") terminal.se...
[ { "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
test/terminal.py
ltouroumov/yarl
from django.db import models from polymorphic.models import PolymorphicModel class Interface(PolymorphicModel): name = models.CharField(max_length=30, unique=True) def __str__(self): return self.name class NetworkInterface(Interface): mac_address = models.CharField(max_length=23) address = ...
[ { "point_num": 1, "id": "has_multiple_inheritance", "question": "Does any class in this file use multiple inheritance?", "answer": false }, { "point_num": 2, "id": "more_functions_than_classes", "question": "Does this file define more functions than classes?", "answer": false }...
3
ConfManager/models/interfaces.py
cygerior/LabManager
# encoding: utf-8 # module RevitServices.Threading calls itself Threading # from RevitServices, Version=1.2.1.3083, Culture=neutral, PublicKeyToken=null # by generator 1.145 # no doc # no imports # no functions # classes class RevitSchedulerThread(object, ISchedulerThread): """ RevitSchedulerThread(rev...
[ { "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
release/stubs/RevitServices/Threading.py
htlcnn/ironpython-stubs
#!/usr/bin/env python3 """Usage: test.py FILE test.py -h --help """ import sys import os.path from docopt import docopt from backtest.oanda_backtest import OandaBacktest from logic.strategy import Strategy from settings import CANDLES_MINUTES, MAX_PERCENTAGE_ACCOUNT_AT_RISK,\ STOP_LOSS, TRAILING_PERIOD, TAKE_PR...
[ { "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_nested_function_def", "question": "Does this file contain any function defined inside another function?", ...
3
test.py
hreshtaksensei/forexpy
# Copyright (c) 2006,2007,2008 Mitch Garnaat http://garnaat.org/ # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy,...
[ { "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
.eggs/boto-2.48.0-py2.7.egg/boto/sdb/db/key.py
MQQ/git-bigstore
from typing import Any, Dict from neuralpp.inference.graphical_model.representation.frame.dict_frame import ( generalized_len_of_dict_frame, ) def dict_data_generator(dictionary: Dict[Any, Any], length, batch_size=100): for i in range(0, length, batch_size): yield {k: v[i : i + batch_size] for k, v i...
[ { "point_num": 1, "id": "has_multiple_inheritance", "question": "Does any class in this file use multiple inheritance?", "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
neuralpp/inference/graphical_model/representation/frame/dict_data_loader.py
horizon-blue/neuralpp
import os import subprocess def run_test_coverage(): """ Simple run coverage and do: - Runs the tests - Check your test coverage - Generates HTML coverage report under "htmlcov" directory. """ py_test_command = "coverage run -m pytest" CURRENT_DIR = os.path.dirname(os.path.abspath(...
[ { "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
coverage.py
Adilet1/beta_career
def PageUse(): msg.showinfo("์‚ฌ์šฉ๋ฐฉ๋ฒ•", "๋„์›Œ์ง„ ์ฐฝ ์•ˆ์—์„œ\n๋…ธํŠธ๋ฅผ ์ž‘์„ฑํ•˜์„ธ์š” โœ๏ธ") def PageLicens(): msg.showinfo("๋ผ์ด์„ผ์Šค", "MIT License\n\nโ“’ 2021 ์ฐจํ•œ์Œ ๐Ÿ˜Ž") def PageVersion(): msg.showinfo("๋ฒ„์ „", "ํ˜„์žฌ ๋ฒ„์ „ v2.1.1 โœ‹") def MenuHelp(root): menu = Menu(root) help = Menu(menu, tearoff=0) help.add_command(label="์‚ฌ์šฉ๋ฐฉ๋ฒ•", 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": "has_nested_function_def", "question": "Does this file contain any function defined inside another function?", "...
3
tests/bu.py
developerHaneum/Worker
import torch import torch.nn as nn import torch.nn.functional as F from pytorch_metric_learning import losses class TripletLoss(nn.Module): def __init__(self, **kwargs) -> None: super().__init__(**kwargs) self.loss_fn = losses.TripletMarginLoss(**kwargs) def forward(self, feats1, feats2): ...
[ { "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
modules/losses/triplet.py
kaylode/tern