max_stars_repo_path
stringlengths
3
269
max_stars_repo_name
stringlengths
4
119
max_stars_count
int64
0
191k
id
stringlengths
1
7
content
stringlengths
6
1.05M
score
float64
0.23
5.13
int_score
int64
0
5
src/oci/autoscaling/models/cron_execution_schedule.py
Manny27nyc/oci-python-sdk
249
29200
<gh_stars>100-1000 # coding: utf-8 # Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved. # This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LIC...
2.3125
2
roadmap_planner_tools/scripts/pi_manager_example.py
JKBehrens/STAAMS-Solver
16
29201
#!/usr/bin/env python """ Copyright (c) 2018 <NAME> GmbH All rights reserved. This source code is licensed under the BSD-3-Clause license found in the LICENSE file in the root directory of this source tree. @author: <NAME> """ from geometry_msgs.msg import TransformStamped from roadmap_planner_tools.planner_input_ma...
1.820313
2
Trie/PrintUniqueRows.py
kopok2/DataStructures
0
29202
<reponame>kopok2/DataStructures # coding=utf-8 """Print unique rows in table. Trie data structure Python solution. """ from Trie import Trie def print_unique(table): t = Trie() for row in table: if not t.in_tree(row): print(row) t.add_key(row) if __name__ == "__main__": ...
3.671875
4
telemetry_client_bgp_sessions.py
akshshar/bigmuddy-network-telemetry-proto
0
29203
<reponame>akshshar/bigmuddy-network-telemetry-proto #!/usr/bin/env python # Standard python libs import os,sys sys.path.append("./src/genpy") import ast, pprint import pdb import yaml, json import telemetry_pb2 from mdt_grpc_dialin import mdt_grpc_dialin_pb2 from mdt_grpc_dialin import mdt_grpc_dialin_pb2_grpc impor...
2
2
Python3-functions/define_custom_exception_class.py
ipetel/code-snippets
1
29204
''' This code is a simple example how to define custom exception class in Python ''' # custom exception class class CustomError(Exception): def __init__(self,message): self.message = message super().__init__(self.message) # use it whenever you need in your code as follows: try: ... ...
4.0625
4
2020/3a.py
combatopera/advent2020
2
29205
<filename>2020/3a.py #!/usr/bin/env python3 from pathlib import Path slope = 3, 1 class Map: def __init__(self, rows): self.w = len(rows[0]) self.rows = rows def tree(self, x, y): return '#' == self.rows[y][x % self.w] def main(): m = Map(Path('input', '3').read_text().splitlin...
3.765625
4
src/dataProcessing.py
KJithendra/SCALE-Sim
0
29206
<filename>src/dataProcessing.py import numpy as np import csv import matplotlib.pyplot as pyplot from gBarGraph import * # Conditional Debugging debug = False # Inputs scaleFac = 10**6 # scaling factor adList = [[128,128], [64,64], [32,32], [16,16], [8,8]] #list of systolic array dimensions dfList = ["os", "ws", "is...
2.3125
2
src/cn_query/juhe/exceptions.py
winkidney/juhe-sdk
0
29207
<filename>src/cn_query/juhe/exceptions.py from functools import wraps DEFAULT_CODE = -1 class APIError(ValueError): pass def normalize_network_error(func): from requests import exceptions as exc @wraps(func) def decorated(*args, **kwargs): try: return func(*args, **kwargs) ...
2.359375
2
keyboard.py
misterpah/ldtp_adapter
0
29208
import re def find_key(keyString): k = PyKeyboard() key_to_press = None highest = 0 for each in dir(k): if each.endswith("_key"): if similar(keyString + "_key" ,each) > highest: highest = similar(keyString + "_key" ,each) key_to_press = getattr(k,each)...
2.90625
3
dags/crawl.py
a07458666/StockCrawlerSendSlack
0
29209
<filename>dags/crawl.py #!/usr/bin/python # -*- coding: utf-8 -*- import os import json import csv import time from datetime import date import requests class CrawlerController(object): '''Split targets into several Crawler, avoid request url too long''' def __init__(self, targets, max_stock...
2.9375
3
supplier_testing/case_05.py
openhealthcare/python-fp17
1
29210
<reponame>openhealthcare/python-fp17 import datetime from fp17 import treatments def annotate(bcds1): bcds1.patient.surname = "BEDWORTH" bcds1.patient.forename = "TOBY" bcds1.patient.address = ["5 HIGH STREET"] bcds1.patient.sex = 'M' bcds1.patient.date_of_birth = datetime.date(1938, 4, 11) ...
2.46875
2
mipkit/faces/helpers.py
congvmit/mipkit
8
29211
<reponame>congvmit/mipkit<filename>mipkit/faces/helpers.py<gh_stars>1-10 """ The MIT License (MIT) Copyright (c) 2021 <NAME> 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 restricti...
1.28125
1
src/fizz_buzz.py
rckt-cmdr/fizz-buzz
0
29212
#!/usr/bin/python3 # File: fizz_buzz.py # Author: <NAME> # Description: Fizz-Buzz Coding Challenge # Reference: https://edabit.com/challenge/WXqH9qvvGkmx4dMvp def evaluate(inputValue): result = None if inputValue % 3 == 0 and inputValue % 5 == 0: result = "FizzBuzz" elif inputValue % 3 == 0: ...
3.640625
4
Ex.27-Numpy.py
aguinaldolorandi/100-exercicios-Numpy
0
29213
# Exercícios Numpy-27 # ******************* import numpy as np Z=np.arange((10),dtype=int) print(Z**Z) print(Z) print(2<<Z>>2) print() print(Z <- Z) print() print(1j*Z) print() print(Z/1/1) print() #print(Z<Z>Z)
3.25
3
project_opensource/nanodet-2020_11_27/nanodet-main/nanodet/data/dataset/__init__.py
yunshangyue71/mycodes
0
29214
import copy from .coco import CocoDataset def build_dataset(cfg, mode): dataset_cfg = copy.deepcopy(cfg) if dataset_cfg['name'] == 'coco': dataset_cfg.pop('name') return CocoDataset(mode=mode, **dataset_cfg)
2.046875
2
straintables/Executable/GenomePipeline.py
Gab0/linkageMapper
0
29215
#!/bin/python """ straintables' main pipeline script; """ import os import argparse import shutil import straintables import subprocess from Bio.Align.Applications import ClustalOmegaCommandline from straintables.logo import logo from straintables.Executable import primerFinder, detectMutations,\ compareHea...
2.40625
2
venv/lib/python3.8/site-packages/vsts/test/v4_1/models/test_failures_analysis.py
amcclead7336/Enterprise_Data_Science_Final
0
29216
# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -----------------------------------------------------------------...
1.804688
2
health.py
adil-zhang/healthy_auto
4
29217
<reponame>adil-zhang/healthy_auto # -*- coding: utf-8 -*- # coding=utf-8 import json import random import requests import argparse import time # 请求内容转json def getval(): values = {"province": "北京", "city": "北京市", "addressType": "整租房", "temperature": "36.7", "dayNum": "", "contactHbPerplr": "无接触", "toWh": "未去过/路...
2.5625
3
thirdparty/his_evaluators/his_evaluators/utils/video.py
tj-eey/impersonator
1,717
29218
# -*- coding: utf-8 -*- # @Time : 2019-08-02 18:31 # @Author : <NAME> # @Email : <EMAIL> import os import cv2 import glob import shutil from multiprocessing import Pool from concurrent.futures import ProcessPoolExecutor from functools import partial from tqdm import tqdm import numpy as np import subprocess de...
2.59375
3
podcats/__init__.py
moritzj29/podcats
0
29219
""" Podcats is a podcast feed generator and a server. It generates RSS feeds for podcast episodes from local audio files and, optionally, exposes the feed and as well as the episode file via a built-in web server so that they can be imported into iTunes or another podcast client. """ import os import re import time i...
2.578125
3
1301-1400/1387-Binary Trees With Factors/1387-Binary Trees With Factors.py
jiadaizhao/LintCode
77
29220
<reponame>jiadaizhao/LintCode<filename>1301-1400/1387-Binary Trees With Factors/1387-Binary Trees With Factors.py class Solution: """ @param A: @return: nothing """ def numFactoredBinaryTrees(self, A): A.sort() MOD = 10 ** 9 + 7 dp = {} for j in range(len(A)): ...
3.03125
3
Machine learning/ML/ARIMA/DS1_ar_model_2.py
warpalatino/public
1
29221
import pandas as pd import numpy as np import matplotlib.pyplot as plt import statsmodels.graphics.tsaplots as sgt from statsmodels.tsa.arima_model import ARMA from scipy.stats.distributions import chi2 import statsmodels.tsa.stattools as sts # ------------------------ # load data # ---------- raw_csv_data = pd.rea...
2.390625
2
cytoskeleton_analyser/database/sqlite_alchemy_orm/containers/cell_elements.py
vsukhor/cytoskeleton-analyser
0
29222
<reponame>vsukhor/cytoskeleton-analyser # Copyright (c) 2021 <NAME>. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # 1. Redistributions of source code must retain the above copyright # notice, ...
1
1
snow/views.py
cdmaok/web-sentiment
0
29223
from django.shortcuts import render from django.http import HttpResponse from django.views.decorators.csrf import csrf_exempt import json from snownlp import SnowNLP # Create your views here. @csrf_exempt def index(request): message = {} print request.method if request.method == 'GET': message = construct_message...
2.15625
2
Products/CMFCore/FSPageTemplate.py
fulv/Products.CMFCore
0
29224
############################################################################## # # Copyright (c) 2001 Zope Foundation and Contributors. # # This software is subject to the provisions of the Zope Public License, # Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. # THIS SOFTWARE IS PROVIDED "AS I...
1.679688
2
branches/g3d-8.0-64ffmpeg-win/bin/ice/doxygen.py
brown-ccv/VRG3D
0
29225
# doxygen.py # # Doxygen Management from utils import * import glob ############################################################################## # Doxygen Management # ############################################################################## """ Called ...
2.25
2
models/LASSO.py
MattAHarrington/crypto-comovement
1
29226
#!/usr/bin/env python # Standard imports import pandas as pd import numpy as np # Pytorch import torch from torch import nn # Using sklearn's LASSO implementation from sklearn.linear_model import Lasso # Local Files from models.model_interface import CryptoModel class LASSO(CryptoModel): """Wrapper around the ...
3.265625
3
Test_Beat_Detector.py
filipmazurek/Heart-Rate-Monitor
0
29227
<filename>Test_Beat_Detector.py from Beat_Detector import BeatDetector from SignalChoice import * update_time_seconds = 20 update_time_easy = 2 # means enough data for 2 seconds. array_easy = [0, 2, 5, 10, 5, 2, 0, 2, 5, 10, 5] def test_get_num_beats(): beat_detector = BeatDetector(update_time_seconds, SignalCh...
2.8125
3
test_ocr.py
lanstonpeng/NightOwlServer
0
29228
<reponame>lanstonpeng/NightOwlServer #!/usr/bin/env python # encoding: utf-8 import urllib, urllib2 import tempfile import base64 from PIL import Image import os # 全局变量 API_URL = 'http://apis.baidu.com/apistore/idlocr/ocr' API_KEY = "<KEY>" def get_image_text(img_url=None): headers = {} # download image ...
2.75
3
token_importance_utils.py
keyurfaldu/token_importance
0
29229
<reponame>keyurfaldu/token_importance<filename>token_importance_utils.py import torch class AttentionBasedImportance: def __init__(self, inputs, tokenizer, attentions): if type(inputs["input_ids"]) == torch.Tensor: if inputs["input_ids"].device != torch.device(type='cpu'): ...
2.46875
2
python/2020/day11.py
SylvainDe/aoc
0
29230
<gh_stars>0 # vi: set shiftwidth=4 tabstop=4 expandtab: import datetime import itertools import collections RUN_LONG_TESTS = False def string_to_seat_layout(string): return { (i, j): s for i, line in enumerate(string.splitlines()) for j, s in enumerate(line) } def seat_layout_to_str...
2.953125
3
gestor_usuarios/apps/app_gestor_usuarios/forms.py
Enrialonso/LP-Manage-Contacts
0
29231
from django import forms from apps.app_gestor_usuarios.models import db_usuarios, db_manage_contacts class signupForm(forms.ModelForm): class Meta: model = db_usuarios fields = [ 'name', 'last', 'email', 'password', ] labels = { ...
2.21875
2
service/routes/greet.py
illuscio-dev/isleservice-py
0
29232
<reponame>illuscio-dev/isleservice-py from spanserver import ( SpanRoute, Request, Response, MimeType, RecordType, DocInfo, DocRespInfo, ) from isleservice_objects import models, errors, schemas from service.api import api class SchemaCache: ENEMY_FULL = schemas.EnemySchema() ENEM...
2.28125
2
openregister/record.py
psd/openregister
0
29233
from .item import Item from .entry import Entry from copy import copy class Record(object): """ A Record, the tuple of an entry and it's item Records are useful for representing the latest entry for a field value. Records are serialised as the merged entry and item """ def __init__(self,...
4
4
pyexcel_matplotlib/__init__.py
pyexcel/pyexcel-matplotlib
0
29234
""" pyexcel_matplotlib ~~~~~~~~~~~~~~~~~~~ chart drawing plugin for pyexcel :copyright: (c) 2016-2017 by Onni Software Ltd. :license: New BSD License, see LICENSE for further details """ from pyexcel.plugins import PyexcelPluginChain PyexcelPluginChain(__name__).add_a_renderer( relative_plug...
1.335938
1
content/Coverage Criteria/code-snippets-2-fytd/test_impl_with_properties.py
rvprasad/software-testing-course
11
29235
<filename>content/Coverage Criteria/code-snippets-2-fytd/test_impl_with_properties.py #py.test --cov-report=term --cov=. --cov-config=coverage.rc --cov-fail-under=100 from impl import PhysicalInfo import pytest import hypothesis.strategies as st from hypothesis import given, assume
1.46875
1
homepage/views.py
gwillig/octocat
0
29236
<filename>homepage/views.py<gh_stars>0 from django.http import Http404, JsonResponse from django.shortcuts import render from chatbot.chatbot import create_chatbot import threading import pickle import collections from io import BytesIO import numpy as np import urllib.request import json import wave import librosa imp...
2.234375
2
settings/base.py
ankit-ak/django-ecommerce-1
4
29237
""" Django settings for petstore project. Generated by 'django-admin startproject' using Django 2.2.10. For more information on this file, see https://docs.djangoproject.com/en/2.2/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/2.2/ref/settings/ """ import os ...
1.695313
2
day-01/part-2/jon.py
evqna/adventofcode-2020
12
29238
from tool.runners.python import SubmissionPy class JonSubmission(SubmissionPy): def run(self, s): l = [int(x) for x in s.strip().split()] n = len(l) for i in range(n): for j in range(i): if l[i] + l[j] > 2020: continue for k...
2.734375
3
threading/recon-ng_threadpool.py
all3g/pieces
34
29239
#!/usr/bin/env python # -*- coding: utf-8 -*- # From /opt/recon-ng/recon/mixins/threads.py from Queue import Queue, Empty import threading import time import logging logging.basicConfig(level=logging.INFO, format="[+] %(message)s") logger = logging.getLogger("mutilthreads") class ThreadingMixin(object): def _...
2.84375
3
abstracts_mutual_PCAscore.py
diegovalenzuelaiturra/EasyPatents
2
29240
from BusquedasSem import * import seaborn as sns def main(): df = pd.read_csv('./client0-sort.csv') df_abstract = df['Abstract'] l = df_abstract.size abstracts = df_abstract.values PCA_score = np.zeros((l, l)) abstracts_aux = preprocessing_abstracts_PCA(abstracts) for i in range(l): ...
2.625
3
.workloads/hash-crack/hash-crack.py
lolenseu/Projects
5
29241
<reponame>lolenseu/Projects<filename>.workloads/hash-crack/hash-crack.py import os import sys import time import hashlib target_hash = input("Input a target hash: ") numbers = '1234567890' uptext = 'qwertyuiopasdfghjklzxcvbnm' lotext = 'QWERTYUIOPASDFGHJKLZXCVBNM' steach = uptext + lotext lash_ash = open('log', 'w'...
2.8125
3
scripts/bert_system/voter.py
GKingA/tuw-inf-hasoc2021
0
29242
<filename>scripts/bert_system/voter.py import pandas as pd from sklearn.metrics import classification_report, confusion_matrix from argparse import ArgumentParser from read_data import read_csv def create_toxic_result(path, expected, out, toxic_category, test=False): if not test: df_true = read_csv(expect...
2.84375
3
cap8/ex2.py
felipesch92/livroPython
0
29243
<gh_stars>0 def multiplo(a, b): if a % b == 0: return True else: return False print(multiplo(2, 1)) print(multiplo(9, 5)) print(multiplo(81, 9))
3.46875
3
parsifal/apps/reviews/migrations/0020_searchresult.py
ShivamPytho/parsifal
342
29244
<reponame>ShivamPytho/parsifal<filename>parsifal/apps/reviews/migrations/0020_searchresult.py # -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations import parsifal.apps.reviews.models import django.db.models.deletion class Migration(migrations.Migration): depen...
1.414063
1
mastiff/plugins/analysis/EXE/EXE-singlestring.py
tt1379/mastiff
164
29245
#!/usr/bin/env python """ Copyright 2012-2013 The MASTIFF Project, All Rights Reserved. This software, having been partly or wholly developed and/or sponsored by KoreLogic, Inc., is hereby released under the terms and conditions set forth in the project's "README.LICENSE" file. For a list of all contributors...
2.296875
2
Libs/Scene Recognition/SceneRecognitionCNN.py
vpulab/Semantic-Guided-Scene-Attribution
3
29246
<filename>Libs/Scene Recognition/SceneRecognitionCNN.py import torch.nn as nn from torchvision.models import resnet class SceneRecognitionCNN(nn.Module): """ Generate Model Architecture """ def __init__(self, arch, scene_classes=1055): super(SceneRecognitionCNN, self).__init__() # --...
2.96875
3
raduga/aws/ec2.py
tuxpiper/raduga
0
29247
from time import sleep class AWSEC2(object): def __init__(self, target): self.conn = target.get_ec2_conn() def get_instance_state(self, instance_id): instance = self.conn.get_only_instances(instance_id)[0] return instance.state def stop_instance(self, instance_id): self.co...
2.796875
3
sails/commands.py
metrasynth/solar-sails
6
29248
import rv.api class Command(object): args = () processed = False def __init__(self, *args, **kw): self._apply_args(*args, **kw) def __repr__(self): attrs = ' '.join( '{}={!r}'.format( arg, getattr(self, arg), ) for ...
2.359375
2
rfcc/model.py
IngoMarquart/rfcc
0
29249
<reponame>IngoMarquart/rfcc from sklearn.ensemble import RandomForestClassifier, RandomForestRegressor from scipy.spatial.distance import squareform, pdist from rfcc.data_ops import ordinal_encode import pandas as pd import numpy as np from typing import Union, Optional from scipy.cluster.hierarchy import linkage...
2.3125
2
zoloto/cameras/camera.py
RealOrangeOne/yuri
0
29250
from pathlib import Path from typing import Any, Generator, Optional, Tuple from cv2 import CAP_PROP_BUFFERSIZE, VideoCapture from numpy import ndarray from zoloto.marker_type import MarkerType from .base import BaseCamera from .mixins import IterableCameraMixin, VideoCaptureMixin, ViewableCameraMixin from .utils im...
2.109375
2
.config/vim/python3/tex.py
psvenk/dotfiles
0
29251
<filename>.config/vim/python3/tex.py import vim from datetime import datetime from os import path from subprocess import run, DEVNULL def include_screenshot(): directory = path.dirname(vim.current.buffer.name) timestamp = datetime.now().strftime("%Y-%m-%d-%H-%M-%S") filename = f"screenshot-{timestamp}.png"...
2.5625
3
tests/ext/test_ext_plugin.py
tomekr/cement
826
29252
<reponame>tomekr/cement from cement.ext.ext_plugin import CementPluginHandler # module tests class TestCementPluginHandler(object): def test_subclassing(self): class MyPluginHandler(CementPluginHandler): class Meta: label = 'my_plugin_handler' h = MyPluginHandler() ...
2.34375
2
wofry/beamline/optical_elements/ideal_elements/screen.py
PaNOSC-ViNYL/wofry
0
29253
<filename>wofry/beamline/optical_elements/ideal_elements/screen.py """ Represents an ideal lens. """ from syned.beamline.optical_elements.ideal_elements.screen import Screen from wofry.beamline.decorators import OpticalElementDecorator class WOScreen(Screen, OpticalElementDecorator): def __init__(self, name="Undef...
2.578125
3
scripts/sample_imgnet.py
duanzhiihao/mycv
0
29254
<reponame>duanzhiihao/mycv import os from tqdm import tqdm from pathlib import Path import random from mycv.paths import IMAGENET_DIR from mycv.datasets.imagenet import WNIDS, WNID_TO_IDX def main(): sample(200, 600, 50) def sample(num_cls=200, num_train=600, num_val=50): assert IMAGENET_DIR.is_dir() ...
2.578125
3
test/test_document.py
hibtc/madseq
0
29255
<filename>test/test_document.py # test utilities import unittest from decimal import Decimal # tested module import madseq class Test_Document(unittest.TestCase): def test_parse_line(self): parse = madseq.Document.parse_line Element = madseq.Element self.assertEqual(list(parse(' \t ')...
2.765625
3
Assignment3/src/main/bkool/utils/Visitor.py
ntnguyen648936/PPL-BKOOOL
0
29256
from abc import ABC, abstractmethod, ABCMeta class Visitor(ABC): @abstractmethod def visitProgram(self, ast, param): pass @abstractmethod def visitVarDecl(self, ast, param): pass @abstractmethod def visitConstDecl(self, ast, param): pass @abstractmethod def visi...
3.25
3
opensanctions/crawlers/eu_fsf.py
quantumchips/opensanctions
102
29257
from prefixdate import parse_parts from opensanctions import helpers as h from opensanctions.util import remove_namespace def parse_address(context, el): country = el.get("countryDescription") if country == "UNKNOWN": country = None # context.log.info("Addrr", el=el) return h.make_address( ...
2.421875
2
lre/nlp/__init__.py
ovixiao/lre
0
29258
# -*- coding: utf-8 -*- """ 处理各种语言的库,主要是实现分段落、句子、词的功能 """ from __future__ import unicode_literals from .nlp_zh import NlpZh class Nlp(object): def __init__(self, config): self.config = config if self.config.language == 'zh': self.nlp = NlpZh(config) else: raise Va...
2.875
3
scripts/vertical/scr_process_stats.py
juhi24/radcomp
1
29259
<filename>scripts/vertical/scr_process_stats.py # coding: utf-8 import matplotlib.pyplot as plt from scr_class_stats import init_rain, cl_frac_in_case, frac_in_case_hist def proc_frac(cases, lcl, frac=True): """fraction or sum of process occurrences per case""" cl_sum = cases.case.apply(lambda x: 0) for ...
2.640625
3
scripts/supervised/exam_real_robot_data/analysis_icm_model_real_bot.py
fredshentu/public_model_based_controller
0
29260
<gh_stars>0 """ Since the size of real robot data is huge, we first go though all data then save loss array, then sort loss array. Finally we use the indexes to find the corresponding graphs """ import time from rllab.core.serializable import Serializable from numpy.linalg import norm from numpy import mean from numpy ...
2.1875
2
data_preprocess/build_data_to_tfrecord.py
YuxianMeng/CorefQA-pytorch
6
29261
#!/usr/bin/env python # -*- coding:utf-8 -*- """ @author: <NAME> @license: Apache Licence @file: prepare_training_data.py @time: 2019/12/19 @contact: <EMAIL> 将conll的v4_gold_conll文件格式转成模型训练所需的jsonlines数据格式 """ import argparse import json import logging import os import re import sys from collections import defaultdict...
2.265625
2
pulseplot/pulseplot.py
kaustubhmote/pulseplot
2
29262
""" Utilities for making plots """ from warnings import warn import matplotlib.pyplot as plt from matplotlib.projections import register_projection from matplotlib.animation import ArtistAnimation from .parse import Delay, Pulse, PulseSeq def subplots(*args, **kwargs): """ Wrapper around matplotlib.pyplot.s...
2.734375
3
test/test_immutable_maps.py
zuoralabs/autolisp
0
29263
<reponame>zuoralabs/autolisp from genlisp.immutables import _ImmutableMap as ImmutableMap import random test_dicts = [{1: 2}, {1: 3}, {1: 2, 3: 4}, dict(a=1, b=2, c=3, d=4, e=5), dict(a=3, b=1, c=3, d=4, e=5), {ii: random.randint(0, 10000) for ii in...
2.375
2
Mentorama/Modulo 3 - POO/Quadrado.py
MOURAIGOR/python
0
29264
class Quadrado: def __init__(self, lado): self.tamanho_lado = lado def mudar_valor_lado(self, novo_lado): lado = novo_lado self.tamanho_lado = novo_lado def retornar_valor_lado(self, retorno): self.tamanho_lado = retorno print(retorno) def calcular_area(self, a...
3.59375
4
src/sima/riflex/fileformatcode.py
SINTEF/simapy
0
29265
<gh_stars>0 # Generated with FileFormatCode # from enum import Enum from enum import auto class FileFormatCode(Enum): """""" BINARY_OUTPUT_ONLY = auto() ASCII_OUTPUT_ONLY = auto() NO_ADDITIONAL_OUTPUT = auto() ASCII_OUTPUT = auto() BINARY_OUTPUT = auto() def label(self): if self =...
3.046875
3
wolframclient/evaluation/pool.py
krbarker/WolframClientForPython
0
29266
<reponame>krbarker/WolframClientForPython # -*- coding: utf-8 -*- from __future__ import absolute_import, print_function, unicode_literals import itertools import logging from asyncio import CancelledError from wolframclient.evaluation.base import WolframAsyncEvaluator from wolframclient.evaluation.kernel.asyncsessi...
2.65625
3
results/neural_nets/trainsize_varyresults/run_charcnn.py
k-ivey/FastSK
13
29267
<gh_stars>10-100 import os.path as osp import subprocess dna_datasets = [ "CTCF", "EP300", "JUND", "RAD21", "SIN3A", "Pbde", "EP300_47848", "KAT2B", "TP53", "ZZZ3", "Mcf7", "Hek29", "NR2C2", "ZBTB33", ] prot_datasets = [ "1.1", "1.34", "2.1", "2....
2.109375
2
pages/cart_page.py
kukushdi3981/sel-1_test-project
0
29268
from selenium.webdriver.support.wait import WebDriverWait from selenium.webdriver.support import expected_conditions as EC from selenium.webdriver.common.by import By class CartPage: def __init__(self, driver): self.driver = driver self.wait = WebDriverWait(driver, 10) def del_from_cart_butto...
2.796875
3
malaya/entity.py
aizatrosli/Malaya
1
29269
from ._utils import _tag_class from ._utils._paths import PATH_ENTITIES, S3_PATH_ENTITIES def available_deep_model(): """ List available deep learning entities models, ['concat', 'bahdanau', 'luong'] """ return ['concat', 'bahdanau', 'luong'] def available_bert_model(): """ List available be...
2.46875
2
src/invoices/tests/test_models.py
brianl9995/payinv
2
29270
<reponame>brianl9995/payinv<gh_stars>1-10 from django.test import TestCase from core.tests.factories import SaleFactory, InvoiceFactory from invoices.models import Invoice class InvoiceModelTestCase(TestCase): def test_sales_pending_without_invoice(self): """ Should return this sale if not have Invoice t...
2.875
3
testes e exercícios/URI/somaImparesConsecutivosII.py
LightSnow17/exercicios-Python
0
29271
<reponame>LightSnow17/exercicios-Python<gh_stars>0 valores = [] quant = int(input()) for c in range(0, quant): x, y = input().split(' ') x = int(x) y = int(y) maior = menor = soma = 0 if x > y: maior = x menor = y else: maior = y menor = x if maior == menor+1...
3.328125
3
magmap/stats/vols.py
kaparna126/magellanmapper
0
29272
<reponame>kaparna126/magellanmapper # Regional volume and density management # Author: <NAME>, 2018, 2019 """Measure volumes and densities by regions. Intended to be higher-level, relatively atlas-agnostic measurements. """ from enum import Enum from time import time import numpy as np import pandas as pd from scipy...
2.046875
2
PythonCode/Pyboard/Examples/SImpleUART.py
CarterWS/Summer2020
0
29273
import time,pyb uart = pyb. UART(3,9600, bits=8, parity=None, stop=1) while(True): time.sleep_ms(100) size = uart.any() if (size > 0): string = uart.read(size) data = int(string[-1]) print('Data: %3d' % (data))
2.9375
3
scripts/add_session_chairs.py
pranav-ust/naacl-2021-website
8
29274
<gh_stars>1-10 # Adds session chairs to the existing (static) program.html file. # Source: https://docs.google.com/spreadsheets/d/1aoUGr44xmU6bnJ_S61WTJkwarOcKzI_u1BgK4H99Yt4/edit?usp=sharing # Please download and save the spreadsheet in CSV format. PATH_TO_CSV = "/tmp/sessions.csv" #PATH_TO_HTML = "../conference-prog...
3.015625
3
generator/request.py
WulffHunter/log_generator
5
29275
from faker import Faker import random import parameters from utils import chance_choose, chance from uri_generator import gen_path, uri_extensions, gen_uri_useable # TODO: Continue to expand this list with the proper formats for other application # layer protocols (e.g. FTP, SSH, SMTP...) protocols = ['HTTP/1.0', 'H...
2.515625
3
ktx_parser/format_jupyter.py
SebastianoF/ktx-parser
0
29276
<filename>ktx_parser/format_jupyter.py from pathlib import PosixPath, Path from typing import Optional import nbformat as nbf from ktx_parser.abs_format import AbsFormat from ktx_parser.abs_getter import AbsGetter from ktx_parser.decorations import keys_to_decorations class FormatJupyter(AbsFormat): def __init_...
2.625
3
leetcode/binary_search.py
verthais/exercise-python
0
29277
def binary_search(collection, lhs, rhs, value): if rhs > lhs: mid = lhs + (rhs - lhs) // 2 if collection[mid] == value: return mid if collection[mid] > value: return binary_search(collection, lhs, mid-1, value) return binary_search(collection, mid+1, rhs, v...
3.828125
4
pywakeup.py
CRImier/pyWakeUp
0
29278
<reponame>CRImier/pyWakeUp #! /usr/bin/env python from datetime import datetime, timedelta from threading import Thread import logging import os from time import sleep logging.basicConfig(level = logging.DEBUG) """# define various handy options usage = "usage: %prog [options] [+]hours:minutes" parser = OptionParser...
2.703125
3
lib/mpmath/tests/test_hp.py
np0212/Capstone-Project
4
29279
<gh_stars>1-10 """ Check that the output from irrational functions is accurate for high-precision input, from 5 to 200 digits. The reference values were verified with Mathematica. """ import time from mpmath import * precs = [5, 15, 28, 35, 57, 80, 100, 150, 200] # sqrt(3) + pi/2 a = \ "3.302847134363773912758768033...
2.078125
2
mp2ragelib/ui.py
ofgulban/mp2ragelib
1
29280
"""Commandline interface.""" # TODO: After scripting works.
1.171875
1
DQMServices/Components/scripts/dqmiodumpindices.py
ckamtsikis/cmssw
6
29281
<reponame>ckamtsikis/cmssw #!/usr/bin/env python from __future__ import print_function import uproot import argparse from prettytable import PrettyTable from collections import defaultdict parser = argparse.ArgumentParser(description="Shows Indices table in a DQMIO file. Last column (ME count) is computed like this:...
2.25
2
Modulo1/exercicio009_2.py
natterra/python3
0
29282
#Exercício Python 9: Faça um programa que leia um número Inteiro qualquer e mostre na tela a sua tabuada. n = int(input("Digite um número: ")) i = 0 print("--------------") while i < 10: i += 1 print("{:2} x {:2} = {:2}".format(n, i, n*i)) print("--------------")
4.09375
4
test3a.py
naveen912014/pyneta
0
29283
print print('This is Naveen') :q
1.492188
1
tests/test_metrics.py
Patte1808/moda
27
29284
"""Test evaluation functionality.""" from moda.evaluators import f_beta from moda.evaluators.metrics import calculate_metrics_with_shift, _join_metrics def test_f_beta1(): precision = 0.6 recall = 1.0 beta = 1 f = f_beta(precision, recall, beta) assert (f > 0.74) and (f < 0.76) def test_f_beta3(...
2.328125
2
server/utils/server_db.py
DoctorChe/Python_DataBase_PyQT
1
29285
<reponame>DoctorChe/Python_DataBase_PyQT from contextlib import contextmanager from sqlalchemy import MetaData from sqlalchemy import create_engine from sqlalchemy.ext.declarative import declarative_base from sqlalchemy.orm import sessionmaker from .config_server import SERVER_DATABASE engine = create_engine(SERVER_...
2.46875
2
glouton/repositories/archive/archiveRepo.py
deckbsd/glouton-satnogs-data-downloader
13
29286
<reponame>deckbsd/glouton-satnogs-data-downloader<gh_stars>10-100 from queue import Queue from threading import Thread from glouton.commands.download.downloadCommandParams import DownloadCommandParams from glouton.commands.download.archiveDownloadCommand import ArchiveDownloadCommand from glouton.commands.module.endMod...
2.34375
2
DataWorkflow/file_deletion/migrations/0005_maxlength_filename.py
Swiss-Polar-Institute/data-workflow
0
29287
<gh_stars>0 # Generated by Django 2.2.6 on 2019-10-25 19:50 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('file_deletion', '0004_maxlength_etag'), ] operations = [ migrations.AlterField( model_name='deletedfile', ...
1.382813
1
tools/Sikuli/DoReplace.sikuli/DoReplace.py
marmyshev/vanessa-automation
296
29288
click(Pattern("Bameumbrace.png").similar(0.80)) sleep(1) click("3abnb.png") exit(0)
1.570313
2
src/python/procyon/types.py
orbea/procyon
0
29289
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # Copyright 2017 The Procyon Authors # # 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 # # Un...
2.484375
2
approval/models.py
rajeshr188/django-onex
2
29290
from django.db import models,transaction from contact.models import Customer from product.models import Stock from django.urls import reverse from django.db.models import Sum # Create your models here. class Approval(models.Model): created_at = models.DateTimeField(auto_now_add = True, editable = F...
2.03125
2
Other/pdf2imageTest.py
Wanganator414/python
1
29291
from pdf2image import convert_from_path, convert_from_bytes from pdf2image.exceptions import ( PDFInfoNotInstalledError, PDFPageCountError, PDFSyntaxError ) images = convert_from_path('.\git_cheat_sheet.pdf')
2.21875
2
Google-Meet-Scheduler/script.py
dsrao711/Amazing-Python-Scripts
1
29292
from googleapiclient.discovery import build from uuid import uuid4 from google.auth.transport.requests import Request from pathlib import Path from google_auth_oauthlib.flow import InstalledAppFlow from typing import Dict, List from pickle import load, dump class CreateMeet: def __init__(self, attendees: Dict[str,...
2.4375
2
app/main/models/rover.py
Jeffmusa/Twende_Dev_Project
1
29293
class Rover: def __init__(self,photo,name,date): self.photo = photo self.name = name self.date = date class Articles: def __init__(self,author,title,description,url,poster,time): self.author = author self.title = title self.description = description ...
2.859375
3
submissions/urls.py
annalee/alienplan
5
29294
<reponame>annalee/alienplan<gh_stars>1-10 from django.urls import path from . import views urlpatterns = [ path('panel/', views.panel, name='panel-noslug'), path('panel/<slug:conslug>/', views.panel, name='panel'), path('panelreview/', views.PendingPanelList.as_view(), name='pending-panel-list-nos...
1.734375
2
voicebox_project.py
raccoonML/audiotools
0
29295
import librosa import numpy as np import audio from hparams import hparams """ This helps implement a user interface for a vocoder. Currently this is Griffin-Lim but can be extended to different vocoders. Required elements for the vocoder UI are: self.sample_rate self.source_action self.vocode_action """ class Voice...
3.28125
3
templatetags/spreedly_tags.py
shelfworthy/django-spreedly
2
29296
<gh_stars>1-10 from django.conf import settings from django import template from spreedly.functions import subscription_url register = template.Library() @register.simple_tag def existing_plan_url(user): return 'https://spreedly.com/%(site_name)s/subscriber_accounts/%(user_token)s' % { 'site_name': setti...
1.921875
2
tests/test_replace_lcsh.py
BookOps-CAT/ChangeSubject
1
29297
# -*- coding: utf-8 -*- import pytest from src.replace_lcsh import replace_term, lcsh_fields, normalize_subfields # def test_flip_impacted_fields(fake_bib): # pass @pytest.mark.parametrize( "arg,expectation", [ (1, ["a", "local term", "x", "subX1", "x", "subX2", "z", "subZ."]), (3, ["a...
2.296875
2
tutorplanner/input/data.py
tutor-planner/tutor-planner
1
29298
__author__ = ("<NAME> <mrost AT inet.tu-berlin.de>, " "<NAME> <aelvers AT inet.tu-berlin.de>") __all__ = ["Data"] from collections import OrderedDict from typing import Dict, List, Optional from . import tutor from . import rooms from ..util import converter from ..util.settings import settings class...
3
3
tests/doubles/producers.py
ess-dmsc/JustBinIt
0
29299
from just_bin_it.exceptions import KafkaException class SpyProducer: def __init__(self, brokers=None): self.messages = [] def publish_message(self, topic, message): self.messages.append((topic, message)) class StubProducerThatThrows: def publish_message(self, topic, message): ra...
2.3125
2