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
mapreduce/handlers.py
igeeker/v2ex
161
14600
#!/usr/bin/env python # # Copyright 2010 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law o...
2.109375
2
radiomicsfeatureextractionpipeline/backend/src/logic/entities/ct_series.py
Maastro-CDS-Imaging-Group/SQLite4Radiomics
0
14601
<filename>radiomicsfeatureextractionpipeline/backend/src/logic/entities/ct_series.py """ This module is used to represent a CTSeries object from the DICOMSeries table in the database. Inherits SeriesWithImageSlices module. """ from logic.entities.series_with_image_slices import SeriesWithImageSlices class CtSeries(Se...
1.71875
2
models/pointSIFT_pointnet_age.py
KelvinTao/pointSIFT_Age2
0
14602
<reponame>KelvinTao/pointSIFT_Age2<filename>models/pointSIFT_pointnet_age.py import os import sys import tensorflow as tf import tf_utils.tf_util as tf_util from tf_utils.pointSIFT_util import pointSIFT_module, pointSIFT_res_module, pointnet_fp_module, pointnet_sa_module def placeholder_inputs(batch_size,num_point,n...
2.203125
2
cwl_airflow_parser/operators/__init__.py
lrodri29/cwl-airflow-parser
14
14603
<filename>cwl_airflow_parser/operators/__init__.py<gh_stars>10-100 from .cwljobdispatcher import CWLJobDispatcher from .cwljobgatherer import CWLJobGatherer
1.078125
1
primeiro programa/primeiro_programa.py
Cesario115/Ola-mundo
0
14604
<filename>primeiro programa/primeiro_programa.py print('='*50) print("Ol<NAME>!") print('='*50)
1.679688
2
src/third_party/swiftshader/third_party/subzero/pydir/wasm-run-torture-tests.py
rhencke/engine
2,151
14605
<filename>src/third_party/swiftshader/third_party/subzero/pydir/wasm-run-torture-tests.py #!/usr/bin/env python2 #===- subzero/wasm-run-torture-tests.py - Subzero WASM Torture Test Driver ===// # # The Subzero Code Generator # # This file is distributed under the University of Illinois Open Sour...
1.617188
2
game_vs_ai.py
fernandojosuece/Minimax_AI_connect4
0
14606
import numpy as np import pygame import sys import math import random from board import Board from ai import Minimax_AI # function to draw the board in pygame def draw_board(board): for c in range(COLUMN_COUNT): for r in range(ROW_COUNT): pygame.draw.rect(screen, colors["blue"], (c*SQUARESIZE,...
3.734375
4
{{cookiecutter.project_slug}}/sources/app/config/settings/components/security.py
AsheKR/cookiecutter-django
0
14607
<filename>{{cookiecutter.project_slug}}/sources/app/config/settings/components/security.py # https://docs.djangoproject.com/en/dev/ref/settings/#secure-proxy-ssl-header SECURE_PROXY_SSL_HEADER = ("HTTP_X_FORWARDED_PROTO", "https") # https://docs.djangoproject.com/en/dev/ref/settings/#secure-ssl-redirect SECURE_SSL_REDI...
1.429688
1
dabest/bootstrap_tools.py
nitishkumarmishra/DABEST
0
14608
<filename>dabest/bootstrap_tools.py #!/usr/bin/python # -*-coding: utf-8 -*- # Author: <NAME> # Email : <EMAIL> from __future__ import division class bootstrap: '''Computes the summary statistic and a bootstrapped confidence interval. Keywords: x1, x2: array-like The data in a one-dimen...
2.828125
3
Numbers/floor_tiles_cost.py
lucasc896/Projects
0
14609
<gh_stars>0 import math as ma # note all sizes in m^2 # all costs in pounds def get_details(): return {'w': get_value("Width:", float), 'h': get_value("Height:", float), 'cost': get_value("Cost per tile:", float),} def get_value(text = "enter_val", expected_type = None): while True:...
3.5
4
pyflow/demo/cwdDemo/cwdDemo.py
quejebo/pyflow
3
14610
#!/usr/bin/env python # # pyFlow - a lightweight parallel task engine # # Copyright (c) 2012-2017 Illumina, Inc. # 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 ...
1.59375
2
cc/apps/coder/admin.py
mavroskardia/codechallenge
0
14611
<reponame>mavroskardia/codechallenge from django.contrib import admin from .models import Coder, Level class CoderAdmin(admin.ModelAdmin): pass class LevelAdmin(admin.ModelAdmin): list_display_links = ('id',) list_display = ('id', 'name', 'starting_xp') list_editable = ('name', 'starting_xp') admin.site.regis...
1.882813
2
src/py/env.py
timgates42/lithp
76
14612
# The `Environment` class represents the dynamic environment of McCarthy's original Lisp. The creation of # this class is actually an interesting story. As many of you probably know, [<NAME> wrote a paper and # code for McCarthy's original Lisp](http://www.paulgraham.com/rootsoflisp.html) and it was my first exposu...
3.28125
3
tests/storage/test_filesystem.py
dilyanpalauzov/vdirsyncer
888
14613
<filename>tests/storage/test_filesystem.py import subprocess import aiostream import pytest from vdirsyncer.storage.filesystem import FilesystemStorage from vdirsyncer.vobject import Item from . import StorageTests class TestFilesystemStorage(StorageTests): storage_class = FilesystemStorage @pytest.fixtur...
2.296875
2
covid_sicilia.py
Cip0/covid-ita-graph
0
14614
import pandas as pd from datetime import timedelta, date import matplotlib.pyplot as plt def daterange(start_date, end_date): for n in range(int((end_date - start_date).days)): yield start_date + timedelta(n) def getFileByDate(date = 'latest'): url = 'https://raw.githubusercontent.com/pcm-dpc/COVID-19/...
3.109375
3
mhcflurry/select_allele_specific_models_command.py
ignatovmg/mhcflurry
113
14615
""" Model select class1 single allele models. """ import argparse import os import signal import sys import time import traceback import random from functools import partial from pprint import pprint import numpy import pandas from scipy.stats import kendalltau, percentileofscore, pearsonr from sklearn.metrics import ...
2.453125
2
CircuitPython_Made_Easy_On_CPX/cpx_temperature_neopixels.py
joewalk102/Adafruit_Learning_System_Guides
665
14616
import time from adafruit_circuitplayground.express import cpx import simpleio cpx.pixels.auto_write = False cpx.pixels.brightness = 0.3 # Set these based on your ambient temperature for best results! minimum_temp = 24 maximum_temp = 30 while True: # temperature value remapped to pixel position peak = simple...
3.03125
3
Python_Fundamentals/06_Object_And_Classes/task_object_and_classes/d_exercises.py
Dochko0/Python
0
14617
class Exercises: def __init__(self, topic, course_name, judge_contest_link, problems): self.topic = topic self.course_name = course_name self.judge_contest_link = judge_contest_link self.problems = [*problems] def get_info(self): info = f'Exercises: {self.topic}\n' \ ...
3.546875
4
Machine Learning Summer School 2019 (London, UK)/tutorials/mcmc/2 - markov_chain_monte_carlo.py
xuedong/rlss2019
0
14618
############################################################ # Copyright 2019 <NAME> # Licensed under the new BSD (3-clause) license: # # https://opensource.org/licenses/BSD-3-Clause ############################################################ ############################################################ # # Initial se...
2.703125
3
opendbc/generator/test_generator.py
darknight111/openpilot3
116
14619
<gh_stars>100-1000 #!/usr/bin/env python3 import os import filecmp import tempfile from opendbc.generator.generator import create_all, opendbc_root def test_generator(): with tempfile.TemporaryDirectory() as d: create_all(d) ignore = [f for f in os.listdir(opendbc_root) if not f.endswith('_generated.dbc')]...
2.21875
2
src/vigorish/scrape/brooks_pitchfx/scrape_task.py
a-luna/vigorish
2
14620
import vigorish.database as db from vigorish.enums import DataSet, ScrapeCondition from vigorish.scrape.brooks_pitchfx.parse_html import parse_pitchfx_log from vigorish.scrape.scrape_task import ScrapeTaskABC from vigorish.status.update_status_brooks_pitchfx import update_status_brooks_pitchfx_log from vigorish.util.dt...
2.265625
2
mayan/apps/rest_api/classes.py
atitaya1412/Mayan-EDMS
336
14621
<filename>mayan/apps/rest_api/classes.py from collections import namedtuple import io import json from furl import furl from django.core.handlers.wsgi import WSGIRequest from django.http.request import QueryDict from django.template import Variable, VariableDoesNotExist from django.test.client import MULTIPART_CONTEN...
1.921875
2
python/griddly/util/rllib/torch/agents/common.py
maichmueller/Griddly
93
14622
import numpy as np from torch import nn def layer_init(layer, std=np.sqrt(2), bias_const=0.0): """ Simple function to init layers """ nn.init.orthogonal_(layer.weight, std) nn.init.constant_(layer.bias, bias_const) return layer
3.0625
3
turnitin/src9.py
alvaedu/NYUsakai11
4
14623
""" Test script for src=9 provisioning Below are some odd examples and notes: Adding a class { 'src': '9', 'uln': 'Githens', 'ufn': 'Steven', 'aid': '56021', 'utp': '2', 'said': '56021', 'fid': '2', 'username': 'swgithen', 'ctl': 'CourseTitleb018b622-b425-4af7-bb3d-d0d2b4deb35c', 'diagnost...
1.601563
2
test.py
probot1511/test_repo
0
14624
<gh_stars>0 print("RUnning!!!") print("Updated!!!")
1.132813
1
tests/parser/choice.47.test.py
veltri/DLV2
0
14625
input = """ % This is a synthetic example documenting a bug in an early version of DLV's % backjumping algorithm. % The abstract computation tree looks as follows (choice order should be fixed % by disabling heuristics with -OH-): % % o % a / \ -a % / \_..._ % o \ % ...
2.859375
3
functions.py
brupoon/blackfork
0
14626
<filename>functions.py from __future__ import division from random import * #...(former location of probability as a FN GLOBAL) #OUR SUPERCOOL GENETIC MUTANT NINJA TURTALGORITHM def genetics(sampleList): winLoss = [] #win/loss arrays for each sample for sample in range(sampleList): winLoss.append(isWin...
3.71875
4
testframework/checkers/spanner_checker.py
emartech/ems-dataflow-testframework
0
14627
import logging from collections import Generator from typing import Dict from spanner import ems_spanner_client from tenacity import retry, stop_after_attempt, wait_fixed class SpannerChecker: STOP_AFTER_ATTEMPT_SECS = 15 WAIT_FIXED = 3 def __init__(self, project_id: str, instance_id: str, db_name: str)...
2.265625
2
src/sniptly/output.py
jjaakko/sniptly
0
14628
from typing import Any from click import echo, style def out(message: str, new_line: bool = True, **styles: Any) -> None: if "bold" not in styles: styles["bold"] = True message = style(message, **styles) echo(message, nl=new_line) def err(message: str, new_line: bool = True, **styles: Any) -...
2.484375
2
bookmarks/images/signals.py
hiteshgarg14/Django-Social-Website
1
14629
from django.db.models.signals import m2m_changed from django.dispatch import receiver from .models import Image @receiver(m2m_changed, sender=Image.users_likes.through) def users_like_changed(sender, instance, **kwargs): instance.total_likes = instance.users_likes.count() instance.save()
1.929688
2
src/nemo/transforms.py
thomasjo/nemo-redux
0
14630
import random from typing import List, Union import torch import torchvision.transforms as T import torchvision.transforms.functional as F from PIL import Image class RandomDiscreteRotation(): def __init__(self, angles, resample=0, expand=False): self.angles = angles self.resample = resample ...
2.53125
3
zadania-python/zadanie#8.01-03/zadanie_8_01.py
Qeentissue/wizualizacja-danych
0
14631
import pandas as pd # Wczytaj do DataFrame arkusz z narodzinami dzieci # w Polsce dostępny pod adresem df = pd.read_csv('Imiona_dzieci_2000-2019.csv')
2.15625
2
vgg16_imagenet.py
jamccomb92/TransferLearningPneuomia
0
14632
<reponame>jamccomb92/TransferLearningPneuomia<filename>vgg16_imagenet.py \ import os from keras import applications import keras import tensorflow as tf import time config = tf.ConfigProto() config.gpu_options.allow_growth = True keras.backend.tensorflow_backend.set_session(tf.Session(config=config)) from keras.mod...
2.046875
2
mvpa2/tests/test_procrust.py
mortonne/PyMVPA
0
14633
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*- # vi: set ft=python sts=4 ts=4 sw=4 et: ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ## # # See COPYING file distributed along with the PyMVPA package for the # copyright and license terms. # ### ### ### ### ###...
2.203125
2
configs/production.py
syz247179876/Flask-Sports
2
14634
<reponame>syz247179876/Flask-Sports # -*- coding: utf-8 -*- # @Time : 2020/12/1 下午11:24 # @Author : 司云中 # @File : production.py # @Software: Pycharm from configs.default import DefaultConfig class ProductionConfig(DefaultConfig): """the config of production env""" DEBUG = False TESTING = False MONGOD...
1.453125
1
glider/test/test_gliderRadio.py
ezeakeal/glider_drone
0
14635
<reponame>ezeakeal/glider_drone from unittest import TestCase from glider.modules.glider_radio import GliderRadio class TestGliderRadio(TestCase): def setUp(self): self.radio = GliderRadio(self.test_callback) self.radio.start() def tearDown(self): self.radio.stop() def test_callb...
2.421875
2
apps/warframes/migrations/0001_initial.py
tufbel/wFocus
0
14636
# Generated by Django 2.2.7 on 2019-12-15 12:15 from django.db import migrations, models class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( name='Warframe', fields=[ ('id', models.AutoField...
1.710938
2
pxr/base/tf/testenv/testTfStringUtils.py
DougRogers-DigitalFish/USD
3,680
14637
#!/pxrpythonsubst # # Copyright 2016 Pixar # # Licensed under the Apache License, Version 2.0 (the "Apache License") # with the following modification; you may not use this file except in # compliance with the Apache License and the following modification to it: # Section 6. Trademarks. is deleted and replaced with: # ...
2.25
2
oui/return_arp.py
sukhjinderpalsingh/ansible
4
14638
<gh_stars>1-10 #!/usr/bin/python import subprocess import sys import cgi import datetime import re import requests validMac = False ERROR = False form = cgi.FieldStorage() user = "READONLY_USER_HERE" pwd = "PASSWORD" OUI = form.getvalue('OUI') host = form.getvalue('HOST') def formatOUI(OUI): ...
2.5625
3
scripts/propogate_elab_labels.py
dmort27/elab-order
1
14639
<gh_stars>1-10 #!/usr/bin/env python3 import csv import glob import os.path from collections import deque from tqdm import tqdm def read_csv(fnin): with open(fnin) as f: return {tuple(e) for e in csv.reader(f)} def write_tagged_span(fout, buffer, count): b_token = buffer.popleft() print(f'{b_tok...
2.5
2
python/ml_preproc/pipeline/beam_classes/parse_csv.py
gmogr/dataflow-production-ready
1
14640
<gh_stars>1-10 # Copyright 2020 Google LLC. # This software is provided as-is, without warranty or representation for any use or purpose. # Your use of it is subject to your agreement with Google. from apache_beam import DoFn, pvalue from apache_beam.metrics import Metrics from ..model import data_classes from ..mo...
2.4375
2
src/sentry/integrations/pagerduty/client.py
pombredanne/django-sentry
0
14641
<gh_stars>0 from __future__ import absolute_import from sentry.integrations.client import ApiClient from sentry.models import EventCommon from sentry.api.serializers import serialize, ExternalEventSerializer LEVEL_SEVERITY_MAP = { "debug": "info", "info": "info", "warning": "warning", "error": "error"...
2.03125
2
darling_ansible/python_venv/lib/python3.7/site-packages/oci/monitoring/models/failed_metric_record.py
revnav/sandbox
0
14642
# coding: utf-8 # Copyright (c) 2016, 2020, 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/LICENSE-2.0. You may c...
2.21875
2
PyBlend/pyblend_prism.py
nfb2021/PrismPyTrace
0
14643
import bpy import numpy as np import math import mathutils import time import os class Prism: """ ^""" """ / \\""" """ / ^ \\""" """ / | \\""" """ /'alpha'\\ <-- lenght of this side is calculated based on 'width' and 'alpha'""" """/ \\""" """-------...
3.078125
3
Source/RainyDay_utilities_Py3/__init__.py
Dewberry/RainyDay2
12
14644
<reponame>Dewberry/RainyDay2 # -*- coding: utf-8 -*- """ Created on Fri Feb 6 17:38:00 2015 @author: dbwrigh3 """
0.738281
1
setup.py
Lewinta/ProcesosLab
0
14645
# -*- coding: utf-8 -*- from setuptools import setup, find_packages with open('requirements.txt') as f: install_requires = f.read().strip().split('\n') # get version from __version__ variable in proceso/__init__.py from proceso import __version__ as version setup( name='proceso', version=version, description='A ...
1.53125
2
eye/widgets/misc.py
hydrargyrum/eye
12
14646
<reponame>hydrargyrum/eye<gh_stars>10-100 # this project is licensed under the WTFPLv2, see COPYING.txt for details import logging from weakref import ref from PyQt5.QtCore import QEventLoop from PyQt5.QtWidgets import QPlainTextEdit, QLabel, QWidget, QRubberBand, QApplication from ..app import qApp from ..qt import...
2.09375
2
envelopes/envelope.py
siyaoyao/envelopes
202
14647
# -*- coding: utf-8 -*- # Copyright (c) 2013 <NAME> <<EMAIL>> # # 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, mo...
1.453125
1
dependencies/panda/Pmw/Pmw_2_0_1/lib/PmwOptionMenu.py
SuperM0use24/Project-Altis
0
14648
import types import tkinter import Pmw import sys import collections class OptionMenu(Pmw.MegaWidget): def __init__(self, parent = None, **kw): # Define the megawidget options. INITOPT = Pmw.INITOPT optiondefs = ( ('command', None, None), ('items', ...
2.78125
3
options/train_options.py
fatalfeel/DeblurGAN
3
14649
<reponame>fatalfeel/DeblurGAN import os import torch import argparse from util import util def str2bool(b_str): if b_str.lower() in ('yes', 'true', 't', 'y', '1'): return True elif b_str.lower() in ('no', 'false', 'f', 'n', '0'): return False class TrainOptions(): def __init__(self): ...
2.375
2
bin/tabletest.py
tjoneslo/pypdflite
7
14650
import os from pypdflite.pdflite import PDFLite from pypdflite.pdfobjects.pdfcolor import PDFColor def TableTest(test_dir): """ Functional test for text, paragraph, and page splitting. """ data = [["Heading1", "Heading2", "Heading3"], ["Cell a2", "Cell b2", "Cell c2"], ...
3.015625
3
backend/app/literature/schemas/cross_reference_schemas.py
alliance-genome/agr_literature_service
0
14651
from typing import List, Optional from pydantic import BaseModel from pydantic import validator class CrossReferenceSchemaRelated(BaseModel): curie: str pages: Optional[List[str]] = None is_obsolete: Optional[bool] = None @validator('curie') def name_must_contain_space(cls, v): if v.coun...
2.515625
3
leetcode/53.py
jasonlmfong/leetcode
0
14652
<gh_stars>0 class Solution(object): def maxSubArray(self, nums): """ :type nums: List[int] :rtype: int """ Max = -float("inf") currMax = -float("inf") for num in nums: currMax = max(num, num + currMax) Max = max(Max, currMax) ...
3.0625
3
tests/test_resolver.py
manz/a816
2
14653
<reponame>manz/a816 import unittest from a816.parse.ast.expression import eval_expression_str from a816.symbols import Resolver class ResolverTest(unittest.TestCase): def test_math_expr_eval(self) -> None: expr = "0x100+toto & 0xFFFF" resolver = Resolver() resolver.current_scope.add_symb...
3
3
syft_proto/frameworks/crypten/onnx_model_pb2.py
vkkhare/syft-proto
0
14654
# -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # source: syft_proto/frameworks/crypten/onnx_model.proto from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message from google.protobuf import reflection as _reflection from google.protobuf im...
1.335938
1
Actor_CriticPointer_Network-TSP/knapsack_env.py
GeoffNN/DLforCombin
5
14655
<reponame>GeoffNN/DLforCombin<filename>Actor_CriticPointer_Network-TSP/knapsack_env.py import numpy as np import knapsack class Knapsack: def __init__(self, K, max_weight, state_shape = 'flat', penalize_repeat = False): self.K = K self.max_weight = max_weight self.penalize_repeat = penalize...
2.890625
3
plotmonitor.py
mjlosch/python_scripts
1
14656
<filename>plotmonitor.py #!/usr/bin/env python # -*- coding: iso-8859-15 -*- ######################## -*- coding: utf-8 -*- """Usage: plotres.py variable INPUTFILE(S) """ import sys from getopt import gnu_getopt as getopt import matplotlib.pyplot as plt import numpy as np import datetime # parse command-line argument...
2.796875
3
src/primaires/communication/contextes/immersion.py
vlegoff/tsunami
14
14657
# -*-coding:Utf-8 -* # Copyright (c) 2010-2017 <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: # # * Redistributions of source code must retain the above copyright notice, this # list ...
1.453125
1
Projects/ABM_DA/experiments/ukf_experiments/tests/arc_test.py
RobertClay/DUST-RC
15
14658
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Mon Jan 13 12:07:22 2020 @author: medrclaa Stand alone script for testing arc in ARC. simply run pytest arc_test.py To ensure the working environment is suitable for running experiments. If you only wish to run a single experiment then you an easily ha...
3.265625
3
setup.py
dunkgray/nomics-python
0
14659
<reponame>dunkgray/nomics-python import setuptools with open("README.md", "r") as fh: long_description = fh.read() setuptools.setup( name = "nomics-python", version = "3.1.0", author = "<NAME>", author_email = "<EMAIL>", description = "A python wrapper for the Nomics API", long_description...
1.523438
2
tests/test_day3.py
ullumullu/adventofcode2020
0
14660
import os from pathlib import Path from typing import List from challenges.day3 import frequency_character def _read_input() -> List[str]: """Read the input file.""" travel_map = [] current_path = Path(os.path.dirname(os.path.realpath(__file__))) image_path = current_path / "resources" / "day3_puzzle_...
3.6875
4
test/test_format.py
GuyTuval/msgpack-python
1,252
14661
<reponame>GuyTuval/msgpack-python #!/usr/bin/env python # coding: utf-8 from msgpack import unpackb def check(src, should, use_list=0, raw=True): assert unpackb(src, use_list=use_list, raw=raw, strict_map_key=False) == should def testSimpleValue(): check(b"\x93\xc0\xc2\xc3", (None, False, True)) def test...
2.296875
2
src/main/resources/pytz/zoneinfo/Asia/Brunei.py
TheEin/swagger-maven-plugin
65
14662
<gh_stars>10-100 '''tzinfo timezone information for Asia/Brunei.''' from pytz.tzinfo import DstTzInfo from pytz.tzinfo import memorized_datetime as d from pytz.tzinfo import memorized_ttinfo as i class Brunei(DstTzInfo): '''Asia/Brunei timezone definition. See datetime.tzinfo for details''' zone = 'Asia/Brune...
2.796875
3
raiden/tests/unit/test_messages.py
ConsenSysMesh/raiden
3
14663
# -*- coding: utf-8 -*- import pytest from raiden.messages import Ping, Ack, decode, Lock, MediatedTransfer from raiden.utils import make_privkey_address, sha3 PRIVKEY, ADDRESS = make_privkey_address() def test_signature(): ping = Ping(nonce=0) ping.sign(PRIVKEY, ADDRESS) assert ping.sender == ADDRESS ...
2.0625
2
python/helpful_scripts/circle_packing.py
Oilgrim/ivs_sim
0
14664
#!/usr/bin/env python2 # -*- coding: utf-8 -*- """ Created on Wed Jul 5 12:41:09 2017 @author: lracuna """ #!/usr/bin/env python """ This program uses a simple implementation of the ADMM algorithm to solve the circle packing problem. We solve minimize 1 subject to |x_i - x_j| > 2R, R < x_i, ...
3.828125
4
models/train/train_seq2seq.py
Chucooleg/alfred
1
14665
<reponame>Chucooleg/alfred import os import sys import random sys.path.append(os.path.join(os.environ['ALFRED_ROOT'])) sys.path.append(os.path.join(os.environ['ALFRED_ROOT'], 'models')) import torch import pprint import json from data.preprocess import Dataset from importlib import import_module from argparse import A...
2.046875
2
tests/search_test.py
martingaston/billy-search
0
14666
import pytest from billy.utils.search import google_book_search class TestGoogleBookSearch(object): def test_search_returns_200(self, mock): """Ensure a basic search returns a 200 request""" assert google_book_search("<NAME>")["status"] == 200 def test_search_body_returns_dict(self, mock): ...
2.78125
3
src/config.py
Clloud/MostPopularRoute
7
14667
import math class Config_1: DATASET_ROOT_DIR = '../data/test1/Data' # The data set root directory DATASET_SCALE = 0 # How many users' trajectory data are choosed TRAJACTORY_SCALE = 20 # How many trajectories are choosed per user RANGE = { # To...
2.546875
3
Python/first01.py
praseedpai/WhetYourApettite
0
14668
<reponame>praseedpai/WhetYourApettite import sys from sys import exit if len(sys.argv) == 1 : print ("No command line argument" ) sys.exit() #else : # print ("rest of the program ") #numbers = sys.argv[1:] #print (sorted(numbers, key=lambda x: float(x))) numbers = [] i=1 n= len(sys.argv) while ( i < n )...
4.1875
4
library/gui.py
bwbryant1/Library
0
14669
<reponame>bwbryant1/Library from . import dbFuncs import sys, os import pkg_resources from PyQt5.QtCore import Qt from PyQt5.QtWidgets import QApplication, qApp, QHBoxLayout, QMainWindow, QAction, QMessageBox, QFileDialog, QPushButton from PyQt5.QtGui import QIcon class MainWindow(QMainWindow): def __init__(self):...
2.140625
2
du/ps_utils.py
diogo149/doo
1
14670
import os import psutil import time def process_time(): p = psutil.Process(os.getpid()) return time.time() - p.create_time()
2.46875
2
config.py
Laikos38/rockopy
0
14671
<reponame>Laikos38/rockopy # ================================================= # SERVER CONFIGURATIONS # ================================================= CLIENT_ID='' CLIENT_SECRET='' REDIRECT_URI='http://ROCKOPY/' # ================================================= # SERVER CONFIGURATIONS # ========================...
1.898438
2
upcfcardsearch/c269.py
ProfessorSean/Kasutamaiza
0
14672
import discord from discord.ext import commands from discord.utils import get class c269(commands.Cog, name="c269"): def __init__(self, bot: commands.Bot): self.bot = bot @commands.command(name='Vir_the_True_Elementalist', aliases=['c269', 'Elementalist_1', 'Distasta_Master_1']) async def exam...
2.71875
3
test/method_comparison.py
kiyami/stad
2
14673
<reponame>kiyami/stad<filename>test/method_comparison.py<gh_stars>1-10 from soad import AsymmetricData as asyd import matplotlib.pyplot as plt # This script is prepared for showing the difference between methods of handling asymmetric errors. class Data: control_variable_parameters = [10.0, 1.0, 1.0] contro...
2.828125
3
python/ex4/ex4.py
SHIMengjie/Machine-Learning-Andrew-Ng-Matlab
6
14674
<filename>python/ex4/ex4.py import scipy.io as scio import numpy as np import matplotlib.pyplot as plt import scipy.optimize as opt from displayData import display_data from costFunction import nn_cost_function from sigmoid import sigmoid_gradient from randInitializeWeights import rand_init_weights from checkNNGradien...
2.625
3
examples/complex_filtering.py
ITgladiator/tortoise-orm
0
14675
""" This example shows some more complex querying Key points are filtering by related names and using Q objects """ import asyncio from tortoise import Tortoise, fields from tortoise.models import Model from tortoise.query_utils import Q class Tournament(Model): id = fields.IntField(pk=True) name = fields.T...
3.03125
3
igmp/packet/PacketIpHeader.py
pedrofran12/igmp
3
14676
<gh_stars>1-10 import struct import socket class PacketIpHeader: """ 0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |Version| +-+-+-+-+ """ ...
2.90625
3
shopping_mall/shopping_mall/utils/fastdfs/fdfs_storage.py
lzy00001/SHOP_CENTER
0
14677
<reponame>lzy00001/SHOP_CENTER<filename>shopping_mall/shopping_mall/utils/fastdfs/fdfs_storage.py<gh_stars>0 from django.conf import settings from django.core.files.storage import Storage from django.utils.deconstruct import deconstructible from fdfs_client.client import Fdfs_client @deconstructible class FastDFSStor...
2.1875
2
src/sovereign/server.py
bochuxt/envoy-control-plane-python3
1
14678
<filename>src/sovereign/server.py import gunicorn.app.base from sovereign import asgi_config from sovereign.app import app class StandaloneApplication(gunicorn.app.base.BaseApplication): def __init__(self, application, options=None): self.options = options or {} self.application = application ...
2.15625
2
Python/CeV/Exercicios/ex71.py
WerickL/Learning
0
14679
Val = int(input('Digite o valor que você quer sacar:')) c50 = c20 = c10 = c1 = 0 if Val // 50 != 0: c50 = Val // 50 Val = Val % 50 if Val // 20 != 0: c20 = Val // 20 Val = Val % 20 if Val // 10 != 0: c10 = Val // 10 Val = Val % 10 if Val // 1 != 0: c1 = Val // 1 if c50 != 0: print(f'{c50...
3.53125
4
model/oppia_proto_library.bzl
bhaktideshmukh/oppia-android
0
14680
""" Bazel macros for defining proto libraries. """ load("@rules_proto//proto:defs.bzl", "proto_library") # TODO(#4096): Remove this once it's no longer needed. def oppia_proto_library(name, **kwargs): """ Defines a new proto library. Note that the library is defined with a stripped import prefix which en...
1.757813
2
tests/test_cbers_ndvi.py
RemotePixel/remotepixel-py
5
14681
import os from remotepixel import cbers_ndvi CBERS_SCENE = "CBERS_4_MUX_20171121_057_094_L2" CBERS_BUCKET = os.path.join(os.path.dirname(__file__), "fixtures", "cbers-pds") CBERS_PATH = os.path.join( CBERS_BUCKET, "CBERS4/MUX/057/094/CBERS_4_MUX_20171121_057_094_L2/" ) def test_point_valid(monkeypatch): ""...
2.09375
2
test/scons-time/time/no-result.py
moroten/scons
1,403
14682
#!/usr/bin/env python # # __COPYRIGHT__ # # 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, publish, ...
2.1875
2
alipy/index/index_collections.py
Houchaoqun/ALiPy
1
14683
""" The container to store indexes in active learning. Serve as the basic type of 'set' operation. """ # Authors: <NAME> # License: BSD 3 clause from __future__ import division import collections import copy import numpy as np from .multi_label_tools import check_index_multilabel, infer_label_size_multilabel, flatt...
3.453125
3
keycache/util.py
psytron/keycache
2
14684
import platform as p import uuid import hashlib def basic(): sb = [] sb.append(p.node()) sb.append( ''.join([ x for x in p.architecture() ]) ) sb.append(p.machine()) sb.append(p.processor()) sb.append(p.system()) sb.append(str(uuid.getnode())) # MAC address text = '.'.join(sb) retu...
2.671875
3
the biggidy back end/rawText.py
jlekas/recipe-site
1
14685
url = "https://www.delish.com/cooking/recipe-ideas/recipes/a53823/easy-pad-thai-recipe/" url2 = "https://www.allrecipes.com/recipe/92462/slow-cooker-texas-pulled-pork/" # opener = urllib.URLopener() # opener.addheader(('User-Agent', 'Mozilla/5.0')) # f = urllib.urlopen(url) import requests import html2text h = html2...
3.09375
3
tests/test_service_desk.py
p-tombez/jira
0
14686
#!/usr/bin/env python from __future__ import print_function import inspect import logging import os import platform import sys from time import sleep from flaky import flaky import pytest import requests from jira_test_manager import JiraTestManager # _non_parallel is used to prevent some tests from failing due to ...
1.898438
2
mods/goofile.py
Natto97/discover
1
14687
<reponame>Natto97/discover #!/usr/bin/env python # Goofile v1.5a # by Thomas (G13) Richards # www.g13net.com # Project Page: code.google.com/p/goofile # TheHarvester used for inspiration # A many thanks to the Edge-Security team! # Modified by <NAME> import getopt import httplib import re import string imp...
2.34375
2
Atividade do Livro-Nilo Ney(PYTHON)/Cap.05/exe 5.25.py
EduardoJonathan0/Python
0
14688
<gh_stars>0 n = int(input('Insira um número e calcule sua raiz: ')) b = 2 while True: p = (b + (n / b)) / 2 res = p ** 2 b = p if abs(n - res) < 0.0001: break print(f'p = {p}') print(f'p² = {res}')
3.609375
4
wolframclient/utils/six.py
krbarker/WolframClientForPython
0
14689
# -*- coding: utf-8 -*- from __future__ import absolute_import, print_function, unicode_literals import datetime import decimal import platform import sys import types from itertools import chain #stripped version of SIX PY2 = sys.version_info[0] == 2 PY3 = sys.version_info[0] == 3 PY_35 = sys.version_info >= (3, 5...
2.171875
2
Lib/site-packages/pynput/mouse/_xorg.py
djaldave/laevad-python-2.7.18
0
14690
<reponame>djaldave/laevad-python-2.7.18 # coding=utf-8 # pynput # Copyright (C) 2015-2016 <NAME> # # This program is free software: you can redistribute it and/or modify it under # the terms of the GNU Lesser General Public License as published by the Free # Software Foundation, either version 3 of the License, or (at ...
2.890625
3
automate_online-materials/census2010.py
kruschk/automate-the-boring-stuff
2
14691
<reponame>kruschk/automate-the-boring-stuff allData = {'AK': {'Aleutians East': {'pop': 3141, 'tracts': 1}, 'Aleutians West': {'pop': 5561, 'tracts': 2}, 'Anchorage': {'pop': 291826, 'tracts': 55}, 'Bethel': {'pop': 17013, 'tracts': 3}, 'Bristol Bay': {'pop': 997, 'tracts': 1}, ...
1.507813
2
piecutter/engines/mock.py
diecutter/piecutter
2
14692
# -*- coding: utf-8 -*- """Mock template engine, for use in tests.""" from piecutter.engines import Engine #: Default value used as :py:attr:`MockEngine.render_result` default_render_result = u'RENDER WITH ARGS={args!s} AND KWARGS={kwargs!s}' class MockEngine(Engine): """Template engine mock. Typical usage...
3.375
3
Groups/Group_ID_18/CWMVFE.py
shekhar-sharma/DataScience
5
14693
#MCCA (Multiview Canonical Correlation Analysis) import numpy as np from scipy import linalg as lin from sklearn.preprocessing import StandardScaler from sklearn.neighbors import KNeighborsClassifier class CWMVFE: def __init__(self,n_components=2,reg_param=0.01 , L): self.n_components = n_component...
2.546875
3
scripts/lda.py
flatironinstitute/catvae
6
14694
import argparse from sklearn.decomposition import LatentDirichletAllocation as LDA import pickle from biom import load_table def main(args): model = LDA(n_components=args.n_latent, max_iter=args.iterations, verbose=1, learning_method='online') table = load_table(args.train_biom) X = table....
2.3125
2
splitjoin.py
sonicskye/senarai
1
14695
<filename>splitjoin.py ''' splitjoin.py sonicskye@2018 The functions are used to split and join files based on: https://stonesoupprogramming.com/2017/09/16/python-split-and-join-file/ with modification by adding natural sort ''' import os import re # https://stackoverflow.com/questions/11150239/python-natura...
3.625
4
daily_leader_board.py
bundgus/hadoop-yarn-resource-consumption-report
1
14696
<gh_stars>1-10 # <NAME> 2019 import luigi import logging from yarn_api_client import ResourceManager # https://python-client-for-hadoop-yarn-api.readthedocs.io from datetime import datetime from datetime import timedelta import pandas as pd from tabulate import tabulate import os import configuration log = logging.ge...
2.234375
2
bfxhfindicators/wma.py
quadramadery/bfx-hf-indicators-py
1
14697
<reponame>quadramadery/bfx-hf-indicators-py<gh_stars>1-10 from bfxhfindicators.indicator import Indicator class WMA(Indicator): def __init__(self, args = []): [ period ] = args d = 0 for i in range(period): d += (i + 1) self._d = d self._p = period self._buffer = [] super().__in...
2.171875
2
src/scripts/train_image.py
paavalipopov/introspection
0
14698
import argparse from datetime import datetime import os from catalyst import dl, utils from catalyst.contrib.data import AllTripletsSampler from catalyst.contrib.losses import TripletMarginLossWithSampler from catalyst.data import BatchBalanceClassSampler from torch import nn, optim from torch.utils.data import DataLo...
1.945313
2
aegea/batch.py
MrOlm/aegea
0
14699
<filename>aegea/batch.py<gh_stars>0 """ Manage AWS Batch jobs, queues, and compute environments. """ from __future__ import absolute_import, division, print_function, unicode_literals import os, sys, argparse, base64, collections, io, subprocess, json, time, re, hashlib, concurrent.futures, itertools from botocore.e...
2.078125
2