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
leetcode/lessons/binary_search/004_median_of_two_sorted_arrays/__init__.py
wangkuntian/leetcode
0
44500
#!/usr/bin/env python # -*- coding: utf-8 -*- """ __project__ = 'leetcode' __file__ = '__init__.py' __author__ = 'king' __time__ = '2020/2/10 14:40' _ooOoo_ o8888888o 88" . "88 (| -_- |) ...
2.84375
3
spira/yevon/gdsii/base.py
JCoetzee123/spira
0
44501
<filename>spira/yevon/gdsii/base.py from spira.core.transformable import Transformable from spira.core.parameters.initializer import ParameterInitializer from spira.core.parameters.initializer import MetaInitializer from spira.core.parameters.descriptor import FunctionParameter from spira.yevon.process.gdsii_layer impo...
1.890625
2
torch_enhance/utils.py
lawrence880301/pytorch-enhance
25
44502
import torchvision __all__ = ["plot_compare"] def plot_compare(sr, hr, baseline, filename): """ Plot Super-Resolution and High-Resolution image comparison """ sr, hr, baseline = sr.squeeze(), hr.squeeze(), baseline.squeeze() grid = torchvision.utils.make_grid([hr, baseline, sr]) torchvision....
2.53125
3
util/data_loader.py
chrismachado/ML-IFCE2020.1
0
44503
import torch from sklearn.model_selection import train_test_split from torch.utils.data import TensorDataset, DataLoader def data_loader(targets, labels): batch_size = 10 train_samples, test_samples, train_labels, test_labels = train_test_split(targets, labels, test_size=0.2) train_samples = torch.FloatTe...
2.890625
3
tgadmin/santabot/migrations/0004_alter_event_last_register_date_and_more.py
c-Door-in/secret-santa-bot
0
44504
<filename>tgadmin/santabot/migrations/0004_alter_event_last_register_date_and_more.py # Generated by Django 4.0 on 2021-12-24 20:48 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('santabot', '0003_alter_event_last_register_date_and_more'), ] op...
1.414063
1
xnmt/simultaneous/simult_state.py
neulab/xnmt
195
44505
import numbers import xnmt.tensor_tools as tt import xnmt.modelparts.decoders as decoders import xnmt.transducers.recurrent as recurrent import xnmt.transducers.base as transducers_base import xnmt.expression_seqs as expr_seq import xnmt.vocabs as vocabs class SimultaneousState(decoders.AutoRegressiveDecoderState): ...
2.171875
2
checkov/json_doc/base_json_check.py
pmalkki/checkov
0
44506
<reponame>pmalkki/checkov from typing import Iterable, Optional from checkov.common.checks.base_check import BaseCheck from checkov.common.models.enums import CheckCategories from checkov.json_doc.registry import registry class BaseJsonCheck(BaseCheck): def __init__(self, name: str, id: str, categories: "Iterabl...
2.0625
2
RemoveDuplicatesFromSortedList.py
reedwave/leetcode-cn
1
44507
#!/usr/bin/env python # -*- coding: utf-8 -*- # @Time : 2019/12/27 下午6:04 # @Title : 83. 删除排序链表中的重复元素 # @Link : https://leetcode-cn.com/problems/remove-duplicates-from-sorted-list/ QUESTION = """ 给定一个排序链表,删除所有重复的元素,使得每个元素只出现一次。 示例 1: 输入: 1->1->2 输出: 1->2 示例 2: 输入: 1->1->2->3->3 输出: 1->2->3 """ THINKING = ...
3.90625
4
xldlib/controllers/bindings/core.py
Alexhuszagh/XLDiscoverer
0
44508
<reponame>Alexhuszagh/XLDiscoverer<gh_stars>0 ''' Controllers/Bindings/core _________________________ Core ABC with methods to bind QKeySequences to various slots defined in other modules within the package. :copyright: (c) 2015 The Regents of the University of California. :license: GNU GPL, s...
2.09375
2
envs/babyai/oracle/xy_corrections.py
AliengirlLiv/babyai
2
44509
import numpy as np import pickle as pkl from envs.babyai.oracle.teacher import Teacher class XYCorrections(Teacher): def __init__(self, *args, **kwargs): super(XYCorrections, self).__init__(*args, **kwargs) self.next_state_coords = self.empty_feedback() def empty_feedback(self): """ ...
2.390625
2
python_tools/utils.py
ultimatezen/felix
0
44510
<gh_stars>0 #!/usr/bin/env python from loc import (we_are_frozen, module_path) import os import datetime import time import loc import traceback import sys from win32com.client import Dispatch logfile = sys.stdout def determine_redirect(filename): """ Determine where to redir...
2.375
2
train.py
Nuwanda7O/Financial-data-analysis-paper
0
44511
<reponame>Nuwanda7O/Financial-data-analysis-paper<filename>train.py # 导入模块用于获取股票数据 import tushare as ts # 导入数据处理模块 import numpy as np import pandas as pd # 导入神经网络模块 from torch.autograd import Variable import torch.nn as nn import torch from torch.utils.data import DataLoader, Dataset from torchvision import transforms ...
2.953125
3
library/tests/test_compensation.py
Sossa24/bmp280-python
39
44512
TEST_TEMP_RAW = 529191 TEST_TEMP_CMP = 24.7894877676 TEST_PRES_RAW = 326816 TEST_PRES_CMP = 1006.61517564 TEST_ALT_CMP = 57.3174 def test_temperature(): from tools import SMBusFakeDevice from bmp280 import BMP280 from calibration import BMP280Calibration dev = SMBusFakeDevice(1) # Load the fake ...
2.109375
2
tsai/models/RNNPlus.py
MOREDataset/tsai
0
44513
<reponame>MOREDataset/tsai # AUTOGENERATED! DO NOT EDIT! File to edit: nbs/105_models.RNNPlus.ipynb (unless otherwise specified). __all__ = ['RNNPlus', 'LSTMPlus', 'GRUPlus'] # Cell from ..imports import * from ..utils import * from ..data.core import * from .layers import * # Cell class _RNNPlus_Base(Module): d...
2.265625
2
tests/losses/test_smooth_ap_loss.py
tajanthan/pytorch-metric-learning
0
44514
# mnist example, Downloaded from PML github import torch import torch.nn as nn import torch.nn.functional as F import torch.optim as optim ### MNIST code originally from https://github.com/pytorch/examples/blob/master/mnist/main.py ### from torchvision import datasets, transforms from pytorch_metric_learning import d...
2.984375
3
gpt2/test.py
kimjayney/flask-app-blueprint
1
44515
import time while True: print("Test program") time.sleep(10) pass
2.140625
2
LintCode/364.py
RENHANFEI/LintCode
0
44516
class Solution: """ @param heights: a matrix of integers @return: an integer """ def trapRainWater(self, heights): """ :type heightMap: List[List[int]] :rtype: int """ m = len(heights) n = len(heights[0]) if m else 0 peakMap = [[0x7FFFFFF...
3.34375
3
spidermon/contrib/scrapy/runners.py
heylouiz/spidermon
2
44517
<reponame>heylouiz/spidermon from __future__ import absolute_import import logging from spidermon.results.monitor import ( MonitorResult, actions_step_required, monitors_step_required, ) from spidermon.runners import MonitorRunner from spidermon.utils.text import Message, line, line_title LOG_MESSAGE_HEA...
2.28125
2
committees/listeners.py
navotsil/Open-Knesset
69
44518
<filename>committees/listeners.py from django.db.models.signals import post_save,m2m_changed, pre_delete from django.contrib.comments.signals import comment_was_posted from django.contrib.comments.models import Comment from django.contrib.contenttypes.models import ContentType from planet.models import Feed, Post from ...
2
2
src/resources/embed.py
ev1ldoge/mokujin
0
44519
<reponame>ev1ldoge/mokujin import discord def move_embed(character, move): """Returns the embed message for character and move""" embed = discord.Embed(title=character['proper_name'], colour=0x00EAFF, url=character['online_webpage'], ...
2.734375
3
models/unetc.py
sxlyiyiyi/HuBMAP---Hacking-the-Kidney_Baseline
0
44520
<reponame>sxlyiyiyi/HuBMAP---Hacking-the-Kidney_Baseline import tensorflow as tf from models.backbone.efficientnet import (EfficientNetB0, EfficientNetB1, EfficientNetB2, EfficientNetB3, ...
2.296875
2
uti.py
shaoxiang-zheng/Branch-and-price-for-one-dimensional-bin-packing
1
44521
<gh_stars>1-10 #!/usr/bin/env python # -*- coding:utf-8 -*- # @Time: 2020/9/26 9:41 # Author: <NAME> # @Email: <EMAIL> # Description: from enum import Enum ReducedEpsilon = 1e-5 IntegerEpsilon = 1e-6 ComparisonEpsilon = 1e-5 def is_integer(num): if abs(round(num) - num) <= IntegerEpsilon: ...
2.796875
3
zoo_tensorflow/examples/ssd_mobilenet_v2_quanteval.py
quic/aimet-model-zoo
89
44522
#!/usr/bin/env python3.6 # -*- mode: python -*- # ============================================================================= # @@-COPYRIGHT-START-@@ # # Copyright (c) 2020 of Qualcomm Innovation Center, Inc. All rights reserved. # # @@-COPYRIGHT-END-@@ # ===========================================================...
1.164063
1
openmdao/devtools/d3graph.py
colinxs/OpenMDAO
0
44523
<reponame>colinxs/OpenMDAO<filename>openmdao/devtools/d3graph.py import os import sys import json from itertools import chain from six import iteritems import webbrowser from openmdao.core.component import Component # default options for different viewers viewer_options = { 'collapse_tree': { 'expand_l...
2.390625
2
data_utils/split_train_val.py
aman0044/pytorch-classifier
0
44524
import torch from torchvision import datasets import shutil import argparse import os import numpy as np from tqdm import tqdm ########### Help ########### ''' #size = (h,w) python split_train_val.py \ --data_dir /Users/aman.gupta/Documents/self/datasets/blank_page_detection/letterbox_training_data/ \ --val...
2.734375
3
main.py
James-Leslie/github-actions
0
44525
<filename>main.py def add_two(a, b): '''Adds two numbers together''' return a + b def multiply_two(a, b): '''Multiplies two numbers together''' return a * b
3.625
4
tools/visualize_mask.py
wilson1yan/RLBench
0
44526
<gh_stars>0 from PIL import Image import numpy as np import glob import os.path as osp import matplotlib.pyplot as plt import matplotlib.cm as cm root = osp.join('data', 'lamp_on_big', 'variation0', 'episodes', 'episode0') rgb_images = glob.glob(osp.join(root, 'front_rgb', '*.png')) rgb_images.sort() mask_images = glo...
2.203125
2
install.py
mattgonley/YoutubeDownloader
0
44527
<reponame>mattgonley/YoutubeDownloader<filename>install.py<gh_stars>0 import re import subprocess import os dir_path = os.path.dirname(os.path.realpath(__file__)) os.chdir(dir_path) os.system("pip install -r requirements.txt") output = subprocess.Popen("pip show pytube3", shell=True, stdout=subprocess.PIPE) location ...
2.5625
3
__init__.py
Alex2Yang97/recommender
0
44528
<reponame>Alex2Yang97/recommender # -*- coding:utf8 -*- """ @Author: Zhirui(<NAME> @Date: 2021/4/25 下午11:07 """
0.800781
1
achievements/admin.py
kaduuuken/achievementsystem
1
44529
<filename>achievements/admin.py from models import Achievement, Category, Trophy, CollectionAchievement, Progress, ProgressAchievement, Task, TaskAchievement, TaskProgress from django.contrib import admin from django import forms from django.core.exceptions import ValidationError from django.contrib.admin.widgets impor...
2.40625
2
tests/test_tracing_trace.py
rgstephens/opentracing-decorator
4
44530
<filename>tests/test_tracing_trace.py import numbers import unittest import uuid from unittest.mock import MagicMock, create_autospec from opentracing.mocktracer import MockTracer from opentracing_decorator.tracing import Tracing class TestTracing(unittest.TestCase): def setUp(self): self.tracer = MockT...
2.8125
3
gamestonk_terminal/economy/yfinance_model.py
jbushago/GamestonkTerminal
1
44531
""" Yahoo Finance Model """ __docformat__ = "numpy" import logging import pandas as pd import yfinance as yf from gamestonk_terminal.decorators import log_start_end from gamestonk_terminal.rich_config import console logger = logging.getLogger(__name__) INDICES = { "sp500": {"name": "S&P 500", "ticker": "^GSPC"...
2.578125
3
practise.py
purva-saxena/Python-programming
14
44532
<reponame>purva-saxena/Python-programming # # example string # string = 'cat' # width = 5 # print right justified string # print(string.rjust(width)) # print(string.rjust(width)) # # example string # string = 'cat' # width = 5 # fillchar = '*' # # print right justified string # print(string.rjust(width, fillchar)) ...
4.1875
4
ooobuild/lo/awt/end_docking_event.py
Amourspirit/ooo_uno_tmpl
0
44533
# coding: utf-8 # # Copyright 2022 :Barry-Thomas-Paul: Moss # # Licensed under the Apache License, Version 2.0 (the "License") # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http: // www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicab...
1.960938
2
XSD/XSDValidator.py
ghajba/python
3
44534
# Simple XML against XSD Validator for Python 2.7 - 3.2 # to run this script you need additionally: lxml (http://lxml.de) # author: <NAME>, 2013 import sys from lxml import etree xsd_files = [] xml_files = [] def usage(): print("Usage: ") print("python XSDValidator.py <list of xml files> <list of xsd file...
3.65625
4
auxiliary/templatetags/hashtag.py
navotsil/Open-Knesset
69
44535
<filename>auxiliary/templatetags/hashtag.py from django import template register = template.Library() @register.filter def hash(h, key): return h[key]
1.78125
2
questao6.py
higorcastro17/Avaliacao1
0
44536
turno = input('M-matutino, V-vespertino, N-noturno: ') if (turno == 'M')or(turno == 'm') : print ('Bom Dia') if (turno == 'V')or(turno == 'v'): print ('Boa Tarde') if (turno == 'N')or(turno == 'n'): print ('Boa Noite') else: print ('Valor inválido')
3.765625
4
tests/components/luftdaten/__init__.py
domwillcode/home-assistant
30,023
44537
<filename>tests/components/luftdaten/__init__.py """Define tests for the Luftdaten component."""
1.234375
1
b0mb3r/services/webbankir.py
Superior0/b0mb3r_r
0
44538
<gh_stars>0 from b0mb3r.services.service import Service class WebBankir(Service): async def run(self): await self.post( "https://ng-api.webbankir.com/user/v2/create", json={ "lastName": self.russian_name, "firstName": self.russian_name, ...
2.421875
2
login.py
sgravrock/flickr-to-go
0
44539
import os import sys import flickr_api from flickr_api import auth a = auth.AuthHandler(key=os.environ['FLICKR_API_KEY'], secret=os.environ['FLICKR_API_SECRET'], callback='oob') print("Open this in your browser: " + a.get_authorization_url('read')) print("Once you finish logging in, enter the code from the browser: ")...
2.796875
3
cupyx/scipy/special/_statistics.py
Pandinosaurus/cupy
1
44540
<reponame>Pandinosaurus/cupy from cupy import _core ndtr = _core.create_ufunc( 'cupyx_scipy_ndtr', ('f->f', 'd->d'), 'out0 = normcdf(in0)', doc='''Cumulative distribution function of normal distribution. .. seealso:: :meth:`scipy.special.ndtr` ''')
1.632813
2
zshoes/articles/models.py
andresgz/zshoes
0
44541
from __future__ import unicode_literals from django.db import models from django.utils.encoding import python_2_unicode_compatible from zshoes.stores.models import Store @python_2_unicode_compatible class Article(models.Model): """ Entity that represents the articles of the store """ #: Name of the ...
2.234375
2
Cousins_in_Binary_Tree.py
raniyer/Learning-competitive-coding
2
44542
""" In a binary tree, the root node is at depth 0, and children of each depth k node are at depth k+1. Two nodes of a binary tree are cousins if they have the same depth, but have different parents. We are given the root of a binary tree with unique values, and the values x and y of two different nodes in the tree. R...
4.0625
4
main.py
Smaniac1/02-Text-adeventure
0
44543
#!/usr/bin/env python3 import sys, os, json import random # Check to make sure we are running the correct version of Python assert sys.version_info >= (3,7), "This script requires at least Python 3.7" # The game and item description files (in the same folder as this script) game_file = 'game.json' # Load the content...
3.25
3
tests/fixtures/defxmlschema/chapter16/example1607.py
nimish/xsdata
0
44544
from dataclasses import dataclass, field from typing import Optional from tests.fixtures.defxmlschema.chapter22.example2207 import ( ProductType, ) @dataclass class HatType: """ :ivar number: :ivar name: :ivar size: """ number: Optional[int] = field( default=None, metadata=...
2.453125
2
pydisco/disco/modutil.py
jseppanen/disco
2
44545
<reponame>jseppanen/disco<gh_stars>1-10 import re, struct, sys, os, imp, modulefinder import functools from os.path import abspath, dirname from opcode import opname from disco.error import ModUtilImportError def user_paths(): return set(os.getenv('PYTHONPATH', '').split(':') + ['']) def parse_function(function...
2.171875
2
structures/cycle.py
TheBiggerFish/fishpy
0
44546
""" This module provides a sequence class which can be used for cyclic values """ from typing import Generic, TypeVar T = TypeVar('T') class Cycle(list,Generic[T]): """This class can be used to store cyclic values""" def __getitem__(self,key:int) -> T: return super().__getitem__(key%len(self)) ...
3.5625
4
SerialLogger_spectro.py
szajakubiak/SerialLogger_spectro
0
44547
<reponame>szajakubiak/SerialLogger_spectro """ Read and save data from the SparkFun Triad Spectroscopy Sensor by <NAME> Twitter: @SzymonJakubiak LinkedIn: https://www.linkedin.com/in/szymon-jakubiak-495442127/ """ import serial, time from datetime import datetime # Specify serial port device_port ...
2.5625
3
djangoq_demo/order_reminder/migrations/0001_initial.py
forance/django-q
0
44548
# -*- coding: utf-8 -*- # Generated by Django 1.9.4 on 2016-03-17 12:32 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( name='orders'...
1.953125
2
src/algorithms/05-tic-tac-toe/test_board.py
SamVanhoutte/python-musings
0
44549
############################################### # <NAME> - PG Applied AI - Programming # Unit tests, for the graph algorithms ############################################### import unittest # unit testing ftw from board import Board import numpy as np import play class TestMethods(unittest.TestCas...
3.578125
4
vulture/pipelines.py
aksiksi/vulture
0
44550
from scrapy.exceptions import DropItem class DubizzlePipeline(object): def process_item(self, item, spider): return item
1.851563
2
qcfractal/dashboard/index.py
radical-cybertools/QCFractal
0
44551
import dash_bootstrap_components as dbc import dash_core_components as dcc import dash_html_components as html from dash.dependencies import Input, Output from . import dash_managers, dash_queue, dash_service from .app import app from .navbar import navbar body = dbc.Container( [ dbc.Row([ dbc...
2.1875
2
xgboost_algorithm/CreateDataSet.py
SmileOfHeart/xgboostTrain_accuracyStop
3
44552
# -*- coding: utf-8 -*- """ Created on Mon Apr 8 11:09:33 2019 @author: 10365 """ #CreateDataSet import numpy as np import sys sys.path.append('../subway_system') sys.path.append('../ato_agent') import TrainAndRoadCharacter as trc import trainRunningModel as trm import pandas as pds import matplotlib.pyplot as pl...
2.421875
2
inventory.py
justinwatkinson/ecs-weave-demo
0
44553
#!/usr/bin/python3 import boto3 import json if __name__ == '__main__': ec2_client = boto3.client('ec2') ec2_filter = [{'Name': 'tag:role', 'Values': ['ecs-cluster']}] instances=ec2_client.describe_tags(Filters=ec2_filter) #get only the instance_ids instance_ids = [] for i in instances['Tags'...
2.46875
2
examples/surface.py
pedromxavier/svg-motion
0
44554
from cstream import stdwar from svgen import Point, Vector, SVG, Figure, Camera, Domain, Map, Surface, Animation from math import radians, sin, cos, pi, hypot, sqrt import sys from tqdm import tqdm from svgen.svglib.math import Transform COLOR = "#3703b3" if len(sys.argv) > 1 and sys.argv[1] == "-o": proj = C...
2.515625
3
samples/vis_amass_and_h36m.py
zaverichintan/mocap
22
44555
import sys sys.path.insert(0, '../') from mocap.settings import get_amass_validation_files, get_amass_test_files from mocap.math.amass_fk import rotmat2euclidean, exp2euclidean from mocap.visualization.sequence import SequenceVisualizer from mocap.math.mirror_smpl import mirror_p3d from mocap.datasets.dataset import Li...
1.898438
2
tests/test_provider.py
ApeWorX/ape-fantom
0
44556
def test_use_provider(accounts, networks): with networks.fantom.local.use_provider("test"): account = accounts.test_accounts[0] account.transfer(account, 100)
1.382813
1
django_vueformgenerator/fields.py
agronick/django-vueformgenerator
7
44557
<reponame>agronick/django-vueformgenerator class Field(object): def render(self, field): raise NotImplementedError('Field.render needs to be defined') class Attr(Field): def __init__(self, attr, default=None, type=None): self.attr = attr self.default = default if type is None: ...
2.3125
2
review/tests/test_review_model.py
hossainchisty/Multi-Vendor-eCommerce
16
44558
from django.test import TestCase from review.models import Review class TestReviewModel(TestCase): ''' Test suite for review modules. ''' def setUp(self): ''' Set up test data for the review model. ''' Review.objects.create( feedback='Test rev...
2.46875
2
app.py
BodhisattwaMandal/wembedder
42
44559
"""Script to start webserving.""" from wembedder.app import create_app app = create_app() if __name__ == '__main__': app.run(debug=True)
1.695313
2
src/openprocurement/tender/esco/procedure/serializers/bid.py
ProzorroUKR/openprocurement.api
10
44560
from openprocurement.tender.core.procedure.serializers.base import ListSerializer from openprocurement.tender.core.procedure.serializers.document import ConfidentialDocumentSerializer from openprocurement.tender.core.procedure.serializers.parameter import ParameterSerializer from openprocurement.tender.esco.procedure.s...
1.648438
2
lib/model/config.py
Li-Chengyang/MSDS-RCNN
56
44561
<gh_stars>10-100 # ------------------------------------------------------------------------- # MSDS R-CNN # Licensed under The MIT License [see LICENSE for details] # Written by <NAME>, based on code from <NAME> and <NAME> # ------------------------------------------------------------------------- from __future__ impor...
2.078125
2
tensorflow_federated/python/core/impl/bindings_utils/data_conversions.py
RyanMarten/federated
1,918
44562
# Copyright 2021, The TensorFlow Federated Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law o...
2.109375
2
app/routes.py
mattkantor/basic-flask-app
0
44563
<reponame>mattkantor/basic-flask-app<filename>app/routes.py from app.api.feed import FeedController from app.api.follows import FollowController from .api import apiv1, app_routes from .api.news import * from .api.user import * from .api.group import * from .api.auth import get_auth_token, register class Route(): ...
2.4375
2
openmdao/solvers/brent.py
naylor-b/OpenMDAO1
17
44564
<filename>openmdao/solvers/brent.py """ Brent Nonlinear solver.""" from six import iteritems from math import isnan import numpy as np from scipy.optimize import brentq from openmdao.core.system import AnalysisError from openmdao.solvers.solver_base import NonLinearSolver from openmdao.util.record_util import updat...
2.46875
2
uvu/test_retinanet.py
fabianfallasmoya/semi_supervised_v1
0
44565
from typing import List import argparse from detectron2.evaluation import COCOEvaluator, inference_on_dataset from detectron2.config import get_cfg from detectron2 import model_zoo from detectron2.data.datasets import register_coco_instances from detectron2.data import build_detection_test_loader from trainers import...
2.21875
2
pixiedust/display/streamingDisplay.py
elgalu/pixiedust
598
44566
# ------------------------------------------------------------------------------- # Copyright IBM Corp. 2017 # # 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/licens...
1.992188
2
repl.py
PostCenter/botlang
1
44567
<gh_stars>1-10 from botlang import Evaluator from botlang.interpreter import BotlangSystem from botlang.parser import Parser class BotlangREPL(object): def exit_function(self): def repl_exit(): self.active = False return repl_exit def __init__(self): self.active = True ...
2.625
3
main.py
LN-24111/RPC_Sim
0
44568
<reponame>LN-24111/RPC_Sim from tournament import * from strategies import * resultSetPoints = {} resultSetWins = {} observer = Documenter() for i in range(100): if i % 100 == 0: print (i//100) participants = [] # participants.append(WaPlayer1()) # participants.append(Adam()) # participants.append(Rock()) # par...
2.25
2
npc/gui/uis/new_character.py
Arent128/npc
0
44569
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'npc/gui/uis/new_character.ui' # # Created by: PyQt5 UI code generator 5.7.1 # # WARNING! All changes made in this file will be lost! from PyQt5 import QtCore, QtGui, QtWidgets class Ui_NewCharacterDialog(object): def setupUi(self, NewC...
1.9375
2
tests/integration/test_dataframe_logging.py
mbseid/rubicon
0
44570
<gh_stars>0 import pandas as pd import pytest from dask import dataframe as dd from rubicon.exceptions import RubiconException def test_pandas_df(rubicon_local_filesystem_client): rubicon = rubicon_local_filesystem_client project = rubicon.create_project("Dataframe Test Project") multi_index_df = pd.Dat...
2.34375
2
820.py
tsbxmw/leetcode
0
44571
<filename>820.py # 给定一个单词列表,我们将这个列表编码成一个索引字符串 S 与一个索引列表 A。 # 例如,如果这个列表是 ["time", "me", "bell"],我们就可以将其表示为 S = "time#bell#" 和 indexes = [0, 2, 5]。 # 对于每一个索引,我们可以通过从字符串 S 中索引的位置开始读取字符串,直到 "#" 结束,来恢复我们之前的单词列表。 # 那么成功对给定单词列表进行编码的最小字符串长度是多少呢? #   # 示例: # 输入: words = ["time", "me", "bell"] # 输出: 10 # 说明: ...
3.71875
4
src/constants.py
tiefenauer/ip9
4
44572
<gh_stars>1-10 import os from os.path import abspath, dirname, join SRC_DIR = dirname(abspath(__file__)) # absolute path to project ./src/ directory ROOT_DIR = abspath(join(SRC_DIR, os.pardir)) # absolute path to project root directory ASSETS_DIR = join(ROOT_DIR, 'assets') LS_RAW = "/media/daniel/Data/corpus/libri...
2.03125
2
app/core/migrations/0001_initial.py
Uniquode/uniquode2
0
44573
<reponame>Uniquode/uniquode2 # Generated by Django 3.2.7 on 2021-09-19 02:59 from django.conf import settings from django.db import migrations, models import django.db.models.manager import markdownx.models import components class Migration(migrations.Migration): initial = True dependencies = [ mig...
1.875
2
livestock/slaughtering/doctype/chicken_co_packing/test_chicken_co_packing.py
jayan13/livestock
0
44574
# Copyright (c) 2022, alantechnologies and Contributors # See license.txt # import frappe import unittest class TestChickenCoPacking(unittest.TestCase): pass
1.171875
1
tests/utils/environment_vars.py
alanverresen/django-keys
0
44575
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # Contains a context manager for temporarily introducing an environment var. import os import contextlib @contextlib.contextmanager def use_environment_variable(key, value): """ Used to temporarily introduce a new environment variable as if it was set by th...
3.140625
3
data/analyzer.py
morelab/teseo2014
0
44576
<filename>data/analyzer.py<gh_stars>0 # -*- coding: utf-8 -*- """ Created on Mon Sep 22 08:55:14 2014 @author: aitor """ import mysql.connector import networkx as nx from networkx.generators.random_graphs import barabasi_albert_graph import json import os.path import numpy as np import pandas as pd from pandas import...
2.65625
3
user_service/user/schema/user_schema.py
ss-o-furda/part_of_proj-user_service
0
44577
<gh_stars>0 from marshmallow import fields, validate, validates_schema, ValidationError from user import MARSHMALLOW from user.models.user_model import User class UserSchema(MARSHMALLOW.ModelSchema): user_password = fields.Str(validate=validate.Length(6, 255)) user_email = fields.Str(validate=validate.Email()...
2.5
2
primal_dual_models.py
louisenaud/pytorch_primal_dual
2
44578
<reponame>louisenaud/pytorch_primal_dual """ Project: pytorch_primal_dual File: primal_dual_models.py Created by: louise On: 29/11/17 At: 4:00 PM """ import numpy as np from numpy import random from torch.autograd import Variable import torch import torch.nn as nn import torch.nn.functional as ...
2.484375
2
.venv/lib/python3.6/site-packages/pyglet/media/sources/__init__.py
FedericoFontana/ray
3
44579
"""Sources for media playback.""" # Collect public interface from .loader import load, have_avbin from .base import AudioFormat, VideoFormat, AudioData, SourceInfo from .base import Source, StreamingSource, StaticSource, SourceGroup # help the docs figure out where these are supposed to live (they live here) __all__ ...
1.6875
2
regexport/views/histogram2.py
jonnykohl/ABBA-QuPath-RegistrationAnalysis
2
44580
import matplotlib import matplotlib.pyplot as plt import numpy as np from PySide2.QtWidgets import QVBoxLayout, QWidget from traitlets import HasTraits, Instance, Bool, directional_link from regexport.model import AppState from regexport.views.utils import HasWidget matplotlib.use('Qt5Agg') from matplotlib.backends...
2.59375
3
tests/plot/test_layouts.py
akrherz/pyIEM
29
44581
<reponame>akrherz/pyIEM """Test pyiem.plot.layouts.""" # third party import pytest # local from pyiem.plot.layouts import figure_axes @pytest.mark.mpl_image_compare(tolerance=0.1) def test_crawl_before_walk(): """Test that we can do basic things.""" fig, ax = figure_axes( title="This is my Fancy Pan...
2.25
2
python_sets/set_elements_sum.py
antonarnaudov/python-tigers-2021-02
0
44582
def set_elements_sum(a, b): c = [] for i in range(len(a)): result = a[i] + b[i] c.append(result) return c ll = [1, 2, 3, 4, 5] ll2 = [3, 4, 5, 6, 7] print(set_elements_sum(ll, ll2)) # [4, 6, 8, 10, 12]
3.5
4
src/view/api.py
NKUST-ITC/NKUST-AP-API
7
44583
<gh_stars>1-10 import datetime import json import falcon import redis from auth import jwt_auth from cache import ap_cache, api_cache from utils import config, error_code from utils.util import max_body, randStr red_auth_token = redis.StrictRedis.from_url( url=config.REDIS_URL, db=6, charset="utf-8", decode_resp...
2.3125
2
tests/pie.py
Sup3rGeo/allure-docx
25
44584
<reponame>Sup3rGeo/allure-docx<gh_stars>10-100 from allure_docx.piechart import create_piechart data = { "broken": 1, "failed": 2, "skipped": 3, "passed": 4, } create_piechart(data, "C:\\Users\\victo\\Desktop\\piechart.png")
1.945313
2
numba/typeinfer.py
meawoppl/numba
1
44585
<filename>numba/typeinfer.py """ Type inference base on CPA. The algorithm guarantees monotonic growth of type-sets for each variable. Steps: 1. seed initial types 2. build constrains 3. propagate constrains 4. unify types Constrain propagation is precise and does not regret (no backtracing). Constrai...
2.046875
2
examples/_pweave.py
erelsgl/prtpy
2
44586
""" Run all the example files and convert them to markdown files containing the output. Uses `pweave`. It is not installed by default. To install: pip install pweave """ import pweave, datetime, glob, os def publish_to_markdown(python_file: str, output_file: str): doc = pweave.Pweb(python_file, kernel="pyt...
3.109375
3
Course.py
timot3/uiuc-course-api
6
44587
<gh_stars>1-10 from dataclasses import dataclass import json @dataclass class Course: name: str # "CS 124" number: str # "124" label: str # "Introduction to Computer Science I" description: str # "Basic concepts in computing and fundamental techniques for solving computati...
2.71875
3
mlops/parallelm/mlops/config_info.py
lisapm/mlpiper
7
44588
<filename>mlops/parallelm/mlops/config_info.py import os from parallelm.mlops.mlops_env_constants import MLOpsEnvConstants from parallelm.mlops.constants import Constants class ConfigInfo: def __init__(self): self.mlops_mode = None self.output_channel_type = None self.zk_host = None ...
2.078125
2
pyupdater/vendor/PyInstaller/hooks/hookutils.py
rsumner31/PyUpdater1
0
44589
<filename>pyupdater/vendor/PyInstaller/hooks/hookutils.py #----------------------------------------------------------------------------- # Copyright (c) 2013, PyInstaller Development Team. # # Distributed under the terms of the GNU General Public License with exception # for distributing bootloader. # # The full licens...
1.765625
2
gpu_disk_monitor.py
alicfeng/node-gpu-exporter
0
44590
<filename>gpu_disk_monitor.py # -*- coding: utf-8 -*- import pynvml import psutil import time import os while True: time.sleep(int(os.getenv("PLUGIN_PROM_INTERVAL", 5))) try: # nvml初始化 pynvml.nvmlInit() # 通过驱动获取GPU个数 DeviceCount = pynvml.nvmlDeviceGetCount() GpuData = ""...
2.515625
3
src/siliqua/util.py
Matoking/siliqua
8
44591
import binascii import uuid from collections import UserDict from functools import cmp_to_key, wraps from nanolib import Block as RawBlock from nanolib import nbase32_to_bytes, get_account_id __all__ = ( "RawBlock", "BlockProxy", "Callbacks", "CallbackSlot", "AccountIDDict" ) class BlockProxy(object): """ ...
2.4375
2
similarity/io/kv_storage.py
diepdaocs/redis-minhash-es
1
44592
<gh_stars>1-10 from abc import ABC, abstractmethod from redis import StrictRedis class KVStorage(ABC): @abstractmethod def put(self, name, key, value): pass @abstractmethod def get(self, name, key): pass @abstractmethod def delete(self, key): pass class RedisStora...
2.765625
3
canvasxpress/config/collection.py
docinfosci/canvasxpress-python
4
44593
import json from copy import deepcopy from functools import total_ordering from typing import List, Any, Union from canvasxpress.config.type import CXConfig, CXString, CXInt, CXFloat, CXBool, \ CXList, CXDict, CXRGBColor, CXRGBAColor from canvasxpress.data.convert import CXDictConvertable, CXListConvertable @tot...
2.265625
2
make_error_table_1plus1D.py
rtimms/asymptotic-pouch-cell
2
44594
<filename>make_error_table_1plus1D.py # # Check convergence of 1+1D model to full 2D model # import pybamm import sys import pickle from pprint import pprint import shared import numpy as np # increase recursion limit for large expression trees sys.setrecursionlimit(100000) pybamm.set_logging_level("INFO") # choose...
2.09375
2
dpy_firestore_manager/structures/document.py
ming-suhi/dpy-firestore-manager
2
44595
<reponame>ming-suhi/dpy-firestore-manager from .database import Database class Document(Database): """ Document structure Args: path (str): absolute path leading to the document Attributes: path (str): absolute path leading to the document """ def __init__(self, path): super().__init__()...
2.953125
3
people/migrations/0001_initial.py
David5627/instagram-clone
0
44596
# Generated by Django 3.1.5 on 2021-01-17 15:24 import cloudinary.models from django.conf import settings from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ migrations.swappable_dependency(settings.AUTH_US...
1.851563
2
jobs/models.py
soheltarir/django-es-test
5
44597
<gh_stars>1-10 from django.conf import settings from django.db import models, connection from elasticsearch import Elasticsearch from jobs.managers import BaseManager class ElasticModelMixin(models.Model): class Meta: abstract = True app_label = 'jobs' @classmethod def elastic_index(cls)...
2.21875
2
1 - Beginner/1132.py
andrematte/uri-submissions
1
44598
# URI Online Judge 1133 X = int(input()) Y = int(input()) soma = 0 if Y < X: X, Y = Y, X for i in range(X,Y+1): if i%13!=0: soma += i print(soma)
3.4375
3
1051 - Imposto de Renda.py
CalixtoNeto/UriOnlineJudge
0
44599
<reponame>CalixtoNeto/UriOnlineJudge salario = float(input()) if (salario >= 0 and salario <= 2000.00): print('Isento') elif (salario >= 2000.01 and salario <= 3000.00): resto = salario - 2000 resul = resto * 0.08 print('R$ {:.2f}'.format(resul)) elif (salario >= 3000.01 and salario <= 4500.00): re...
3.703125
4