source
string
points
list
n_points
int64
path
string
repo
string
""" Console Module display message of a dialog """ import wx import sys from sas.sascalc.dataloader.loader import Loader _BOX_WIDTH = 60 CONSOLE_WIDTH = 340 CONSOLE_HEIGHT = 240 if sys.platform.count("win32") > 0: _STATICBOX_WIDTH = 450 PANEL_WIDTH = 500 PANEL_HEIGHT = 550 FONT_VARIANT = 0 else: _S...
[ { "point_num": 1, "id": "no_function_exceeds_5_params", "question": "Does every function in this file take 5 or fewer parameters (excluding self/cls)?", "answer": true }, { "point_num": 2, "id": "all_params_annotated", "question": "Does every function parameter in this file have a ty...
3
src/sas/sasgui/perspectives/calculator/console.py
opendatafit/sasview
import pytest from tests.integrations import config as conf from tests.integrations import experiment as exp @pytest.mark.nightly # type: ignore def test_nas_search() -> None: config = conf.load_config(conf.experimental_path("nas_search/train_one_arch.yaml")) config = conf.set_max_steps(config, 2) exp....
[ { "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
tests/integrations/test_experimental.py
renedlog/determined
import os import argparse from datetime import datetime import asyncio from dotenv import load_dotenv from aiofile import AIOFile DELAY_TO_CONNECT = 5 def get_args(host, port, logs): '''Parses arguments from CLI.''' parser = argparse.ArgumentParser(description='Undergroung Chat CLI') parser.add_argumen...
[ { "point_num": 1, "id": "every_function_under_20_lines", "question": "Is every function in this file shorter than 20 lines?", "answer": false }, { "point_num": 2, "id": "all_function_names_snake_case", "question": "Are all function names in this file written in snake_case?", "ans...
3
read.py
olegush/underground-chat-cli
""" molssi_devops_uf.py Workshop Handles the primary functions """ def mean(num_list): """ Calculate the mean/average of a list of numbers Parameters ------------ num_list : list THe list to take the average of Returns ------------ mean_list : float The mean of the ...
[ { "point_num": 1, "id": "every_function_has_docstring", "question": "Does every function in this file have a docstring?", "answer": true }, { "point_num": 2, "id": "every_function_under_20_lines", "question": "Is every function in this file shorter than 20 lines?", "answer": fals...
3
molssi_devops_uf/molssi_math.py
zdong1995/molssi_devops_uf
import matplotlib.pyplot as plt from numpy import sin,cos,pi,sqrt,exp,floor,zeros,copy,array from numpy.random import normal from numpy.linalg import norm from random import uniform from time import time start = time() def euler(x,v): for i in range(n_particles): sigmaF = zeros(2) for j in range(n_...
[ { "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
two-body-mond.py
alifianmahardhika/galaxy_simpy
import subprocess from .autograd import Variable from graphviz import Digraph def viz(variable: Variable, filename: str) -> Digraph: f = Digraph(filename=filename) f.attr(rankdir='LR') f.attr('node', shape='rectangle') def loop(var: Variable): if var.op: f.node(str(id(var)), f"{...
[ { "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
python/src/tensor/autograd/viz.py
dawidkski/space
import logging import Queue import sia_client as sc logger = logging.getLogger(__name__) def from_upload_jobs(upload_jobs): """Creates a new upload queue from a list of upload jobs. Creates a new queue of files to upload by starting with the full input dataset and removing any files that are uploaded (...
[ { "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
sia_load_tester/upload_queue.py
mtlynch/sia_load_tester
class Node(): def __init__(self, val): self.val = val self.left = None self.right = None def insert(root, val): new_node = Node(val) parent = None curr = root while curr: parent = curr if curr.val <= val: curr = curr.right else: ...
[ { "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
data_structures/bst/insertion_iterative.py
Inquis1t0r/python-ds
from InquirerPy import prompt, inquirer from InquirerPy.separator import Separator from ...flair_management.skin_manager.skin_manager import Skin_Manager from .weapon_config_prompts import Prompts class Weight_Editor: @staticmethod def weights_entrypoint(): weapon_data, skin_data, skin_choice, weapon...
[ { "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
src/flair_management/skin_manager/weight_editor.py
PxT00/valorant-skin-cli
from django import forms from django.conf import settings from django.utils.translation import pgettext_lazy from payments import PaymentStatus from ..registration.forms import SignupForm from .models import OrderNote, Payment class PaymentMethodsForm(forms.Form): method = forms.ChoiceField( label=pgette...
[ { "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
saleor/order/forms.py
VanilleBid/weekly-saleor
import os from typing import Optional, Sequence from csr.tabular_file_reader import TabularFileReader from sources2csr.ngs import NGS, LibraryStrategy from sources2csr.ngs_reader import NgsReader, ReaderException class NgsMafReader(NgsReader): """ Mutation data reader. Parses NGS files in the MAF format....
[ { "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
sources2csr/ngs_maf_reader.py
princessmaximacenter/python_csr2transmart
from notedrive.lanzou import CodeDetail, LanZouCloud, download downer = LanZouCloud() downer.ignore_limits() downer.login_by_cookie() def example1(): print(downer.login_by_cookie() == CodeDetail.SUCCESS) def example2(): file_path = '/Users/liangtaoniu/workspace/MyDiary/tmp/weights/yolov3.weight' downe...
[ { "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
example/lanzou_example.py
notechats/notepan
from .iterator import Span, RawIterator class Token: def __init__(self, start, end): self.start = start.copy() self.end = end.copy() @property def raw(self): return str(Span(RawIterator(self.start), RawIterator(self.end))) def __str__(self): return str(Span(self.start...
[ { "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
src/quom/tokenizer/token.py
Viatorus/Quom
import unittest,os from src.tasks.scrape_reddit.tiktok import dwn_tiktok from src.tasks.generate_video.task import generate_tiktok from src.tasks.upload_video.task import upload_video class TestTiktok(unittest.TestCase): def setUp(self): pass def test_tiktok(self): context = { '...
[ { "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_return_types_annotated", "question": "Does every function in this file have a return type annotation?", "an...
3
test/test_tiktok.py
lijemutu/auddit_extension
from rest_framework import generics, authentication, permissions from rest_framework.authtoken.views import ObtainAuthToken from rest_framework.settings import api_settings from user.serializers import UserSerializer, AuthTokenSerializer class CreateUserView(generics.CreateAPIView): """Create a new user in the s...
[ { "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
app/user/views.py
Uladzimir1986/recipe-app-api
import numpy as np from agents import DiffAgentBase class DiffAgent(DiffAgentBase.DiffAgentBase): def prediction(self, observation): self.diff = [] self.noise_reduction = [] for dimension in self.space.spaces: self.diff.append(np.random.randint(0, dimension.n)) se...
[ { "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": "any_function_over_40_lines", "question": "Is any function in this file longer than 40 lines?", "answer": f...
3
agents/DiffAgent.py
sergiuionescu/gym-agents
# Time: O(m * n) # Space: O(m) import itertools import collections class Solution(object): def findDiagonalOrder(self, nums): """ :type nums: List[List[int]] :rtype: List[int] """ result, dq, col = [], collections.deque(), 0 for i in xrange(len(nums)+max(itertools...
[ { "point_num": 1, "id": "more_functions_than_classes", "question": "Does this file define more functions than classes?", "answer": false }, { "point_num": 2, "id": "every_function_has_docstring", "question": "Does every function in this file have a docstring?", "answer": true }...
3
Algo and DSA/LeetCode-Solutions-master/Python/diagonal-traverse-ii.py
Sourav692/FAANG-Interview-Preparation
from pyopenproject.business.root_service import RootService from pyopenproject.business.services.command.root.find import Find class RootServiceImpl(RootService): def __init__(self, connection): """Constructor for class RootServiceImpl, from RootService :param connection: The connection data ...
[ { "point_num": 1, "id": "every_function_has_docstring", "question": "Does every function in this file have a docstring?", "answer": false }, { "point_num": 2, "id": "has_multiple_inheritance", "question": "Does any class in this file use multiple inheritance?", "answer": false ...
3
pyopenproject/business/services/root_service_impl.py
webu/pyopenproject
"""A modified image folder class We modify the official PyTorch image folder (https://github.com/pytorch/vision/blob/master/torchvision/datasets/folder.py) so that this class can load images from both current directory and its subdirectories. """ import torch.utils.data as data from PIL import Image import os IMG_E...
[ { "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
CycleGAN/data/image_folder.py
Theomat/colorization-av-enseirb-2020
''' Get Duplicated parameter lists ''' from collections import Counter from .extension_base import ExtensionBase DEFAULT_MIN_PARAM_COUNT = 5 class LizardExtension(ExtensionBase): FUNCTION_INFO = { "parameter_list_duplicates": { "caption": " dup_param_list ", "average_caption": " ...
[ { "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
lizard_ext/lizardduplicated_param_list.py
apiiro/lizard
import curses import sys import time from pynput import keyboard from ._widget import Widget class Box(Widget): """The widget for making a text box to get a value""" def __init__(self, h, w, y, x): super().__init__("text box") self.window = curses.newwin(h, w, y, x) self.text = "ent...
[ { "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
src/client/ui/widget/simple_textbox.py
Tubular-Terriers/code-jam
#!/bin/false python3 # -*- coding: utf-8 -*- # # Copyright (C) 2020 The SymbiFlow Authors. # # Use of this source code is governed by a ISC-style # license that can be found in the LICENSE file or at # https://opensource.org/licenses/ISC # # SPDX-License-Identifier: ISC import re from BaseRunner import BaseRunner cl...
[ { "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
tools/runners/moore.py
Keno/sv-tests
class Config: def __init__(self): self.de = None self.population = None self.problem = None self.size = 0 self.dimensions = 0 self.f = 0.5 self.cr = 0.9 self.function_evaluations_budget = 0 self.evaluations_budget_left = self.function_evaluatio...
[ { "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
src/config.py
h3nnn4n/odeen
import typing import numpy as np import numba as nb @nb.njit def find_divisors( n: int, ) -> np.array: i = np.arange(int(n ** .5)) i += 1 i = i[n % i == 0] i = np.hstack((i, n // i)) return np.unique(i) @nb.njit def gpf( n: int = 1 << 20, ) -> np.array: s = np.arange(n) s[:2] = -1 i = 0 whi...
[ { "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
src/atcoder/abc212/g/sol_8.py
kagemeka/competitive-programming
import os from conans import ConanFile, CMake, tools class DecoTestConan(ConanFile): settings = "os", "compiler", "build_type", "arch" generators = "cmake", "cmake_find_package_multi" def build(self): cmake = CMake(self) cmake.configure() cmake.build() def test(self): ...
[ { "point_num": 1, "id": "has_multiple_inheritance", "question": "Does any class in this file use multiple inheritance?", "answer": false }, { "point_num": 2, "id": "has_nested_function_def", "question": "Does this file contain any function defined inside another function?", "answ...
3
recipes/deco/all/test_package/conanfile.py
dpronin/conan-center-index
from django.http import HttpResponse from django.shortcuts import render # Create your views here. from rest_framework.views import APIView from rest_framework.response import Response from libs.captcha.captcha import captcha from django_redis import get_redis_connection from verifications.serializers import Register...
[ { "point_num": 1, "id": "every_class_has_docstring", "question": "Does every class in this file have a docstring?", "answer": false }, { "point_num": 2, "id": "has_multiple_inheritance", "question": "Does any class in this file use multiple inheritance?", "answer": false }, {...
3
meiduo02/mall/apps/verifications/views.py
sunsyw/web
# -*- coding: utf-8 -*- from model.contact_data import Contact_option def test_add_new(app): old_contacts = app.contact.get_contact_list() contact = Contact_option(first_name="Kamaz", middle_name="Petroviz", last_name="Testov", nick_name="petro", title="neznay",company="opensystem", address="moskva", ...
[ { "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
test/test_contact_creation.py
AlexeyKozlov/python_training-master
from typing import Tuple class Clock: MINS_PER_HOUR = 60 HOURS_PER_DAY = 24 def __init__(self, hour: int, minute: int) -> None: nhours, nmins = self.__normalize(hour, minute, self.MINS_PER_HOUR) _, nhours = self.__normalize(0, nhours, self.HOURS_PER_DAY) self.hours = nhours ...
[ { "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
problems/exercism/clock/clock.py
JayMonari/py-personal
# 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": "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
isi_sdk_9_0_0/test/test_ndmp_settings_variables_variable.py
mohitjain97/isilon_sdk_python
"""find() finds the path of a project within projects path. """ import glob import re __all__ = ['find'] def find(*, path, name): """Look for Project("proj_foo") in __init__.py files under path. Since this function should be called to compare code in one git repo with another repo, we do the search ...
[ { "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
birgitta/project/find.py
telia-oss/birgitta
from LinguaFrancaBase.constants import * #Useful constants from LinguaFrancaBase.functions import * #Useful helper functions from LinguaFrancaBase.classes import * #Useful classes import sys import copy sys.setrecursionlimit(100000) EXPECTED = 10000 class _Ping: count = 1000000 pingsLeft = count def __ini...
[ { "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
benchmark/Python/Savina/PingPong.py
Feliix42/lingua-franca
class Node: def __init__(self, val): self.val = val self.left = None self.right = None self.height = 1 def insert(node, val): if not node: return Node(val) if val <= node.val: node.left = insert(node.left, val) else: node.right = insert(node.rig...
[ { "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
practice/bst.py
haandol/dojo
from flask import Flask, request from twilio.twiml.messaging_response import MessagingResponse from utils import fetch_reply app = Flask(__name__) @app.route("/") def hello(): return "Hello, World!" @app.route("/sms", methods=['POST']) def sms_reply(): """Respond to incoming calls with a simple text message...
[ { "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
app.py
mHamzaArain/Whatsapp_assistant_bot
# recursive def _factorial(num): if num < 0: raise ValueError("number must be positive.") if num == 0: return 1 else: return num*_factorial(num - 1) # iterative def factorial(num): result = 1 if num < 0: raise ValueError("number must be positive.") while num > 0:...
[ { "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
Factorial Finder/factorial.py
yashpatel123a/Mini-Projects
from .utils import * from .funcs import * def test_unit(): storage = Storage() @op(storage) def f(x:int) -> int: return x + 1 @superop(storage) def f_twice(x:int) -> int: return f(f(x)) with run(storage, autocommit=True): f_twice(42) cg = storage.cal...
[ { "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
mandala/tests/test_call_graph.py
amakelov/mandala
import os import sys import pytest from bs4 import BeautifulSoup sys.path.insert(0, os.path.abspath('.')) sys.path.append(os.path.join(os.path.abspath('.'), 'habrpars')) @pytest.fixture def page(): path = os.path.abspath('.') filename = os.path.join(path, 'habrpars', 'fixtures', 'page.html') return fil...
[ { "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
habrpars/tests/conftest.py
mitrofun/habrpars
class TestDay002(object): testcases = [ ([3, 2, 1], [2, 3, 6]), ([1, 2, 3, 4, 5], [120, 60, 40, 30, 24]), ([5, 4, 3, 2, 1], [24, 30, 40, 60, 120]) ] def test_product_expect_self01(self): from solutions.day_002.solution01 import product_expect_self for (inputs, expect...
[ { "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_day_002.py
Hsins/Daily-Coding-Problem
""" @author: ksanoo @updated_at: 12/4/2020 @description: All parameters that are to be swept (specified in sweep_setup files) must have a class definition in this script. The class name must be the same as the parameter key in loop_param """ import global_vars as swp_gbl from parameter_classes import GenericParam impo...
[ { "point_num": 1, "id": "no_function_exceeds_5_params", "question": "Does every function in this file take 5 or fewer parameters (excluding self/cls)?", "answer": true }, { "point_num": 2, "id": "every_function_under_20_lines", "question": "Is every function in this file shorter than...
3
Python_Mscs/parametric_sweep/parameter_classes_tx.py
kaungsgit/Python_DSP
# THIS FILE IS AUTO-GENERATED. DO NOT EDIT from verta._swagger.base_type import BaseType class ModeldbAddProjectTags(BaseType): def __init__(self, id=None, tags=None): required = { "id": False, "tags": False, } self.id = id self.tags = tags for k, v in required.items(): if 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": "more_functions_than_classes", "question": "Does this file define more functions than classes?", "answ...
3
client/verta/verta/_swagger/_public/modeldb/model/ModeldbAddProjectTags.py
CaptEmulation/modeldb
from graphgallery.sequence import FullBatchSequence from graphgallery import functional as gf from graphgallery.gallery.nodeclas import TensorFlow from graphgallery.gallery import Trainer from graphgallery.nn.models import get_model @TensorFlow.register() class DenseGCN(Trainer): """ Implementation of Den...
[ { "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
graphgallery/gallery/nodeclas/tensorflow/densegcn.py
TobiasSchmidtDE/GraphGallery
# -*- coding: utf-8 -*- from __future__ import absolute_import, unicode_literals import os import platform from unittest.case import TestCase import placa_grafica from templates import FRAMES class TestesDoMotor(TestCase): def test_inverter_coordenadas(self): self.assertTupleEqual((0, placa_grafica.ALTURA...
[ { "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
testes/test_placa_grafica.py
vizagre/pythonbirds
import torch from torch.nn import Module from torch.nn import init from torch.nn.parameter import Parameter # Acknowledgements: https://github.com/wohlert/semi-supervised-pytorch class Standardize(Module): """ Applies (element-wise) standardization with trainable translation parameter μ and scale parameter σ...
[ { "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
src/networks/layers/standard.py
leyiweb/Deep-SAD-PyTorch
from django import template from ..models import Post,Category register = template.Library() @register.simple_tag def get_recent_posts(num=5): return Post.objects.all().order_by('-created_time')[:num] @register.simple_tag def archives(): return Post.objects.dates('created_time', 'month', order='DESC') @register.s...
[ { "point_num": 1, "id": "every_function_has_docstring", "question": "Does every function in this file have a docstring?", "answer": false }, { "point_num": 2, "id": "all_function_names_snake_case", "question": "Are all function names in this file written in snake_case?", "answer"...
3
blog/templatetags/blog_tags.py
triumph1001/gitblogproject
from flask_unchained.bundles.sqlalchemy import SessionManager, SQLAlchemyUnchained def setup(db: SQLAlchemyUnchained): session_manager = SessionManager(db) class Foo(db.Model): class Meta: lazy_mapped = False name = db.Column(db.String) db.create_all() return Foo, sessio...
[ { "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/bundles/sqlalchemy/services/test_session_manager.py
achiang/flask-unchained
# reset datetime stamps to make them aware and not naive from django.core.management.base import BaseCommand import datetime import pytz from op_tasks.models import Dataset, Product, OpTask, UserProfile, TaskListItem class Command(BaseCommand): def update_time(self): saved_task_items = TaskListItem.objects.all() ...
[ { "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
op_tasks/management/commands/update_datetime.py
isabella232/incubator-flagon-stout
#Nilo soluction class Estado: def __init__(self, nome, sigla): self.nome = nome self.sigla = sigla self.cidades = [] def adiciona_cidades(self, cidade): cidade.estado = self self.cidades.append(cidade) def populacao(self): return sum([c.populacao for c in s...
[ { "point_num": 1, "id": "no_function_exceeds_5_params", "question": "Does every function in this file take 5 or fewer parameters (excluding self/cls)?", "answer": true }, { "point_num": 2, "id": "all_params_annotated", "question": "Does every function parameter in this file have a ty...
3
IntroProPython/aula10-poo/ex10_9.py
SweydAbdul/estudos-python
import cupy as np def supersample(clip, d, n_frames): """Replaces each frame at time t by the mean of `n_frames` equally spaced frames taken in the interval [t-d, t+d]. This results in motion blur. """ def filter(get_frame, t): timings = np.linspace(t - d, t + d, n_frames) frame_avera...
[ { "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
moviepy/video/fx/supersample.py
va6996/moviepy
#!../../../env/bin/python """ Script to scan through archive of mbox files and produce a spam report. """ # Standalone broilerplate ------------------------------------------------------------- from django_setup import do_setup do_setup() # -------------------------------------------------------------------------------...
[ { "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
backend/mlarchive/bin/check_spam_legacy.py
dkg/mailarch
from scrapy import Spider class AuthorSpider(Spider): name = 'author' start_urls = [ 'http://quotes.toscrape.com/', ] def parse(self, response): #follow links to author pages for href in response.css('.author + a::attr(href)'): yield response.follow(href, ca...
[ { "point_num": 1, "id": "has_multiple_inheritance", "question": "Does any class in this file use multiple inheritance?", "answer": false }, { "point_num": 2, "id": "has_nested_function_def", "question": "Does this file contain any function defined inside another function?", "answ...
3
practice/practice/spiders/authors.py
Soulzerz/py_web_crawler
class Transport: name = '' @property def cache(self): return self.handshake.cache @property def config(self): return self.handshake.config @property def app(self): return self.handshake.app def on_open(self, client): raise NotImplementedError
[ { "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
lux/ext/sockjs/transports/__init__.py
quantmind/lux
#!/usr/bin/env python # coding=utf-8 """ @author: Jiawei Wu @create time: 2020-04-06 15:36 @edit time: 2020-04-06 15:37 @FilePath: /vvlab/utils/OUProcess.py @desc: """ import numpy as np class OUProcess(object): """Ornstein-Uhlenbeck process""" def __init__(self, x_size, mu=0, theta=0.15, sigma=0.3): ...
[ { "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
vvlab/utils/OUProcess.py
yuhuihan/Reinforcement-Learning
from quapy.data import LabelledCollection from .base import BaseQuantifier class MaximumLikelihoodPrevalenceEstimation(BaseQuantifier): """ The `Maximum Likelihood Prevalence Estimation` (MLPE) method is a lazy method that assumes there is no prior probability shift between training and test instances (pu...
[ { "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
quapy/method/non_aggregative.py
valgur/QuaPy
# -*- coding: utf-8 -*- import unittest from pathlib import Path from knipse.db import KnipseDB from knipse.scan import scan_images from knipse.lists import image_id_from_string from .test_walk import EXPECTED_IMAGES class TestKnipseDatabase(unittest.TestCase): def setUp(self) -> None: self.src = Path(...
[ { "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
tests/test_lists.py
luphord/knipse_old
import os import pytest # import re import testinfra.utils.ansible_runner testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner( os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all') @pytest.mark.parametrize('pkg', [ 'curl', 'sshpass', ]) def test_pkg(host, pkg): package = host.package(pkg) ...
[ { "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
provisioning/molecule/gitlab/tests/test_default.py
ortizmj12/DevSecOps-Studio
import sqlalchemy from functools import partial async def create_engine(*args, **kwargs): engine = sqlalchemy.create_engine(*args, **kwargs) if engine.driver == "psycopg2": import asyncpg p = await asyncpg.create_pool(str(engine.url)) elif engine.driver == "pyodbc": imp...
[ { "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
aiodata/db/connection.py
jan-mue/aiodata
import tensorflow as tf print(tf.__version__) import os from . import converter DEBUG_OUTPUT = False def model_id_to_ord(model_id): if 0 <= model_id < 4: return model_id # id is already ordinal elif model_id == 50: return 0 elif model_id == 75: return 1 elif model_id == 100...
[ { "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/kgmk/ds/img/pose_estimation/posenet/model.py
kagemeka/python
import queue import threading import time import concurrent.futures q = queue.Queue(maxsize=10) def Producer(name): count = 1 while True: q.put("包子 %s" % count) print("做了包子", count) count += 1 time.sleep(0.5) def Consumer(name): while True: print("[%s] 取到[%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_nested_function_def", "question": "Does this file contain any function defined inside another function?", "...
3
qu.py
oldshensheep/crawl-yande.re
from abc import ABC, abstractmethod class Optimizer(ABC): def __init__(self): super().__init__() @abstractmethod def optimize(self, u_n): pass
[ { "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
python/optimizer/optimizer.py
sarahaguasvivas/GPC
# -*- coding: utf-8 -*- import platform from . import __version__ _sys_info = '{0}: {1}'.format(platform.system(), platform.machine()) _python_ver = platform.python_version() USER_AGENT = 'UCloud UFile Python SDK {0} ({1} : Python/{2})'.format(__version__, _sys_info, _python_ver) UCLOUD_PROXY_SUFFIX = '.cn-bj.ufile...
[ { "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
ufile/config.py
NightRain233/ufile-sdk-python
# Author: Christian Brodbeck <christianbrodbeck@nyu.edu> import pickle from nose.tools import eq_ import numpy as np from numpy.testing import assert_array_equal from eelbrain import datasets from eelbrain._stats.spm import LM, LMGroup def test_lm(): ds = datasets.get_uts() model = ds.eval("A*B*Y") coeff...
[ { "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
eelbrain/_stats/tests/test_spm.py
reddigari/Eelbrain
#Logging import logging logging.basicConfig(level=logging.DEBUG, format='%(asctime)s - %(name)s - %(levelname)s - %(message)s') logger = logging.getLogger(__name__) import os import pyrogram from chat import Chat from config import Config logging.getLogger('pyrogram').setLevel(logging.WARNING) ...
[ { "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
plugins/help_text.py
ilhamr0f11/Sub-Mux-IR-Bot
import torch.nn as nn import torch.nn.functional as F class noise_Conv2d(nn.Conv2d): def __init__(self, in_channels, out_channels, kernel_size, stride=1, padding=0, dilation=1, groups=1, bias=True, noise_std=0.1): super(noise_Conv2d, self).__init__(in_channels, out_chann...
[ { "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
cnns/nnlib/robustness/pni/code/models/noise_layer_robust.py
anonymous-user-commits/perturb-net
import numpy as np from seisflows.tools import unix from seisflows.tools.array import loadnpy, savenpy from seisflows.tools.array import grid2mesh, mesh2grid, stack from seisflows.tools.code import exists from seisflows.tools.config import SeisflowsParameters, SeisflowsPaths, \ ParameterError, custom_import from ...
[ { "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
seisflows/postprocess/total_variation.py
chukren/seisflows
# This problem was asked by Facebook. # Given an N by N matrix, rotate it by 90 degrees clockwise. # For example, given the following matrix: # [[1, 2, 3, 4], # [5, 6, 7, 8], # [9, 10, 11, 12], # [13, 14, 15, 16]] # you should return: # Follow-up: What if you couldn't use any extra space? #### def rotate90(arr): ...
[ { "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
168.py
whoophee/DCP
import discord import io import aiohttp from aiohttp import request, ClientSession from src.embeds.image_embed import ImageEmbed async def request_canvas_image(ctx, url, member: discord.Member = None, params={}, is_gif=False): params_url = "&" + "&".join(["{}={}".format(k, v) for k...
[ { "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
src/helpers/api_handler.py
alejandrodlsp/grogu-bot
import datetime from datetime import datetime, timedelta from time import sleep from app.search import add_to_index, delete_index, create_index, query_index from app import db from app.models import Post, User from tests.BaseDbTest import BaseDbTest class SearchTest(BaseDbTest): index_name = "test_index" d...
[ { "point_num": 1, "id": "every_function_has_docstring", "question": "Does every function in this file have a docstring?", "answer": false }, { "point_num": 2, "id": "has_nested_function_def", "question": "Does this file contain any function defined inside another function?", "ans...
3
tests/SearchTest.py
cuongbm/microblog
import os import numpy as np import psutil def calculate_ETA(last_epoch_times, current_iteration, max_iterations): """Calculates remaining training time in seconds Args: last_epoch_times (list/deque): Running time of last epochs current_iteration (int): current iteration number max_i...
[ { "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
utils.py
cvillacampa/dgps_pep
import pkg_resources pkg_resources.require( "SQLAlchemy >= 0.4" ) from sqlalchemy import * from sqlalchemy.orm import * from sqlalchemy.interfaces import * import logging log = logging.getLogger( __name__ ) dialect_to_egg = { "sqlite": "pysqlite>=2", "postgres": "psycopg2", "postgresql": "psycopg2", ...
[ { "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
lib/galaxy/model/orm/__init__.py
blankenberg/galaxy-data-resource
# The MIT License (MIT) # # Copyright (c) 2014 coolchip # # 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...
[ { "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
udpout.py
coolchip/amp-switch
class Complex: def create(self, real_part, imag_part): self.r = real_part self.i = imag_part def build(self): self.num = complex(self.r, self.i) complex_number = Complex() # Instantiate a complex number object complex_number.create(12, 5) # Call create method with real_part = 12 and...
[ { "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_params_annotated", "question": "Does every function parameter in this file have a type annotation (excluding self/cls)?"...
3
Classes and objects/The self parameter/self_parameter.py
7Chilly/introduction_to_python
# -*- coding: utf-8 -*- from sqlalchemy import Column, String, Integer from sqlalchemy.ext.declarative import declarative_base from zvt.api.data_type import Region, Provider from zvt.contract import Portfolio, PortfolioStockHistory from zvt.contract.register import register_entity, register_schema FundMetaBase = decl...
[ { "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
zvt/domain/meta/fund_meta.py
doncat99/FinanceAnalysis
from rest_framework import serializers from rest_framework_jwt.settings import api_settings from django.contrib.auth.models import User class UserSerializer(serializers.ModelSerializer): class Meta: model = User fields = ('username', 'first_name', 'last_name') class UserSerializerWithToken(seri...
[ { "point_num": 1, "id": "more_functions_than_classes", "question": "Does this file define more functions than classes?", "answer": false }, { "point_num": 2, "id": "every_function_has_docstring", "question": "Does every function in this file have a docstring?", "answer": false ...
3
backend/core/serializers.py
mariaeid/Examensarbete
from websocket_manager import WebsocketManager class HuobiWsManagerFactory(): def get_ws_manager(self, symbol: str): """Jay""" book_url = "wss://api-aws.huobi.pro/feed" trades_url = 'wss://api-aws.huobi.pro/ws' # Subscribe to channels def subscribe_book(ws_manager): ...
[ { "point_num": 1, "id": "has_nested_function_def", "question": "Does this file contain any function defined inside another function?", "answer": true }, { "point_num": 2, "id": "all_params_annotated", "question": "Does every function parameter in this file have a type annotation (exc...
3
src/huobi/huobi_ws_factory.py
EzePze/l3_data_collection
from typing import List from collections import deque # Definition for a Node. class Node: def __init__(self, val=None, children=None): self.val = val self.children = children class Solution: # This is a spin-off of my third solution to LeetCode #589. Once I had # that one working, this...
[ { "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
LeetCode/1-1000/401-500/426-450/429. N-ary Tree Level Order Traversal/solution-python.py
adubois85/coding_challenge_websites
import pytest from content.ext.envconfig import EnvConfig @pytest.mark.parametrize('use_init_app', [True, False]) def test_ext_init(app, mocker, use_init_app): mock_init_app = mocker.patch.object(EnvConfig, 'init_app') if use_init_app: ext = EnvConfig() ext.init_app(app) else: Env...
[ { "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
tests/ext/test_envconfig.py
Zipmatch/zipmatch-content
import os # Send a command to the linux terminal def terminal(cmd): #print(cmd) return os.popen(cmd).read() def getServerProcessID(): output = terminal('ps -A | grep bssl') output = output.strip().split(' ') if len(output) == 0 or output[0] == '': return None pid = int(output[0]) return pid def stopServer(): ...
[ { "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
QUIC-project/Stopserver.py
prchander/boringssl
from ulauncher.api.client.Extension import Extension from ulauncher.api.shared.action.ExtensionCustomAction import ExtensionCustomAction from ulauncher.api.client.EventListener import EventListener from ulauncher.api.shared.event import KeywordQueryEvent, ItemEnterEvent from ulauncher.api.shared.item.ExtensionResultIte...
[ { "point_num": 1, "id": "more_functions_than_classes", "question": "Does this file define more functions than classes?", "answer": false }, { "point_num": 2, "id": "all_function_names_snake_case", "question": "Are all function names in this file written in snake_case?", "answer":...
3
main.py
manulaiko/ulauncher-openInBrowser
import copy import os from flask import Flask, request, jsonify from queue import PriorityQueue from threading import Thread # Agent from end2end.soloist.methods.baseline.SoloistAgent import Soloist rgi_queue = PriorityQueue(maxsize=0) rgo_queue = PriorityQueue(maxsize=0) app = Flask(__name__) # soloist model model...
[ { "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
end2end/submission3/human.py
boliangz/dstc9
from django.db import models from datetime import datetime from django.contrib.auth.models import User from django.db.models.signals import post_save from django.dispatch import receiver # Create your models here. class Tutorial(models.Model): tutorial_title = models.CharField(max_length = 200) tutorial_published =...
[ { "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
mysite/main/models.py
Anjani100/mysite-tuts
from tkinter import * from tkinter.scrolledtext import ScrolledText import win32clipboard import webbrowser corBG = '#D8F3DC' cor1 = '#40916c' cor2 = '#6c757d' def callback(Link): webbrowser.open_new(Link) def Gerador_Link(): def btn_Copiar(): copiado = str(Link) print('\033[1;33;41m TEXTO CO...
[ { "point_num": 1, "id": "has_nested_function_def", "question": "Does this file contain any function defined inside another function?", "answer": true }, { "point_num": 2, "id": "every_function_under_20_lines", "question": "Is every function in this file shorter than 20 lines?", "...
3
Gerar Link WhatsApp/WhatsAppAPI.py
EuCarlos/10-Dias-de-Projeto
################################################################### ## Test case for tasks ## ## ## ## How to run ? : ## ## $ python tests/integration/tes...
[ { "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/integration/testTasks.py
claudep/cloudconvert-python
"""A nominal composition value.""" from gemd.entity.value.composition_value import CompositionValue class NominalComposition(CompositionValue): """ Nominal composition, represented as a map from the component names to the quantities. The quantities do not express an uncertainty but also do not imply that...
[ { "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
gemd/entity/value/nominal_composition.py
ventura-rivera/gemd-python
import json import plotly import pandas as pd from flask import Flask from flask import render_template, request, jsonify from plotly.graph_objs import Bar, Histogram, Scatter, Table import plotly.graph_objs as go import yfinance as yf import sys import re import datetime as dt import sys sys.path.append("..") from...
[ { "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
app/run.py
tnkarthik/stock_analysis
# <auto-generated> # This code was generated by the UnitCodeGenerator tool # # Changes to this file will be lost if the code is regenerated # </auto-generated> def to_celsius(value): return value - 273.15 def to_fahrenheit(value): return ((value - 273.15) * 1.8) + 32.0 def to_rankine(value): return value * 1.8
[ { "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
units/temperature/kelvin.py
putridparrot/PyUnits
__doc__ = 'Creates an instance of the App class, loads the main menu and \ enters main loop.' from interface import Interface from library import Time class App(): 'Application Class ' def __init__(self): self.app = Interface() def loop(self): """ Main Loop """ self.app.load_main_menu() ...
[ { "point_num": 1, "id": "every_function_under_20_lines", "question": "Is every function in this file shorter than 20 lines?", "answer": false }, { "point_num": 2, "id": "more_functions_than_classes", "question": "Does this file define more functions than classes?", "answer": true...
3
app.py
ichpuchtli/Geometry-Genocide
from unittest import TestCase from ipipeline.structure.node import Node class TestNode(TestCase): def test_init(self) -> None: node = Node( 'n1', mock_task, inputs={'param1': 7}, outputs=['return1'], tags=['t1'] ) self.asser...
[ { "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
tests/structure/test_node.py
novaenext/ipipeline
from gatekeeping.db import get_db from flask import abort def get_submission_reasons(): submission_reasons = get_db().execute( 'SELECT *' ' FROM submission_reason' ).fetchall() return submission_reasons def get_submission_reason(id): submission_status = get_db().execute( 'SELE...
[ { "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
web/gatekeeping/api/submission_reason.py
gabegm/Headcount-Planning-Management-System
from checkov.common.models.enums import CheckCategories, CheckResult from checkov.kubernetes.base_spec_check import BaseK8Check class ContainerSecurityContext(BaseK8Check): def __init__(self): # CIS-1.5 5.7.3 name = "Apply security context to your pods and containers" # Security context ...
[ { "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
checkov/kubernetes/checks/ContainerSecurityContext.py
cclauss/checkov
#!/usr/bin/env python """ .. py:currentmodule:: FileFormat.Results.test_Dump .. moduleauthor:: Hendrix Demers <hendrix.demers@mail.mcgill.ca> Tests for module `Dump` """ # Script information for the file. __author__ = "Hendrix Demers (hendrix.demers@mail.mcgill.ca)" __version__ = "" __date__ = "" __copyright__ = "Cop...
[ { "point_num": 1, "id": "every_function_has_docstring", "question": "Does every function in this file have a docstring?", "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
pymcxray/FileFormat/Results/test_Dump.py
drix00/pymcxray
#!/usr/bin/env python # -*- coding: utf-8 -*- """ test_garbagetruck ---------------------------------- Tests for `garbagetruck` module. """ import pytest from contextlib import contextmanager from click.testing import CliRunner from garbagetruck import garbagetruck from garbagetruck import cli class TestGarbaget...
[ { "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
tests/test_garbagetruck.py
bradrf/garbagetruck
import os import sys import gen_database as gendb import json from shutil import copyfile def run_cmd(cmd): cmd_pipe = os.popen(cmd) cmd_print = cmd_pipe.read() print(cmd_print) if __name__ == '__main__': print("") root_read_dir = sys.argv[1] if root_read_dir[-1] != r"/" or r...
[ { "point_num": 1, "id": "all_params_annotated", "question": "Does every function parameter in this file have a type annotation (excluding self/cls)?", "answer": false }, { "point_num": 2, "id": "no_function_exceeds_5_params", "question": "Does every function in this file take 5 or fe...
3
doc/gen_javadoc.py
ChillingVan/LocalHtmlSearchBox
class Virus(object): '''Properties and attributes of the virus used in Simulation.''' def __init__(self, name, repro_rate, mortality_rate): self.name = name self.repro_rate = repro_rate self.mortality_rate = mortality_rate def test_virus_instantiation(): #TODO: Create your own tes...
[ { "point_num": 1, "id": "more_functions_than_classes", "question": "Does this file define more functions than classes?", "answer": true }, { "point_num": 2, "id": "has_nested_function_def", "question": "Does this file contain any function defined inside another function?", "answe...
3
Projects/HerdImmunity/virus.py
AbdullahNoori/CS-1.1-Intro-to-Programming
# -*- coding: utf-8 -*- """A client to the Monarch Disease Ontology (MONDO).""" from typing import Optional from indra.databases.obo_client import OboClient _client = OboClient(prefix='mondo') def get_name_from_id(mondo_id: str) -> Optional[str]: """Return the name corresponding to the given MONDO ID. Pa...
[ { "point_num": 1, "id": "all_function_names_snake_case", "question": "Are all function names in this file written in snake_case?", "answer": true }, { "point_num": 2, "id": "all_params_annotated", "question": "Does every function parameter in this file have a type annotation (excludi...
3
indra/databases/mondo_client.py
dianakolusheva/indra
import os import yaml from .cassette import Cassette def load_cassette(cassette_path): try: pc = yaml.load(open(cassette_path)) cassette = Cassette(pc) return cassette except IOError: return None def save_cassette(cassette_path, cassette): dirname, filename = os.path.spli...
[ { "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
vcr/files.py
charlax/vcrpy
# (c) Copyright [2017] Hewlett Packard Enterprise Development LP # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
[ { "point_num": 1, "id": "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
python/dlbs/tests/test_config_caffe2.py
joehandzik/dlcookbook-dlbs
#!/usr/bin/env python # -*- coding: utf-8 -*- # ############################################################################## from PyQt4.QtGui import ( QWidget, QListWidget, QVBoxLayout, ) ############################################################################## class QPacketList(QWidget): def...
[ { "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
ether/qpacketlist.py
alexin-ivan/ether
import abc import xml.etree.ElementTree as ET from typing import Type from humanfriendly import parse_size, format_size from pystatus.plugin import IPlugin, IInstance class StorAvailPlugin(IPlugin): def __init__(self, name: str, version: str, author: str, inst: Type[IInstance]): super()._...
[ { "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
pystatus/internal/bases.py
g0dsCookie/pystatus
class Solution: def maxDiv(self, a: int, b: int) -> int: while a % b == 0: a = a / b return a def isUgly2(self, n: int) -> bool: n = self.maxDiv(n, 2) n = self.maxDiv(n, 3) n = self.maxDiv(n, 5) return n == 1 def isUgly(self, n: int) -> bool: ...
[ { "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
easy/ugly number/solution.py
i-redbyte/leetcode
class HermiteFace(Face,IDisposable): """ A cubic hermite spline face of a 3d solid or open shell. """ def Dispose(self): """ Dispose(self: APIObject,A_0: bool) """ pass def ReleaseManagedResources(self,*args): """ ReleaseManagedResources(self: APIObject) """ pass def ReleaseUnmanagedResources(self,*...
[ { "point_num": 1, "id": "all_function_names_snake_case", "question": "Are all function names in this file written in snake_case?", "answer": false }, { "point_num": 2, "id": "has_multiple_inheritance", "question": "Does any class in this file use multiple inheritance?", "answer":...
3
stubs.min/Autodesk/Revit/DB/__init___parts/HermiteFace.py
ricardyn/ironpython-stubs
from django.shortcuts import render from users.models import Reward from django.core.paginator import Paginator, PageNotAnInteger, EmptyPage from django.shortcuts import get_object_or_404 from .filters import RewardFilter from .models import BadgeClaim def badge_list(request): query = Reward.objects.order_by('-ti...
[ { "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
badge/views.py
Gagan-Shenoy/sushiksha-website