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
tests/controller/templates_manager/local_temp/bridge.py
threefoldtech/0-templates
1
28900
<gh_stars>1-10 from jumpscale import j from zerorobot.service_collection import ServiceNotFoundError from testconfig import config import random class BrigeManager: def __init__(self, parent, service_name=None): self.bridge_template = 'github.com/threefoldtech/0-templates/bridge/0.0.1' self._parent...
2
2
insights/parsers/ceph_insights.py
lhuett/insights-core
121
28901
<reponame>lhuett/insights-core<gh_stars>100-1000 """ ceph_insights - command ``ceph insights`` ========================================= """ import json import re from .. import CommandParser, parser from insights.specs import Specs @parser(Specs.ceph_insights) class CephInsights(CommandParser): """ Parse the...
2.203125
2
src/learners/__init__.py
OscarPedaVendere/sc2MultiAgentES
0
28902
<reponame>OscarPedaVendere/sc2MultiAgentES<filename>src/learners/__init__.py from .q_learner import QLearner from .coma_learner import COMALearner from .es_learner import ESLearner REGISTRY = {} REGISTRY["q_learner"] = QLearner REGISTRY["coma_learner"] = COMALearner REGISTRY["es_learner"] = ESLearner
1.195313
1
ietf/utils/management/base.py
hassanakbar4/ietfdb
25
28903
# Copyright The IETF Trust 2013-2020, All Rights Reserved # -*- coding: utf-8 -*- from email.message import EmailMessage from textwrap import dedent from traceback import format_exception, extract_tb from django.conf import settings from django.core.management.base import BaseCommand from ietf.utils.mail import send...
2.546875
3
lab01/calculadora/urls.py
josepilco7501/TECSUP-DAE-2021-2
0
28904
<gh_stars>0 from django.urls import path from.import views urlpatterns = [ #ex: localhost:8080/app/ path('', views.index, name='index'), #ex: localhost:8080/app/sumar/n1+n2/ path('sumar/<int:n1>/<int:n2>', views.sumar, name='suma'), #ex: localhost:8080/app/sumar/n1-n2/ path('restar/<int:n1>/<i...
1.78125
2
kmeans_poc/data/generate_dataset.py
katyamust/with_git_actions
0
28905
<reponame>katyamust/with_git_actions # generate dataset : random data in a two-dimensional space #https://towardsdatascience.com/understanding-k-means-clustering-in-machine-learning-6a6e67336aa1 import pandas as pd import numpy as np import matplotlib.pyplot as plt from sklearn.cluster import KMeans #%matplotlib inl...
3.75
4
stere/__init__.py
thomasmost/stere
17
28906
<filename>stere/__init__.py from .browserenabled import BrowserEnabled as Stere from .page import Page __all__ = [ "Stere", "Page", ]
1.234375
1
antlr/SevenBillionHumansParser.py
behrmann/7billionhumans
45
28907
from antlr4 import * from antlr4.error.ErrorListener import ErrorListener from antlr.SBHasmLexer import SBHasmLexer from antlr.SBHasmListener import SBHasmListener from antlr.SBHasmParser import SBHasmParser class MyErrorListener(ErrorListener): def __init__(self): super(MyErrorListener, self).__init__(...
2.265625
2
pig-latin/pig_latin.py
cmccandless/ExercismSolutions-python
0
28908
<filename>pig-latin/pig_latin.py consonents = ['sch', 'squ', 'thr', 'qu', 'th', 'sc', 'sh', 'ch', 'st', 'rh'] consonents.extend('bcdfghjklmnpqrstvwxyz') def prefix(word): if word[:2] not in ['xr', 'yt']: for x in consonents: if word.startswith(x): return (x, word[len(x)...
3.421875
3
amalia/simulation/PoissonSimulation.py
Aganonce/AMALIA-lite
0
28909
import logging from tools.EventGeneration import convert_date, generate_random_time, generate_random_node_id logger = logging.getLogger(__name__.split('.')[-1]) from features.ResponseTypeFeature import ResponseTypeFeature from features.ReplayTimeSeriesFeature import ReplayTimeSeriesFeature import tools.Cache as Cach...
2.296875
2
flee/pmicro_flee.py
jataware/flee
0
28910
<gh_stars>0 import datetime import math import os import sys from functools import wraps from typing import Optional, Tuple from flee import pflee from flee.SimulationSettings import SimulationSettings # noqa, pylint: disable=W0611 if os.getenv("FLEE_TYPE_CHECK") is not None and os.environ["FLEE_TYPE_CHECK"].lower()...
2.34375
2
src/my_pubsub.py
shirosweets/vosk-speech-to-text
1
28911
<filename>src/my_pubsub.py import os import datetime from json import dumps from google.cloud import pubsub_v1 from config_speech import config as conf from google.api_core.exceptions import AlreadyExists class Pubsub(): def __init__(self): PROJECT_PATH = "projects/project_name" TOPIC_NAME = 'top...
2.34375
2
ui/_alert.py
isbm/pybug
0
28912
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'xml/alert.ui' # # Created by: PyQt4 UI code generator 4.11.4 # # WARNING! All changes made in this file will be lost! from PyQt4 import QtCore, QtGui try: _fromUtf8 = QtCore.QString.fromUtf8 except AttributeError: def _fromUtf8(s):...
1.679688
2
scripts/client_lidar.py
Paulllit/projet_proto_lidar
0
28913
#!/usr/bin/env python import rospy import math from sensor_msgs.msg import LaserScan #import des donnes laser du lidar import time from rplidar_ros.srv import * class Client(): vel=None angle_est=None #Init def __init__(self): rospy.init_node('client_lidar') def listen_angle(self): ...
2.453125
2
tests/util/config_mixin.py
pruh/backee
0
28914
<filename>tests/util/config_mixin.py import os import logging from unittest import mock from backee.parser.config_parser import parse_config class ConfigMixin: def __get_config_file_contents(self, filename: str): config_file = os.path.join( os.path.dirname(__file__), os.pardir, "resources", f...
2.625
3
utils/__init__.py
KpaBap/palbot
0
28915
#from utils import ordinal import re from urllib.parse import quote as uriquote import asyncio from bs4 import BeautifulSoup import collections from utils.context import MoreContext from utils.context import Location from utils.paginator import Paginator from utils.units import units ordinal = lambda n: "%d%s" % (n,"t...
2.46875
2
tests/expectations/cat-hs-x-cat-date-smoothed-col-pct-w3.py
Crunch-io/crunch-cube
3
28916
<reponame>Crunch-io/crunch-cube<filename>tests/expectations/cat-hs-x-cat-date-smoothed-col-pct-w3.py<gh_stars>1-10 [ [float("NaN"), float("NaN"), 73.55631426, 76.45173763], [float("NaN"), float("NaN"), 71.11031587, 73.6557548], [float("NaN"), float("NaN"), 11.32891221, 9.80444014], [float("NaN"), float(...
1.039063
1
02-Tuples-and-sets/count_same_values.py
nmoskova/Python-advanced
0
28917
numbers = [float(num) for num in input().split()] nums_dict = {} for el in numbers: if el not in nums_dict: nums_dict[el] = 0 nums_dict[el] += 1 [print(f"{el:.1f} - {occurence} times") for el, occurence in nums_dict.items()]
3.515625
4
main.py
maxc0d3r/google-workspace-manager
0
28918
<gh_stars>0 """ Usage: main.py domains list main.py domains add [--body=<request_body>] [--file=<input_file>] main.py users list [--domain=<domain_name>] main.py users get [--email=<email>] main.py users add [--body=<request_body>] [--file=<input_file>] main.py users update [--email=<email>] [-...
2.5625
3
run_tests.py
Knitschi/CPFBuildscripts
1
28919
<reponame>Knitschi/CPFBuildscripts<filename>run_tests.py #!/usr/bin/python3 import unittest import sys import os sys.path.append(os.path.dirname(os.path.realpath(__file__))) from python.buildautomat_unit_tests import * from python.filesystemaccess_unit_tests import * if __name__ == '__main__': unittest.main() ...
1.34375
1
django_formset_vuejs/forms.py
fatse/django-formsets-vuejs
11
28920
from django.forms import ModelForm, inlineformset_factory, BaseInlineFormSet from . import models class AuthorContainerForm(ModelForm): class Meta: model = models.AuthorContainer exclude = ('id',) class AuthorForm(ModelForm): class Meta: model = models.Author fields = ('first...
2.125
2
test/__init__.py
shikajiro/picosdk-python-wrappers
114
28921
# # Copyright (C) 2018 Pico Technology Ltd. See LICENSE file for terms. #
0.59375
1
BMES_exps/BMES.py
volgachen/Chinese-Tokenization
0
28922
from collections import Counter from math import log from tqdm import tqdm import re from evaluation import evaluateSet def build_model(train_set): hmm_model = {i:Counter() for i in 'SBME'} trans = {'SS':0, 'SB':0, 'BM':0, 'BE':0, 'MM':0, 'ME':0, ...
2.34375
2
third_party/nucleus/io/bedgraph.py
llevar/deepvariant
1
28923
# Copyright 2018 Google Inc. # # 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, # this list of conditions and the following disclaimer. # #...
1.148438
1
code/bqutils/auth.py
victoria-cds-sig/explore_mimiciv
3
28924
<gh_stars>1-10 import google.auth def get_gcreds(scopes = None): if scopes == None: scopes = ["https://www.googleapis.com/auth/bigquery"] return google.auth.default( scopes = scopes )
2.125
2
solnml/components/evaluators/rgs_evaluator.py
zhengjian2322/soln-ml
0
28925
from ConfigSpace import ConfigurationSpace, CategoricalHyperparameter import time import warnings import os import numpy as np import pickle as pkl from sklearn.metrics.scorer import balanced_accuracy_scorer from solnml.utils.logging_utils import get_logger from solnml.components.evaluators.base_evaluator import _Base...
1.867188
2
testing/MLDB-1104-input-data-spec.py
kstepanmpmg/mldb
665
28926
# # MLDB-1104-input-data-spec.py # mldb.ai inc, 2015 # This file is part of MLDB. Copyright 2015 mldb.ai inc. All rights reserved. # import unittest import datetime import random from mldb import mldb, ResponseException class InputDataSpecTest(unittest.TestCase): @classmethod def setUpClass(cls): cls...
2.578125
3
code/python/external/pi3d/shape/EnvironmentCube.py
rec/echomesh
30
28927
import os.path from pi3d import * from pi3d.Buffer import Buffer from pi3d.Shape import Shape from pi3d.Texture import Texture CUBE_PARTS = ['front', 'right', 'top', 'bottom', 'left', 'back'] BOTTOM_INDEX = 3 def loadECfiles(path, fname, suffix='jpg', nobottom=False): """Helper for loading environment cube faces. ...
3.0625
3
views.py
margish100/Api-json
0
28928
<reponame>margish100/Api-json<filename>views.py<gh_stars>0 from django.shortcuts import render from django.http import HttpResponse, JsonResponse from rest_framework.parsers import JSONParser from .models import Article from .serializers import ArticleSerializer from django.views.decorators.csrf import csrf_exempt...
2.09375
2
Hangman.py
Draxsis/hangman-game
0
28929
<filename>Hangman.py<gh_stars>0 import random import time # Welcome and start time.sleep(1) player_name = input('Please enter your player name : ') time.sleep(1) print(f'Welcome to hangman game {player_name}') # main function def main(): global count global word global display global ...
4.125
4
vermin_rules_3.9.py
gousaiyang/python-change-parser
3
28930
modules_rules = { "graphlib": (None, (3, 9)), "test.support.socket_helper": (None, (3, 9)), "zoneinfo": (None, (3, 9)), } classes_rules = { "asyncio.BufferedProtocol": (None, (3, 7)), "asyncio.PidfdChildWatcher": (None, (3, 9)), "importlib.abc.Traversable": (None, (3, 9)), "importlib.abc.Tr...
1.890625
2
src/pynvraw/nvapi_api.py
JustAMan/pynvraw
8
28931
<gh_stars>1-10 '''Low-level API working through obscure nvapi.dll.''' import ctypes import typing import sys import collections import enum from .status import NvStatus, NvError, NVAPI_OK nvapi = ctypes.CDLL('nvapi64.dll' if sys.maxsize > 2**32 else 'nvapi.dll') _nvapi_QueryInterface = nvapi.nvapi_QueryInterface _n...
1.882813
2
prototype/ukwa/lib/sip/ids.py
GilHoggarth/ukwa-manage
1
28932
<reponame>GilHoggarth/ukwa-manage<gh_stars>1-10 #!/usr/bin/env python """ Generic methods used for verifying/indexing SIPs. """ from __future__ import absolute_import import re import logging import tarfile import hdfs from lxml import etree from StringIO import StringIO # import the Celery app context #from crawl....
2.28125
2
gentelella/registeration/forms.py
horoyoii/admin_dashboard_edgex
2
28933
<reponame>horoyoii/admin_dashboard_edgex from django import forms from .models import * class ProfileFormModel(forms.ModelForm): class Meta: model = Device_profile fields = ['device_profile_file']
1.570313
2
tests/tensors/similarity_functions/dot_product_test.py
richarajpal/deep_qa
459
28934
<reponame>richarajpal/deep_qa<filename>tests/tensors/similarity_functions/dot_product_test.py<gh_stars>100-1000 # pylint: disable=no-self-use,invalid-name import numpy from numpy.testing import assert_almost_equal import keras.backend as K from deep_qa.tensors.similarity_functions.dot_product import DotProduct class...
2.359375
2
kiwi/cogs/Mod.py
Andres2055/Kiwi-bot
1
28935
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ He copiado y modificado software ajeno. Gran parte de este script es una modificación y/o mejora del original, por ello doy los debidos créditos al autor del software original: MIT License Copyright (c) 2016 - 2017 <NAME> Permission is hereby granted, ...
2.03125
2
scripts/genotype/GetReadDepthDiff.py
EichlerLab/smrtsv2
45
28936
#!/usr/bin/env python3 import argparse import gc import numpy as np import os import pandas as pd import pysam # Number of SVs to process before resetting pysam (close and re-open file). Avoids a memory leak in pysam. PYSAM_RESET_INTERVAL = 1000 def get_read_depth(df_subset, bam_file_name, mapq, ref_filename=None)...
2.6875
3
examples/cpcdata.py
zhmcclient/python-zhmcclient
30
28937
<gh_stars>10-100 #!/usr/bin/env python # Copyright 2016-2021 IBM Corp. 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 #...
1.859375
2
model-training/mtl_processor.py
imdiptanu/MUDESv2
0
28938
<gh_stars>0 from farm.data_handler.processor import Processor from tokenizers.pre_tokenizers import WhitespaceSplit from farm.data_handler.samples import ( Sample, SampleBasket, ) from farm.data_handler.utils import expand_labels import ast import numpy as np import pandas as pd class MTLProcessor(Processor):...
2.28125
2
knightmovs_test.py
rcolomina/pythonchess
0
28939
#!/usr/bin/python from piece import Piece from gameNode import GameNode from knightmovs import * from functions import * listPiecesWhite=[] listPiecesBlack=[] w1=Piece('Q',[3,1]) w2=Piece('N',[3,2]) w3=Piece('N',[4,2]) w4=Piece('B',[2,3]) listPiecesWhite.append(w1) listPiecesWhite.append(w2) listPiecesWhite.append(w...
2.65625
3
Rendering/Core/Testing/Python/ImageActor.py
jasper-yeh/VtkDotNet
3
28940
#!/usr/bin/env python import vtk from vtk.test import Testing from vtk.util.misc import vtkGetDataRoot VTK_DATA_ROOT = vtkGetDataRoot() # Create the RenderWindow, Renderer and both Actors ren1 = vtk.vtkRenderer() renWin = vtk.vtkRenderWindow() renWin.AddRenderer(ren1) iren = vtk.vtkRenderWindowInteractor() iren.SetRen...
2.296875
2
bot/typings/common.py
Axelancerr/Life
27
28941
# Future from __future__ import annotations # Standard Library from typing import Literal ImageFormat = Literal["webp", "jpeg", "jpg", "png", "gif"]
1.796875
2
boggle.py
tron32213021/boggle-game
0
28942
#!/usr/local/anaconda/bin/python #copyright: <NAME>, <EMAIL> from random import random from tkinter import * from copy import deepcopy class Boggle(): ''' @param dict F @param dict T @param int size @param int cellWidth @param array clone @param list soln @param cube ActionNow @...
2.890625
3
chart/message_passing_tree/message_passing_tree/decorators.py
JoeyBF/sseq
7
28943
<filename>chart/message_passing_tree/message_passing_tree/decorators.py from copy import copy import functools import inspect import sys import traceback from . import ansi from .agent import Agent def reset_global_handlers(): global HANDLERS HANDLERS = { "in" : { }, "out" : { }...
2.21875
2
Python/bolha_curta.py
robertogoes/exercicios-coursera-python
0
28944
def bolha_curta(self, lista): fim = len(lista) for i in range(fim-1, 0, -1): trocou = False for j in range(i): if lista[j] > lista[j+1]: lista[j], lista[j+1] = lista[j+1], lista[j] trocou = True if trocou== Fal...
3.453125
3
tests/lightning/utils/helpers.py
jexio/fulmo
0
28945
<filename>tests/lightning/utils/helpers.py # flake8: noqa # Copyright The PyTorch Lightning team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENS...
2.34375
2
bootstrapvz/providers/virtualbox/tasks/boot.py
qqshfox/bootstrap-vz
1
28946
<gh_stars>1-10 from bootstrapvz.base import Task from bootstrapvz.common import phases from bootstrapvz.common.tasks import grub class AddVirtualConsoleGrubOutputDevice(Task): description = 'Adding `tty0\' as output device for grub' phase = phases.system_modification successors = [grub.WriteGrubConfig] ...
2.15625
2
tensorflow_similarity/distances.py
djm2131/similarity
0
28947
# Copyright 2021 The TensorFlow 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 # # Unless required by applicable law or agreed to ...
3.03125
3
satang_pro_signer/signer.py
thebevrishot/satang-pro-signer
0
28948
import hashlib import hmac from satang_pro_signer import preparer class Signer: def __init__(self, secret: bytes): self.secret = secret def sign(self, obj) -> bytes: parsed = preparer.Preparer(obj).encode() msg = bytes(parsed, encoding='utf-8') try: # better perf...
2.734375
3
atcoder/abc/a035.py
tomato-300yen/coding
0
28949
<filename>atcoder/abc/a035.py<gh_stars>0 W, H = map(int, input().split()) print("4:3" if 4 * H == 3 * W else "16:9")
2.625
3
carbondesign/tests/test_multi_select_html.py
dozymoe/django-carbondesign
0
28950
# pylint:disable=missing-module-docstring,missing-class-docstring,missing-function-docstring from django import forms #- from .base import compare_template, SimpleTestCase class DummyForm(forms.Form): choice1 = forms.ChoiceField( required=False, help_text="Optional helper text here") ch...
2.140625
2
visualization/POF/utils/keypoint_conversion.py
alvaro-budria/body2hands
63
28951
<reponame>alvaro-budria/body2hands<filename>visualization/POF/utils/keypoint_conversion.py import numpy as np import numpy.linalg as nl from utils.general import connMat a4_to_main = { 'body': np.array([1, 0, 9, 10, 11, 3, 4, 5, 12, 13, 14, 6, 7, 8, 17, 15, 18, 16, 19, 20], dtype=np.int64), # convert to order of ...
2.328125
2
rubika/__init__.py
sajjadsoleimani/rubika
1
28952
from requests import post from random import randint from json import loads, dumps import asyncio,base64,glob,json,math,urllib3,os,pathlib,random,sys,concurrent.futures,time from tqdm import tqdm from Crypto.Cipher import AES from Crypto.Util.Padding import pad, unpad urllib3.disable_warnings(urllib3.exceptions.Insecu...
2.5625
3
colab_zirc_dims/non_std_cfgs/non_std_cfgs.py
MCSitar/colab-zirc-dims
2
28953
# -*- coding: utf-8 -*- """ Functions to install dependencies for non-standard models (e.g., Centermask2) and get compatible Detectron2 configs for them. """ import sys import subprocess try: from detectron2.config import get_cfg except ModuleNotFoundError: print('WARNING: Detectron2 not installed on (virtual?...
2.1875
2
main_train_brf.py
MahshidJabari/accident-prediction-montreal
9
28954
#!/usr/bin/env python from preprocess import get_negative_samples, get_positive_samples from utils import init_spark from preprocess import get_dataset_df from pyspark.ml.classification import RandomForestClassifier from pyspark.ml.tuning import ParamGridBuilder, TrainValidationSplit, \ Cr...
2.46875
2
operations/tests/rally/custom_runner/ocss_search_runner.py
irin4eto/open-commerce-search
22
28955
<reponame>irin4eto/open-commerce-search<filename>operations/tests/rally/custom_runner/ocss_search_runner.py # -*- coding: utf-8 -*- import json class OCSSSearchRunner: """ This runner should perform searches from ocss search logfile against elastic """ # define search data search_data = [] ...
2.484375
2
Packages/LiveReload/server/PluginAPI.py
kangTaehee/st3
4
28956
<filename>Packages/LiveReload/server/PluginAPI.py #!/usr/bin/python # -*- coding: utf-8 -*- import LiveReload import json import sublime try: from .Settings import Settings except ValueError: from Settings import Settings def log(msg): pass class PluginFactory(type): """ Based on example from ...
2.140625
2
team/migrations/0014_auto_20200608_1855.py
Aleccc/gtcrew
0
28957
<reponame>Aleccc/gtcrew<filename>team/migrations/0014_auto_20200608_1855.py # Generated by Django 3.0.4 on 2020-06-08 22:55 from django.db import migrations import wagtail.core.fields class Migration(migrations.Migration): dependencies = [ ('team', '0013_auto_20200608_1824'), ] operations = [ ...
1.234375
1
discussions/migrations/0006_channel_is_deleted.py
Wassaf-Shahzad/micromasters
32
28958
<reponame>Wassaf-Shahzad/micromasters<filename>discussions/migrations/0006_channel_is_deleted.py # Generated by Django 2.1.5 on 2019-03-22 07:29 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('discussions', '0005_timestamped_discussions_models'), ] ...
1.625
2
exabel_data_sdk/client/api/search_service.py
burk/python-sdk
0
28959
<reponame>burk/python-sdk<gh_stars>0 import itertools from typing import Mapping, Sequence, Tuple, TypeVar, Union from exabel_data_sdk.client.api.api_client.entity_api_client import EntityApiClient from exabel_data_sdk.client.api.data_classes.entity import Entity from exabel_data_sdk.stubs.exabel.api.data.v1.all_pb2 i...
2.515625
3
test/test_CustomLayers.py
tomasheiskanen/pro_gan_pytorch
2
28960
import torch as th from unittest import TestCase from pro_gan_pytorch import CustomLayers as cL device = th.device("cuda" if th.cuda.is_available() else "cpu") class Test_equalized_conv2d(TestCase): def setUp(self): self.conv_block = cL._equalized_conv2d(21, 3, k_size=(3, 3), pad=1) # print th...
2.578125
3
onlinecourse/tests.py
vicbolo78/Week-8-Lab
0
28961
<filename>onlinecourse/tests.py<gh_stars>0 import unittest from django.test import TestCase class TestQuestion(unittest.TestCasel): def test_is_get_score(self, selected_ids): self.assertNotEqual(all_answers = self.choice_set.filter(is_correct=True).count() self.assertEqual(selected_correct = self....
2.84375
3
trnsystor/statement/overwritecheck.py
samuelduchesne/pyTrnsys
5
28962
"""OverwriteCheck Statement.""" from trnsystor.statement.statement import Statement class OverwriteCheck(Statement): """OverwriteCheck Statement. A common error in non standard and user written TRNSYS Type routines is to reserve too little space in the global output array. By default, each Type is a...
3.15625
3
src/python/serif/model/impl/relation_mention/aida_relation_mention_model.py
BBN-E/text-open
2
28963
import os from serif.model.relation_mention_model import RelationMentionModel from serif.theory.enumerated_type import Tense, Modality # Modified from DogFoodFinderRelationMentionModel class AIDARelationMentionModel(RelationMentionModel): '''adds TACRED relations to TACRED entities''' def __init__(self, mapp...
2.265625
2
datamodel_code_generator/model/pydantic/__init__.py
languitar/datamodel-code-generator
0
28964
from pathlib import Path from typing import List, Optional from jinja2 import Environment, FileSystemLoader, Template from pydantic import BaseModel as _BaseModel from ..base import TEMPLATE_DIR from .base_model import BaseModel, DataModelField from .custom_root_type import CustomRootType from .dataclass import DataC...
2.21875
2
tools/test_everything.py
cdleary/bazel_rules_hdl
0
28965
<reponame>cdleary/bazel_rules_hdl<filename>tools/test_everything.py #!/usr/bin/env python3 # 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.apac...
1.578125
2
A069675/A069675_helper.py
sethtroisi/OEIS
3
28966
import math import gmpy2 # How many you want to find MAX_COUNT = 500 K_COUNT = 3.7 # d = 1000 yields ~264 #for parallel C++ K_COST = 4.14 * 1e-11 # d = 5000 takes ~400s K_FILTER_COST = 1.0 * 1e-9 # d = 5000, sieve = 30M takes 10.3s def optimal_sieve(d, expected_cost): non_trivial_a_b = d * 2...
3.140625
3
devilry/devilry_examiner/views/assignment/bulkoperations/bulk_feedback.py
devilry/devilry-django
29
28967
<reponame>devilry/devilry-django from django import forms from django.contrib import messages from django.db import models from django.db import transaction from django.http import HttpResponseRedirect, Http404 from django.utils import timezone from django.utils.translation import gettext_lazy, pgettext_lazy from dja...
2.203125
2
tests/test_util.py
NickVeld/battery_handyman
2
28968
<filename>tests/test_util.py # Copyright [2021] [<NAME>] # # 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 requir...
2.21875
2
tests/http_wrappers/test_response.py
pabarros/asgard-api
3
28969
<reponame>pabarros/asgard-api<gh_stars>1-10 import json import unittest from copy import deepcopy from http import HTTPStatus from unittest.mock import call, patch from flask import Response as FlaskResponse from marathon import MarathonApp from marathon.models.group import MarathonGroup from marathon.models.task impo...
2.28125
2
airbyte-integrations/connectors/source-chargebee/unit_tests/conftest.py
onaio/airbyte
22
28970
<reponame>onaio/airbyte # # Copyright (c) 2022 Airbyte, Inc., all rights reserved. # import json import os from pytest import fixture def load_file(fn): return open(os.path.join("unit_tests", "responses", fn)).read() @fixture def test_config_v1(): return {"site": "airbyte-test", "site_api_key": "site_api_...
1.796875
2
tests/test_rfc8226.py
alvistack/etingof-pyasn1-modules
34
28971
<reponame>alvistack/etingof-pyasn1-modules<gh_stars>10-100 # # This file is part of pyasn1-modules software. # # Created by <NAME> # Copyright (c) 2019, Vigil Security, LLC # License: http://snmplabs.com/pyasn1/license.html # import sys import unittest from pyasn1.codec.der import decoder as der_decoder from pyasn1.co...
2.0625
2
Maior_e_Menor.py
PedroFelipe-G-Arruda/Grupo-python
0
28972
<filename>Maior_e_Menor.py a = float(input('digite um numero:')) b = float(input('digite um numero:')) c = float(input('digite um numero:')) if a > b: if a > c: ma = a if b > c: mi = c if c > b: mi = b if b > a: if b > c: ma = b if a > c: ...
3.875
4
nosai/numbers.py
kurianbenoy/Reading_like_AI
0
28973
<filename>nosai/numbers.py """ 1999- Nineteen Ninty Nine 1888 - Eighteen Eighty Eight 1777 - Seventeen Seventy Seven 1111 - Oneeen Onety One Not fully huristics """ from num2words import num2words def spell(N): if N // 1_0000 ==0: N = divmod(N, 100) top, bot = N[0], N[1] result = [ ] ...
3.015625
3
src/preprocessing.py
kushagrasharma/bilstm-for-seq2f
0
28974
import pandas as pd import numpy as np function2idx = {"negative": 0, "ferritin": 1, "gpcr": 2, "p450": 3, "protease": 4} input_dir = '../data/raw/' data_dir = '../data/processed/' max_seq_len = 800 def read_and_concat_data(): df_cysteine = pd.read_csv(input_dir + 'uniprot-cysteine+protease+AND+reviewed_yes.tab...
2.703125
3
errores.py
facmartoni/python_exercises
0
28975
<gh_stars>0 def run(): countries = { 'mexico': 122, 'colombia': 49, 'argentina': 43, 'chile': 18, 'peru': 31 } while True: try: country = input( '¿De que país quieres saber la población?: ').lower() print( ...
3.765625
4
Ara_Ara/apps.py
ksdfg/ARA-ARA
0
28976
from django.apps import AppConfig class AraAraConfig(AppConfig): name = "Ara_Ara"
1.046875
1
ahmed-package/__init__.py
gokcelahmed/ahmed-package
0
28977
<filename>ahmed-package/__init__.py from ahmed-package.functions import printName
1.203125
1
fsdviz/stocking/forms/__init__.py
AdamCottrill/fsdivz
0
28978
<reponame>AdamCottrill/fsdivz<filename>fsdviz/stocking/forms/__init__.py from .FindEventsForm import * from .StockingEventForm import * from .XlsEventForm import *
1.109375
1
Chapter 16/Lookup/algorithms.py
codered-by-ec-council/Micro-Degree-in-Python-Security
4
28979
<reponame>codered-by-ec-council/Micro-Degree-in-Python-Security #!/usr/bin/env python3 ''' This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any late...
2.609375
3
neurolang/region_solver.py
hndgzkn/NeuroLang
1
28980
import typing import re from .CD_relations import cardinal_relation, inverse_directions from .regions import Region, region_union from .expression_walker import PatternWalker from .expressions import Constant REFINE_OVERLAPPING = True class RegionSolver(PatternWalker[Region]): type_name = 'Region' def __n...
2.28125
2
More/E00_Publications/Infographics/conditionsHierarchy.py
freder/PageBotExamples
5
28981
# ----------------------------------------------------------------------------- # # P A G E B O T E X A M P L E S # # Copyright (c) 2017 <NAME> <https://github.com/thomgb> # www.pagebot.io # Licensed under MIT conditions # # Supporting DrawBot, www.drawbot.com # Supporting Flat, xxyxyz.org/flat...
2.296875
2
mcarch/model/file.py
Scotsguy/MCArchive
0
28982
import os import enum import hashlib from urllib.parse import urljoin from flask import url_for, current_app as app from mcarch.app import db, get_b2bucket class StoredFile(db.Model): """Represents a file stored in some sort of storage medium.""" __tablename__ = 'stored_file' id = db.Column(db.Integer, p...
2.671875
3
taxi/migrations/0001_initial.py
alifelan/taxi-unico-web
1
28983
<filename>taxi/migrations/0001_initial.py<gh_stars>1-10 # Generated by Django 2.2 on 2019-05-09 06:09 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( ...
1.929688
2
mainapp/migrations/0006_auto_20200308_1745.py
Raistlin11123/inquiry-soso
0
28984
# Generated by Django 2.2 on 2020-03-08 16:45 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('mainapp', '0005_auto_20200308_1735'), ] operations = [ migrations.AlterField( model_name='clue', name='paragraph1', ...
1.59375
2
utils/youtube.py
ramrathi/baritone
3
28985
import subprocess import scipy.io.wavfile as wav import sys import numpy as np # import pyaudio import time import wave import os from pydub import AudioSegment import pafy from youtube_transcript_api import YouTubeTranscriptApi from youtube_dl import YoutubeDL dirname = os.path.dirname(os.path.abspath(__file__)) s...
2.640625
3
pepdb/cms_pages/migrations/0006_auto_20151024_2019.py
dchaplinsky/pep.org.ua
7
28986
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models import wagtail.wagtailcore.fields class Migration(migrations.Migration): dependencies = [ ('cms_pages', '0005_auto_20150829_1516'), ] operations = [ migrations.AddField( ...
1.71875
2
autorop/leak/puts.py
Tanson/autorop
0
28987
from autorop import PwnState, arutil from pwn import ROP def puts(state: PwnState) -> PwnState: """Leak libc addresses using ``puts``. This function leaks the libc addresses of ``__libc_start_main`` and ``puts`` using ``puts``, placing them in ``state.leaks``. Arguments: state: The current `...
2.515625
3
tests/unit/drivers/simple_vlan.py
gsilvis/haas
0
28988
# Copyright 2013-2014 Massachusetts Open Cloud Contributors # # 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 applicab...
1.984375
2
norm_test.py
szmybs/GOES-R-2017-HurricaneExtraction
0
28989
import numpy as np import matplotlib.pyplot as plt from extract import HurricaneExtraction #npy_file = './Data/NpyData/LIDIA/20172450002.npz' npy_file = './Data/NpyData/IRMA/20172531622.npz' data = HurricaneExtraction.read_extraction_data(npy_file) data = HurricaneExtraction.normalize_using_physics(data) for d in ...
2.484375
2
util/get_weather_icons_map.py
multipolygon/esphome-configs
0
28990
from urllib.request import urlopen import json import re url = urlopen("https://raw.githubusercontent.com/Templarian/MaterialDesign/master/meta.json") meta = [(i['name'], i['codepoint']) for i in json.loads(url.read()) if re.search('^weather-', i['name'])] print('''--- esphome: # ... includes: - weather_icon_...
2.90625
3
network_anomaly/KDDCup99-LSTM/binary/lskerastest.py
kidrabit/Data-Visualization-Lab-RND
1
28991
<reponame>kidrabit/Data-Visualization-Lab-RND from __future__ import print_function from sklearn.cross_validation import train_test_split import pandas as pd import numpy as np np.random.seed(1337) # for reproducibility from keras.preprocessing import sequence from keras.utils import np_utils from keras.models import ...
2.671875
3
train.py
MannyKayy/PlayableVideoGeneration
1
28992
<filename>train.py import argparse import importlib import os import torch import torch.nn as nn import torchvision import numpy as np from dataset.dataset_splitter import DatasetSplitter from dataset.transforms import TransformsGenerator from dataset.video_dataset import VideoDataset from evaluation.action_sampler i...
2.4375
2
src/gripit/edgelib/maxlinedev.py
yor1001/GripIt
0
28993
<filename>src/gripit/edgelib/maxlinedev.py from __future__ import print_function from __future__ import division from __future__ import unicode_literals from __future__ import absolute_import # MAXLINEDEV - Finds max deviation from a line in an edge contour. # # Function finds the point of maximum deviation from a line...
3.15625
3
common.py
tim-moody/mdwiki-cacher
0
28994
# common functions import sys import json # taken from sp_lib def read_json_file(file_path): try: with open(file_path, 'r') as json_file: readstr = json_file.read() json_dict = json.loads(readstr) return json_dict except OSError as e: print('Unable to read url js...
3.203125
3
integration-test/291-483-suppress-historical-closed.py
roman-ianivskyy/vector-datasource
0
28995
# -*- encoding: utf-8 -*- import dsl from shapely.wkt import loads as wkt_loads from . import FixtureTest class SuppressHistoricalClosed(FixtureTest): def test_cartoon_museum(self): # Cartoon Art Museum (closed) self.generate_fixtures(dsl.way(368173967, wkt_loads('POINT (-122.400856246311 37.786...
2.0625
2
dots_testsuite.py
nguyent2/Practice-with-Modules
0
28996
/Learn more or give us feedback ###################################################################### # Author: <NAME> # TODO: Change this to your names # Username: nguyent2 # TODO: Change this to your usernames # # Assignment: A06: It's in your Genes # # Purpose: A test suite for testing the a06_genes.py program # ##...
2.484375
2
comparison_order_butter_cheby.py
ivanpauno/filter_design_examples
0
28997
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Sat Apr 13 11:03:51 2019 @author: ivanpauno """ import matplotlib.pyplot as plt import numpy as np def main(): # A = sqrt(10^(.1*alpha_min-1)/10^(.1*alpha_max-1)) A = np.logspace(np.log10(2), np.log10(100), num=200) ws_array = [1.1, 1.5, 2, 3...
3.078125
3
zipline/pipeline/common.py
lv-cha/zipline-chinese
606
28998
<reponame>lv-cha/zipline-chinese<filename>zipline/pipeline/common.py """ Common constants for Pipeline. """ AD_FIELD_NAME = 'asof_date' ANNOUNCEMENT_FIELD_NAME = 'announcement_date' CASH_FIELD_NAME = 'cash' CASH_AMOUNT_FIELD_NAME = 'cash_amount' BUYBACK_ANNOUNCEMENT_FIELD_NAME = 'buyback_date' DAYS_SINCE_PREV = 'days_s...
1.242188
1
akaocr/utils/runtime.py
qai-research/Efficient_Text_Detection
2
28999
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ _____________________________________________________________________________ Created By : <NAME> - Bacnv6 Created Date: Mon November 03 10:00:00 VNT 2020 Project : AkaOCR core _____________________________________________________________________________ Thi...
2.203125
2