source
string
points
list
n_points
int64
path
string
repo
string
__author__ = 'tester' import re def test_phones_on_home_page(app): contact_from_home_page = app.contact.get_contact_list()[0] contact_from_edit_page = app.contact.get_contact_info_from_edit_page(0) assert contact_from_home_page.all_phones_from_home_page == merge_phones_like_on_home_page(contact_from_edit...
[ { "point_num": 1, "id": "all_function_names_snake_case", "question": "Are all function names in this file written in snake_case?", "answer": true }, { "point_num": 2, "id": "all_params_annotated", "question": "Does every function parameter in this file have a type annotation (excludi...
3
test/test_phones.py
EwgOskol/python_training
"""0.10.0 create new schedule tables Revision ID: 493871843165 Revises: 942138e33bf9 Create Date: 2021-01-13 14:43:03.678784 """ from dagster.core.storage.migration.utils import create_0_10_0_schedule_tables # revision identifiers, used by Alembic. revision = "493871843165" down_revision = "942138e33bf9" branch_labe...
[ { "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
python_modules/dagster/dagster/core/storage/alembic/versions/014_0_10_0_create_new_schedule_tables_postgres.py
asamoal/dagster
#!/usr/bin/python3 from argparse import ArgumentParser import subprocess def main(): parser = ArgumentParser() parser.add_argument('--version', required=True) args = parser.parse_args() version = args.version _create_package(version) def _create_package(version): options = { 'depen...
[ { "point_num": 1, "id": "every_function_under_20_lines", "question": "Is every function in this file shorter than 20 lines?", "answer": false }, { "point_num": 2, "id": "any_function_over_40_lines", "question": "Is any function in this file longer than 40 lines?", "answer": true ...
3
docker-containers/microservice_focal/packaging/package_build.py
b-bird/armada
#!/usr/bin/env python2 # -*- coding: utf-8 -*- import logging from doubanfm.views import help_view from doubanfm.controller.lrc_controller import LrcController logger = logging.getLogger('doubanfm') # get logger class HelpController(LrcController): """ 按键控制 """ def __init__(self, player, data, que...
[ { "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
doubanfm/controller/help_controller.py
fakegit/douban.fm
from typing import List import numpy as np from .mesh import StudioMesh from .....library.utils.byte_io_mdl import ByteIO class StudioModel: vertex_dtype = np.dtype([ ('id', np.uint32, (1,)), ('pos', np.float32, (3,)), ]) def __init__(self): self.name = '' self.unk_1 = 0...
[ { "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
library/goldsrc/mdl_v4/structs/model.py
anderlli0053/SourceIO
import pytest from thedarn.rules.java import match, get_new_command from thedarn.types import Command @pytest.mark.parametrize('command', [ Command('java foo.java', ''), Command('java bar.java', '')]) def test_match(command): assert match(command) @pytest.mark.parametrize('command, new_command', [ (...
[ { "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": "no_function_exceeds_5_params", "question": "Does every function in this file take 5 or fewer parameters (...
3
tests/rules/test_java.py
frankhli843/thedarn
import numpy as np from numpy.testing import assert_allclose, assert_equal import unittest from pb_bss.distribution import VonMisesFisher from pb_bss.distribution import VonMisesFisherTrainer class TestGaussian(unittest.TestCase): def test_shapes(self): samples = 10000 mean = np.ones((3,)) ...
[ { "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
tests/test_distribution/test_von_mises_fisher.py
mdeegen/pb_bss
from tkinter import * import tkinter.font from gpiozero import LED import RPi.GPIO RPi.GPIO.setmode(RPi.GPIO.BCM) ### HARDWARE DEFINITIONS ### # LED pin definitions led0 = LED(7) led1 = LED(8) led2 = LED(25) led3 = LED(23) led4 = LED(24) led5 = LED(18) led6 = LED(15) led7 = LED(14) # Arrange LEDs into a list leds = [l...
[ { "point_num": 1, "id": "every_function_under_20_lines", "question": "Is every function in this file shorter than 20 lines?", "answer": true }, { "point_num": 2, "id": "has_nested_function_def", "question": "Does this file contain any function defined inside another function?", "...
3
led-command-centre.py
kazma89/Taller_RPi
import pytest from skidl import * from .setup_teardown import * def test_pin_names_1(): codec = Part("xess.lib", "ak4520a") assert codec["ain"] == codec.n["ain"] assert codec[1:4] == codec.p[1:4] def test_pin_names_2(): codec = Part("xess.lib", "ak4520a") codec[4].name = "A1" codec[8].name...
[ { "point_num": 1, "id": "every_function_has_docstring", "question": "Does every function in this file have a docstring?", "answer": false }, { "point_num": 2, "id": "has_nested_function_def", "question": "Does this file contain any function defined inside another function?", "ans...
3
tests/test_pin_num_name.py
arjenroodselaar/skidl
import json from urllib.parse import urlparse from django.db.models import Q from django.utils.encoding import smart_text def get_url_path(url): parsed_url = urlparse(url) return parsed_url.path def get_redirect_location(response): # Due to Django 1.8 compatibility, we have to handle both cases ret...
[ { "point_num": 1, "id": "every_function_under_20_lines", "question": "Is every function in this file shorter than 20 lines?", "answer": true }, { "point_num": 2, "id": "all_params_annotated", "question": "Does every function parameter in this file have a type annotation (excluding se...
3
tests/utils.py
skazancev/saleor
from allennlp_demo.common.testing import ModelEndpointTestCase from allennlp_demo.ccg_supertagging.api import CCGSupertaggingModelEndpoint class TestCCGSupertaggingModelEndpoint(ModelEndpointTestCase): endpoint = CCGSupertaggingModelEndpoint() predict_input = { "sentence": "Did Uriah honestly think he...
[ { "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
api/allennlp_demo/ccg_supertagging/test_api.py
jakpra/allennlp-demo
import os import json import random as rn class Process_pr: def __init__(self, pr_number, pr_author): self.__pr_number = pr_number self.__pr_author = pr_author def author(self): return self.__pr_author def pr_number(self): return self.__pr_number def command(self, cm...
[ { "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
automation_tools/pr_automation/process_pr.py
VedPatwardhan/ivy
# Copyright (c) 2021 Johnathan P. Irvin # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish,...
[ { "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
viking/connections/interfaces/abstract_socket.py
JohnnyIrvin/CommunicateProject
"""Compatibility constants and helpers for Python 2.x and 3.x. """ import sys # NB If this module grows to more than a handful of items it is probably # to bite the bullet and depend on the six package. __all__ = [ 'string_types', 'binary_type', 'text_type', 'int2byte', 'byte2int' ] # Needed f...
[ { "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
sdk/python-yubicommon/yubicommon/compat.py
lucusfly/iost-ledger-app
from .modal_type_enum import * class Modal: def __init__( self, message: str = "", type: MODAL_TYPE = MODAL_TYPE.SUCCESS, headline: str = "Hinweis" ): self.modal_type = type self.modal_msg = message self.modal_headline = headline def to_dict(self): tmp_dict = { ...
[ { "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": "more_functions_than_classes", "question": "Does this file define more functions than class...
3
sws_webstuff/modal_class.py
Aurvandill137/sws_webstuff
"""Importer decorators.""" import logging from functools import wraps logger = logging.getLogger(__name__) # pylint: disable=invalid-name class ImporterHook: """Interface for an importer hook.""" def __call__(self, importer, file, imported_entries, existing_entries): """Apply the hook and modify th...
[ { "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
smart_importer/hooks.py
EINDEX/smart_importer
#!/usr/bin/env python # -*- encoding: utf-8 -*- import os import unittest from functional_tests.data.atlas.skulls.run import AtlasSkulls from functional_tests.data.atlas.brain_structures.run import AtlasBrainStructures from functional_tests.data.atlas.digits.run import AtlasDigits from functional_tests.data.regressio...
[ { "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/functional_tests/run_functional_tests.py
EuroPOND/deformetrica
""" Created on June 21, 2018 @author: Moritz """ import numpy as np from spn.algorithms.Inference import add_node_likelihood from spn.experiments.AQP.leaves.static.StaticNumeric import StaticNumeric def static_likelihood_range(node, ranges, dtype=np.float64, **kwargs): assert len(node.scope) == 1, node.scope ...
[ { "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/spn/experiments/AQP/leaves/static/InferenceRange.py
tkrons/SPFlow_topdownrules
import os from instaloader import Profile, Post class IgpdLinuxFeaturesPrivate: def download_post(self,link,p_instance_param): pid = link.rsplit("/",2)[-2] post = Post.from_shortcode(p_instance_param.context, pid) p_instance_param.download_post(post,target=(pid)) print("\nPost do...
[ { "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
src/features.py
ahn1305/igpd-linux
# -*- coding: utf-8 -*- ########################################################################### # Copyright (c), The AiiDA team. All rights reserved. # # This file is part of the AiiDA code. # # ...
[ { "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
aiida/backends/tests/cmdline/commands/test_status.py
lekah/aiida_core
from math import sqrt, floor def solution(n): if n<3 or n>200: return 0 else: sum = 0 cache = [] for x in range(0, n): temp = [] for y in range(0, n): temp.append(-1) cache.append(temp) for i in ran...
[ { "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
the_grandest_step_of_them_all.py
sakurusurya2000/FOOBAR
#!/usr/bin/env python3 # -*- coding: utf-8 -*- from photoCoordinates import photoCoordinates from PIL import Image, ImageFont, ImageDraw class photoImposer: pc = photoCoordinates() allCoordinates = pc.allCoordinates all_images = {} def __init__(self): self.all_images['KICKOFF'] = "formation...
[ { "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
backend/src/photoImposer.py
jayeshjakkani/American-Football-Analytics-Application
from som.primitives.primitives import Primitives from som.vmobjects.primitive import UnaryPrimitive def _holder(rcvr): return rcvr.get_holder() def _signature(rcvr): return rcvr.get_signature() class InvokablePrimitivesBase(Primitives): def install_primitives(self): self._install_instance_prim...
[ { "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
src/som/primitives/invokable_primitives.py
smarr/RPySOM
import bpy import bmesh from bpy.props import * from ... base_types import AnimationNode class CreateBMeshFromMesh(bpy.types.Node, AnimationNode): bl_idname = "an_CreateBMeshFromMeshNode" bl_label = "Create BMesh" errorHandlingType = "EXCEPTION" def create(self): self.newInput("Mesh", "Mesh", ...
[ { "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": "every_function_under_20_lines", "question": "Is every function in this file shorter than 20 lines?", "ans...
3
scripts/addons/animation_nodes/nodes/mesh/bmesh_create.py
Tilapiatsu/blender-custom_conf
# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. import sys, os from pathlib import Path import qlib import fire import pandas as pd import ruamel.yaml as yaml from qlib.config import C from qlib.model.trainer import task_train def get_path_list(path): if isinstance(path, 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": "every_function_has_docstring", "question": "Does every function in this file have a docstring?", "answer": fal...
3
qlib/workflow/cli.py
GoooIce/qlib
from .confirmacionMensaje import ConfirmacionMensaje from .mensajeEnviado import MensajeEnviado from .estadoMensaje import EstadoMensaje class MensajeParcialmenteEnviado(EstadoMensaje): #Colaboradores externos #confirmaciones: Conjunto<ConfirmacionMensaje> #msg: Mensaje def __init__(self, unMensaje, unConjDeConfi...
[ { "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
isw2-master/src/app/core/mensajeParcialmenteEnviado.py
marlanbar/academic-projects
#!/usr/bin/env python3 import telnetlib import struct import logging HOST="localhost" #while true; do nc -l -p 1111 -e /tmp/vuln; done old_write=telnetlib.Telnet.write def write(self, str_: bytes): try: print("w: ",str_.decode("utf-8")) except UnicodeDecodeError: print("w: ",str_) old_writ...
[ { "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
random_stuff/telnetlib_logging.py
adw1n/competitive-programming
import numpy as np import pandas as pd import matplotlib.pyplot as plt data = pd.read_csv("ex1data1.txt",names = ['population','profit']) x = data.population y = data.profit "初始化,所有变量都是matrix" df = data.copy()#因为insert会改变原数组,所以先复制一份,坑1. df.insert(0,"one",1) X = df.iloc[:,0:df.shape[1]-1] y = df.iloc[:,df.shape[1]-1:df....
[ { "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
code-homework/ML/ex1_Linear Regression/ex1_batch.py
phww/Andrew.Ng-ML-Study
# coding: utf-8 """ Instagram API The Instagram Private API in OpenAPI specs.v3.0 # noqa: E501 OpenAPI spec version: 0.0.1 GitHub repo: https://github.com/instagrambot/instagram-api-toolkit """ from __future__ import absolute_import import unittest import private_instagram_sdk from JsonObject.cls...
[ { "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
sdks/python/test/test_JsonObject.py
pormes/pormes_bot17
# *** WARNING: this file was generated by the Kulado Kubernetes codegen tool. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** import kulado import kulado.runtime import warnings from ... import tables, version class PodTemplateList(kulado.CustomResource): """ PodTemplate...
[ { "point_num": 1, "id": "no_function_exceeds_5_params", "question": "Does every function in this file take 5 or fewer parameters (excluding self/cls)?", "answer": false }, { "point_num": 2, "id": "more_functions_than_classes", "question": "Does this file define more functions than cl...
3
sdk/python/pulumi_kubernetes/core/v1/PodTemplateList.py
kulado/kulado-kubernetes
from multiprocessing import Pool import argparse import glob import os import io import time import logging import gluonnlp as nlp import tokenizer as tokenization parser = argparse.ArgumentParser(description='BERT tokenizer') parser.add_argument('--input_files', type=str, default='wiki_*.doc', hel...
[ { "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
do_trim.py
eric-haibin-lin/text-proc
"""AyudaEnPython: https://www.facebook.com/groups/ayudapython # ------------------------ Enunciado Original ------------------------- Pedir al usuario la cantidad de números de la secuencia de Fibonacci que desea ver. Por ejemplo si el usuario digita 10, deberá mostrarse en pantalla la secuencia: 1, 1, 2, 3, 5, 8, 13...
[ { "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
soluciones/serie_fibonacci.py
AyudaEnPython/Soluciones
# coding: utf-8 """ RadioManager RadioManager # noqa: E501 OpenAPI spec version: 2.0 Contact: support@pluxbox.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ from __future__ import absolute_import import unittest import radiomanager_sdk from radiomanager_sdk.models.s...
[ { "point_num": 1, "id": "every_function_under_20_lines", "question": "Is every function in this file shorter than 20 lines?", "answer": true }, { "point_num": 2, "id": "has_multiple_inheritance", "question": "Does any class in this file use multiple inheritance?", "answer": false...
3
test/test_station_result_station.py
Pluxbox/radiomanager-python-client
import unittest import pytest import cupy import cupyx class TestSyncDetect(unittest.TestCase): def test_disallowed(self): a = cupy.array([2, 3]) with cupyx.allow_synchronize(False): with pytest.raises(cupyx.DeviceSynchronized): a.get() def test_allowed(self): ...
[ { "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
tests/cupy_tests/core_tests/test_syncdetect.py
svlandeg/cupy
import os import pandas as pd import dill as pickle from flask import Flask, jsonify, request from utils import PreProcessing app = Flask(__name__) @app.route('/predict', methods=['POST']) def apicall(): """API Call Pandas dataframe (sent as a payload) from API Call """ try: test_json = request.get_json() t...
[ { "point_num": 1, "id": "every_function_has_docstring", "question": "Does every function in this file have a docstring?", "answer": false }, { "point_num": 2, "id": "every_function_under_20_lines", "question": "Is every function in this file shorter than 20 lines?", "answer": fal...
3
flask_api/server.py
pedrocarvalhodev/flask_api
from bpy.types import Node from arm.logicnode.arm_nodes import * import arm.nodes_logic class TestNode(Node, ArmLogicTreeNode): '''Test node''' bl_idname = 'LNTestNode' bl_label = 'Test' bl_icon = 'GAME' def init(self, context): self.inputs.new('ArmNodeSocketAction', 'In') self.out...
[ { "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
dev_logicnode/Libraries/mynodes/blender.py
katharostech/armory_examples
""" Exception for errors raised by Basic Aer. """ from qiskit.exceptions import QiskitError class C3QiskitError(QiskitError): """Base class for errors raised by C3 Qiskit Simulator.""" def __init__(self, *message): """Set the error message.""" super().__init__(*message) self.message ...
[ { "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": true }...
3
c3/qiskit/c3_exceptions.py
picbeats/c3
# Copyright 2020 Google LLC # # 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
[ { "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_params_annotated", "question": "Does every function parameter in this file have a type annotation (ex...
3
new_semantic_parsing/callbacks.py
nikhilgoel1997/new-semantic-parsing
""" Integration tests for __main__.py """ # pragma pylint: disable=redefined-outer-name from click.testing import CliRunner import pytest from traveling_salesperson import __main__ as main def test_main_runs(mocker, filename_fixture): """Ensures that main() runs smoothly over a test file.""" mock_etl = mocke...
[ { "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
tests/integration/test_main.py
benjaminkaplanphd/traveling-salesperson
# 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 applic...
[ { "point_num": 1, "id": "every_class_has_docstring", "question": "Does every class 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_auto_scan_size.py
neonhuang/Paddle2ONNX
#!/usr/bin/env python # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software...
[ { "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
kolla_ansible/cmd/mergepwd.py
okleinschmidt/kolla-ansible
#climber.py #Robot Code For BlueCrew 6153 import wpilib #Commands to make the robot climb. class Climber: climb_motor = wpilib.Talon #Set robot to climb when motor is on. def climb(self): self.climb_motor.set(1) #Stops the robot from climbing when motor is off. def stop_climb(self...
[ { "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
components/climber.py
BlueCrewRobotics/2017Robot
#!/usr/bin/env python """ Memory Loss github.com/irlrobot/memory_loss """ from __future__ import print_function from random import choice, shuffle from alexa_responses import speech_with_card from brain_training import QUESTIONS def handle_answer_request(player_answer, session): """check if the answer is right, ad...
[ { "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
src/handle_answer_request.py
irlrobot/memory_loss
""" Tiny little ORM (Object Relational Mapper) for SQLite. """ import logging from .db_helpers import attrs from .manager import Manager logging.basicConfig( filename='simple_orm_sqlite.log', format='%(asctime)s - %(levelname)s - %(message)s', datefmt='%d-%b-%y %H:%M:%S', level=logging.INFO) class M...
[ { "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
orm/orm.py
draihal/simple_orm_sqlite
class HashableList(object): """ A structure that stores a list of str()-able items, but can also be used as a key in a dict. This is not a very good general purpose data structure. It has a very specific use in DetailsCompatibilityChecker. """ def __init__(self, delimiter=","): self...
[ { "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
rules_default/castervoice/lib/util/hashable_list.py
MLH-Fellowship/LarynxCode
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
[ { "point_num": 1, "id": "every_function_has_docstring", "question": "Does every function in this file have a docstring?", "answer": false }, { "point_num": 2, "id": "every_function_under_20_lines", "question": "Is every function in this file shorter than 20 lines?", "answer": tru...
3
aliyun-python-sdk-outboundbot/aliyunsdkoutboundbot/request/v20191226/SaveAfterAnswerDelayPlaybackRequest.py
yndu13/aliyun-openapi-python-sdk
# -*- coding: utf-8 -*- from unisim import DB class DummyDB(DB): def connect(self): pass def disconnect(self): pass def init_table(self): pass def store(self, tick, objects): pass
[ { "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
simdata/hakata/script/dummy_db.py
RDC4Smart-Mobility/UniSim
# -*- coding: utf-8 -*- from __future__ import print_function, division, absolute_import import numba from numba import * from numba import error, nodes from numba.type_inference import module_type_inference from numba import typesystem if PY3: import builtins else: import __builtin__ as builtins debug = Fal...
[ { "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
numba/type_inference/infer_call.py
shiquanwang/numba
from .create_db import db class CompoundETH(db.Model): __tablename__ = 'compound' id = db.Column('id', db.Integer, primary_key=True) blocknumber = db.Column('blocknumber', db.Integer) timestamp = db.Column('timestamp', db.Integer) price = db.Column('price', db.Float) def __repr__(self): ...
[ { "point_num": 1, "id": "all_function_names_snake_case", "question": "Are all function names in this file written in snake_case?", "answer": true }, { "point_num": 2, "id": "every_class_has_docstring", "question": "Does every class in this file have a docstring?", "answer": false...
3
src/models/compound.py
Dragonfly-Capital/oracles.club.server
from django.contrib import admin from django.utils.translation import ugettext, ugettext_lazy as _ from ella.positions.models import Position from ella.utils import timezone class PositionOptions(admin.ModelAdmin): def show_title(self, obj): if not obj.target: return '-- %s --' % ugettext('em...
[ { "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
ella/positions/admin.py
petrlosa/ella
# -*- coding: utf-8 -*- import unittest.mock import pytest import pycamunda.activityinst import pycamunda.incident INCIDENT_TYPE_COUNT = pycamunda.incident.IncidentTypeCount( incident_type=pycamunda.incident.IncidentType.failed_job, incident_count=1 ) @unittest.mock.patch( 'pycamunda.incident.Inciden...
[ { "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/activityinst/test_transitioninstance.py
asyncee/pycamunda
from CtCI_Custom_Classes.stack import Stack class SetOfStacks: def __init__(self, capacity): self.capacity = capacity self.stacks = [] def get_last_stack(self): if not self.stacks: return None return self.stacks[-1] def is_empty(self): last = self.get_...
[ { "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
CtCI_custom_classes/overflow_stack.py
enyquist/Cracking_the_Coding_Interview
from setuptools import setup,find_packages import os import shutil #remove the dist folder first if exists if os.path.exists("dist"): shutil.rmtree("dist") def readme(): with open('README.rst') as f: return(f.read()) VERSION = '1.0.53' def write_version_py(filename='SigProfilerTopography/version.py'): # Copied...
[ { "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
setup.py
AlexandrovLab/SigProfilerTopography
# Generic memory-mapped peripheral interface. # # Luz micro-controller simulator # Eli Bendersky (C) 2008-2010 # class Peripheral(object): """ An abstract memory-mapped perhipheral interface. Memory-mapped peripherals are accessed through memory reads and writes. The address given to reads...
[ { "point_num": 1, "id": "no_function_exceeds_5_params", "question": "Does every function in this file take 5 or fewer parameters (excluding self/cls)?", "answer": true }, { "point_num": 2, "id": "more_functions_than_classes", "question": "Does this file define more functions than cla...
3
luz_asm_sim/lib/simlib/peripheral/peripheral.py
eliben/luz-cpu
import os import pandas as pd from .utils import load_setting class Divider(object): def __init__(self, df, files, base): self.data = df self.files = files self.base = base self.writers = dict() def _setup_writer(self, outdir): assert self.files os.makedirs(o...
[ { "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
murasame/divider.py
amaotone/caruta-contest-manager
import pytest from service.common.login import LoginPage """ function:每一个函数或方法都会调用 class:每一个类调用一次,一个类可以有多个方法 module:每一个.py文件调用一次,该文件内又有多个function和class session:是多个文件调用一次,可以跨.py文件调用,每个.py文件就是module """ @pytest.fixture() def session(page): return LoginPage(page).login( username='18886885', password...
[ { "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
conftest.py
aquichita/awesome-pytest-playwright
from __future__ import annotations from . import Endpoint import web_framework_v2.http.http_request as http_request class EndpointMap: def __init__(self): self._method_routes_map = {} # HttpMethod: {route_str: Route} def get_endpoint(self, request: http_request.HttpRequest) -> tuple[Endpoint | None...
[ { "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
web_framework_v2/route/endpoint_map.py
Heknon/web_framework_v2
import numpy as np from typing import Union, Tuple, Dict class Agent(object): def get_action(self, obs:np.ndarray, stochastic:bool=True)-> Tuple[Union[int, np.ndarray, Dict], float]: raise NotImplementedError def update(self, obs:np.ndarray, act:Union[int, np.ndarray, Dict], blogp:float, reward:float...
[ { "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
rllib/agents/agent.py
ScottJordan/python-rllib
from node.myownp2pn import MyOwnPeer2PeerNode from lib.settings import the_settings def ndstart(port): node = MyOwnPeer2PeerNode("",port) node.debug = the_settings().debug_mode() node.start() def ndstop(): MyOwnPeer2PeerNode.main_node.stop() def ndconnect(ip,port): MyOwnPeer2PeerNode.main_no...
[ { "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
func/node_connection.py
cyberhacktowelie/POW-Blockchain-Network-Infrustructure
import json import re import requests import dbt.exceptions import dbt.semver PYPI_VERSION_URL = 'https://pypi.org/pypi/dbt/json' def get_latest_version(): try: resp = requests.get(PYPI_VERSION_URL) data = resp.json() version_string = data['info']['version'] except (json.JSONDecode...
[ { "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
core/dbt/version.py
ClaySheffler/dbt
import random import numpy as np from easydict import EasyDict as edict def get_default_augment_config(): config = edict() config.do_aug = True config.scale_factor = 0.25 config.rot_factor = 15 config.center_factor = 0.10 # 15% relative to the patch size config.color_factor = 0.2 config.do...
[ { "point_num": 1, "id": "all_function_names_snake_case", "question": "Are all function names in this file written in snake_case?", "answer": true }, { "point_num": 2, "id": "all_params_annotated", "question": "Does every function parameter in this file have a type annotation (excludi...
3
common/utility/augment.py
klo9klo9kloi/win_det_heatmaps
# -*- coding: utf-8 -*- from __future__ import division import numpy as np import scipy.linalg as sl from odelab.scheme import Scheme from newton import FSolve, Newton class EulerMaruyama(Scheme): def step(self,t,u,h): system = self.system noise = np.random.normal(size=[len(system.noise(t,u).T)]) def residual...
[ { "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
odelab/scheme/stochastic.py
olivierverdier/odelab
__author__ = 'erasmospunk' import unittest from utils import hash_160_to_address, bc_address_to_hash_160 class UtilTest(unittest.TestCase): def test_hash_160_to_address(self): self.assertEqual(hash_160_to_address(None), None) self.assertEqual(hash_160_to_address('04e9fca1'.decode('hex')), None) ...
[ { "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
src/test/test_utils.py
RdeWilde/ion-electrum-server
from invoke import task @task def dist(context): context.run("python setup.py bdist_wheel") @task def test(context): context.run("tox")
[ { "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": "has_nested_function_def", "question": "Does this file contain any function defined inside another function?...
3
tasks.py
mtkennerly/clingy
# Copyright 2016 Husky Team # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, softw...
[ { "point_num": 1, "id": "every_function_has_docstring", "question": "Does every function in this file have a docstring?", "answer": false }, { "point_num": 2, "id": "more_functions_than_classes", "question": "Does this file define more functions than classes?", "answer": true }...
3
python/pyhusky/frontend/library/logistic_regression_receiver.py
husky-team/PyHusky
import os import re from pathlib import Path from subprocess import PIPE from typing import List import pytest from _pytest.capture import CaptureFixture from _pytest.monkeypatch import MonkeyPatch import scanpy from scanpy.cli import main HERE = Path(__file__).parent @pytest.fixture def set_path(monkeypatch: Mon...
[ { "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
scanpy/tests/test_binary.py
gamazeps/scanpy
#!/usr/bin/env python3 # Copyright (c) 2009 Giampaolo Rodola'. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """ Generate MANIFEST.in file. """ import os import subprocess SKIP_EXTS = ('.png', '.jpg', '.jpeg') SKIP_FILES = ('.cirrus.yml',...
[ { "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
scripts/internal/generate_manifest.py
zed/psutil
""" Basic utility functions """ from __future__ import annotations import json import docker from cloudfiles import CloudFiles import cloudvolume as cv def sendjsonfile(cloudvolume: cv.CloudVolume, filename: str, content: str ) -> None: """Stores a json file us...
[ { "point_num": 1, "id": "every_function_under_20_lines", "question": "Is every function in this file shorter than 20 lines?", "answer": false }, { "point_num": 2, "id": "every_function_has_docstring", "question": "Does every function in this file have a docstring?", "answer": tru...
3
provenancetoolbox/utils.py
ZettaAI/provenance-toolbox
from plato.test.base import BaseTestCase from sqlalchemy.exc import IntegrityError from plato import db from plato.model.user import User from plato.test.utils import add_user class TestUserModel(BaseTestCase): def test_user_model(self): user = add_user('foo', 'foo@bar.com', 'test_pwd') self.asse...
[ { "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
server/plato/test/test_user_model.py
zhlooking/plato
# coding: utf-8 '''Fauzi, fauzi@soovii.com''' from flask import Blueprint, request from flask_restful import Api, reqparse from app.view import Resource from app.model import db # from app.main.model import Main from sqlalchemy.exc import SQLAlchemyError from log import logger mainBlueprint = Blueprint('main', __name...
[ { "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
app/main/view.py
fauziwei/_flask_
# Copyright (c) 2015 Pixomondo # # CONFIDENTIAL AND PROPRIETARY # # This work is provided "AS IS" and subject to the MIT License included in this # distribution package. See LICENSE. # By accessing, using, copying or modifying this work you indicate your # agreement to the MIT License. All rights # not expressly grante...
[ { "point_num": 1, "id": "all_function_names_snake_case", "question": "Are all function names in this file written in snake_case?", "answer": true }, { "point_num": 2, "id": "every_function_under_20_lines", "question": "Is every function in this file shorter than 20 lines?", "answ...
3
app.py
ssvfx41/tk-houdini-geometrynode
__copyright__ = "Copyright (c) 2020 Jina AI Limited. All rights reserved." __license__ = "Apache-2.0" from typing import Iterable from .. import QuerySetReader, BaseRecursiveDriver if False: from ...proto import jina_pb2 class SliceQL(QuerySetReader, BaseRecursiveDriver): """Restrict the size of the ``docs...
[ { "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
jina/drivers/querylang/slice.py
kaushikb11/jina
from .varint_parser import parse_varint def parse_record(stream, column_count): """ Parses SQLite's "Record Format" as mentioned here: https://www.sqlite.org/fileformat.html#record_format """ _number_of_bytes_in_header = parse_varint(stream) serial_types = [parse_varint(stream) for i in range(col...
[ { "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": "no_function_exceeds_5_params", "question": "Does every function in this file take 5 or fewer parameters (...
3
starter_templates/sqlite/python/app/record_parser.py
knarkzel/languages
# coding: utf-8 """ Isilon SDK Isilon SDK - Language bindings for the OneFS API # noqa: E501 OpenAPI spec version: 10 Contact: sdk@isilon.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ from __future__ import absolute_import import unittest import isi_sdk_9_0_0 from ...
[ { "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
isi_sdk_9_0_0/test/test_network_pools.py
mohitjain97/isilon_sdk_python
import graphene from graphene import relay from ....product import models from ...core.connection import CountableDjangoObjectType from ...core.scalars import UUID from ...meta.types import ObjectWithMetadata class DigitalContentUrl(CountableDjangoObjectType): url = graphene.String(description="URL for digital 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": "every_class_has_docstring", "question": "Does every class in this file have a docstring?", "answer": ...
3
saleor/graphql/product/types/digital_contents.py
shannenye/saleor
#!/usr/bin/python # # Copyright 2018-2021 Polyaxon, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable ...
[ { "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
core/polyaxon/client/handlers/handler.py
Ohtar10/polyaxon
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # michael a.g. aïvázis # orthologue # (c) 1998-2019 all rights reserved # """ Verify that derived descriptors get harvested correctly """ def test(): # get the descriptor package from pyre import descriptors # get the base metaclass from pyre.patterns...
[ { "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
tests/pyre/descriptors/inheritance.py
lijun99/pyre
# -*- coding: utf-8 -*- from django.db import models from apps.accounts.models.choices import Platform from apps.accounts.models.managers.phone_device import PhoneDeviceManager from django.utils.translation import ugettext_lazy as _ from apps.contrib.models.mixins import UUIDPrimaryKeyModelMixin, TimeStampedModelM...
[ { "point_num": 1, "id": "every_class_has_docstring", "question": "Does every class in this file have a docstring?", "answer": false }, { "point_num": 2, "id": "has_multiple_inheritance", "question": "Does any class in this file use multiple inheritance?", "answer": true }, { ...
3
apps/accounts/models/phone_device.py
victoraguilarc/agendas
# Generates comments with the specified indentation and wrapping-length def generateComment(comment, length=100, indentation=""): out = "" for commentChunk in [ comment[i : i + length] for i in range(0, len(comment), length) ]: out += indentation + "// " + commentChunk + "\n" return out ...
[ { "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
autocoding/util.py
badgerloop-software/pod-embedded-beta
from unittest import TestCase from tests import get_data from pytezos.michelson.converter import build_schema, decode_micheline, encode_micheline, micheline_to_michelson class StorageTestKT1VwGoijY62ze1w9iTaCum7ybMyGcw2Uep5(TestCase): @classmethod def setUpClass(cls): cls.maxDiff = None cls....
[ { "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/cases/test_KT1VwGoijY62ze1w9iTaCum7ybMyGcw2Uep5.py
juztin/pytezos-1
#!/usr/bin/env python import argparse import pdpyras import sys # Disables noisy warning logging from pdpyras import logging logging.disable(logging.WARNING) # Get all users' contact methods. # Originally by Ryan Hoskin def get_users(session): sys.stdout.write("Listing All Users' Contact Methods:\n") for us...
[ { "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
get_info_on_all_users/contact_methods.py
DuncanMillard/public-support-scripts
#подключение библиотек from PyQt5.QtCore import Qt from PyQt5.QtWidgets import QApplication, QWidget, QPushButton, QLabel,QVBoxLayout,QHBoxLayout, QMessageBox, QRadioButton #создание приложения и главного окна app=QApplication([]) main_win =QWidget() main_win.setWindowTitle('Конкурс от Crazy People') question =QLabel(...
[ { "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
youtube_contest.py
all0ws/cryze-peple
from orator import Model from orator.orm import belongs_to_many,has_many,belongs_to from config import db Model.set_connection_resolver(db) class Entry(Model): __fillable__ = ['location'] @belongs_to_many def trans(self): return Tran class Tran(Model): __fillable__ = ['name','type'] @b...
[ { "point_num": 1, "id": "more_functions_than_classes", "question": "Does this file define more functions than classes?", "answer": true }, { "point_num": 2, "id": "every_class_has_docstring", "question": "Does every class in this file have a docstring?", "answer": false }, { ...
3
orms.py
cliuxinxin/mukeniao2
import torch from torch import nn from torch.nn import functional as F LAYER1_NODE = 10240 def weights_init(m): if type(m) == nn.Conv2d: nn.init.xavier_uniform(m.weight.data) nn.init.constant(m.bias.data, 0.01) class TxtModule(nn.Module): def __init__(self, y_dim, bit): """ ...
[ { "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": "any_function_over_40_lines", "question": "Is any function in this file longer than 40 lin...
3
DCHUC/utils/txt_module.py
BMC-SDNU/Cross-Modal-Hashing-Retrieval
# -*- coding: utf-8 -*- # @File : XGBoostLRDataProcess.py # @Author : Hua Guo # @Disc : from sklearn.preprocessing import OneHotEncoder from sklearn.base import TransformerMixin, BaseEstimator from xgboost.sklearn import XGBModel from copy import deepcopy from xgboost.sklearn import XGBClassifier import logging ...
[ { "point_num": 1, "id": "has_multiple_inheritance", "question": "Does any class in this file use multiple inheritance?", "answer": true }, { "point_num": 2, "id": "has_nested_function_def", "question": "Does this file contain any function defined inside another function?", "answe...
3
src/DataPreprocess/XGBoostLRDataProcess.py
xiaoye-hua/recommendation_system
import numpy as np import pandas as pd class DataModel: """ This class implements a data model - values at time points and provides methods for working with these data. """ def __init__(self, n=0, values=None, times=None): """ A constructor that takes values and a time point. ...
[ { "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
model/src/DataModel.py
roman-baldaev/course-project
from behave import * from behave.log_capture import capture import tempfile import shutil @capture() def before_scenario(context, scenario): context.working_directory = tempfile.mkdtemp() # prepare some lists to store mentioned entities during steps context.cells = [] context.files = [] context.f...
[ { "point_num": 1, "id": "no_function_exceeds_5_params", "question": "Does every function in this file take 5 or fewer parameters (excluding self/cls)?", "answer": true }, { "point_num": 2, "id": "all_params_annotated", "question": "Does every function parameter in this file have a ty...
3
features/environment.py
alpine-data/synbconvert
import logging from typing import Any, Awaitable, Callable, Dict, Optional from aiogram import BaseMiddleware from aiogram.dispatcher.event.handler import HandlerObject from aiogram.types import TelegramObject, User from aiolimiter import AsyncLimiter logger = logging.getLogger(__name__) class ThrottlingMiddleware(...
[ { "point_num": 1, "id": "all_return_types_annotated", "question": "Does every function in this file have a return type annotation?", "answer": true }, { "point_num": 2, "id": "no_function_exceeds_5_params", "question": "Does every function in this file take 5 or fewer parameters (exc...
3
bot/middlewares/throttling.py
darksidecat/telegram-2048-bot
"""add Revision ID: 5edcaaadde99 Revises: a1d970c1214f Create Date: 2019-03-18 09:41:06.484761 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = '5edcaaadde99' down_revision = 'a1d970c1214f' branch_labels = None depends_on = None def upgrade(): # ### comman...
[ { "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
migrations/versions/5edcaaadde99_add.py
13460991260/shop
from collections import namedtuple import numpy as np from jesse.helpers import get_candle_source, np_shift, slice_candles AG = namedtuple('AG', ['jaw', 'teeth', 'lips']) def alligator(candles: np.ndarray, source_type: str = "close", sequential: bool = False) -> AG: """ Alligator :param candles: np.nd...
[ { "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
jesse/indicators/alligator.py
noenfugler/jesse
compression_methods = [''] _blosc_methods = ['blosc-blosclz', 'blosc-lz4'] try: import blosc HAVE_BLOSC = True compression_methods.extend(_blosc_methods) except ImportError: HAVE_BLOSC = False def compress(data, method, *args, **kwds): if method == '': return data _check_method(metho...
[ { "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
pyacq/core/stream/compression.py
cimbi/pyacq
# Everything covered in oop class RegisterUser: # actual class attribute user_ref_id = 100 # class constructor | deifnes class attributes def __init__(self, username, email, passcode): self.username = username self.email = email self.passcode = passcode # basic class metho...
[ { "point_num": 1, "id": "no_function_exceeds_5_params", "question": "Does every function in this file take 5 or fewer parameters (excluding self/cls)?", "answer": true }, { "point_num": 2, "id": "more_functions_than_classes", "question": "Does this file define more functions than cla...
3
OOP/review.py
danielkpodo/python-zero-to-mastery
import unittest import numpy as np from numba import autojit mu = 0.1 Lx, Ly = 101, 101 @autojit def diffusionObstacleStep(u,tempU,iterNum): for n in range(iterNum): for i in range(1, Lx - 1): for j in range(1, Ly - 1): u[i,j] = mu * (tempU[i+1,j]-2*tempU[i,j]+tempU[i-1,j] +...
[ { "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
numba/tests/test_diffusion.py
liuzhenhai/numba
from flask import current_app as app, url_for from CTFd.utils import get_config, get_app_config from CTFd.utils.config import get_mail_provider, mailserver from CTFd.utils.email import mailgun, smtp from CTFd.utils.security.signing import serialize import re EMAIL_REGEX = r"(^[^@\s]+@[^@\s]+\.[^@\s]+$)" def sendmai...
[ { "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
CTFd/utils/email/__init__.py
ramadistra/CTFd
import os from step_project.utils.import_methods import import_pygraphviz from common_utils.file_utils import get_settings def create_project_graph(project, output_filename='project_graph'): # Nodes nodes = [] edges = [] for d in sorted(os.listdir('.')): if os.path.isdir(d) and os.path.isfile(...
[ { "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
step_project/common/graph/project_graph.py
CroP-BioDiv/zcitools
import numpy as np from cobras_ts.superinstance import SuperInstance def get_prototype(A,indices): max_affinity_to_others = -np.inf prototype_idx = None for idx in indices: affinity_to_others = 0.0 for j in indices: if j == idx: continue affinity_t...
[ { "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
cobras_ts/superinstance_dtw.py
Pica4x6/cobras
from PyQt5.Qt import QMainWindow, QTabWidget, QAction from pyqt_sql_demo.widgets.connection import ConnectionWidget class MainWindow(QMainWindow): def __init__(self): super().__init__() self.setMinimumWidth(640) self.setMinimumHeight(480) # Set up QTabWidget as a central widget ...
[ { "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
pyqt_sql_demo/widgets/main.py
nshiell/pyqt-sql-demo
# Copyright (c) 2018 StackHPC Ltd. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in wr...
[ { "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
stackhpc_monasca_agent_plugins/detection/nvidia.py
stackhpc/monasca-agent-plugins
""" Upgrade custom's game dir to the latest version. """ from utils import compare_version class BaseUpgrader(object): """ Upgrade a game dir from the version in [<from_version>, <to_version>) to version <target_version>. """ # Can upgrade the game of version between from_version and to_version. ...
[ { "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_under_20_lines", "question": "Is every function in this file shorter than 20 lines?", "a...
3
muddery/server/upgrader/base_upgrader.py
MarsZone/DreamLand
from django.test import TestCase from django.urls import resolve, reverse from . import views class TestMapUrl(TestCase): def test_map_check_resloved(self): url = reverse('map.check') self.assertEqual(resolve(url).func, views.check) def test_map_fetch_resloved(self): url = reverse('m...
[ { "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
map/tests.py
Code-and-Response/ISAC-SIMO-Repo-2