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
Chapter11/grades_ms/grades/grades_svc/admin.py
MichaelRW/Python-for-Geeks
31
32900
<reponame>MichaelRW/Python-for-Geeks<filename>Chapter11/grades_ms/grades/grades_svc/admin.py from django.contrib import admin from .models import Grade admin.site.register(Grade)
1.34375
1
tracksuite/utils/metrics.py
jimiolaniyan/tracksuite
0
32901
import numpy as np def calculate_iou(bboxes1, bboxes2): """ This calculates the intersection over union of N bounding boxes in the form N x [left, top, right, bottom], e.g for N=2: >> bb = [[21,34,45,67], [67,120, 89, 190]] :param bboxes1: np array: N x 4 ground truth bounding boxes :param bb...
2.953125
3
Python/RussianPeasantMult.py
sheenxavi004/problem-solving
11
32902
<filename>Python/RussianPeasantMult.py """ Russian Peasant Multiplication (RPM) Algorithm Implemented In Python RPM is a method of mutiplication of any 2 numbers using only multiplication and division by 2. The basics are that you divide the second number by 2 (integer division) until it equals 1, every time you divide...
4.125
4
celery-queue/metrical-tree/metricaltree.py
HwanSolo/stanford-linguistics
0
32903
<reponame>HwanSolo/stanford-linguistics<filename>celery-queue/metrical-tree/metricaltree.py<gh_stars>0 #!/usr/bin/env python # -*- coding: utf-8 -*- import os from collections import defaultdict import cPickle as pkl import numpy as np import pandas as pd import matplotlib.pyplot as plt import codecs import nltk from ...
2.109375
2
multiuploader/management/commands/clean_uploads.py
SharmaVinayKumar/django-multiuploader
5
32904
from __future__ import print_function, unicode_literals import os from datetime import timedelta import multiuploader.default_settings as DEFAULTS from django.conf import settings from django.core.management.base import BaseCommand from django.utils.timezone import now from multiuploader.models import MultiuploaderFi...
2.234375
2
tests/test_source.py
Koech-code/News-App
0
32905
import unittest from app.models import Source class testSource(unittest.TestCase): """ SourcesTest class to test the behavior of the Sources class """ def setUp(self): """ Method that runs before each other test runs """ self.new_source = Source('abc-news','ABC news','Yo...
3.421875
3
python_backend/custom_types/forvo_api_types.py
BenLeong0/japanese_vocab_fetcher
0
32906
<gh_stars>0 from typing import Literal, TypedDict class ForvoAPIItem(TypedDict): id: int word: str original: str addtime: str hits: int username: str sex: str country: str code: str langname: str pathmp3: str pathogg: str rate: int num_votes: int num_positiv...
2.421875
2
src/workers.py
lmdu/krait2
1
32907
<reponame>lmdu/krait2<gh_stars>1-10 import os import csv import time import stria import pyfastx import traceback import multiprocessing from PySide6.QtCore import * from primer3 import primerdesign from motif import * from stats import * from utils import * from config import * from backend import * from annotate i...
2.078125
2
src/deepnnmnist/deepnn-nobias/linear_deep_nn_nobias_no_activationf.py
renaudbougues/continuous-deep-q-learning
1
32908
<reponame>renaudbougues/continuous-deep-q-learning ''' Training a deep "incomplete" ANN on MNIST with Tensorflow The ANN has no bias and no activation function This function does not learn very well because the the hypothesis is completely off The loss function is bad. The network is unstable in training (easily blow...
3.078125
3
tests/conftest.py
Usetech/labelgun
0
32909
<filename>tests/conftest.py import pytest import structlog @pytest.fixture(autouse=True) def setup(): structlog.configure( processors=[ structlog.processors.JSONRenderer(ensure_ascii=False), ], context_class=structlog.threadlocal.wrap_dict(dict), logger_factory=structlo...
1.929688
2
lib/db_manager.py
kevin20888802/liang-medicine-line-bot-py
0
32910
import psycopg2 from psycopg2.extensions import ISOLATION_LEVEL_AUTOCOMMIT import os import urllib.parse as urlparse class PostgresBaseManager: def __init__(self,local): self.database = 'postgres' self.user = 'postgres' self.password = '<PASSWORD>' self.host = 'localhost' ...
2.78125
3
bike/refactor/test_moveToModule.py
debiancn/bicyclerepair
2
32911
#!/usr/bin/env python import setpath from bike.testutils import * from bike.transformer.save import save from moveToModule import * class TestMoveClass(BRMTestCase): def test_movesTheText(self): src1=trimLines(""" def before(): pass class TheClass: pass def after(): pas...
2.6875
3
src/ggrc_risks/migrations/versions/20170823162755_5aa9ec7105d1_add_test_plan_field.py
HLD/ggrc-core
0
32912
<reponame>HLD/ggrc-core # Copyright (C) 2017 Google Inc. # Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file> """ Add test_plan field Create Date: 2017-08-23 16:27:55.094736 """ # disable Invalid constant name pylint warning for mandatory Alembic variables. # pylint: disable=invalid-name im...
1.640625
2
mem_mem/avgblk.py
3upperm2n/trans_kernel_model
0
32913
<filename>mem_mem/avgblk.py import pandas as pd import numpy as np from math import * import copy # deep copy objects from model_param import * #------------------------------------------------------------------------------ # Figure out when to launch another block for current kernel #--------------------------------...
2.40625
2
pychecktext/checktext_parser.py
da1910/pyCheckText
0
32914
import _ast import ast from typing import Dict, Union import os from pychecktext import teamcity, teamcity_messages class CheckTextVisitor(ast.NodeVisitor): def __init__(self, aliases: Dict[str, str] = {}): self.literal_calls = [] self.expression_calls = [] self.aliases = aliases s...
2.59375
3
Apriori/src/main.py
ranery/Courses-only
2
32915
<reponame>ranery/Courses-only<filename>Apriori/src/main.py # -*- coding: utf-8 -*- """ @author : <NAME> """ import sys import data from Apriori import Apriori from optparse import OptionParser optparser = OptionParser() optparser.add_option('--inputFile', dest='input', help='filename containing csv', default='goods.c...
2.546875
3
extra/slothclasses/agares.py
Tirithel/sloth-bot
0
32916
import discord from discord.ext import commands import os from .player import Player from extra.menu import ConfirmSkill import os from datetime import datetime bots_and_commands_channel_id = int(os.getenv('BOTS_AND_COMMANDS_CHANNEL_ID')) class Agares(Player): emoji = '<:Agares:839497855621660693>' def __i...
2.53125
3
WhatsAppManifest/automator/android/__init__.py
riquedev/WhatsAppManifest
15
32917
""" Module responsible for all automation related to the device """ __author__ = '<NAME>' __copyright__ = 'Copyright 2020, WhatsAppManifest' from WhatsAppManifest.automator.android.phone import AndroidPhone from WhatsAppManifest.automator.android.contacts import AndroidContacts
0.960938
1
threp_example.py
wasupandceacar/threp_fucker
24
32918
<reponame>wasupandceacar/threp_fucker from threp import THReplay if __name__ == '__main__': # 载入一个replay文件,参数为路径 tr = THReplay('rep_tst/th13_01.rpy') # 获取rep基本信息,包含机体,难度,通关情况,字符串 # etc. Reimu A Normal All print(tr.getBaseInfo()) # 获取rep基本信息的字典,包含机体,难度,通关情况,字符串 # 字典的键分别为 character shottype...
1.976563
2
web/api/tests/test_health_check.py
marcelomansur/maria-quiteria
151
32919
<reponame>marcelomansur/maria-quiteria import pytest from django.urls import reverse class TestHealthCheck: def test_return_success_when_accessing_health_check(self, api_client, url): response = api_client.get(url, format="json") assert response.status_code == 200 assert list(response.json...
2.171875
2
examples/client-gen/tictactoe/types/game_state.py
kevinheavey/anchorpy
87
32920
<filename>examples/client-gen/tictactoe/types/game_state.py from __future__ import annotations import typing from dataclasses import dataclass from solana.publickey import PublicKey from anchorpy.borsh_extension import EnumForCodegen, BorshPubkey import borsh_construct as borsh class WonJSONValue(typing.TypedDict): ...
2.390625
2
test/test_cli.py
yxmanfred/optimesh
1
32921
# -*- coding: utf-8 -*- # import pytest import optimesh from helpers import download_mesh @pytest.mark.parametrize( "options", [ ["--method", "cpt-dp"], ["--method", "cpt-uniform-fp"], ["--method", "cpt-uniform-qn"], # ["--method", "cvt-uniform-lloyd"], ["--me...
2.03125
2
stubs.min/System/Windows/Interop_parts/WindowInteropHelper.py
ricardyn/ironpython-stubs
1
32922
<reponame>ricardyn/ironpython-stubs class WindowInteropHelper(object): """ Assists interoperation between Windows Presentation Foundation (WPF) and Win32 code. WindowInteropHelper(window: Window) """ def EnsureHandle(self): """ EnsureHandle(self: WindowInteropHelper) -> IntPtr Creates the...
2.25
2
roles/lib_openshift/src/lib/import.py
ramkrsna/openshift-ansible
0
32923
<reponame>ramkrsna/openshift-ansible<gh_stars>0 # pylint: skip-file # flake8: noqa ''' OpenShiftCLI class that wraps the oc commands in a subprocess ''' # pylint: disable=too-many-lines from __future__ import print_function import atexit import json import os import re import shutil import subprocess import tempfil...
1.585938
2
ngsutils/bam/t/test_stats.py
bgruening/ngsutils
57
32924
<filename>ngsutils/bam/t/test_stats.py #!/usr/bin/env python ''' Tests for bamutils stats ''' import os import unittest import ngsutils.bam import ngsutils.bam.stats class StatsTest(unittest.TestCase): def setUp(self): self.bam = ngsutils.bam.bam_open(os.path.join(os.path.dirname(__file__), 'test.bam'))...
2.453125
2
test/gcp/test_gcs.py
bavard-ai/bavard-ml-utils
1
32925
from unittest import TestCase from bavard_ml_utils.gcp.gcs import GCSClient from test.utils import DirSpec, FileSpec class TestGCSClient(TestCase): test_data_spec = DirSpec( path="gcs-test", children=[ FileSpec(path="test-file.txt", content="This is a test."), FileSpec(pat...
2.484375
2
utils.py
cyborg00222/kowalsky.at
0
32926
<reponame>cyborg00222/kowalsky.at # <NAME> - 10.06.19 import os def check_if_file_exists(path): exists = os.path.isfile(path) if exists: return 1 else: return 0 def list_all_files_in_dir(path, type): files = [] # r=root, d=directories, f = files for r, d, f in os.walk(path): for file in f: ...
3.1875
3
formain.py
GenBill/Maple_2K
0
32927
from fim_mission import * import torch import torch.nn as nn import torch.nn.parallel import torch.nn.functional as F import torch.backends.cudnn as cudnn import torch.optim as optim from torch.optim import lr_scheduler import torchvision.transforms as transforms from torchvision import datasets, models import matplo...
2.015625
2
sleep_staging_methods/multitaper/train_8m.py
GuanLab/DeepSleep
27
32928
<reponame>GuanLab/DeepSleep from __future__ import print_function import os import sys import numpy as np from keras.models import Model from keras.layers import Input, concatenate, Conv1D, MaxPooling1D, Conv2DTranspose,Lambda from keras.optimizers import Adam from keras.callbacks import ModelCheckpoint from keras imp...
2.078125
2
Sprachanalyse/versuch.py
DemonicStorm/LitBlogRepo
2
32929
<gh_stars>1-10 import spacy from spacy_langdetect import LanguageDetector import en_core_web_sm from glob import glob nlp = en_core_web_sm.load() #nlp = spacy.load('en') nlp.add_pipe(LanguageDetector(), name='language_detector', last=True) print(LanguageDetector)
2.59375
3
usr/lib/tuquito/tuquito-software-manager/widgets/pathbar2.py
emmilinuxorg/emmi-aplicativos
0
32930
<reponame>emmilinuxorg/emmi-aplicativos<filename>usr/lib/tuquito/tuquito-software-manager/widgets/pathbar2.py # Copyright (C) 2009 <NAME> # # Authors: # <NAME> # # 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 Sof...
2.21875
2
.venv/lib/python3.8/site-packages/rmtest/disposableredis/__init__.py
nuruddinsayeed/ru102py
0
32931
import subprocess import socket import redis import time import os import os.path import sys import warnings import random REDIS_DEBUGGER = os.environ.get('REDIS_DEBUGGER', None) REDIS_SHOW_OUTPUT = int(os.environ.get( 'REDIS_VERBOSE', 1 if REDIS_DEBUGGER else 0)) def get_random_port(): while True: ...
2.59375
3
disco_aws_automation/disco_autoscale.py
Angakkuq/asiaq-aws
0
32932
'''Contains DiscoAutoscale class that orchestrates AWS Autoscaling''' import logging import random import boto import boto.ec2 import boto.ec2.autoscale import boto.ec2.autoscale.launchconfig import boto.ec2.autoscale.group from boto.ec2.autoscale.policy import ScalingPolicy from boto.exception import BotoServerError ...
2.453125
2
rrlfd/residual/train.py
shaun95/google-research
1
32933
<filename>rrlfd/residual/train.py # coding=utf-8 # Copyright 2022 The Google Research 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...
2.171875
2
doc/python_study_code/fibc.py
beiliwenxiao/vimrc
0
32934
#!/usr/bin/env python # coding=utf-8 __metaclass__ = type class Fibs: """docstring for Fibc""" def __init__(self): self.a = 0 self.b = 1 def next(self): self.a, self.b = self.b, self.a+self.b return self.a def __iter__(self): return self fibs = Fibs() for f in f...
3.3125
3
Python/turtle_drawer_seanyboi.py
nskesav/Hacktoberfest-Beginner-level
59
32935
<reponame>nskesav/Hacktoberfest-Beginner-level # draws a shape and fills with a colour import turtle import math import colorsys phi = 180 * (3 - math.sqrt(5)) # initialises the turtle Pen t = turtle.Pen() t.speed() # defines the shape to be drawn def square(t, size): for tmp in range(0,4): t.forward(size) t.ri...
3.984375
4
mininext/util.py
vikaskamath/miniNExT
36
32936
<reponame>vikaskamath/miniNExT """ Additional utilities and patches for MiniNExT. """ from os.path import isdir import os import pwd import grp import shutil from mininet.util import quietRun from mininext.mount import ObjectPermissions # Patches # def isShellBuiltin(cmd): """Override to replace MiniNExT's exi...
2.21875
2
volaupload/utils.py
RealDolos/volaupload
8
32937
""" RealDolos' funky volafile upload tool""" # pylint: disable=broad-except import math import re import sys # pylint: disable=no-name-in-module try: from os import posix_fadvise, POSIX_FADV_WILLNEED except ImportError: def posix_fadvise(*args, **kw): """Mock implementation for systems not supporting...
2.4375
2
openquake/hazardlib/tests/source/non_parametric_test.py
gfzriesgos/shakyground-lfs
1
32938
<reponame>gfzriesgos/shakyground-lfs<gh_stars>1-10 # The Hazard Library # Copyright (C) 2013-2018 GEM Foundation # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # published by the Free Software Foundation, either version 3 of the ...
1.882813
2
tmc/config.py
jgke/tmc.py
0
32939
import os from os import path, environ from configparser import ConfigParser from collections import OrderedDict class Config(object): """ This class will take care of ConfigParser and writing / reading the configuration. TODO: What to do when there are more variables to be configured? Should we ...
3.03125
3
code/main.py
RoshanTanisha/covid19
1
32940
import h5py import numpy as np from code.model import UNetClassifier def load_dataset(covid_file_path, normal_file_path): covid = h5py.File(covid_file_path, 'r')['covid'] normal = h5py.File(normal_file_path, 'r')['normal'] all_images = np.expand_dims(np.concatenate([covid, normal]), axis=3) all_labe...
2.5
2
datmo/core/storage/local/dal.py
awesome-archive/datmo
331
32941
<filename>datmo/core/storage/local/dal.py import os from kids.cache import cache from datetime import datetime from datmo.core.util.i18n import get as __ from datmo.core.entity.model import Model from datmo.core.entity.code import Code from datmo.core.entity.environment import Environment from datmo.core.entity.file_c...
2.390625
2
CodeForces/StonesOnTheTable/StonesonTheTable.py
GeorgianBadita/algorithmic-problems
1
32942
def main(): _ = input() string = input() if _ == 0 or _ == 1: return 0 if _ == 2: if string[0] == string[1]: return 1 return 0 last = string[0] cnt = 0 for i in range(1, len(string)): if string[i] == last: cnt += 1 last = str...
3.625
4
app/routes.py
valtemirprocopio/forms
0
32943
from app import app from flask import render_template, flash, redirect, url_for from app.forms import LoginForm @app.route('/') @app.route('/index') def index(): return render_template('index.html') @app.route('/contato', methods=['GET','POST']) def contato(): form = LoginForm() if form.validate_on_submit...
2.453125
2
Python/Math/Armstrong-Number/armstrong-number.py
manoj-paramsetti-testing/Algorithm-Warehouse
4
32944
<reponame>manoj-paramsetti-testing/Algorithm-Warehouse<gh_stars>1-10 num = int(input("Enter a number: ")) sum = 0; size = 0; temp = num; temp2 = num while(temp2!=0): size += 1 temp2 = int(temp2/10) while(temp!=0): remainder = temp%10 sum += remainder**size temp = int(temp/10) if(sum == num): ...
3.9375
4
sdk/python/pulumi_spotinst/aws/mr_scalar.py
pulumi/pulumi-spotinst
4
32945
# coding=utf-8 # *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** import warnings import pulumi import pulumi.runtime from typing import Any, Mapping, Optional, Sequence, Union, overload from .. import...
1.375
1
python-backend/app/api/mines/variances/resources/variance_document_upload.py
ActionAnalytics/mds
0
32946
<reponame>ActionAnalytics/mds import base64 import requests from werkzeug.exceptions import BadRequest, NotFound from flask import request, current_app, Response from flask_restplus import Resource from app.extensions import api from ...mine.models.mine import Mine from ....documents.mines.models.mine_document import...
1.9375
2
src/generated-spec/data_pipeline.py
wheerd/cloudformation-to-terraform
0
32947
<reponame>wheerd/cloudformation-to-terraform from . import * class AWS_DataPipeline_Pipeline_ParameterAttribute(CloudFormationProperty): def write(self, w): with w.block("parameter_attribute"): self.property(w, "Key", "key", StringValueConverter()) self.property(w, "StringValue", "string_value", Stri...
2.390625
2
rl_algorithms/utils/config.py
medipixel/rl_algorithms
466
32948
<gh_stars>100-1000 import collections.abc as collections_abc import os.path as osp from addict import Dict import yaml class ConfigDict(Dict): def __missing__(self, name): raise KeyError(name) def __getattr__(self, name): try: value = super(ConfigDict, self).__getattr__(name) ...
2.390625
2
elit/components/amr/amr_parser/amr_graph.py
emorynlp/el
40
32949
# MIT License # # Copyright (c) 2020 <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 restriction, including without limitation the rights # to use, copy, modify, merge, publi...
1.882813
2
passage/preprocessing.py
vishalbelsare/Passage
597
32950
#!/usr/bin/env python # -*- coding: utf-8 -*- import string from collections import Counter import numpy as np import theano import theano.tensor as T punctuation = set(string.punctuation) punctuation.add('\n') punctuation.add('\t') punctuation.add(u'’') punctuation.add(u'‘') punctuation.add(u'“') punctuation.add(u'”...
2.421875
2
agendamentos/apps.py
afnmachado/univesp_pi_1
0
32951
<filename>agendamentos/apps.py<gh_stars>0 from django.apps import AppConfig class AgendamentoConfig(AppConfig): default_auto_field = 'django.db.models.BigAutoField' name = 'agendamentos'
1.140625
1
app/mods/calculator.py
MzB-Teaching/calculator
0
32952
#!/usr/bin/env python3 """This is a simple python3 calculator for demonstration purposes some to-do's but we'll get to that""" __author__ = "<NAME>" __copyright__ = "2000-2019 by MzB Solutions" __email__ = "<EMAIL>" class Calculator(object): @property def isDebug(self): return self._isDebug @is...
3.875
4
tcp_syn_flood.py
r3k4t/tcp_syn_flood
0
32953
<reponame>r3k4t/tcp_syn_flood import os import sys import time import pyfiglet from scapy.all import* os.system("clear") print (chr(27)+"[36m") import pyfiglet banner = pyfiglet.figlet_format("Tcp Syn Flood",font="slant") print (banner) print (chr(27)+"[33m") print (" Author : <NAME>(RKT)") print ("...
2.625
3
tests/test_models.py
lmacaya/oddt
264
32954
import pickle import numpy as np from numpy.testing import assert_array_almost_equal, assert_array_equal import pytest from oddt.scoring.models import classifiers, regressors @pytest.mark.filterwarnings('ignore:Stochastic Optimizer') @pytest.mark.parametrize('cls', [classifiers.svm(probabil...
2.046875
2
data/fech_data.py
wangjiehui11235/panther
3
32955
<filename>data/fech_data.py # -*- coding: utf-8 -*- import pdb, six, importlib import pandas as pd from PyFin.api import makeSchedule, BizDayConventions from sqlalchemy import create_engine, select, and_, or_ from utilities.singleton import Singleton import sys sys.path.append('..') import config # 连接句柄 @six.add_met...
2.4375
2
models/collaborator.py
phil-lopreiato/frc-notebook-server
0
32956
from google.appengine.ext import ndb class Collaborator(ndb.Model): """ Represents collab relationship at events Notifications will only be sent if both the sender and receiver have shared with each other """ srcUserId = ndb.StringProperty(required=True) dstUserId = ndb.StringProperty(req...
2.390625
2
genomics_geek/graphql/mixins.py
genomics-geek/genomics-geek.com
0
32957
from graphene import Int from .decorators import require_authenication class PrimaryKeyMixin(object): pk = Int(source='pk') class LoginRequiredMixin(object): @classmethod @require_authenication(info_position=1) def get_node(cls, info, id): return super(LoginRequiredMixin, cls).get_node(inf...
2.609375
3
oops_fhir/r4/code_system/flag_priority_codes.py
Mikuana/oops_fhir
0
32958
<filename>oops_fhir/r4/code_system/flag_priority_codes.py from pathlib import Path from fhir.resources.codesystem import CodeSystem from oops_fhir.utils import CodeSystemConcept __all__ = ["FlagPriorityCodes"] _resource = CodeSystem.parse_file(Path(__file__).with_suffix(".json")) class FlagPriorityCodes: """...
2.4375
2
components/collector/src/source_collectors/sonarqube/duplicated_lines.py
kargaranamir/quality-time
33
32959
"""SonarQube duplicated lines collector.""" from .base import SonarQubeMetricsBaseClass class SonarQubeDuplicatedLines(SonarQubeMetricsBaseClass): """SonarQube duplicated lines collector.""" valueKey = "duplicated_lines" totalKey = "lines"
1.742188
2
myapp/migrations/0002_studentmodel_dob.py
RajapandiR/Student
0
32960
<gh_stars>0 # Generated by Django 3.2.9 on 2021-11-23 16:24 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('myapp', '0001_initial'), ] operations = [ migrations.AddField( model_name='studentmodel', name='DOB', ...
1.632813
2
sl_cutscenes/camera.py
AIS-Bonn/sl-cutscenes
2
32961
<reponame>AIS-Bonn/sl-cutscenes import numpy as np import torch from typing import List from sl_cutscenes.constants import SCENARIO_DEFAULTS from sl_cutscenes.utils.camera_utils import ConstFunc, LinFunc, LinFuncOnce, SinFunc, TanhFunc camera_movement_constraints = SCENARIO_DEFAULTS["camera_movement"] class Camera(o...
2.171875
2
dpoll/polls/views.py
tymmesyde/dpoll.xyz
0
32962
<filename>dpoll/polls/views.py import copy import uuid import json from datetime import timedelta from dateutil.parser import parse from django.conf import settings from django.contrib import messages from django.contrib.auth import authenticate, login from django.contrib.auth.views import auth_logout from django.core...
1.757813
2
e2e/Tests/Merit/MultiplePacketsTest.py
kayabaNerve/Currency
66
32963
#Tests that blocks can't have multiple verification packets for the same transaction. from typing import Dict, Any import json from pytest import raises from e2e.Libs.Minisketch import Sketch from e2e.Classes.Transactions.Data import Data from e2e.Classes.Consensus.VerificationPacket import VerificationPacket from e...
2.1875
2
skworkorders/test_websocket.py
ZhaoUncle/skstack
0
32964
#! /usr/bin/env python # -*- coding: utf-8 -*- ''' Created on 2018年4月17日 @author: encodingl ''' from django.shortcuts import render #from dwebsocket.decorators import accept_websocket, require_websocket from django.http import HttpResponse import paramiko from django.contrib.auth.decorators import login_required ...
1.96875
2
src/Analyse/views.py
Hash-It-Out/MeetingMinutes
3
32965
from __future__ import print_function from django.shortcuts import render from django.http import HttpResponse, Http404, HttpResponseRedirect from django.contrib.auth import get_user_model import os from django.core.mail import send_mail import nltk from nltk.tokenize import sent_tokenize, word_tokenize from nltk.st...
1.851563
2
000000stepikProgBasKirFed/Stepik000000ProgBasKirFedсh01p01st07TASK07_20210205_print.py
SafonovMikhail/python_000577
0
32966
''' Напишите программу, которая объявляет переменную: "name" и присваивает ей значение "Python". Программа должна напечатать в одну строку, разделяя пробелами: Строку "name" Значение переменной "name" Число 3 Число 8.5 Sample Input: Sample Output: name Python 3 8.5 ''' name = 'Python' print('name', name, 3, 8.5)
4.3125
4
cross_loss_influence/helpers/influence_function.py
CORE-Robotics-Lab/Cross_Loss_Influence_Functions
1
32967
<filename>cross_loss_influence/helpers/influence_function.py # Created by <NAME> # Extensions to https://github.com/nimarb/pytorch_influence_functions import torch import time import datetime import numpy as np import copy import logging from torch.autograd import grad import random from cross_loss_influence.helpers.b...
2.671875
3
tests/test_rtfit_dumps.py
ndraeger/rt1
0
32968
""" Test the fits-module by loading a dumped rtfits result and performing all actions again """ import unittest import numpy as np import cloudpickle import matplotlib.pyplot as plt import copy import os class TestDUMPS(unittest.TestCase): def setUp(self): self.sig0_dB_path = os.path.dirname(__file__) + ...
2.375
2
tests/test_bus_model.py
romainsacchi/carculator_bus
1
32969
<filename>tests/test_bus_model.py import numpy as np from carculator_bus import * tip = BusInputParameters() tip.static() _, array = fill_xarray_from_input_parameters(tip) tm = BusModel(array, country="CH") tm.set_all() def test_presence_PHEVe(): # PHEV-e should be dropped assert "PHEV-e" not in tm.array.po...
2.765625
3
Ej-Lab8-MoisesSanjurjo-UO270824/ejercicio2-MoisesSanjurjo-UO270824.py
moiSS00/CN
0
32970
<gh_stars>0 # -*- coding: utf-8 -*- """ Ejercicio 2: Aproximación numérica de orden 1 y de orden 2 de la derivada de la función f(x) = 1/x. """ import numpy as np import matplotlib.pyplot as plt # Función f(x)= 1/x y su derivada f' f = lambda x:1/x # función f df = lambda x:(-1)/x**2 # derivada exacta f' ...
3.296875
3
examples/multi_client_example.py
ondewo/ondewo-csi-client-python
0
32971
<reponame>ondewo/ondewo-csi-client-python<filename>examples/multi_client_example.py #!/usr/bin/env python # coding: utf-8 # # Copyright 2021 ONDEWO 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 Lic...
2.171875
2
chrome/tools/extract_actions.py
zachlatta/chromium
1
32972
#!/usr/bin/python # Copyright 2007 Google Inc. All rights reserved. """Extract UserMetrics "actions" strings from the Chrome source. This program generates the list of known actions we expect to see in the user behavior logs. It walks the Chrome source, looking for calls to UserMetrics functions, extracting actions...
2.8125
3
hamgr/bin/hamgr-manage.py
platform9/pf9-ha
11
32973
<filename>hamgr/bin/hamgr-manage.py #!/bin/env python # Copyright (c) 2019 Platform9 Systems 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/LICENS...
1.960938
2
src/nerb/named_entities.py
johnnygreco/nerb
0
32974
from __future__ import annotations # Standard library import re from copy import deepcopy from dataclasses import dataclass from typing import Callable, Optional __all__ = ['NamedEntity', 'NamedEntityList'] @dataclass(frozen=True) class NamedEntity: name: str entity: str string: str span: tuple[int...
3.296875
3
sources/rnt/mediane/process.py
bryan-brancotte/rank-aggregation-with-ties
0
32975
from django.utils import timezone from django.utils.translation import ugettext from mediane.algorithms.enumeration import get_name_from from mediane.algorithms.lri.BioConsert import BioConsert from mediane.algorithms.lri.ExactAlgorithm import ExactAlgorithm from mediane.algorithms.misc.borda_count import BordaCount f...
2.03125
2
utils_demo/percentage_format.py
IBM/nesa-demo
2
32976
def percentage_format(x: float) -> str: return f"{(x * 100):.1f}%"
2.953125
3
restaurantapp/mainapp/migrations/0003_auto_20200508_1206.py
ShubhamJain0/ShubhamJain0.github.io
0
32977
# Generated by Django 2.2.2 on 2020-05-08 12:06 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('mainapp', '0002_auto_20200508_1115'), ] operations = [ migrations.AlterField( model_name='yourorder', name='phone', ...
1.507813
2
pybomberman/__init__.py
pybomberman/pybomberman
2
32978
from .map import Map print("Soon... https://github.com/pybomberman/pybomberman")
1.398438
1
cd2h_repo_project/modules/doi/schemas.py
galterlibrary/InvenioRDM-at-NU
6
32979
"""JSON Schemas.""" import csv from collections import defaultdict from datetime import date from os.path import dirname, join, realpath from flask import current_app from marshmallow import Schema, fields from cd2h_repo_project.modules.records.resource_type import ResourceType class DataCiteResourceTypeMap(object)...
2.53125
3
python/dazl/model/__init__.py
DACH-NY/dazl-client
0
32980
<gh_stars>0 # Copyright (c) 2017-2022 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved. # SPDX-License-Identifier: Apache-2.0 """ :mod:`dazl.model` package ========================= This module is deprecated. These types have generally moved to :mod:`dazl.client` (for the API introduced in ...
1.523438
2
paxes_cinder/scheduler/filters/storage_protocol_filter.py
windskyer/k_cinder
0
32981
<reponame>windskyer/k_cinder<filename>paxes_cinder/scheduler/filters/storage_protocol_filter.py from cinder.openstack.common import log as logging from cinder.openstack.common.scheduler import filters from cinder.openstack.common.scheduler.filters import extra_specs_ops LOG = logging.getLogger(__name__) class Storag...
2.046875
2
Bioinformatics IV/Week IV/PeptideSequencingProblem.py
egeulgen/Bioinformatics_Specialization
3
32982
import sys from copy import deepcopy mass_file=open('integer_mass_table.txt') mass_table = {} for line in mass_file: aa, mass = line.rstrip().split(' ') mass_table[int(mass)] = aa # mass_table[4] = 'X' # mass_table[5] = 'Z' def PeptideSequencing(spectral_vector): spectral_vector = [0] + spectral_vector ...
2.59375
3
test/likelihoods/test_multitask_gaussian_likelihood.py
llguo95/gpytorch
2,673
32983
<filename>test/likelihoods/test_multitask_gaussian_likelihood.py #!/usr/bin/env python3 import unittest import torch from gpytorch.distributions import MultitaskMultivariateNormal from gpytorch.lazy import KroneckerProductLazyTensor, RootLazyTensor from gpytorch.likelihoods import MultitaskGaussianLikelihood from gp...
2.15625
2
zip/unzip_print.py
juarezhenriquelisboa/Python
1
32984
<filename>zip/unzip_print.py import zipfile import sys for arg in sys.argv[1:]: senha = str(arg) z = zipfile.ZipFile("protegido.zip") files = z.namelist() z.setpassword(senha) z.extractall() z.close() for extracted_file in files: print "Nome do arquivo: "+extracted_file+"\n\nConteudo: " with ope...
3.078125
3
awards/forms.py
JKimani77/awards
0
32985
from django import forms from django.contrib.auth.forms import UserCreationForm,AuthenticationForm from django.contrib.auth.models import User from .models import Profile,Project,Review class RegForm(UserCreationForm): email = forms.EmailField() class Meta: model = User fields = ('usernam...
2.15625
2
setup.py
aaren/pharminv
12
32986
<gh_stars>10-100 import subprocess from setuptools import setup, Extension try: pandoc = subprocess.Popen(['pandoc', 'README.md', '--to', 'rst'], stdout=subprocess.PIPE) readme = pandoc.communicate()[0].decode() except OSError: with open('README.md') as f: readme = f...
1.601563
2
RiskQuantLib/Tool/databaseTool.py
SyuyaMurakami/RiskQuantLib-Doc
1
32987
#!/usr/bin/python #coding = utf-8 import numpy as np import pandas as pd import mysql.connector class mysqlTool(): """ This is the API to connect with mysql database. """ def __init__(self,databaseNameString:str,hostAddress:str,userName:str,passWord:str): self.targetDB = mysql.connector.connect( host = hostA...
3.265625
3
subset_train.py
sngweicong/DeepCTR-Torch
0
32988
data_size_plus_header = 1000001 train_dir = 'train' subset_train_dir = 'sub_train.txt' fullfile = open(train_dir, 'r') subfile = open(subset_train_dir,'w') for i in range(data_size_plus_header): subfile.write(fullfile.readline()) fullfile.close() subfile.close()
2.484375
2
packages/validate_and_forward/lambda_handler.py
NHSDigital/list-reconciliation
4
32989
<filename>packages/validate_and_forward/lambda_handler.py<gh_stars>1-10 import json import os import traceback from datetime import datetime from uuid import uuid4 import boto3 from aws.ssm import get_ssm_params from database import Jobs from gp_file_parser.parser import parse_gp_extract_file_s3 from jobs.statuses imp...
2.078125
2
src/ucar/unidata/apps/noaapsd/default.py
mhiley/IDV
0
32990
""" NOAA/ESRL/PSD Jython functions """ def calcMonAnom(monthly, ltm, normalize=0): """ Calculate the monthly anomaly from a long term mean. The number of timesteps in ltm must be 12 """ from visad import VisADException monAnom = monthly.clone() months = len(ltm) if (not months == 12): raise VisAD...
3.015625
3
bitmovin_api_sdk/account/organizations/groups/__init__.py
jaythecaesarean/bitmovin-api-sdk-python
11
32991
from bitmovin_api_sdk.account.organizations.groups.groups_api import GroupsApi from bitmovin_api_sdk.account.organizations.groups.tenants.tenants_api import TenantsApi from bitmovin_api_sdk.account.organizations.groups.invitations.invitations_api import InvitationsApi from bitmovin_api_sdk.account.organizations.groups....
1.023438
1
app/views.py
we-race-here/wrh-brac
0
32992
<gh_stars>0 from django.shortcuts import render # Create your views here. from django.views.generic import TemplateView from . import models, serializers class HomeView(TemplateView): template_name = 'Data.html' class FrontView(TemplateView): template_name = 'index.html'
1.671875
2
perceptron/gen-data.py
KellyHwong/MIT-ML
15
32993
import numpy as np import random N = 10 def null(a, rtol=1e-5): u, s, v = np.linalg.svd(a) rank = (s > rtol*s[0]).sum() return rank, v[rank:].T.copy() def gen_data(N, noisy=False): lower = -1 upper = 1 dim = 2 X = np.random.rand(dim, N)*(upper-lower)+lower while True: Xsa...
2.890625
3
forgot_password/tests/test_settings.py
oursky/forgot_password
1
32994
<filename>forgot_password/tests/test_settings.py # Copyright 2018 Oursky Ltd. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless req...
2.203125
2
cosa/analyzers/bmc_temporal.py
zsisco/CoSA
52
32995
<reponame>zsisco/CoSA<gh_stars>10-100 # Copyright 2018 <NAME> # # Licensed under the modified BSD (3-clause BSD) License. # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either exp...
1.921875
2
sdk/python/pulumi_azure/blueprint/get_published_version.py
aangelisc/pulumi-azure
0
32996
<reponame>aangelisc/pulumi-azure # coding=utf-8 # *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** import warnings import pulumi import pulumi.runtime from typing import Any, Mapping, Optional, Sequenc...
1.695313
2
basetrainer/scheduler/MultiStepLR.py
PanJinquan/pytorch-base-trainer
11
32997
<gh_stars>10-100 # -*-coding: utf-8 -*- """ @Author : panjq @E-mail : <EMAIL> @Date : 2021-07-28 15:32:44 """ import torch import torch.optim as optim import torch.nn as nn import numpy as np from .WarmUpLR import WarmUpLR from ..callbacks.callbacks import Callback class MultiStepLR(Callback): def ...
2.546875
3
common/inspect.py
skying0527/pull-Demo
0
32998
#!/usr/bin/env python3 # -*- coding:utf-8 -*- import os import yaml from tools.times import timestamp from config.conf import ELEMENT_PATH, LOCATE_MODE def inspect_element(): """审查所有的元素是否正确""" start_time = timestamp() for i in os.listdir(ELEMENT_PATH): _path = os.path.join(ELEMENT_PATH, i) ...
2.40625
2
client/starwhale/swds/store.py
goldenxinxing/starwhale
1
32999
<gh_stars>1-10 from pathlib import Path import sys import yaml import typing as t import click import requests from rich.panel import Panel from rich.pretty import Pretty from fs import open_fs from starwhale.base.store import LocalStorage from starwhale.consts import ( DEFAULT_DATASET_YAML_NAME, DEFAULT_MAN...
1.984375
2