max_stars_repo_path
stringlengths
3
269
max_stars_repo_name
stringlengths
4
119
max_stars_count
int64
0
191k
id
stringlengths
1
7
content
stringlengths
6
1.05M
score
float64
0.23
5.13
int_score
int64
0
5
src/amuse/community/adaptb/__init__.py
sibonyves/amuse
0
12782051
from .interface import Adaptb
1.148438
1
sagas/nlu/legacy/corenlp_procs.py
samlet/stack
3
12782052
<gh_stars>1-10 import sagas def words_table(sents, lang): from sagas.nlu.corenlp_helper import get_nlp nlp=get_nlp(lang) doc = nlp(sents) sentence=doc.sentences[0] rows=[[word.text, word.lemma, word.upos, word.xpos, word.dependency_relation, word.governor, word.feats] for word ...
2.75
3
mri_tools/topup_eddy/nipype_overwrite/all_peb_pipeline.py
movermeyer/mri-tools
0
12782053
from nipype.interfaces.ants.base import ANTSCommandInputSpec, ANTSCommand from nipype.interfaces.ants.segmentation import N4BiasFieldCorrectionOutputSpec from nipype.interfaces.base import (File, traits, isdefined) from nipype.utils.filemanip import split_filename import nipype.pipeline.engine as pe import nipype.inter...
1.929688
2
zeex/core/models/bookmark.py
zbarge/dbtrix
10
12782054
# -*- coding: utf-8 -*- """ Created on Fri Dec 2 14:02:26 2016 MIT License Copyright (c) 2016 <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 limit...
1.78125
2
ydkgen/builder/_types_extractor.py
viardant/ydk-gen
4
12782055
# ---------------------------------------------------------------- # YDK - YANG Development Kit # Copyright 2016-2019 Cisco Systems # # 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 # # htt...
1.578125
2
services/director-v2/src/simcore_service_director_v2/modules/dynamic_sidecar/scheduler/__init__.py
colinRawlings/osparc-simcore
25
12782056
from .task import DynamicSidecarsScheduler, setup_scheduler, shutdown_scheduler
1.023438
1
idest_dash_components/_imports_.py
idest/dash_components
0
12782057
<filename>idest_dash_components/_imports_.py<gh_stars>0 from .ExampleComponent import ExampleComponent from .Import import Import from .Slider import Slider __all__ = [ "ExampleComponent", "Import", "Slider", ]
1.09375
1
system_tests/test_fit_predict.py
h2oai/dask-lightgbm
81
12782058
<reponame>h2oai/dask-lightgbm import os import dask.dataframe as dd import pytest from dask.distributed import Client import dask_lightgbm.core as dlgbm @pytest.fixture(scope='module') def client(): with Client(os.getenv('SCHEDULER')) as client: yield client @pytest.fixture() def listen_port(): li...
2.265625
2
AtCoder/BeginnerContest138/e.py
scnsh/CompetitiveProgramming
1
12782059
<reponame>scnsh/CompetitiveProgramming<gh_stars>1-10 import copy s = input() t = input() if(set(t) - set(s)): print(-1) exit() t_index = 0 s_index = 0 count = 0 copy_s = copy.deepcopy(s) while len(t) > t_index: index = copy_s.find(t[t_index]) if index >= 0: t_index += 1 copy_s = copy_s[...
2.78125
3
dhdt/generic/mapping_io.py
GO-Eratosthenes/dhdt
0
12782060
import os import glob import numpy as np import pandas as pd # geospatial libaries from osgeo import gdal, osr from xml.etree import ElementTree def read_geo_info(fname): """ This function takes as input the geotiff name and the path of the folder that the images are stored, reads the geographic information ...
3.28125
3
SC/northwind.py
lfr4704/DS-Unit-3-Sprint-2-SQL-and-Databases
0
12782061
<filename>SC/northwind.py import os import sqlite3 #Part 2 # construct a path to wherever your database exists DB_FILEPATH = os.path.join(os.path.dirname(__file__), "..", "SC", "northwind_small.sqlite3") connection = sqlite3.connect(DB_FILEPATH) print("CONNECTION:", connection) #connection.row_factory = sqlite3.Row ...
4.03125
4
ahvl/process.py
gardar/ahvl
4
12782062
# # import modules # from ahvl.helper import AhvlMsg, AhvlHelper import subprocess # # helper/message # msg = AhvlMsg() hlp = AhvlHelper() # # process # class Process(object): def __init__(self, proc=None, cmd=[], failonstderr=True, shell=False): # set process name and command self.setproces...
2.46875
2
app/main/routes/routes.py
awtrimpe/socks-chat
0
12782063
import json import sys from flask import (Blueprint, Markup, flash, g, jsonify, redirect, render_template, request, session, url_for) from flask_login import current_user, login_user, logout_user from app.main.admin import (get_admin_control_by_id, get_admin_control_by_name, ...
2.265625
2
loop control statements/break_statements.py
shashikant-sk/python_learning
0
12782064
# Break Transfers control to the statements right after the loops x = "<NAME>" for i in x : if i ==".": break print(i,end=" ")
3.59375
4
quelfilm/engine.py
thomas-marquis/quelfilm-chatbot-app
0
12782065
import os from nlp_tools.preprocessing import Preprocessing from nlp_tools.loaders import MdLoader from nlp_tools.representations import MergedMatrixRepresentation from nlp_tools.classifiers import ClassificationProcessor, NaiveBayseTfIdfClassifier from nlp_tools.utils import get_random_message from quelfilm.settings ...
2.359375
2
Oops/Practics-Oops-11.py
Danish-Belal/Python-Basic-to-Advance
0
12782066
<filename>Oops/Practics-Oops-11.py<gh_stars>0 # Q1 Create a 3d vector using 2d vector. ''' class C2dvec: def __init__(self, i, j): self.icap = i self.jcap = j def __str__(self): return f"{self.icap}i + {self.jcap}k" class C3dvec(C2dvec): def __init__(self, i, j, k): super(...
4.15625
4
dffml/operation/db.py
purnimapatel/dffml
1
12782067
<filename>dffml/operation/db.py import inspect from typing import Dict, Any, Optional, List from ..base import config from ..df.base import op from ..db.base import Conditions, BaseDatabase from ..df.types import Definition # definitions QUERY_TABLE = Definition(name="query_table", primitive="str") QUERY_DATA = Defi...
2.34375
2
tkdet/data/samplers/__init__.py
tkhe/tkdetection
1
12782068
from .distributed_sampler import * from .grouped_batch_sampler import *
1.007813
1
Basics of the Python/DSA with Python/BST.py
suy1968/Hands-on-ML-Basic-to-Advance-
60
12782069
<gh_stars>10-100 class Node: def __init__(self,key): self.key=key self.left=None self.right=None def insert(node,key): if node is None: return Node(key) if key < node.key: node.left = insert(node.left,key) else: node.right = insert(node.right,key) r...
3.734375
4
P1/HTTPClient/web_client.py
ykzzyk/Networking
0
12782070
from socket import * import argparse # Parameters #TCP_IP = 'localhost' #TCP_PORT = 12003 BUFFER_SIZE = 1024 # Arguments parser = argparse.ArgumentParser() parser.add_argument('server_host') parser.add_argument('server_port') parser.add_argument('filename') args = parser.parse_args() # Prepare a client socket clien...
3.359375
3
scvelo/plotting/scatter.py
fidelram/scvelo
0
12782071
<reponame>fidelram/scvelo<filename>scvelo/plotting/scatter.py from .. import settings from .. import AnnData from .utils import make_dense, is_categorical, update_axes, set_label, set_title, interpret_colorkey, set_colorbar, \ default_basis, default_color, default_size, default_color_map, get_components, savefig_or...
2.515625
3
python_work/Chapter8/making_pizzas.py
Elektra-2/python_crash_course_2nd
1
12782072
<filename>python_work/Chapter8/making_pizzas.py import pizza pizza.make_pizza(16, 'pepperoni') pizza.make_pizza(17, 'cheese', 'ham')
2.3125
2
a.sikorska/CASE/case_trojkat_A_Sikorska.py
alsikorska/python_wprowadzenie_warsztaty_2021
0
12782073
class TriangleChecker(): def __init__(self, a, b, c): self.a = a self.b = b self.c = c print("Sprawdźmy czy można utworzyć trójkąt!") def is_triangle(self): if self.check_is_triangle() : print("Hurra, możesz zbudować trójkąt!") elif sel...
3.9375
4
Assignements/2A_WillhelmRendahl.py
Dazpoet/Learning-python
0
12782074
<gh_stars>0 #!/usr/bin/env python3 # -*- coding: utf-8 -*- #Assignement: #Create an implementation of the game "Gissa mitt tal" where the user is #tasked with finding a random number between 1-100 #Use try-except to catch errors import pickle import random import sys def welcome_text(isfirst): #We call on this to we...
3.71875
4
src/amuse/ext/cloud.py
rknop/amuse
131
12782075
<reponame>rknop/amuse<filename>src/amuse/ext/cloud.py<gh_stars>100-1000 import inspect import numpy from amuse.units import generic_unit_system from amuse import datamodel def fill_grid_with_cloud_and_medium( grid, center = None, radius = None, rho_medium = 1.0 | generic_unit_system.m...
2.328125
2
vgablog.py
PeterFidelman/vga-blog
0
12782076
#!/usr/bin/python import os import datetime import PyRSS2Gen kInDir = "raw_post" kTmplDir = "template" kBlogDir = "site/blog" kPostsDir = "site/blog/posts" def main(): postlist = posts() archive(postlist) def posts(): postlist = [] # Create the output directory if it doesn't already exist os.m...
2.84375
3
texsymdetect/service/lib/symbol_search.py
andrewhead/symbol-extractor
1
12782077
import logging import math import re from collections import defaultdict from dataclasses import dataclass from typing import Dict, Iterable, Iterator, List, Optional, Sequence, Set, Tuple import cv2 import numpy as np import scipy.spatial from lib.image_processing import ( Point, Rectangle, _contains_sta...
2.296875
2
Reg_exp_Emp_fields.py
abhisek1985/Python-Unit-Testing
1
12782078
import re def check_userID(ID): ''' Rule : UserID consists of [A-Z|a-z|0-9] ''' match = re.search(r'\w+', ID) #print match.group(0), if match: return True else: return False def check_jobTitleName(Job_Title): ''' Rule: Employee Job title starts with [A-Z] then multiple occurr...
3.453125
3
src/hera/workflow.py
bchalk101/hera-workflows
0
12782079
"""The implementation of a Hera workflow for Argo-based workflows""" from typing import Dict, List, Optional, Tuple from argo_workflows.models import ( IoArgoprojWorkflowV1alpha1DAGTemplate, IoArgoprojWorkflowV1alpha1Template, IoArgoprojWorkflowV1alpha1VolumeClaimGC, IoArgoprojWorkflowV1alpha1Workflow,...
2.375
2
242. Valid Anagram/solution1.py
sunshot/LeetCode
0
12782080
import collections class Solution: def isAnagram(self, s: str, t: str) -> bool: if not s and not t: return True if not s or not t: return False if len(s) != len(t): return False s_hash = collections.defaultdict(int) t_hash = collections.def...
3.6875
4
pyyacp/testing/test_format_encoder.py
ODInfoBiz/pyyacp
1
12782081
<filename>pyyacp/testing/test_format_encoder.py # -*- coding: utf-8 -*- import codecs import unittest import string import sys from pyyacp.column_format_detector import translate def for_examples(parameters): def tuplify(x): if not isinstance(x, tuple): return (x,) return x def decorator(method, ...
2.671875
3
func_saver/func_saver_helpers.py
sfinktah/func_saver
0
12782082
<gh_stars>0 import os, sys import ida_auto import ida_bytes import ida_funcs import ida_ida import ida_name import ida_search import ida_ua import idaapi import idautils import idc import tempfile import json from string_between import string_between from superhex import hex try: import __builtin__ as builtins ...
2.421875
2
yaetos/etl_utils.py
mcarbonell-paymefy/yaetos
0
12782083
<reponame>mcarbonell-paymefy/yaetos<filename>yaetos/etl_utils.py """ Helper functions. Setup to run locally and on cluster. """ # TODO: # - add linter # - finish _metadata.txt file content. # - get inputs and output by commandline (with all related params used in yml, like 'type', 'incr'...). # - better check that db c...
1.835938
2
qubellclient/private/application.py
dmakhno/contrib-python-qubell-client
0
12782084
# Copyright (c) 2013 Qubell Inc., http://qubell.com # # 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 agr...
2.03125
2
users/migrations/0014_auto_20200313_0548.py
RaghibMrz/webapp-testing
2
12782085
<filename>users/migrations/0014_auto_20200313_0548.py # Generated by Django 3.0.1 on 2020-03-13 05:48 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('users', '0013_auto_20200313_0546'), ] operations = [ migrations.AlterField...
1.351563
1
Regex/function-compile.py
SpenceGuo/py3-learning
1
12782086
<filename>Regex/function-compile.py<gh_stars>1-10 """ compile 函数 compile 函数用于编译正则表达式,生成一个正则表达式( Pattern )对象,供 match() 和 search() 这两个函数使用。 语法格式为: re.compile(pattern[, flags]) 参数: pattern : 一个字符串形式的正则表达式 flags 可选,表示匹配模式,比如忽略大小写,多行模式等,具体参数为: re.I 忽略大小写 re.L 表示特殊字符集 \w, \W, \b, \B, \s, \S 依赖于当前环境 ...
3.015625
3
src/tuplenet/lcp/commit_ovs.py
darcy-xiao/TupleNet
1
12782087
<gh_stars>1-10 import sys import json import subprocess import logging import threading import struct, socket import logicalview as lgview from pyDatalog import pyDatalog from onexit import on_parent_exit from run_env import is_gateway_chassis logger = logging.getLogger(__name__) flow_lock = threading.Lock() class OV...
2
2
sc_config/config.py
Scott-Lau/sc-conf
1
12782088
"""Configurations Copyright (c) 2021 <NAME> """ # The MIT License (MIT) # # Copyright (c) 2021. <NAME> # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including ...
2.15625
2
src/main.py
pqtrng/wine
0
12782089
import logging from pathlib import Path import hydra from omegaconf import DictConfig from omegaconf import OmegaConf from src.evaluate import evaluate from src.plot import plot_feature from src.plot import plot_residual from src.train import train logger = logging.getLogger(__name__) @hydra.main(config_path="../c...
2.265625
2
ifirma/yaml_parser.py
pnowosie/firma-api
0
12782090
<filename>ifirma/yaml_parser.py from datetime import date from yaml import load, FullLoader from ifirma.invoice import Invoice, InvoicePosition today = date.today() DEFAULT_EMAIL_MESSAGE = ( f"W załączeniu przesyłam fakturę za {today.year}/{today.month:02}.\nPozdrawiam :)" ) def parse(str): doc = load(str,...
2.578125
3
sidekick-seq/sidekick/seq/iter.py
fabiommendes/sidekick
32
12782091
import itertools import operator from functools import wraps, cached_property from .._utils import safe_repr from ..functions import fn from ..typing import Iterator, Tuple, T, TYPE_CHECKING if TYPE_CHECKING: from .. import api as sk # noqa: F401 NOT_GIVEN = object() _iter = iter class Iter(Iterator[T]): ...
2.78125
3
py-app/productiveware/widgets/main_window.py
productiveware-xhacks/productiveware
0
12782092
import requests import webbrowser from os.path import dirname, exists, join, realpath from typing import List from PySide6.QtCore import QTimer, Qt, Slot from PySide6.QtGui import QIcon from PySide6.QtWidgets import * from win10toast import ToastNotifier from pathlib import Path from productiveware import encryption f...
2.1875
2
arcade_universe/tests/gen_pylab_img.py
caglar/Arcade-Universe
24
12782093
<reponame>caglar/Arcade-Universe<filename>arcade_universe/tests/gen_pylab_img.py #!/usr/bin/env python from web_graphics import gradient, RADIAL, NO_NOISE, get_pixel_intensities from itertools import izip_longest import numpy as np def grouper(n, iterable, fillvalue=None): "grouper(3, 'ABCDEFG', 'x') --> ABC DEF...
2.359375
2
maomew/views.py
gitgitcode/myflask
0
12782094
<filename>maomew/views.py from flask import render_template from flask import login_required from . import app from .util import check_expired @app.route('/use_app') @login_required @check_expired def use_app(): ""
1.820313
2
main.py
pdoro/pytracker
0
12782095
<gh_stars>0 import sys import re import json import csv def load_tracked_products(path): with open(path, 'r') as data_file: data = json.load(data_file) return data def load_historical_data(path): with open(path, 'r') as data_file: return [{k: int(v) for k, v in row.items()} for row in...
2.8125
3
web/apps/mortality/migrations/0001_initial.py
TomaszKaleczyc/PLMoMo
0
12782096
# Generated by Django 3.1 on 2022-02-28 10:11 from django.db import migrations, models class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( name='MortalityFact', fields=[ ('id', models.AutoFi...
1.992188
2
Backend/clear_db.py
nemonanja/furry-ironman
4
12782097
import sqlite3 conn = sqlite3.connect('swp.db') c = conn.cursor() c.execute('DELETE FROM data') c.execute('DELETE FROM api') c.execute("VACUUM") conn.commit() conn.close() print "db cleared"
2.5625
3
iq/filter_bed.py
MelbourneGenomics/iq
0
12782098
<reponame>MelbourneGenomics/iq # remove genes from a bed file # usage filter_bed.py genes_file < exons.bed > filtered.bed import sys def filter_bed(exons, target, genes): exclude = set() for line in genes: exclude.add( line.strip().split()[0].upper() ) sys.stderr.write( '{0} genes selected for ex...
3.25
3
pyhandsontable/core.py
patarapolw/pyhandsontable
10
12782099
from jinja2 import Environment, PackageLoader from threading import Timer import os from collections import OrderedDict from IPython.display import IFrame env = Environment( loader=PackageLoader('pyhandsontable', 'templates') ) def generate_html(data, **kwargs): renderers = kwargs.pop('renderers', dict()) ...
2.46875
2
entity.py
kozbot/kecb
4
12782100
<gh_stars>1-10 from affine import Affine from typing import List from anytree import NodeMixin from config import POLE_OFFSET class Transform: __slots__ = ['origin', 'offset', 'rotation', 'scale'] def __init__(self, origin=(0, 0), offset=(0, 0), rotation=0, scale=1): super().__init__() self.o...
2.3125
2
scripts/get_url_special_encodings.py
Rubix982/Web-Proxy-Golang
0
12782101
<gh_stars>0 import requests as req from bs4 import BeautifulSoup import os res = req.get("https://www.w3schools.com/tags/ref_urlencode.asp") soup = BeautifulSoup(res.text, features='lxml') table_row_parse_tree = soup.findAll('table')[0].findAll('tr')[1:-1] encodings = [] numerical_skip = ['0', '1', '2', '3', '4', '...
2.703125
3
processClubsEmails.py
dhicks6345789/data-tools
0
12782102
<filename>processClubsEmails.py #!/usr/bin/python import os import re import io import sys import pandas import subprocess import dataLib # A function to remove "nan" strings from data - /really/ shouldn't be needed... def noNan(theString): if str(theString) == "nan" or str(theString) == "0": return "" return str(...
2.90625
3
micropython_workshop/projects/project_4_sensor/sensor.py
NetApp-PTC/YWIT-2021
0
12782103
<gh_stars>0 """ This program uses a DHT11 temperature and humidity sensor. It will periodically take measurements and report the values. The information will be printed to the serial connection and optionally to an ss1306 OLED screen. """ import dht from machine import Pin, I2C import ssd1306 import time USE_OLED = T...
3.625
4
service_canary/db/riak_check.py
dbrandt/service_canary
0
12782104
import sys import socket try: import riak except ImportError: print("Riak test requested, but riak library not installed. " "Try 'pip install riak' and try again.") sys.exit(1) def riak_check(config): host = config.get("host", "localhost") port = int(config.get("port", 8087)) def_time...
2.546875
3
accounts/views.py
edumaxsantos/ecommerceedu
0
12782105
from django.shortcuts import render from django.views.generic import CreateView from django.core.urlresolvers import reverse_lazy from .models import User from .forms import UserAdminCreationForm class RegisterView(CreateView): model = User template_name = 'accounts/register.html' form_class = UserAdminCreationFo...
1.742188
2
acmicpc/10987.py
juseongkr/BOJ
7
12782106
l = ['a', 'e', 'i', 'o', 'u'] c = 0 for i in input(): for j in l: if i == j: c += 1 print(c)
3.109375
3
1c. beginner_path_3_How to Think Like a Computer Scientist Learning with Python 3/thinkcs-python3-solutions/Chapter 11/E3.py
codeclubbentleigh/Python
12
12782107
arm = [1, 2, 3] b = arm[:] # b is now [1,2,3] b[0] = 5 # b is now [5,2,3]
3.046875
3
cose/messages/sign1message.py
mpzaborski/pycose
0
12782108
<filename>cose/messages/sign1message.py from typing import Optional, Union, TYPE_CHECKING import cbor2 from cose import CoseMessage from cose.messages import cosemessage, signcommon from cose.keys.ec2 import EC2 from cose.keys.okp import OKP if TYPE_CHECKING: from cose.attributes.algorithms import CoseAlgorithms...
2.125
2
aos_sw_api/enums/snmp_trap_mode.py
KennethSoelberg/AOS-Switch
0
12782109
<filename>aos_sw_api/enums/snmp_trap_mode.py from enum import Enum class SnmpTrapModeEnum(str, Enum): STM_ENABLE = "STM_ENABLE" STM_DISABLE = "STM_DISABLE" STM_NONE = "STM_NONE"
1.953125
2
tests/test_circleci-cli.py
luiscachog/ansible-circleci-cli
0
12782110
<filename>tests/test_circleci-cli.py from __future__ import absolute_import from __future__ import unicode_literals from testinfra.utils.ansible_runner import AnsibleRunner import os import pytest import logging import testinfra.utils.ansible_runner import collections logging.basicConfig(level=logging.DEBUG) # # DEFA...
1.96875
2
skeleton.py
Seanny123/py_bvh
2
12782111
<gh_stars>1-10 # BVHplay is copyright (c) 2008 <NAME>. # # BVHplay is usable as open source software under the terms of version # 3.0 of the Gnu Public License, which is available at # www.gnu.org/licenses/gpl.html # # The author of BVHplay can be reached at <EMAIL> """ AVOIDING OFF-BY-ONE ERRORS: Let N be the total n...
2.078125
2
auto_augment.py
jsiloto/keras_auto_augment
0
12782112
<gh_stars>0 import random import numpy as np import scipy from scipy import ndimage from PIL import Image, ImageEnhance, ImageOps operations = { 'ShearX': lambda img, magnitude: shear_x(img, magnitude), 'ShearY': lambda img, magnitude: shear_y(img, magnitude), 'TranslateX': lambda img, magnitude: translat...
2.171875
2
TPGEgeneration.py
oomlout/oomlout-TPGE
0
12782113
from TPGExml import TPGEgetValueExtra from TPGExml import TPGEgetValue from TPGExml import TPGEgetValueWhere from TPGExml import TPGEgetValueIndex from random import randint import codecs import sys import time from datetime import date,datetime from TPGExml import TPGEgetAllFilesIterate import xml.etree.ElementTree ...
2.453125
2
tests/test_train.py
hadware/pyannote-audio
1
12782114
import pytest from pytorch_lightning import Trainer from pyannote.audio.models.segmentation.debug import SimpleSegmentationModel from pyannote.audio.tasks import ( OverlappedSpeechDetection, Segmentation, VoiceActivityDetection, ) from pyannote.database import FileFinder, get_protocol @pytest.fixture() d...
2.234375
2
play_dodge.py
Dolesaurus/PyDodge
0
12782115
<filename>play_dodge.py # -*- coding: utf-8 -*- """ Description """ from PyQt4 import QtGui, QtCore import sys import pydodge dt = 30 #somehow relate to the rate of spawning class gui(QtGui.QMainWindow): def __init__(self): super().__init__() self.resize(pydodge.WIDTH,pydodge.HEIGH...
2.671875
3
zkstark/quadratic_prover_test.py
kevaundray/research
1,351
12782116
import quadratic_provers as q data = q.eval_across_field([1, 2, 3, 4], 11) qproof = q.mk_quadratic_proof(data, 4, 11) assert q.check_quadratic_proof(data, qproof, 4, 5, 11) data2 = q.eval_across_field(range(36), 97) cproof = q.mk_column_proof(data2, 36, 97) assert q.check_column_proof(data2, cproof, 36, 10, 97)
2.296875
2
anealing/samples/image_search/scripts/model/__init__.py
arkmohba/quantum_computing_memo
0
12782117
from .image_feature import ImageDoubleFeature from .base import Base
1
1
Assignment6/Lab6_Q1_Creating Calculator.py
mjmaisha527/python-projects-cse111
0
12782118
<filename>Assignment6/Lab6_Q1_Creating Calculator.py<gh_stars>0 class Calculator: def __init__(self,value1,operator,value2): self.value1=value1 self.operator=operator self.value2=value2 def add (self): return self.value1+self.value2 def subtract (self): return self.va...
4.125
4
utils.py
jananises/Dwave
3
12782119
<gh_stars>1-10 from collections import defaultdict from tabulate import tabulate import os from dimod import BINARY, INTEGER, sym, ConstrainedQuadraticModel def print_cqm_stats(cqm: ConstrainedQuadraticModel) -> None: """Print some information about the CQM model Args: cqm: a dimod cqm model (dimod....
2.609375
3
ChristmasSocks/src/client/core/consts.py
dsw7/ChristmasSocks
0
12782120
<gh_stars>0 PROJECT_TITLE = '--- ChristmasSocks Remote Server Management Software ---' PANEL_MARGIN = 3
0.96875
1
shot_detector/objects/time/time_float.py
w495/shot_detector
18
12782121
<gh_stars>10-100 # -*- coding: utf8 -*- """ This is part of shot detector. Produced by w495 at 2017.05.04 04:18:27 """ from __future__ import absolute_import, division, print_function import datetime class TimeFloat(float): """ ... """ def td(self): """ :return:...
2.9375
3
sgts/mad_root_distn.py
Tancata/phylo
5
12782122
<reponame>Tancata/phylo import os, sys #use MAD to root a MCMC sample of trees, outputting a sample of rooted trees (for analysis with e.g. RootAnnotator) #python3 combine_treelists.py 300 treelist1 treelist2 treelist3 ... burnin = int(sys.argv[1]) + 1 treelists = sys.argv[2:] outfile = sys.argv[2] + ".combined" final...
2.4375
2
technology/setup_scripts/setup_openram_scn3me_subm.py
kabylkas/OpenRAM
0
12782123
<filename>technology/setup_scripts/setup_openram_scn3me_subm.py #!/usr/bin/python """ This type of setup script should be placed in the setup_scripts directory in the trunk """ import sys import os TECHNOLOGY = "scn3me_subm" ########################## # CDK paths # os.environ["CDK_DIR"] = CDK_DIR #PDK path # os.en...
1.929688
2
wildfire/deps/conll.py
speedcell4/wildfire
0
12782124
from pathlib import Path from typing import NamedTuple __all__ = [ 'CTB5_CHAR_FORMAT', 'CTB5_WORD_FORMAT', 'CTB7_CHAR_FORMAT', 'CTB7_WORD_FORMAT', 'Token', 'CoNLLReader', ] CTB5_WORD_FORMAT = '{ix}\t{form}\t{form}\t{wpos}\t{wpos}_\t{head}\t{drel}' CTB5_CHAR_FORMAT = '{ix}\t{form}\t{form}\t{wpos}\t{cpos}_\...
2.640625
3
asset-transfer/wallet.py
defineapoorv/asset-transfer
0
12782125
<reponame>defineapoorv/asset-transfer import datetime import hashlib import json import pyelliptic import random import requests from node import NodeMixin, BALANCE_URL, FULL_NODE_PORT, TRANSACTION_HISTORY_URL class Client(NodeMixin): __private_key__ = None __public_key__ = None def __init__(self, priv...
2.40625
2
src/spn/algorithms/sklearn.py
QueensGambit/SPFlow
0
12782126
import logging from typing import List import numpy as np import tensorflow as tf try: import tensorflow_probability as tfp distributions = tfp.distributions except: distributions = tf.distributions from sklearn.base import BaseEstimator, ClassifierMixin from sklearn.utils import check_X_y from sklearn.uti...
2.28125
2
productionLine.py
kiiski10/meatGrinder
0
12782127
import pygame, random, time from machine import Machine import utilities from equipment import * from character import Fighter class Section: def __init__(self, pos, prodLine): #self.image = img self.prodLine = prodLine self.tilePos = pos self.machine = None self.neighbors = [] class ProductionLine: def...
2.578125
3
client/game/panel/buttongrp.py
rrsilaya/spaceteam
0
12782128
import tkinter as tk from utils.fonts import _getFont from re import search Y_OFFSET = 220 PANEL_HEIGHT = 127 PANEL_WIDTH = 140 class ButtonGroup: def __init__(self, root, label, id, position, buttons, callback=None): self.id = id self.root = root self.x, self.y = position self.label = label se...
2.40625
2
auth/drivers/root.py
borysvorona/carrier-auth
0
12782129
# Copyright 2020 # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
2.34375
2
technocup/2016/elimination_round_2/b.floors.py
dluschan/olymp
0
12782130
n, m, k = map(int, input().split()) a, b = map(int, input().split()) a -= 1 b -= 1 entrance_time, floor_time, lift_delay, lift_time = 15, 5, 10, 1 entrance_a = a // (m * k) entrance_b = b // (m * k) floor_a = a % (m * k) // k floor_b = b % (m * k) // k time = entrance_time * min(n - abs(entrance_a - entrance_b), abs(en...
2.625
3
pypenumbra/sinogram.py
Brikwerk/pypenumbra
0
12782131
<filename>pypenumbra/sinogram.py """ pypenumbra.sinogram ~~~~~~~~~~~~~~ Defines the logic to enable the construction of a sinogram from a penumbra blob. :copyright: 2019 <NAME> :license: MIT """ import math import numpy as np from skimage.exposure import equalize_adapthist from skimage import i...
3.0625
3
render_all.py
alexandor91/Data-Generation-Tool
22
12782132
""" render_rgb.py renders obj file to rgb image Aviable function: - clear_mash: delete all the mesh in the secene - scene_setting_init: set scene configurations - node_setting_init: set node configurations - render: render rgb image for one obj file and one viewpoint - render_obj_by_vp_lists: wrapper function for rend...
2.421875
2
src/codegen/base_code_gen.py
jwpttcg66/ExcelToTransfer
1
12782133
# -*- coding: utf-8 -*- import os INDENTS = [" " * (i * 4) for i in xrange(10)] class BaseCodeGen(object): def __init__(self, module, module_name, output_path, generator_info): super(BaseCodeGen, self).__init__() self.content = [] self.module = module self.module_name = module_name self.output_path = outp...
2.78125
3
wickedhot/__init__.py
thatch/wickedhot
0
12782134
from wickedhot.one_hot_encoder import OneHotEncoder __version__ = "0.1.6"
1.117188
1
tests/test_graph.py
gerrymandr/graphmaker
0
12782135
<filename>tests/test_graph.py class TestGraph: pass
0.71875
1
src/AoC_2015/d20_elf_visits_counting_generators_factors_and_set_algebra/elf_delivery.py
derailed-dash/Advent-of-Code
9
12782136
<gh_stars>1-10 """ Author: Darren Date: 19/03/2021 Solving https://adventofcode.com/2015/day/20 Infinite elves deliver to infinite houses numbered sequentially. Each elf is assigned a number and a progression. Elf e visits houses eh. E.g. elf 1 visits 1, 2, 3, 4, 5, 6, 7, 8, 9 ... elf 2 visits 2 4 ...
3.203125
3
presentations/20210526_simple_character_recognition/image.py
kevin-kaianalytics/bcgov-python-presentations
5
12782137
'''read ENVI/raw binary format. Dimensions from header, data from .bin file.. ..then segment image using flood-fill segmentation''' import os import sys import pickle import numpy as np from flood import flood import matplotlib.pyplot as plt from dist import normalize, to_list, centroid def read_hdr(hdr): # read th...
3.015625
3
TFile.py
NoOneXXX/magic-wormhole-client
0
12782138
<filename>TFile.py # from src.gui.main_dialog import Ui_MainWindow # from src.gui.main_window import Ui_MainWindow from src.gui.windows_dialog.main_window import Ui_MainWindow from PyQt5.QtWidgets import QApplication, QMainWindow from PyQt5 import QtGui from src.service.wormhole_transfer import transfer_file import twi...
2.171875
2
client_linux/helpers/utils.py
carlosgprado/BrundleFuzz
90
12782139
################################################################## # Utils.py # Client side utilities ################################################################## import platform class Utils(object): def __init__(self, parent): self.parent = parent self.ae = parent.ae self.cfg = par...
2.359375
2
wagtail/admin/viewsets/chooser.py
PaarthAgarwal/wagtail
0
12782140
from django.db.models import ForeignKey from django.urls import path from django.utils.functional import cached_property from django.utils.translation import gettext as _ from wagtail.admin.forms.models import register_form_field_override from wagtail.admin.views.generic import chooser as chooser_views from wagtail.ad...
2.109375
2
tests/apps/orders/views/rest/test_order.py
leonardon473/my-dinner-backend
0
12782141
<filename>tests/apps/orders/views/rest/test_order.py import pytest from freezegun import freeze_time from model_bakery import baker from rest_framework.test import APIClient from apps.users.models import Client, ClientAddress from apps.menu.models import MenuItem, TypeOfCuisine pytestmark = pytest.mark.django_db or...
2.359375
2
addition/addition.py
sowmiya710/squad-repo
0
12782142
<filename>addition/addition.py<gh_stars>0 a=10 b=100 print(a+b)
2.25
2
solutions/ex3_4.py
pycam/python-functions-and-modules
16
12782143
<filename>solutions/ex3_4.py from ex3_3 import gc_content, extract_sub_sequences def gc_content_along_the_chain(dna_sequence, window_size): """Returns a list of GC along the DNA sequence given a DNA sequence and the size of the sliding window """ sub_sequences = extract_sub_sequences(dna_sequence, wind...
3.296875
3
src/media_etl.py
SchootHuang/DSC180B-Coronavirus-Wikipedia
0
12782144
import pandas as pd import zipfile import os def get_media_data(**cfg): '''retrive media dataset''' for url in cfg['URLs']: print(url) infile = os.path.join(cfg['outpath'],url.split('/')[-1]) os.system(cfg['wget_fmt']%(url,infile)) print(infile) with zipfile.ZipFile(infile,...
3.046875
3
core/mongodb.py
naolArega/buchi
0
12782145
import asyncio from decouple import config from motor.motor_asyncio import AsyncIOMotorClient cs = config("MONGODB_CS") client = AsyncIOMotorClient(cs) client.get_io_loop = asyncio.get_running_loop buchi = client.get_database('buchi')
1.820313
2
socialProject/urls.py
sasuke22/socialProject
1
12782146
<reponame>sasuke22/socialProject from django.conf.urls import include, url from django.contrib import admin from account.views import LoginView, AboutView, TermsView, PrivacyView urlpatterns = [ url(r'^admin/', include(admin.site.urls)), url(r'^i18n/', include('django.conf.urls.i18n')), url(r'^$', LoginVi...
1.882813
2
graph.py
blimmo/tfp
0
12782147
<filename>graph.py import itertools import random from collections import defaultdict from copy import deepcopy from common import twos class Graph: def __init__(self, ln): self.ln = ln self.n = n = 2 ** ln self.v = v = frozenset(range(n)) self.e = frozenset(itertools.combinations...
3.3125
3
day1.py
stefan-bordei/AOC2021
0
12782148
<reponame>stefan-bordei/AOC2021<gh_stars>0 with open("./data/day1.txt", "r") as scan_results: contents = [int(x) for x in scan_results] # Part 1 count_part1 = 0 for i in range(len(contents)): if contents[i-1] < contents[i]: count_part1 += 1 print(f'Part1: {coun...
2.984375
3
Exercise02/2-21.py
ywyz/IntroducingToProgrammingUsingPython
0
12782149
''' @Date: 2019-07-10 17:12:59 @Author: ywyz @LastModifiedBy: ywyz @Github: https://github.com/ywyz @LastEditors: ywyz @LastEditTime: 2019-07-10 18:05:17 ''' monthlySavingAmount = eval(input("Enter the monthly saving amount: ")) firstMonth = monthlySavingAmount * (1 + 0.00417) secondMonth = (firstMonth + monthlySavingA...
3.640625
4
echelon.py
jnurmine/tmux-echelon
1
12782150
<gh_stars>1-10 #!/usr/bin/python # -*- coding: iso-8859-15 -*- # (C) 2018 <NAME> <<EMAIL>> # # Echelon adds logic to your tmux panes # import subprocess import sys from pexpect import fdpexpect class TmuxInfo: def __init__(self, session=None, window=None, pane=None): self.session = session self.wi...
2.375
2