source
string
points
list
n_points
int64
path
string
repo
string
# Copyright 2017 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ag...
[ { "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
google-cloud-sdk/lib/surface/ml/operations/delete.py
KaranToor/MA450
# 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 # distributed under the...
[ { "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
zun/conf/utils.py
wanghuiict/zun
from logging import Logger import injector __all__ = [ # module "DownloadsInfrastructure", ] from sqlify import Sqlite3Sqlify from downloads import ( GetTotalFiles, GetFileStatus, GetBulkFileStatus, FilesRepository, DownloadRepository, ) from downloads_infrastructure.queries import ( ...
[ { "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
manager/downloads_infrastructure/downloads_infrastructure/__init__.py
G4brym/download-manager
from scfmsp.controlflowanalysis.instructions.AbstractInstructionTwoRegisters import AbstractInstructionTwoRegisters class InstructionDadd(AbstractInstructionTwoRegisters): name = 'dadd' def get_execution_time(self): return self.clock def execute_judgment(self, ac): super(InstructionDadd,...
[ { "point_num": 1, "id": "has_nested_function_def", "question": "Does this file contain any function defined inside another function?", "answer": false }, { "point_num": 2, "id": "has_multiple_inheritance", "question": "Does any class in this file use multiple inheritance?", "answ...
3
scfmsp/controlflowanalysis/instructions/InstructionDadd.py
sepidehpouyan/SCF-MSP430
#!/usr/bin/env python # -*- coding: utf-8 -*- #author:range def assign(service, arg): if service == "zhengfang": return True, arg def audit(arg): url1 = arg + 'default_ysdx.aspx' url2 = arg + 'default6.aspx' url3 = arg + 'default5.aspx' code1, head1, res1, errcode1,finalurl1 = ...
[ { "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
Bugscan_exploits-master/exp_list/exp-390.py
csadsl/poc_exp
import os from os.path import join, dirname from dotenv import load_dotenv from urllib.parse import urlparse # loading .env file env_path = join(dirname(__file__), '.env') load_dotenv(env_path) # use function def url_path_check(path): sample_host = 'http://localhost' sample_url = sample_host + path ...
[ { "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
backend/config.py
takusan64/world-dictionary-backend
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright (C) 2005 onwards University of Deusto # All rights reserved. # # This software is licensed as described in the file COPYING, which # you should have received as part of this distribution. # # This software consists of contributions made by many individuals, # list...
[ { "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
server/src/voodoo/sessions/serializer.py
romainrossi/weblabdeusto
import os import sys sys.path.append(os.path.abspath(os.path.join(__file__, "../../../"))) import v2.utils.utils as utils import traceback SSL_CERT_PATH = '/etc/ssl/certs/' PEM_FILE_NAME = 'server.pem' PEM_FILE_PATH = os.path.join(SSL_CERT_PATH, PEM_FILE_NAME) import logging log = loggi...
[ { "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
rgw/v2/lib/pem.py
rpratap-bot/ceph-qe-scripts
import sys import traceback from titration.utils import analysis, constants, interfaces, routines def run(): """Main driver for the program. Initializes components and queries the user for next steps""" try: # initialize components initialize_components() # output prompt to LCD scree...
[ { "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
titration/utils/titration.py
Noah-Griffith/AlkalinityTitrator
#!/usr/bin/env python3 from abc import ABCMeta, abstractmethod # Given Book class class Book(object, metaclass=ABCMeta): def __init__(self,title,author): self.title=title self.author=author @abstractmethod def display(): pass # MyBook class class MyBook(Book): price = 0 def __init__(self, title, author,...
[ { "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
day13.py
matthewmuccio/30DaysofCode
from torch.nn.modules.module import Module from torch.autograd import Function, Variable import resample2d_cuda class Resample2dFunction(Function): @staticmethod def forward(ctx, input1, input2, kernel_size=1, bilinear= True): assert input1.is_contiguous() assert input2.is_contiguous(...
[ { "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
networks/resample2d_package/resample2d.py
ryannggy/fn-colab
import os from google.cloud import firestore from google.cloud import vision def photo_analysis_service(event, context): bucket = os.environ.get('BUCKET', 'my-bmd-bucket') file_name = event['name'] objects = _analyze_photo(bucket, file_name) _store_results(bucket, file_name, objects) def _analyze_...
[ { "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
function/main.py
verobega/google-photos-clon
# Standard library imports import json import threading import logging # Third party imports from kafka import KafkaConsumer # Local application imports from Config.config import KafkaTopicNames, KafkaConfig, KafkaGroupIds from Module.kafkaProducer.elasticSendProducer import ElasticSendProducers class NessusOutputCo...
[ { "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
Module/kafkaConsumer/nessusOutputConsumer.py
vietnakid/VulnerabilityManagement
TAM_MAX_CH = 26 def recebeModo(): """ Função que pergunta se o usuário quer criptografar ou decriptografar e garante que uma entrada válida foi recebida """ while True: modo = input("Você deseja criptografar ou decriptografar?\n").lower() if modo in 'criptografar c decriptografar d...
[ { "point_num": 1, "id": "all_function_names_snake_case", "question": "Are all function names in this file written in snake_case?", "answer": false }, { "point_num": 2, "id": "all_params_annotated", "question": "Does every function parameter in this file have a type annotation (exclud...
3
Conteudo das Aulas/048/Cifra de Cesar - Gabarito.py
cerberus707/lab-python
from armulator.armv6.opcodes.abstract_opcode import AbstractOpcode class AndImmediate(AbstractOpcode): def __init__(self, setflags, d, n, imm32, carry): super(AndImmediate, self).__init__() self.setflags = setflags self.d = d self.n = n self.imm32 = imm32 self.carry...
[ { "point_num": 1, "id": "no_function_exceeds_5_params", "question": "Does every function in this file take 5 or fewer parameters (excluding self/cls)?", "answer": true }, { "point_num": 2, "id": "has_multiple_inheritance", "question": "Does any class in this file use multiple inherit...
3
armulator/armv6/opcodes/abstract_opcodes/and_immediate.py
matan1008/armulator
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! import grpc import did_pb2 as did__pb2 class DidStub(object): """The did sidechain service definition. """ def __init__(self, channel): """Constructor. Args: channel: A grpc.Channel. """ self.Sign = channel.unary_unar...
[ { "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_class_has_docstring", "question": "Does every class in this file have a docstring?...
3
grpc_adenine/stubs/did_pb2_grpc.py
rahulguna/GRPC_python
#!/usr/bin/python3 # -*- coding:utf-8 -*- from copy import deepcopy from textprocess import Word class IndirectOrderModifier(): ''' Class to make a sentence in indirect order ''' def __init__(self, pivot): ''' Params --- pivot: is the index that nominal and verbal parts...
[ { "point_num": 1, "id": "every_function_has_docstring", "question": "Does every function in this file have a docstring?", "answer": true }, { "point_num": 2, "id": "more_functions_than_classes", "question": "Does this file define more functions than classes?", "answer": true },...
3
src/server/textprocess/modifiers/indirectordermodifier.py
Vnicius/fact-check
"""Test the date time method""" from datetime import datetime from api.utilities.helpers.date_time import date_time fmt = '%Y-%m-%d %H:%M:%S' fmt1 = '%Y-%m-%d %H:%M:%S %Z%z' class TestDateTime: """Tests the custom datetime class""" def test_the_date_time_method_succeeds(self): """Tests the date_tim...
[ { "point_num": 1, "id": "every_function_has_docstring", "question": "Does every function in this file have a docstring?", "answer": true }, { "point_num": 2, "id": "any_function_over_40_lines", "question": "Is any function in this file longer than 40 lines?", "answer": false },...
3
tests/utilities/helpers/test_date_time.py
Meeqan/trisixty-buys-API
# 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, s...
[ { "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": "every_function_under_20_lines", "question": "Is every function in this file shorter than 2...
3
.sample_configs/param_handlers/create_batch_prediction_job_text_sentiment_analysis_sample.py
dizcology/python-aiplatform
import os import sys from Crypto.Cipher import AES from secret import FLAG iv = os.urandom(16) key = os.urandom(32) auth = os.urandom(16) def encrypt(): plaintext = input('Input a string to encrypt: ') if len(plaintext) < len(FLAG[0]): sys.exit(1) cipher = AES.new(key, AES.MODE_GCM, nonce=iv).upd...
[ { "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
Symmetric/GCM-mode/forbidden-attack/server.py
killua4564/Symmetric
# coding: utf-8 """ mParticle mParticle Event API OpenAPI spec version: 1.0.1 Contact: support@mparticle.com Generated by: https://github.com/swagger-api/swagger-codegen.git Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance wit...
[ { "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
test/test_push_message_event.py
juviasuisei/mparticle-python-sdk
# coding: utf-8 """ Kubernetes No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) OpenAPI spec version: v1.9.3 Generated by: https://github.com/swagger-api/swagger-codegen.git """ from __future__ import absolute_import import os import sys im...
[ { "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
kubernetes/test/test_v1beta1_subject_access_review_spec.py
kevingessner/python
import numpy as np from metaworld.policies.action import Action from metaworld.policies.policy import Policy, assert_fully_parsed, move class SawyerWindowOpenV2Policy(Policy): @staticmethod @assert_fully_parsed def _parse_obs(obs): return { 'hand_xyz': obs[:3], 'wndw_xyz'...
[ { "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
metaworld/policies/sawyer_window_open_v2_policy.py
pkol/metaworld
from gzip import decompress from http import cookiejar from json import loads, dumps from os import environ from time import strftime, gmtime from urllib import request def get_url(ticker): env = environ.get('FLASK_ENV', 'development') if env == 'development': url = 'https://www.fundamentus.com.br/am...
[ { "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
historical_prices.py
pedroeml/stock-projection-service
import os import unittest from contextlib import redirect_stdout, redirect_stderr from io import StringIO from pyshex.shex_evaluator import evaluate_cli data_dir = os.path.abspath(os.path.join(os.path.dirname(__file__), '..', 'data')) validation_dir = os.path.join(data_dir, 'validation') rdffile = os.path.join(valida...
[ { "point_num": 1, "id": "every_function_under_20_lines", "question": "Is every function in this file shorter than 20 lines?", "answer": false }, { "point_num": 2, "id": "has_multiple_inheritance", "question": "Does any class in this file use multiple inheritance?", "answer": fals...
3
tests/test_issues/test_issue_25.py
cmungall/PyShEx
from direct.directnotify import DirectNotifyGlobal import RingTrack class RingAction: notify = DirectNotifyGlobal.directNotify.newCategory('RingAction') def __init__(self): pass def eval(self, t): return (0, 0) class RingActionStaticPos(RingAction): def __init__(self, pos): ...
[ { "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
toontown/minigame/RingAction.py
AnonymousDeveloper65535/open-toontown
""" Copyright (c) 2018-2019 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to i...
[ { "point_num": 1, "id": "every_class_has_docstring", "question": "Does every class in this file have a docstring?", "answer": false }, { "point_num": 2, "id": "every_function_has_docstring", "question": "Does every function in this file have a docstring?", "answer": false }, ...
3
model-optimizer/mo/front/caffe/extractors/inner_product_test.py
shinh/dldt
import json from os.path import abspath, dirname, join from datetime import datetime import tomlkit SYNTAX_DIR = abspath(dirname(join("syntaxes", __name__))) SYNTAXES = ["django-html", "django-txt"] def load(path): with open(path) as f: return tomlkit.loads(f.read()) tomlkit.load = load def build_fil...
[ { "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
.vscode/extensions/batisteo.vscode-django-0.20.0/syntaxes/build.py
jaeyholic/portfolio-v2
# Copyright 2022 highstreet technologies GmbH # # 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 agree...
[ { "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
controller/network_generator.py
demx8as6/network-topology-instance-generator
from __future__ import print_function from flask import Flask, Response from pyzbar import pyzbar from picamera.array import PiRGBArray from picamera import PiCamera from datetime import datetime import numpy as np import cv2 import time camera = PiCamera() camera.resolution = (640, 480) camera.framerate = 32 rawCap...
[ { "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
main.py
shihu/qr-reader
import unittest from cupy import testing @testing.gpu class TestBasic(unittest.TestCase): _multiprocess_can_split_ = True @testing.for_all_dtypes() @testing.numpy_cupy_array_equal() def test_copyto(self, xp, dtype): a = testing.shaped_arange((2, 3, 4), xp, dtype) b = xp.empty((2, 3,...
[ { "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
tests/cupy_tests/manipulation_tests/test_basic.py
ytoyama/yans_chainer_hackathon
from __future__ import absolute_import from .Node import Op from .._base import DNNL_LIB from ..cpu_links import matrix_elementwise_add_by_const as cpu_matrix_elementwise_add_by_const from ..gpu_links import matrix_elementwise_add_by_const class AddByConstOp(Op): def __init__(self, node_A, const_val, ctx=None): ...
[ { "point_num": 1, "id": "every_function_has_docstring", "question": "Does every function in this file have a docstring?", "answer": false }, { "point_num": 2, "id": "all_function_names_snake_case", "question": "Are all function names in this file written in snake_case?", "answer"...
3
python/hetu/gpu_ops/AddConst.py
HugoZHL/Hetu
############################################################################### # # Test cases for xlsxwriter.lua. # # Copyright 2014-2015, John McNamara, jmcnamara@cpan.org # import base_test_class class TestCompareXLSXFiles(base_test_class.XLSXBaseTest): """ Test file created with xlsxwriter.lua against a f...
[ { "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
test/comparison/test_protect.py
moteus/xlsxwriter.lua
import tensorflow as tf def make_weights(shape, name='weights'): return tf.Variable(tf.truncated_normal(shape=shape, stddev=0.05), name=name) def make_biases(shape, name='biases'): return tf.Variable(tf.constant(0.05, shape=shape), name=name) def convolution_layer(prev_layer, f_size, inp_c, out_c, stride_...
[ { "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
tensorflow/mycode/src/tf_layer_utils.py
christinazavou/O-CNN
from abc import ABC, abstractmethod from enum import Enum class ALGO(Enum): ImageMatching = 1 SemanticSegmentation = 2 class SensorAbstractClass(ABC): """ Abstract class which all sensor classes should inherit. """ def __init__(self): """ Initializing the basic data of the c...
[ { "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
ast_project_2018/src/sensors/sensor_abstract_class.py
njanirudh/HBRS-AST-WS18
# coding: utf-8 import yaml from unittest import TestCase, main from hamcrest import assert_that, equal_to, starts_with from pattern_matcher.interface import Interface class MakeInterface(TestCase): def test_str_should_succeed(self): assert_that(str(Interface()), starts_with('interface anonymous_')) ...
[ { "point_num": 1, "id": "more_functions_than_classes", "question": "Does this file define more functions than classes?", "answer": true }, { "point_num": 2, "id": "every_function_has_docstring", "question": "Does every function in this file have a docstring?", "answer": false }...
3
src/match_pattern/pattern_matcher/test/interface.py
elsid/master
import unittest from odesli.Odesli import Odesli from odesli.entity.song.Song import Song EXPECTED_YOUTUBE_SONG = Song('VHb_XIql_gU', 'youtube', 'Kids', 'MGMT - Topic', 'https://i.ytimg.com/vi/VHb_XIql_gU/hqdefault.jpg', 480, 360, { 'youtube': 'https://www.youtube.com/watch?v=VHb_XIql_gU', 'youtubeMusic': 'https://mu...
[ { "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
tests/test_TestSong.py
fabian-thomas/python-odesli
from abc import ABC class ILogger(ABC): def __repr__(self): return f'{self.__class__.__name__}()' class ICommProtocol(ABC): def __init__(self, logger: ILogger): self._logger = logger def __repr__(self): return f'{self.__class__.__name__}({self._logger})' class ICommunicator(AB...
[ { "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
example/interfaces.py
tomer/di_container
""" API user class """ class APIUser: """ Information about an api user. """ def __init__(self, token, username, email, user_id): self.token = token self.username = username self.email = email self.is_admin = False self.clockify_id = user_id def get_token(...
[ { "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
converter/clockify/api_user.py
perlexed/toggl2clockify
import numpy import torch from allennlp.common import Params from allennlp.common.testing.test_case import AllenNlpTestCase from allennlp.modules.attention.attention import Attention from numpy.testing import assert_almost_equal from seq2rel.modules.attention.multihead_attention import MultiheadAttention class TestMu...
[ { "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
tests/modules/attention/test_multihead_attention.py
JohnGiorgi/seq2rel
import os import pytest import testinfra.utils.ansible_runner testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner( os.environ["MOLECULE_INVENTORY_FILE"] ).get_hosts("default_group") @pytest.mark.parametrize( "pkg", [ "epics-dev", ], ) def test_default_pkgs(host, pkg): package ...
[ { "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
roles/lnls-ans-role-epics/molecule/default/tests/test_default.py
lerwys/lnls-ans-role-users
from __future__ import print_function import json import sys import os from . import TornadoScheduledReporter class TornadoStreamReporter(TornadoScheduledReporter): """Writes JSON serialized metrics to a stream using an ``IOLoop`` for scheduling""" def __init__(self, interval, stream=sys.stdout, registry=N...
[ { "point_num": 1, "id": "has_nested_function_def", "question": "Does this file contain any function defined inside another function?", "answer": false }, { "point_num": 2, "id": "has_multiple_inheritance", "question": "Does any class in this file use multiple inheritance?", "answ...
3
tapes/reporting/tornado/stream.py
emilssolmanis/tapes
import time import threading import asyncio from typing import Optional from sarge import run # type: ignore def wait_respond(url: str, timeout: Optional[float] = None, retry_interval: float = 1): test = f"curl --output /dev/null -k --silent --fail {url}" stop_event = threading.Event() def test_func(): ...
[ { "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
metis_lib/service.py
CS-METIS/minimetis
from collections import deque class Vertex: def __init__(self,value): self.value = value class Edge: def __init__(self,vertex,weight): self.vertex = vertex self.weight = weight class Queue: def __init__(self): self.dq = deque() def enqueue(self, value): s...
[ { "point_num": 1, "id": "every_class_has_docstring", "question": "Does every class 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": false }...
3
python/code_challenges/graph/graph.py
dina-fouad/data-structures-and-algorithms
from django.test import TestCase from django.utils import timezone import datetime from django.core.exceptions import ValidationError from BasicBusinessManager.models.order_related_objects.sale_out import Sale_out # Create your tests here. class SaleOutModelTests(TestCase): def test_is_sale_name_returned_properly(...
[ { "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
BasicBusinessManager/tests/tests_sale_out.py
seyhak/RestaurantWebApplication
# -*- coding: UTF-8 -*- from common_utils.new_log import NewLog class LogDecorator: log = NewLog(__name__) logger = log.get_log() def __call__(self, func): def wrapper(*args, **kw): self.logger.debug("call method %s ===============" % func.__name__) self.logger.debug("me...
[ { "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
common_utils/log_decorator.py
beansKingdom/CommonUtils
import re import collections DATA = '06.txt' def get_data(): points = list() with open(DATA) as f: for line in f: match = re.match(r'(\d+), (\d+)', line) points.append(list(int(_) for _ in match.groups())) xmin, xmax = float('inf'), 0 ymin, ymax = floa...
[ { "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
2018/06.py
GillesArcas/Advent_of_Code
class ContentFilteringCategories(object): def __init__(self, session): super(ContentFilteringCategories, self).__init__() self._session = session def getNetworkContentFilteringCategories(self, networkId: str): """ **List all available content filtering categories for an MX n...
[ { "point_num": 1, "id": "more_functions_than_classes", "question": "Does this file define more functions than classes?", "answer": true }, { "point_num": 2, "id": "has_multiple_inheritance", "question": "Does any class in this file use multiple inheritance?", "answer": false },...
3
meraki/api/content_filtering_categories.py
fsandberg/dashboard-api-python
import inspect from .task import * def dir_classes(cls): for member_name in dir(cls): member = getattr(cls, member_name) if (not member_name.startswith('_')) and inspect.isclass(member): yield member def default_predicate(task): return True def get_tasks(cls, predicate = default_p...
[ { "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
modules/qplan/loader.py
fifoforlifo/pyqplan
from Crypto.Cipher import AES from django import forms from django.forms import ValidationError from .utils import get_decode_key class DecodeForm(forms.Form): optional_decode_key = forms.CharField(required=False) message = forms.CharField(widget=forms.Textarea, required=True) def clean_optional_decode_k...
[ { "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
src/monkey_team/forms.py
ionelmc/django-monkey-team
import csv def ClassFactory(class_name, dictionary): return type(class_name, (object,), dictionary) class CsvReader: def __init__(self, filepath): self.data = [] with open(filepath) as csv_files: csv_data = csv.DictReader(csv_files, delimiter=',') for row in csv_data...
[ { "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
src/CSVreader.py
Shannon-NJIT/Calculator-Individual
"""integration tests for messages.email_ module.""" import pathlib import pytest import int_setup from messages.email_ import Email from messages._exceptions import MessageSendError ############################################################################## # SKIP TESTS IF ENVIRONMENT NOT PREPPED ###############...
[ { "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_tests/test_int_email.py
sclickk/messages
from enum import Enum from json import JSONEncoder from typing import Any from strips_hgn.features import AbstractFeatureMapper class MetricsEncoder(JSONEncoder): """ For encoding evaluation metrics """ def default(self, o: Any) -> Any: if isinstance(o, Enum): return o.value else...
[ { "point_num": 1, "id": "every_function_under_20_lines", "question": "Is every function in this file shorter than 20 lines?", "answer": true }, { "point_num": 2, "id": "more_functions_than_classes", "question": "Does this file define more functions than classes?", "answer": false...
3
src/strips_hgn/utils/json_encoders.py
yutian-zhao/STRIPS-HGN
"""Automation using nox. """ import glob import nox nox.options.reuse_existing_virtualenvs = True nox.options.sessions = "lint", "tests", "tests-pytest5" locations = "pytest_test_utils", "tests.py" @nox.session(python=["3.7", "3.8", "3.9", "3.10"]) def tests(session: nox.Session) -> None: session.install(".[tes...
[ { "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
noxfile.py
iterative/pytest-test-utils
class BaseDownsizing: def __init__(self, raw_file_f, raw_file_r=None): self.raw_file_f = raw_file_f self.raw_file_f = raw_file_f self._downsized_f = None if raw_file_r: self.raw_file_r = raw_file_r self.raw_file_r = raw_file_r self._downsized_r = ...
[ { "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
moonstone/normalization/reads/base.py
motleystate/moonstone
# -*- coding: utf-8 -*- from zappa_boilerplate.database import db_session from flask_wtf import Form from wtforms import StringField, PasswordField from wtforms.validators import DataRequired, Email, EqualTo, Length from .models import User class RegisterForm(Form): username = StringField('Username', ...
[ { "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": "any_function_over_40_lines", "question": "Is any function in this file longer than 40 lines?", "answer": false ...
3
zappa_boilerplate/user/forms.py
402900550b/dtnewman2
#!/usr/bin/env python import testcases class Solution: def __init__(self, volume: int, drinks: list): self.volume = volume self.drinks = drinks self.drink_count = len(self.drinks) self.opt = [[0] * (self.drink_count + 1) for _ in range(volume + 1)] def calculate(self) -> in...
[ { "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
chapter-1/1-6/src/dp.py
yuetsin/beauty-of-programming
import os import json Environ = os._Environ def is_on_cloudfoundry(env: Environ=os.environ) -> bool: return 'VCAP_SERVICES' in env def load_cups_from_vcap_services(name: str, env: Environ=os.environ) -> None: ''' Detects if VCAP_SERVICES exists in the environment; if so, parses it and imports all 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": "all_return_types_annotated", "question": "Does every function in this file have a return type annotation?", "answe...
3
bugbounty/settings_utils.py
18F/tts-bug-bounty-dashboard
from flask import request import python_game_code.random_functions class room1(object): which_room = "Finding the Sword" def choices(self): return self.room1_scene1 class room1_scene1(room1): def choices(self): rocks = [ 'throw rock', 'throw rocks', 'throw', ...
[ { "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
thedarkness/rooms.py
AndrewScholly/FlaskTheDarkness
""" Utilities for loading inference data into the model """ # TODO refactor so xml_loader and inference_loader import from a utilities directory from ingestion.ingest_images import load_image, load_proposal, get_example_for_uuid from torch.utils.data import Dataset import torch import os from os.path import splitext fr...
[ { "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_params_annotated", "question": "Does every function parameter in this file have a type annotation (excluding self/c...
3
cosmos/torch_model/inference/data_layer/inference_loader.py
hadarohana/myCosmos
from tensorflow import keras import numpy as np import pidash import os #import gc PATH = os.path.dirname(__file__) # This is a prototype implementation of the sensor AI deployment. #This is not final code and should not be reguarded as a best practices. # get_exposed() is a simple pixel count routine. It establi...
[ { "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
sensor_AI/run_lite.py
USGS-WiM/Gage-Cam-Sensor-AI
# coding: utf-8 """ Decision Lens API No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501 OpenAPI spec version: 1.0 Generated by: https://github.com/swagger-api/swagger-codegen.git """ from __future__ import absolute_import impor...
[ { "point_num": 1, "id": "every_function_under_20_lines", "question": "Is every function in this file shorter than 20 lines?", "answer": true }, { "point_num": 2, "id": "every_function_has_docstring", "question": "Does every function in this file have a docstring?", "answer": fals...
3
python/test/test_custom_name.py
dlens/dlxapi
# -*- coding: utf-8 -*- from __future__ import division, print_function __all__ = ["StarryBaseOp"] import pkg_resources from theano import gof from ..build_utils import get_compile_args, get_cache_version class StarryBaseOp(gof.COp): __props__ = () func_file = None func_name = None def __init__...
[ { "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
exoplanet/theano_ops/starry/base_op.py
Junjun1guo/exoplanet
import RPi.GPIO as GPIO from Adafruit_LED_Backpack import SevenSegment from time import sleep def setup(): GPIO.setmode(GPIO.BCM) red_segment = SevenSegment.SevenSegment(address=0x70) green_segment = SevenSegment.SevenSegment(address=0x72) red_segment.begin() green_segment.begin() return red...
[ { "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
king_of_the_hill/segment_timer.py
andrewzwicky/KingOfTheHill
from flask import url_for from app.questionnaire.rules import evaluate_skip_conditions from app.templating.summary.question import Question class Block: def __init__(self, block_schema, group_id, answer_store, metadata, schema, group_instance): self.id = block_schema['id'] self.title = block_sch...
[ { "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
app/templating/summary/block.py
uk-gov-mirror/ONSdigital.eq-survey-runner
def validate(*validations): """ Checks if all `validations` are correct before executing. """ def message_validation(func): def func_wrapper(*args, **kwargs): if all(validations): func(*args, **kwargs) return func_wrapper return message_validation
[ { "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
bot/utils.py
lessss4/oil-and-rope
#coding=utf-8 def MultiplePackage(N,C,weight,value,num,physic): ''' 多重背包问题(每个物品都有次数限制) :param N: 预测的虚拟机种类,如N=pre_num :param C:输入文件是CPU,那么背包总容量就是MEM,如C= :param weight: 每个物品的容量数组表示,如weight=[0,5,4,7,2,6] :param value: 每个物品的价值数组表示,如value=[0,12,3,10,3,6] :param num:每个物品的个数限制,如num=[0,2,4,1,5,3] ...
[ { "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
Competition Codes/packageFunction.py
Harrdy2018/2018-Huawei-Code-Craft
# encoding: utf-8 import sys from marrow.script.core import Parser __all__ = ['Parser', 'execute', 'script', 'annotate', 'describe', 'short'] def execute(obj): # pragma: no cover sys.exit(Parser(obj)(sys.argv[1:])) def base(attr): def decorator(**kw): def inner(fn): if not hasattr(...
[ { "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
marrow/script/__init__.py
marrow/script
# Copyright (c) 2018-2019, NVIDIA CORPORATION. from utils import assert_eq import nvstrings def test_cat(): strs = nvstrings.to_device( ["abc", "def", None, "", "jkl", "mno", "accént"] ) got = strs.cat() expected = ["abcdefjklmnoaccént"] assert_eq(got, expected) # non-default separa...
[ { "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
python/nvstrings/tests/test_combine.py
williamBlazing/cudf
""" create histogram table Revision ID: a7b01b0429ff Revises: Create Date: 2020-07-09 10:03:15.932674 """ from alembic import op import sqlalchemy as sa from sqlalchemy.engine.reflection import Inspector # revision identifiers, used by Alembic. revision = 'a7b01b0429ff' down_revision = None branch_labels = None dep...
[ { "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
chmap/alembic/versions/a7b01b0429ff_create_histogram_table.py
predsci/CHD
#!/usr/bin/env python3 # Packet MAC Sniffer # Author Yehia Elghaly import socket import textwrap import struct from colorama import Fore, Back, Style def main(): connection = socket.socket(socket.AF_PACKET, socket.SOCK_RAW, socket.ntohs(3)) while True: read_data, addr = connection.recvfrom(65536) send_mac, recv...
[ { "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
Chapter 06/Packet-Sniffer-MAC.py
bpbpublications/Learn-Penetration-Testing-with-Python-3.x
from PyQt5 import QtCore, QtWidgets, QtGui from CharakterAssistent import ChoicePopup class VariantPopupWrapper(object): def __init__(self, variantListCollection, windowTitle): super().__init__() self.formMain = QtWidgets.QDialog() self.formMain.setWindowFlags( QtCore.Qt.Window ...
[ { "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
src/Sephrasto/Plugins/CharakterAssistent/VariantPopupWrapper.py
qeqar/Sephrasto
import json import click from isic_cli.cli.context import IsicContext @click.group(short_help='Manage authentication with the ISIC Archive.') @click.pass_obj def user(ctx): pass @user.command() @click.pass_obj def login(obj: IsicContext): """Login to the ISIC Archive.""" if obj.user: click.ech...
[ { "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
isic_cli/cli/user.py
ImageMarkup/isic-cli
''' Description: Shuffle a set of numbers without duplicates. Example: // Init an array with set 1, 2, and 3. int[] nums = {1,2,3}; Solution solution = new Solution(nums); // Shuffle the array [1,2,3] and return its result. Any permutation of [1,2,3] must equally likely to be returned. solution.shuffle(); // Rese...
[ { "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
Top_Interview_Question_Easy/Design/Shuffle an Array/by_random_shuffle.py
coderMaruf/leetcode-1
# Exercise 7.24 # Author: Noah Waterfield Price import numpy as np import matplotlib.pyplot as plt import operator class PiecewiseConstant: def __init__(self, data, xmax): self.data = data + [(None, xmax)] def __call__(self, x): if isinstance(x, (float, int)): return self.piecew...
[ { "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
ch_7/PiecewiseConstant2.py
ProhardONE/python_primer
Inc('dfaccto/util.py', abs=True) class _Event(ModuleContext): def __init__(self): ModuleContext.__init__(self) self._setup_packages() def _setup_packages(self): self.pkg = Pkg('dfaccto_event', x_templates={self.File('generic/package.vhd.tpl'): self.File('pkg/dfaccto_event.vhd')}) with se...
[ { "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
cfg/dfaccto/event.py
lw0/dfaccto_lib
# # Copyright (c) YugaByte, 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 law or agreed to in writing, so...
[ { "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
build_definitions/openldap.py
d-uspenskiy/yugabyte-db-thirdparty
from .. import DataWrapper from cogdl.data import Graph class FullBatchNodeClfDataWrapper(DataWrapper): def __init__(self, dataset): super(FullBatchNodeClfDataWrapper, self).__init__(dataset) self.dataset = dataset def train_wrapper(self) -> Graph: return self.dataset.data def va...
[ { "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
cogdl/wrappers/data_wrapper/node_classification/node_classification_dw.py
li-ziang/cogdl
# -*- coding: utf-8 -*- """ Routes Module Currently this module contains all of the routes for the main blueprint """ from flask import render_template from flask_login import current_user, login_required from app.main import main_bp @main_bp.route('/') @main_bp.route('/public') def public(): """Public Route...
[ { "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
app/main/routes.py
candicecz/conp-portal
from errors import Request from .mixins import Identify class Report(Identify): def _validate(self, request): super()._validate(request) validator = self._application.validator self.__message = self._get(request, 'message', '').strip() if validator.isempty(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_under_20_lines", "question": "Is every function in this file shorter than 20 lines?", "answer": true...
3
api/source/actions/report.py
1pkg/ReRe
import cocotb import logging from cocotb.triggers import Timer def bin2gray(num): return num >> 1 ^ num; def gray2bin(num): mask = num while(mask != 0): mask = mask >> 1 num = num ^ mask return num BINARY_WIDTH = 8 @cocotb.test() async def test(dut): max_value = 2 ** BINARY_WIDT...
[ { "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
_oldfiles/src_test/gray_encoding/gray_tb.py
4Kamei/verilog_sources
#!/usr/bin/env python """ Solution to Project Euler Problem http://projecteuler.net/ by Apalala <apalala@gmail.com> (cc) Attribution-ShareAlike http://creativecommons.org/licenses/by-sa/3.0/ We shall say that an n-digit number is pandigital if it makes use of all the digits 1 to n exactly once. For example, 2143 is ...
[ { "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
WEEKS/CD_Sata-Structures/_RESOURCES/python-prac/projecteuler/euler041_pandigital_prime.py
webdevhub42/Lambda
from discord.ext import commands class Info(commands.CommandError): def __init__(self, message, **kwargs): super().__init__(message) self.kwargs = kwargs class Warning(commands.CommandError): def __init__(self, message, **kwargs): super().__init__(message) self.kwargs = kwarg...
[ { "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
modules/exceptions.py
Keyruu/miso-bot
from flask import Flask, render_template from db_connector.db_connector import connect_to_database, execute_query app = Flask(__name__) #the route is what you will type in browser @app.route('/hello') #the name of this function is just a cosmetic thing def hello(): #this is the output returned to browser retu...
[ { "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
db_connector/sample.py
DacinTitus/cs340_group15
import re from vistautils.memory_amount import MemoryAmount, MemoryUnit import pytest UNIT_PARSE_TEST_PAIRS = [ (MemoryUnit.KILOBYTES, "K"), (MemoryUnit.MEGABYTES, "M"), (MemoryUnit.GIGABYTES, "G"), (MemoryUnit.TERABYTES, "T"), ] @pytest.mark.parametrize("reference_unit,string_to_parse", UNIT_PARSE...
[ { "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": "every_function_has_docstring", "question": "Does every function in this file have a docstr...
3
tests/test_memory_amount.py
isi-vista/vistautils
""" Dot product of two vectors implemented as parallel lists """ from operator import add, mul from pyske.core.util import fun __all__ = ['opt_dot_product', 'dot_product'] # ------------------- Dot Product Variant Example ------------- def dot_product(vector1, vector2): """ Compute the dot product of two ...
[ { "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
pyske/examples/list/dot_product.py
YohannBaudet/PySke
from django.http import HttpResponse from django.shortcuts import render from .models import Item, Category # Create your views here. def get_html(req): return render(req,"item.html") def create_item(req): #解析参数 params = req.POST name = params.get("i_name") barcoade = params.get("i_barcode") ...
[ { "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
day02/app02/views.py
940716tian/PythonStudy
# Copyright Contributors to the Amundsen project. # SPDX-License-Identifier: Apache-2.0 import logging import os import subprocess from setuptools import setup, find_packages BASE_DIR = os.path.abspath(os.path.dirname(__file__)) PACKAGE_DIR = os.path.join(BASE_DIR, 'amundsen_application', 'static') def is_npm_inst...
[ { "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
setup.py
joshthoward/amundsenfrontendlibrary
#encoding: utf-8 import logging import time # time.time()返回1970/1/1日起的时间戳的(单位是秒) from .base import BasePlugin logger = logging.getLogger(__name__) class Heartbeat(BasePlugin): def __init__(self, config, *args, **kwargs): super(Heartbeat, self).__init__(config, 'heartbeat', 10, *args, **kwargs) def...
[ { "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
agent/plugins/heartbeat.py
Nazicc/easyCMDB
import os, sys sys.path.append(os.path.join(os.path.dirname(__file__), "../../")) import unittest import shutil import numpy as np from ml.model import NumberRecognizeNN from ml.data_processor import DataProcessor from ml.trainer import Trainer from ml.resource import Resource class TestTrainer(unittest.TestCase): ...
[ { "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
ml/tests/test_trainer.py
Karapyon/apli_env
import asyncio import logging import os import shutil import unittest import rlog from omega.logreceivers.redis import RedisLogReceiver from tests import init_test_env class TestRedisLogging(unittest.IsolatedAsyncioTestCase): async def asyncSetUp(self) -> None: self.cfg = init_test_env() async def ...
[ { "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/logreceivers/test_redis_logging.py
zillionare/zeta
import numpy as np def clean_data(df, out_df_dir=""): df.dropna(axis=1, inplace=True) if out_df_dir: df.to_csv(out_df_dir) return df # Calculate log change of daily price def log_change(series): return np.log(series[1] / series[0]) # Calculate correaltion def calculate_...
[ { "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
utils.py
Duy-Vu/stock-network
""" Conversion functions for the NATO Phonetic Alphabet. """ import re # To save a lot of typing the code words are presented here # as a dict, but feel free to change this if you'd like. ALPHANUM_TO_NATO = { "A": "ALFA", "B": "BRAVO", "C": "CHARLIE", "D": "DELTA", "E": "ECHO", "F": "FOXTROT",...
[ { "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_return_types_annotated", "question": "Does every function in this file have a return type annotation?", "answer...
3
exercises/python-2-b/.meta/3/python_2_b.py
ee7/exercism-research_experiment_1
from django.template.backends import django from django.shortcuts import render, redirect def main_board(request): return render(request, 'main_page.html') def redirect_main(request): return redirect('main_boar_url', permanent=True)
[ { "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
students/k3342/laboratory_works/Nikonchuk_Anna/Lr1/minos/minos/views.py
nikonura/ITMO_ICT_WebProgramming_2020
#!/usr/bin/env python3 # -*- coding: utf-8 -*- from set_path import set_path stockrsm_path = set_path() # PYTHON_ARGCOMPLETE_OK import argcomplete, argparse import subprocess import os import sys from argcomplete.completers import ChoicesCompleter from argcomplete.completers import EnvironCompleter # Set path and ...
[ { "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
c2w/scripts/c2w_test_tcp_client.py
JieDiscovery/ChatWhileWatching
import time, datetime from app import db class ServerInfo(db.Model): __tablename__ = 'servers' __table_args__ = (db.PrimaryKeyConstraint('ip', 'port', name='_ip_port_pk'),) ip = db.Column(db.String(128), nullable=False) port = db.Column(db.Integer, nullable=False) ...
[ { "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
app/modules/serverinfo/models.py
sappykun/scpsl-masterserver
"""Aioamqp tests""" import unittest import socket from aioamqp import connect from aioamqp.protocol import OPEN from . import testing, testcase class AmqpConnectionTestCase(testcase.RabbitTestCase, unittest.TestCase): @testing.coroutine def test_connect(self): _transport, proto = yield from connec...
[ { "point_num": 1, "id": "more_functions_than_classes", "question": "Does this file define more functions than classes?", "answer": true }, { "point_num": 2, "id": "every_function_under_20_lines", "question": "Is every function in this file shorter than 20 lines?", "answer": false...
3
aioamqp/tests/test_connect.py
michael-k/aioamqp
from disnake.ext.commands import Bot as _Bot from loguru import logger from .status import StatusHeartbeater class Bot(_Bot): def __init__(self, *args, **kwargs) -> None: super().__init__(*args, **kwargs) self._status = StatusHeartbeater() async def start(self, *args, **kwargs) -> None: ...
[ { "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": "more_functions_than_classes", "question": "Does this file define more functions than classes?", "answer"...
3
src/impl/bot/bot.py
vcokltfre/hbot-rewrite
# Copyright (c) Meta Platforms, Inc. and affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. from typing import Tuple import numpy as np import xarray as xr def log1pexp(x: np.ndarray) -> np.ndarray: """ Compute log(1 + ex...
[ { "point_num": 1, "id": "all_return_types_annotated", "question": "Does every function in this file have a return type annotation?", "answer": true }, { "point_num": 2, "id": "all_function_names_snake_case", "question": "Are all function names in this file written in snake_case?", ...
3
pplbench/models/utils.py
dmitryvinn/pplbench
""" PolygonPShapeOOP. Wrapping a PShape inside a custom class and demonstrating how we can have a multiple objects each using the same PShape. """ from polygon import Polygon # A list of objects polygons = [] def setup(): size(640, 360, P2D) smooth() # Make a PShape. star = createShape() star.b...
[ { "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
mode/examples/Topics/Create Shapes/PolygonPShapeOOP2/PolygonPShapeOOP2.pyde
timgates42/processing.py