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
api_utils.py
zhongerqiandan/OpenDialog
98
12764651
from header import * from models import * def parse_msg(request): data = request.data.decode() xml = ET.fromstring(data) toUser = xml.find('ToUserName').text fromUser = xml.find('FromUserName').text msgType = xml.find('MsgType').text content = xml.find('Content').text return toUser, fromUse...
2.375
2
Open CV/Scanning-Document-Adaptive-Thresholding-OpenCV/Adaptiveopencv.py
Storiesbyharshit/Data-Science-Portfolio
16
12764652
<filename>Open CV/Scanning-Document-Adaptive-Thresholding-OpenCV/Adaptiveopencv.py import cv2 import numpy as np image = cv2.imread('images/Origin_of_Species.jpg', 0) cv2.imshow('Original', image) cv2.waitKey(0) ret,thresh1 = cv2.threshold(image, 127, 255, cv2.THRESH_BINARY) cv2.imshow('Threshold Binar...
3.328125
3
papers/CS-F-LTR/src/gcl_semi.py
mindspore-ai/contrib
2
12764653
"""[summary] """ import os import numpy as np import tensorflow as tf from src.utils import evaluation from src.draw import draw class GCLSemi: """[summary] """ def __init__(self, train_relevance_labels, train_features, test_relevance_labels, test_features, test_query_ids, train_features...
2.421875
2
mopidy_plex/settings.py
risiko79/mopidy_plex
1
12764654
<filename>mopidy_plex/settings.py settings = {} settings['version'] = "0.1" settings['port'] = 36000 settings['product'] = "MOPIDY-PLEX" settings['debug_registration'] = False settings['debug_httpd'] = False settings['host'] = "" settings['token'] = None
1.234375
1
doggunk.py
David-OC/dancingdog
0
12764655
# -*- coding: utf-8 -*- import curses dogdance1=[[ ' ▄','▄','▄', #3 '▄▄▄▄','▄','▄', #6 '▄'],[' ',' ', #9 ' ', '▄','▄'],#12 [' ',' ' , '▄',#15 ' ','▄',' ',#18 '▄▄', '▄▄ '],[ ' ',#21 ' ','▄',' ',#24 ' ','▄',' ',#27 '▄', ' ','▄▄▄▄▄▄',#30 '▄'],[' ',' ',#33 '▄▄▄▄',' ',' ',#36 '▀'],[' '...
2.484375
2
manager/views/calculatecommissions.py
odrolliv13/Hex-Photos
0
12764656
<gh_stars>0 from django import forms from django.conf import settings from django.http import HttpResponse, HttpResponseRedirect, Http404 from django.db.models import Q from manager import models as pmod import decimal, datetime from . import templater # This view calculates the commissions and later displays ...
2.09375
2
pyppeteer/models/_protocol.py
bionic-program/pyppeteer2
0
12764657
import sys from typing import TYPE_CHECKING, Any, Dict, List, Union if sys.version_info < (3, 8): from typing_extensions import Literal, TypedDict else: from typing import Literal, TypedDict """ Automatically generated by ./utils/generate_protocol_types.py Attention! This file should *not* be modified directl...
2.0625
2
lib/python2.7/site-packages/pyscope/config.py
leschzinerlab/myami-3.2-freeHand
0
12764658
#!/usr/bin/env python import sys import ConfigParser import imp import os import inspect import pyscope import pyscope.tem import pyscope.ccdcamera import pyami.fileutil configured = {} temclasses = None cameraclasses = None configfiles = None def parse(): global configured, temclasses, cameraclasses, configfiles ...
2.546875
3
providers/result.py
skomendera/PyMyTools
5
12764659
from collections import OrderedDict from providers import value, terminal def result_format(database_result, fmt): format_function = 'result_format_%s' % fmt if format_function not in globals(): raise Exception('Unsupported format "%s"' % fmt) return globals()[format_function](database_result)...
3
3
If_Instructions/testes_condicionais.py
Brunokrk/Learning-Python
0
12764660
# = atribuição, == comparação car='panamera' print(car=='panamera') car='audi' print(car=='panamera')
3.453125
3
pypy/interpreter/pyparser/parser.py
nanjekyejoannah/pypy
333
12764661
""" A CPython inspired RPython parser. """ from rpython.rlib.objectmodel import not_rpython class Grammar(object): """ Base Grammar object. Pass this to ParserGenerator.build_grammar to fill it with useful values for the Parser. """ def __init__(self): self.symbol_ids = {} se...
2.671875
3
test_summarize.py
axenov/BERT-Summarization-for-OpenNMT
5
12764662
<gh_stars>1-10 #!/usr/bin/env python # -*- coding: utf-8 -*- from summarizer import AbstractiveSummarizer if __name__ == "__main__": FILE_NAME = "sample_de.txt" texts = [] with open("data/"+FILE_NAME) as f: for text in f: texts.append(text) model = AbstractiveSummarizer(language = 'de', method = 'bert', ext...
3.109375
3
protocol_builder/writer.py
numaru/iofus
5
12764663
<reponame>numaru/iofus<filename>protocol_builder/writer.py import re class ClassWriter: HEADER = [] REPLACEMENTS = [ (r'this', "self"), (r'(null|NaN)', "None"), (r'(?:;|{|})', ""), (r'\s*\|\|\s*', " or "), (r'\s*&&\s*', " and "), (r'([\w\d_.]+).length', lambda x:...
2.65625
3
torchrecipes/vision/core/optim/lr_scheduler.py
colin2328/recipes
161
12764664
<reponame>colin2328/recipes #!/usr/bin/env python3 from typing import Union import torch from torch.optim.lr_scheduler import CosineAnnealingLR, LinearLR, SequentialLR class CosineWithWarmup(SequentialLR): r"""Cosine Decay Learning Rate Scheduler with Linear Warmup. Args: optimizer (Optimizer): Wrap...
2.40625
2
Reading/DistractionTask_serial_d7.py
djangraw/PsychoPyParadigms
50
12764665
#!/usr/bin/env python2 """Display multi-page text with simultaneous auditory distractions, recording eye position data using the SMI eye tracker.""" # DistractionTask_serial_d6.py # Created 3/16/15 by DJ based on VidLecTask.py # Updated 3/31/15 by DJ - renamed from ReadingTask_dict_d2.py. # Updated 4/1-16/15 by DJ - in...
2.203125
2
1_code/answer_response/confirmation_utils.py
jaimiles23/Multiplication_Medley
0
12764666
<filename>1_code/answer_response/confirmation_utils.py<gh_stars>0 """/** * @author [<NAME>] * @email [<EMAIL>] * @create date 2020-05-06 11:34:51 * @modify date 2020-05-06 17:48:56 * @desc [ Utility class for confirmation methods. Methods for: - get confirmation - get player confirmation ...
2.640625
3
ezgoogleapi/__init__.py
rrwielema/ezgoogleapi
0
12764667
from ezgoogleapi.analytics.body import Body from ezgoogleapi.analytics.daterange import (TODAY, YESTERDAY, LAST_WEEK, LAST_7_DAYS, THIS_MONT...
1.40625
1
tkinter_project/tkinter_basic/2_button.py
bbjoite09/PythonProject
1
12764668
<reponame>bbjoite09/PythonProject from tkinter import * root = Tk() root.title("Yeonii GUI") # GUI 지정 # 버튼 추가 btn1 = Button(root, text="버튼1") btn1.pack() # pad -> 버튼 내용(text) 제외하고 여백을 5, 10으로 지정함 btn2 = Button(root, padx=5, pady=10, text="버튼2") btn2.pack() btn3 = Button(root, padx=10, pady=5, text="버튼3") btn3.pack...
2.796875
3
config/presets/Modes/Python/T - Bits V/main.py
The-XOR/EYESY_OS
18
12764669
import os import pygame import random trigger = False x = 0 y = 0 height = 720 width = 1340 linelength = 50 lineAmt = 20 displace = 10 ypos = [random.randrange(-200,720) for i in range(0, lineAmt + 2)] ypos1 = [(ypos[i]+displace) for i in range(0, lineAmt + 2)] xr = 360 yr = 240 def setup(screen, etc): global trigge...
2.953125
3
python2.7/site-packages/twisted/names/hosts.py
84KaliPleXon3/sslstrip-hsts-openwrt
19
12764670
<reponame>84KaliPleXon3/sslstrip-hsts-openwrt # Copyright (c) 2001-2004 Twisted Matrix Laboratories. # See LICENSE for details. from twisted.names import dns from twisted.persisted import styles from twisted.python import failure from twisted.internet import defer from twisted.names import common def searchFileFor(...
2.171875
2
homeassistant/components/nws/__init__.py
marioedani/homeassistant-core
1
12764671
<reponame>marioedani/homeassistant-core<filename>homeassistant/components/nws/__init__.py """The National Weather Service integration.""" import asyncio import datetime import logging from pynws import SimpleNWS import voluptuous as vol from homeassistant.config_entries import ConfigEntry from homeassistant.const imp...
2.328125
2
appodeal/__init__.py
PoradaKev/appodeal_py
0
12764672
import json import pandas as pd import requests from datetime import datetime from io import StringIO from furl import furl from tqdm import tqdm from time import sleep class Appodeal: DEFAULT_ENDPOINT = "https://api-services.appodeal.com/api/v2/stats_api?/" TASK_ENDPOINT = "https://api-services.appodeal.c...
2.328125
2
Python/gregorian_leap_year.py
paurav11/HackerRank
1
12764673
<gh_stars>1-10 def is_leap(year): if year >= 1900 and year <= pow(10,5): leap = False if year%4 == 0: if year%100 == 0: if year%400 == 0: leap = True else: leap = False else: leap = True ...
4
4
terrascript/pagerduty/__init__.py
GarnerCorp/python-terrascript
0
12764674
"""2019-05-28 10:50:16"""
0.636719
1
TeensyLogger.py
anabrid/TeensyLogger
2
12764675
<filename>TeensyLogger.py #!/usr/bin/env python3 """ This is some exemplaric code how to aquire ADC data with the TeensyLogger and python on the USB host computer. It was tested with Linux, Python3 and PySerial (https://pythonhosted.org/pyserial/). Copyright (c) 2021 Anabrid GmbH, MIT Licensed, see LICENSE file. """...
2.5
2
tools/build_defs/docker/bundle.bzl
timm-gs/bazel
17
12764676
<reponame>timm-gs/bazel<gh_stars>10-100 # Copyright 2017 The Bazel Authors. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-...
1.867188
2
oscar/lib/python2.7/site-packages/txclib/paths.py
sainjusajan/django-oscar
0
12764677
# -*- coding: utf-8 -*- """ Path handling. We need to take into account the differences between UNIX systems and Windows. """ import os posix_sep = os.sep if os.altsep is None else os.altsep def posix_path(fpath): """Convert a filesystem path to a posix path. Always use the forward sla...
3.15625
3
django_simple_forum/migrations/0001_initial.py
ShinodaII/AshramForum
2
12764678
<gh_stars>1-10 from __future__ import unicode_literals from django.conf import settings from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ ('contenttypes', '0002_remove_content_type_name'), migrati...
1.820313
2
templates/__init__.py
mpiannucci/MapGetter
0
12764679
from web.template import CompiledTemplate, ForLoop, TemplateResult # coding: utf-8 def base (page): __lineoffset__ = -4 loop = ForLoop() self = TemplateResult(); extend_ = self.extend extend_([u'\n']) extend_([u'<html>\n']) extend_([u'<head>\n']) extend_([u' <meta name="viewport" conten...
1.953125
2
crabageprediction/venv/Lib/site-packages/mpl_toolkits/axes_grid/angle_helper.py
13rianlucero/CrabAgePrediction
603
12764680
<reponame>13rianlucero/CrabAgePrediction from mpl_toolkits.axisartist.angle_helper import *
1.101563
1
gseapy/plot.py
jacobkimmel/GSEApy
0
12764681
# -*- coding: utf-8 -*- import numpy as np import logging, sys, operator from matplotlib.colors import Normalize from matplotlib.backends.backend_agg import FigureCanvasAgg as FigureCanvas from matplotlib.figure import Figure from matplotlib.ticker import MaxNLocator from mpl_toolkits.axes_grid1 import make_axes_loca...
2.5625
3
lib/buildcommon.py
wgsyd/SCMReplication
2
12764682
'''some useful functions ''' import contextlib import os import shutil def generate_file_hash(filename): '''generate hash of contents of file @param filename [in] name of file to hash ''' import hashlib hasher = hashlib.sha256() blocksize = 65536 with open(filename, 'rb') as fo: ...
2.828125
3
tests/load/test_load_case.py
mhkc/scout
111
12764683
def test_load_case(case_obj, adapter): ## GIVEN a database with no cases assert adapter.case_collection.find_one() is None ## WHEN loading a case adapter._add_case(case_obj) ## THEN assert that the case have been loaded with correct info assert adapter.case_collection.find_one() def test_lo...
2.375
2
mes1052.py
SricardoSdSouza/LogicaDeProgramacao
0
12764684
<gh_stars>0 ''' Leia um valor inteiro entre 1 e 12, inclusive. Correspondente a este valor, deve ser apresentado como resposta o mês do ano por extenso, em inglês, com a primeira letra maiúscula. Entrada = A entrada contém um único valor inteiro. Saída = Imprima por extenso o nome do mês correspondente ao número exist...
3.765625
4
service/tests/fixtures/sword.py
tuub/jper-sword-out
0
12764685
<reponame>tuub/jper-sword-out<gh_stars>0 """ Fixtures for testing sword features """ from copy import deepcopy class SwordFactory(object): """ Class which provides access to the various fixtures used for testing the sword features """ @classmethod def repository_status(cls): """ Ex...
2.5
2
erikutils/xkeckhelio.py
eteq/erikutils
1
12764686
#This is a direct port of x_keckhelio.pro from XIDL from __future__ import division, print_function from math import pi from numpy import cos, sin import numpy as np def x_keckhelio(ra, dec, epoch=2000.0, jd=None, tai=None, longitude=None, latitude=None, altitude=None, obs='keck'): """ `ra` an...
2.578125
3
graph.py
RemainAplomb/Basic-Data-Structure-Training-using-Python-Tkinter
1
12764687
<reponame>RemainAplomb/Basic-Data-Structure-Training-using-Python-Tkinter class graph1: def __init__(self): self.graph1 = { 1 : [ 2 , 3 ] , 2 : [ 4 ] , 3 : [ 6 ] , 4 : [ 5 ] , 5 : [ 2 ] , ...
3.59375
4
ozone-framework-python-server/migration_owf/export.py
aamduka/ozone
6
12764688
import loader from migration_tool.adapters.mssql import MSSQLAdapter from migration_tool.adapters.mysql import MySQLAdapter from migration_tool.adapters.postgres import PostgresAdapter from migration_tool.adapters.oracle import OracleAdapter from migration_tool.sql2json import SQLtoJSON if __name__ == '__main__': ...
1.867188
2
tests/examples/minlplib/arki0003.py
ouyang-w-19/decogo
2
12764689
# NLP written by GAMS Convert at 04/21/18 13:50:54 # # Equation counts # Total E G L N X C B # 2583 450 31 2102 0 0 0 0 # # Variable counts # x b i s1s s2s sc ...
1.640625
2
scripts/create_testcase.py
Mohit1295/anycore-riscv-tests
0
12764690
<filename>scripts/create_testcase.py #!/usr/bin/python from optparse import OptionParser import csv import os import sys import re def test_list_to_testcases(test_list, bmark_bin_prefix): testcases = '' for test in test_list: #Prefix the path name to the first element of the testcase testcases...
2.84375
3
masks.py
chrisnbattista/multi-agent-kinetics
1
12764691
<gh_stars>1-10 def threshold_distance_mask(r, h): return r < h
1.507813
2
migrator/wix-bazel-migrator/src/main/resources/import_external.bzl
or-shachar/exodus
186
12764692
load("@bazel_tools//tools/build_defs/repo:jvm.bzl", "jvm_maven_import_external") _default_server_urls = ["https://repo.maven.apache.org/maven2/", "https://mvnrepository.com/artifact", "https://maven-central.storage.googleapis.com", "http://gitblit...
1.585938
2
utils/processors/waifu2x_chainer/processor.py
ArchieMeng/anime2x-chainer
12
12764693
import argparse import importlib.util import os import sys import chainer import numpy as np import six from PIL import Image from ..params import ProcessParams from ..simple import BaseProcessor PROJECT_DIR = os.path.dirname(__file__) waifu2x_path = os.path.join(PROJECT_DIR, "waifu2x-chainer") def import_waifu2x_...
2.1875
2
train_branches.py
Bhaskers-Blu-Org2/dcase-2019
8
12764694
import argparse from datetime import datetime import gc import joblib from poutyne.framework import Model from poutyne.framework.callbacks import * from tensorboardX import SummaryWriter import torch import torch.nn as nn import torch.nn.functional as F from torch.utils.data import DataLoader from load_dataset imp...
1.96875
2
setup.py
dyershov/pypile
0
12764695
<reponame>dyershov/pypile #!/usr/bin/env python import setuptools with open("README.md", "r") as fh: long_description = fh.read() package_dir={'': 'src'} packages = setuptools.find_packages(where='src') install_requires = [ 'numpy', 'scipy', 'ipython', 'jupyter', 'interactive-plotter @ git+...
1.664063
2
src/comp_chem_utils/mysql_tables.py
lcbc-epfl/comp_chem_py
0
12764696
<filename>src/comp_chem_utils/mysql_tables.py #!/usr/bin/env python """ Definitions of classes to work with molecular data. The mol_info_table class is used to store and manipulated information about a molecule. The mol_xyz_table class is used to store and manipulated the xyz coodinate of a molecule. The functions ...
3.59375
4
libs/datagen/.ipynb_checkpoints/dataset_generic-checkpoint.py
vankhoa21991/selfsup
1
12764697
from __future__ import print_function, division import os import torch import numpy as np import pandas as pd import math import re import pdb import pickle from scipy import stats from torch.utils.data import Dataset import h5py from libs.utils.utils import generate_split, nth def save_splits(split_datasets, colu...
2.296875
2
pytorch/reg_losses.py
mseitzer/neurips2019-disentanglement-challenge
8
12764698
import math import gin import torch from torch import nn @gin.configurable class RegularizationLoss(nn.Module): def __init__(self, latent_dims, scale_by_batch=True, use_bayes_factor_vae0_loss=False, use_tc_loss=False): supe...
2.5625
3
catsup/reader/html.py
whtsky/catsup-docs-zh
0
12764699
from catsup.models import Post from catsup.utils import to_unicode, ObjectDict from catsup.reader.utils import split_content, parse_yaml_meta def html_reader(path): meta, content = split_content(path) if not meta: meta = ObjectDict() else: meta = parse_yaml_meta(meta, path) return Post...
2.296875
2
automate-package-list-update.py
ZaphodElevated/electric-packages
1
12764700
import json import os os.chdir(r'C:\Users\xtrem\Desktop\electric\Electric Packages\packages') packages = [ f.replace('.json', '') for f in os.listdir(r'C:\Users\xtrem\Desktop\electric\Electric Packages\packages') ] print(packages) data = { 'packages': packages, } with open(r'C:\Users\xtrem\Desktop\electric\Electr...
2.171875
2
Face Attendance/data_preparation.py
dipesh-commits/ML_Materials
1
12764701
import numpy as np import matplotlib.pyplot as plt import cv2 import os from PIL import Image from mtcnn.mtcnn import MTCNN train_dir = 'data/train' valid_dir = 'data/val' face_detector = MTCNN() # for i in os.listdir(train_dir): # print(i) # my_img = 'data/train/madonna/httpiamediaimdbcomimagesMMVBMTANDQNTAxN...
2.828125
3
rbtools/tests.py
brettdh/rbtools
0
12764702
<reponame>brettdh/rbtools<gh_stars>0 class OptionsStub(object): def __init__(self): self.debug = True self.guess_summary = False self.guess_description = False self.tracking = None self.username = None self.password = <PASSWORD> self.repository_url = None ...
1.773438
2
code/default/python27/1.0/lib/noarch/utils.py
wuyongwen/XX-Net
0
12764703
#!/usr/bin/env python # -*- coding: utf-8 -*- import re import os import threading g_ip_check = re.compile(r'^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$') def check_ip_valid4(ip): """检查ipv4地址的合法性""" ret = g_ip_check.match(ip) if ret is not None: "each item range: [0,255]" for item in re...
3.40625
3
backend/api/migrations/0106_add_fuel_classes.py
amichard/tfrs
18
12764704
from django.db import migrations from django.db.migrations import RunPython def add_fuel_classes(apps, schema_editor): """ Creates the fuel classes: Gasoline and Diesel """ db_alias = schema_editor.connection.alias fuel_class = apps.get_model('api', 'FuelClass') fuel_class.objects.using(db_a...
2.078125
2
PosteMeO/posts/models.py
sjkdm0/LearningDjangoReact
0
12764705
from django.db import models from django.contrib.auth.models import User class PostLike(models.Model): post = models.ForeignKey("Post", on_delete=models.CASCADE) user = models.ForeignKey(User, on_delete=models.CASCADE) timestamp = models.DateTimeField(auto_now_add=True) class Post(models.Model): tit...
2.34375
2
src/apps/inventories/admin.py
Remy-TPP/q-api
0
12764706
from django.contrib import admin from apps.inventories.models import Place @admin.register(Place) class PlaceAdmin(admin.ModelAdmin): list_display = ('pk', 'name', 'all_members') ordering = ('pk',) def all_members(self, obj): return '\n'.join([str(member) for member in obj.members.all().distinct...
2.265625
2
dbus_curio/__init__.py
hugosenari/dbus_curio
0
12764707
from .auth import auth from .connection import system_bus, session_bus __all__ = [auth, system_bus, session_bus] __author__ = """<NAME>""" __email__ = '<EMAIL>' __version__ = '0.1.0'
1.335938
1
tests/validators/test_genomic_substitution.py
cancervariants/varlex
0
12764708
<reponame>cancervariants/varlex """Module for testing Genomic Substitution Validator.""" import unittest from variation.validators import GenomicSubstitution from variation.classifiers import GenomicSubstitutionClassifier from .validator_base import ValidatorBase class TestGenomicSubstitutionValidator(ValidatorBase,...
2.46875
2
s3_log_query/S3LogQuery.py
mikethoun/s3-log-query
0
12764709
import logging import boto3 import re import pandas as pd import concurrent.futures from itertools import repeat from typing import Dict, List, Union from datetime import datetime from dateutil.parser import parse __author__ = "mikethoun" __copyright__ = "mikethoun" __license__ = "apache license 2.0" class LogQuery:...
2.640625
3
TTLin_SingleRead.py
cnourshargh/Bham-ARTIQ-examples
8
12764710
<gh_stars>1-10 from artiq.experiment import * #imports everything from artiq experiment library #This code takes a single read from TTL0 and prints the voltage class TTL_Input_Read(EnvExperiment): """TTL Input Read""" def build(self): #This code runs on the host device self.setattr_...
2.84375
3
profiles_api/urls.py
aman162000/rest-api
0
12764711
from django.urls import path from .views import HelloApiView urlpatterns = [ path('hello/',HelloApiView.as_view()) ]
1.609375
2
cngi/vis/ddijoin.py
wxiongccnu1990/cngi_prototype
0
12764712
<filename>cngi/vis/ddijoin.py # Copyright 2019 AUI, Inc. Washington DC, USA # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # ...
1.875
2
config/product/product_config.py
Eastwu5788/Heron
7
12764713
""" 生产环境的配置文件 配置内容: 1. MySQL 2. Redis 3. Memcached 4. Other """ from config.base.base_config import BaseConfig class ProductConfig(BaseConfig): @staticmethod def init_app(app): pass
2.28125
2
video_only/pl_trainer.py
bennzo/deep_avsr
0
12764714
import time import os import glob import gc import numpy as np import torch import torch.optim as optim import torch.nn as nn import pytorch_lightning as pl import pytorch_lightning.loggers as pl_loggers import pytorch_lightning.callbacks as pl_callbacks from torch.utils.data import DataLoader from config_modified im...
1.992188
2
452_Minimum-Number-of-Arrows-to-Burst-Balloons.py
Coalin/Daily-LeetCode-Exercise
3
12764715
<reponame>Coalin/Daily-LeetCode-Exercise # Attempt I: 贪心的思路,方法错。维护一个静态dict不能保证每次remove后余下的序列仍保持有序。 # class Solution: # def findMinArrowShots(self, points): # """ # :type points: List[List[int]] # :rtype: int # """ # left = 10000 # right = -10000 # for i in ra...
3.296875
3
py-polars/polars/internals/construction.py
mahadeveaswar/polars
0
12764716
<reponame>mahadeveaswar/polars import warnings from datetime import date, datetime, timedelta from itertools import zip_longest from typing import ( TYPE_CHECKING, Any, Dict, Iterable, List, Optional, Sequence, Tuple, Type, Union, ) import numpy as np from polars import interna...
2.1875
2
notebooks/parallelcluster/pcluster_athena.py
curtisdarst/aws-research-workshops
3
12764717
<filename>notebooks/parallelcluster/pcluster_athena.py #!/usr/bin/python # # Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. # # 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...
1.296875
1
j2lint/__init__.py
KonikaChaurasiya-GSLab/j2lint
9
12764718
"""__init__.py - A command-line utility that checks for best practices in Jinja2. """ NAME = 'j2lint' VERSION = '0.1' DESCRIPTION = __doc__ __author__ = "<NAME>" __license__ = "MIT" __version__ = VERSION
1.210938
1
lib/train/__init__.py
ishine/TextNormSeq2Seq
36
12764719
<gh_stars>10-100 from .optim import Optim from .trainer import Trainer from .evaluator import Evaluator
0.929688
1
src/data/rnn_dataset.py
ildarlomov/dlcourseproject
0
12764720
from __future__ import print_function, division import os import torch import pandas as pd from skimage import io, transform import numpy as np import matplotlib.pyplot as plt from torch.utils.data import Dataset, DataLoader from torchvision import transforms, utils from src.data.baseline_transformers import Transforms...
2.28125
2
week03/week03.py
ptanh2k/int3404
0
12764721
""" Name: <NAME> Class: K63K2 MSSV: 18020116 You should understand the code you write. """ import numpy as np import cv2 import argparse from matplotlib import pyplot as plt def q_0(input_file, output_file, ): img = cv2.imread(input_file, cv2.IMREAD_COLOR) cv2.imshow('Test img', img) cv2.waitKey(5000) ...
2.765625
3
pepper.py
Retr0680/Spotify-player
3
12764722
<reponame>Retr0680/Spotify-player from spotipy import Spotify class InvalidSearchError(Exception): pass def get_album_uri(spotify: Spotify, name: str) -> str: """ :param spotify: Spotify object to make the search from :param name: album name :return: Spotify uri of the desired album """ ...
3.484375
3
lis.py
carlb15/Python
2
12764723
def binary_search(S, left, right, key): # Find smallest element that's >= key while left <= right: # find midpoint mid = left + (right - left) // 2 # if element found move lower. if S[mid] >= key: right = mid - 1 else: left = mid + 1 # smallest...
3.984375
4
src/dimsm/process.py
ihmeuw-msca/dimsm
0
12764724
<gh_stars>0 """ Process ======= Process class that contains the process matrix and its (co)variance matrix. """ from functools import partial from operator import attrgetter from typing import Callable, Optional, Tuple import numpy as np from scipy.sparse import block_diag, csr_matrix, diags from dimsm.dimension imp...
2.671875
3
redis-monitor/plugins/stats_monitor.py
j3k00/scrapy-cluster
1,108
12764725
from __future__ import absolute_import from .kafka_base_monitor import KafkaBaseMonitor class StatsMonitor(KafkaBaseMonitor): regex = "statsrequest:*:*" def setup(self, settings): ''' Setup kafka ''' KafkaBaseMonitor.setup(self, settings) def handle(self, key, value): ...
2.265625
2
thingsboard_gateway/things/meter/gb_meter_protocol.py
jaysonjh/thingsboard-gateway
0
12764726
import sys from thingsboard_gateway.tb_utility.tb_data_utility import uchar_checksum from thingsboard_gateway.things.meter.meter_protocols import MeterProtocol from abc import ABC, abstractmethod class CJT188Protocol(MeterProtocol, ABC): """ 国标GB-CJ/T188协议 """ # 协议头标识 frame_head = 0x68 # 协议尾标识...
2.421875
2
polyglotdb/query/lexicon/__init__.py
msonderegger/PolyglotDB
25
12764727
from .query import LexiconQuery from .attributes import LexiconNode
1.109375
1
nuke_stubs/nuke/nuke_internal/colorspaces.py
sisoe24/Nuke-Python-Stubs
1
12764728
<filename>nuke_stubs/nuke/nuke_internal/colorspaces.py """ A collection of tools and functions to help manage LUTs and color configuration """ from _nuke_color import * # bring the libnuke PythonAPI for color into scope from . import callbacks import types import nuke_internal as nuke defaultLUTMappers = {} # dictiona...
2.015625
2
t35.py
showerhhh/leetcode_python
0
12764729
<gh_stars>0 class Solution: def searchInsert(self, nums, target: int) -> int: """ 二分法查找,若目标不存在,则返回它将会被按顺序插入的位置。 """ low = 0 high = len(nums) - 1 while low <= high: mid = int((low + high) / 2) if target == nums[mid]: return mid ...
3.671875
4
venv/Lib/site-packages/keystoneauth1/extras/oauth1/_loading.py
prasoon-uta/IBM-coud-storage
48
12764730
<gh_stars>10-100 # 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, software # di...
1.882813
2
echopype/process/ek80.py
lsetiawan/echopype
0
12764731
""" echopype data model inherited from based class Process for EK80 data. """ import os import datetime as dt import numpy as np import xarray as xr from scipy import signal from ..utils import uwa from .processbase import ProcessBase class ProcessEK80(ProcessBase): """Class for manipulating EK80 echo data alrea...
2.421875
2
devip/__main__.py
jorgebg/devip
0
12764732
<reponame>jorgebg/devip import click from devip import get_ip_addresses @click.command() @click.option('--all', '-a', is_flag=True, help='List all IP addresses.') @click.option('--reverse', '-r', is_flag=True, help='List in reverse order.') @click.option('--loopback', '-l', is_flag=True, help='Include loopback.') def...
3.0625
3
tma.py
gtolias/tma
21
12764733
<filename>tma.py import math, numbers, pdb import numpy as np from skimage import filters from PIL import Image import torch from torch import nn import torch.optim as optim from torch.nn import functional as F from cirtorch.layers.functional import mac, spoc, gem, rmac from utils import reproduce POOLING = {'mac' ...
2.15625
2
plot-a-frame.py
nobody48sheldor/fractales
0
12764734
<gh_stars>0 import matplotlib.pyplot as plt import numpy as np from matplotlib import style from matplotlib import cm from matplotlib.backend_bases import MouseButton import os style.use('dark_background') def clicked(event): if event.button is MouseButton.LEFT: x, y = event.xdata, event.ydata pri...
2.875
3
setup.py
emulbreh/bikeshed
2
12764735
# -*- coding: utf-8 -*- from setuptools import setup, find_packages with open('README.rst') as f: description = f.read() setup( name='bikeshed', version='0.1.0', packages=find_packages(), license=u'BSD 3-Clause License', long_description=description, include_package_data=True, install...
1.132813
1
mava/systems/tf/mad4pg/builder.py
mlanas/Mava
0
12764736
<gh_stars>0 # python3 # Copyright 2021 InstaDeep Ltd. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requir...
2.046875
2
test/test_contact_info.py
ilyaYarosh88/barancev_python_training
0
12764737
from model.contact import Contact from random import randrange import re def test_contact_info_on_main_page(app): if app.contact.count() == 0: app.contact.add_contact( Contact(firstname="Ivan", middlename="Sergeevich", lastname="Petrov", nickname="Butthead", title="test", c...
2.46875
2
src/classification/crime_classification_knn.py
sakdag/crime-data-analysis
0
12764738
<gh_stars>0 import numpy as np import pandas as pd from sklearn.neighbors import KNeighborsClassifier from sklearn.preprocessing import LabelEncoder import src.config.config as conf import src.preprocessing.crime_preprocessor as crime_prep import src.utils.classification_reporter as reporter import src.config.column_n...
2.75
3
pseas/runnable/produce_gridsearch_step1.py
Theomat/MPSEAS
0
12764739
""" Run this script with -h for the help. It produces for each method for a given dataset all the data needed to compare the methods on the specified dataset. The strategies being compared are defined after line 88. """ from concurrent.futures import wait, ALL_COMPLETED from concurrent.futures.process import ProcessPo...
2.5625
3
Chapter06/Generate Keys.py
delgadoa1/Python-For-Offensive-Pentest
62
12764740
# Python For Offensive PenTest # Download Pycrypto for Windows - pycrypto 2.6 for win32 py 2.7 # http://www.voidspace.org.uk/python/modules.shtml#pycrypto # Download Pycrypto source # https://pypi.python.org/pypi/pycrypto # For Kali, after extract the tar file, invoke "python setup.py install" # Generate Keys from ...
2.296875
2
app/run.py
DanielDaCosta/disaster-webapp
6
12764741
import json import plotly import pandas as pd import re from nltk.stem import WordNetLemmatizer from nltk.tokenize import word_tokenize from nltk.corpus import stopwords from flask import Flask from flask import render_template, request, jsonify from plotly.graph_objs import Bar from sklearn.externals import joblib f...
2.765625
3
src/store.py
YTCdev/yangubot
0
12764742
<filename>src/store.py from woocommerce import API class Store: def __init__(self, url, key, secret): self.wcapi = API( url=url, consumer_key=key, consumer_secret=secret, wp_api=True, version="wc/v3" ) def get_order(self, order_id): ...
2.28125
2
lindenmayer.py
josephnavarro/l-system-drawing
1
12764743
#!/usr/bin/env python # # <NAME> # # This is a test of a Lindenmayer grammar that generates # rather realistic-looking plant shrubbery. You can go to # http://en.wikipedia.org/wiki/L-system for more information. # This script requires the python-pygame dependency. # # Licensed under the MIT License. import pygame, sys...
3.40625
3
graph/ExperimentIterator.py
Draeius/loopwalk_kernel
0
12764744
<filename>graph/ExperimentIterator.py<gh_stars>0 from typing import Dict, List from grakel import Graph from graph.LabelConverter import LabelConverter from graph.MatrixConverter import MatrixConverter from graph.UnlabeledLabelConverter import UnlabeledLabelConverter class ExperimentIterator: _switcher = { ...
2.59375
3
gym-duckietown/learning/imitation/iil_dagger/model/__init__.py
lyf44/CS4278-5478-Project-Materials
4
12764745
from .squeezenet import Squeezenet
1.03125
1
test/currency/providers/test_base.py
tchar/ulauncher-calculate-anything
41
12764746
<reponame>tchar/ulauncher-calculate-anything<filename>test/currency/providers/test_base.py from calculate_anything.exceptions import CurrencyProviderException import pytest from calculate_anything.currency.providers.base import ( CurrencyProvider, CurrencyData, ) class CurrencyProviderImpl(CurrencyProvider): ...
2.359375
2
src/explanation/surrogate_manual.py
MauroLuzzatto/algorithmic-explanations
0
12764747
# -*- coding: utf-8 -*- """ Created on Fri Jul 16 23:08:55 2021 @author: maurol """ import os from typing import Dict import graphviz import pandas as pd from sklearn.tree import DecisionTreeRegressor # TRUE False f = """ digraph Tree { node [shape=box, style="rounded", color="black", fontname=helvetica] ; edge ...
2.796875
3
src/12/how_to_lock_critical_sections/example1.py
tuanavu/python-gitbook
14
12764748
<reponame>tuanavu/python-gitbook import threading class SharedCounter: ''' A counter object that can be shared by multiple threads. ''' def __init__(self, initial_value = 0): self._value = initial_value self._value_lock = threading.Lock() def incr(self,delta=1): ''' Increm...
3.6875
4
TopQuarkAnalysis/TopEventProducers/python/sequences/ttSemiLepEvtHypotheses_cff.py
ckamtsikis/cmssw
852
12764749
import FWCore.ParameterSet.Config as cms # # produce ttSemiLep event hypotheses # ## geom hypothesis from TopQuarkAnalysis.TopJetCombination.TtSemiLepHypGeom_cff import * ## wMassDeltaTopMass hypothesis from TopQuarkAnalysis.TopJetCombination.TtSemiLepHypWMassDeltaTopMass_cff import * ## wMassMaxSumPt hypothesis fr...
1.304688
1
ott/core/gromov_wasserstein.py
google-research/ott
232
12764750
# coding=utf-8 # Copyright 2021 Google LLC. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed ...
2.125
2