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/__main__.py
MarioBonse/MulticameraTraking
0
51600
<filename>src/__main__.py import threeDplot import camera as cam import HSVObjTracking as HSVTr import numpy as np import matplotlib.pyplot as plt import mpl_toolkits.mplot3d.axes3d as p3 import matplotlib.animation as animation def main(): ######red ball ballLower = (137, 88, 55) ballUpper = (1...
2.84375
3
src/genie/libs/parser/iosxe/tests/ShowIsisHostname/cli/equal/golden_output_expected.py
balmasea/genieparser
204
51601
expected_output = { "tag": { "VRF1": { "hostname_db": { "hostname": { "7777.77ff.eeee": {"hostname": "R7", "level": 2}, "2222.22ff.4444": {"hostname": "R2", "local_router": True}, } } }, "test": {...
1.679688
2
tool/tool04_split_movie_sound/tool04_split_movie_sound.py
amaraimusi/python_sample
0
51602
print ('mp4を動画と音声に分割する') import os import datetime import ffmpeg from pydub import AudioSegment from ConfigX import ConfigX # 文字列を右側から印文字を検索し、右側の文字を切り出す # @param string s 対象文字列 # @param $mark 印文字 # @return 印文字から右側の文字列 def stringRightRev(s, mark): a =s.rfind(mark) res = s[a+len(mark):] return res # 文字列を...
2.921875
3
educative/course1/graphs/ch2_dfs.py
liveroot/ambition2020
0
51603
<gh_stars>0 import educative.course1.stacks_queues.stack as s import educative.course1.graphs.graph as g input_num_vertices = 5 input_edges = {0: [1, 2], 1: [3, 4]} expected_output = "02143 or 02134 or 01432 or 01342" # this code implements Depth First Traversal in a graph. Each element in the graph's adjacency list...
3.859375
4
python/biograph/internal/breadth_find_near.py
spiralgenetics/biograph
16
51604
# coding: utf-8 # In[195]: from biograph import BioGraph, Sequence cseq = "GGTTTAAGGCGTTTCCGTTCTTCTTCGTCATAACTTAATG" diff = " dd * i" qseq = "GGTTTAAGGTTTCCGTTTTTCTTCAGTCATAACTTAATG" diff = " dd * i ****" qseq = "GGTTTAAGGTTTCCGTTTTTCTTCAGTCATAACTTTTTT" qseq = "GGTTTAAG...
1.882813
2
src/unicon/plugins/nd/__init__.py
nielsvanhooy/unicon.plugins
0
51605
""" Module: unicon.plugins.nd Authors: <NAME> (<EMAIL>) Description: This subpackage implements ND """ # from unicon.plugins.linux import LinuxConnection from unicon.plugins.linux import LinuxConnection,LinuxServiceList from unicon.plugins.linux.statemachine import LinuxStateMachine from unicon.plugins.l...
1.664063
2
notebooks/DSGE-RA-K-Dynamics-Problems.py
JHU-Econ-Choice-2018/brock-mirman-etc-jacalin1
0
51606
<reponame>JHU-Econ-Choice-2018/brock-mirman-etc-jacalin1<gh_stars>0 # -*- coding: utf-8 -*- # --- # jupyter: # jupytext: # formats: ipynb,py:percent # text_representation: # extension: .py # format_name: percent # format_version: '1.2' # jupytext_version: 0.8.6 # kernelspec: # di...
3.3125
3
python/7kyu/binary_addition.py
momchilantonov/codewars
0
51607
<reponame>momchilantonov/codewars def add_binary(a, b): """ Implement a function that adds two numbers together and returns their sum in binary. The conversion can be done before, or after the addition. The binary number returned should be a string. """ return str(bin(a+b)[2:]) # TESTS ass...
4.34375
4
fepy/pycopia/fepy/UI.py
kdart/pycopia
89
51608
<reponame>kdart/pycopia<gh_stars>10-100 # -*- coding: utf-8 -*- # vim:ts=4:sw=4:softtabstop=4:smarttab:expandtab # 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/lic...
2
2
setup.py
donilan/python-genthemall
1
51609
<filename>setup.py #!/usr/bin/env python import sys, os from setuptools import setup, find_packages from genthemall.core import get_version # Find template files and package them data_files = [] for dirpath, dirnames, filenames in os.walk('genthemall'): files = [] for f in filenames: if f.endswith('...
1.710938
2
airflow/plugins/helpers/fetch_page.py
makism/find-a-ps5
1
51610
<filename>airflow/plugins/helpers/fetch_page.py import requests from bs4 import BeautifulSoup def fetch_page(url: str) -> str: """Fetch the page from the given URL.""" try: r = requests.get(url) return r.text except Exception as err: print(err) return None
2.859375
3
web/registry/tests/static/data.py
nickjalbert/agentos
1
51611
RUN_CREATE_DATA = { "root_name": "agent", "agent_name": "agent", "component_spec": { "components": { "agent==f39000a113abf6d7fcd93f2eaabce4cab8873fb0": { "class_name": "SB3PPOAgent", "dependencies": { "environment": ( ...
1.453125
1
server/accounts/serializers.py
FredLavoie/workout-tracker
0
51612
from rest_framework import serializers from .models import CustomUser class AccountSerializer(serializers.ModelSerializer): class Meta: fields = ('id', 'username', 'date_joined') model = CustomUser
2.078125
2
tests/denon/test_response.py
JPHutchins/pyavreceiver
2
51613
"""Test responses from Denon/Marantz.""" from pyavreceiver.denon.response import DenonMessage def test_separate(message_none): """Test separation of messages.""" assert message_none.separate("PWON") == ("PW", None, "ON") assert message_none.separate("PWSTANDBY") == ("PW", None, "STANDBY") assert mess...
2.46875
2
flask_google_fonts.py
le717/flask-google-fonts
0
51614
<reponame>le717/flask-google-fonts<filename>flask_google_fonts.py from typing import Optional from flask import Flask from jinja2 import Markup __all__ = ["GoogleFonts"] class GoogleFonts: """Add fast-rendering Google Fonts to your Flask app. Uses the techniques outlined in <NAME>'s post. https://cssw...
2.90625
3
tianshou/policy/sac.py
DZ9/tianshou
1
51615
<reponame>DZ9/tianshou import torch import numpy as np from copy import deepcopy import torch.nn.functional as F from tianshou.data import Batch from tianshou.policy import DDPGPolicy class SACPolicy(DDPGPolicy): """docstring for SACPolicy""" def __init__(self, actor, actor_optim, critic1, critic1_optim, ...
2.359375
2
callisto/web/status.py
isabella232/callisto
84
51616
<filename>callisto/web/status.py from __future__ import annotations import typing as t import aiohttp.web as web from ..libs.domains import consts if t.TYPE_CHECKING: from ..libs.use_cases.status import StatusUseCase async def status_handler(request: web.Request) -> web.Response: uc: StatusUseCase = requ...
2.046875
2
code/ch05/rbf_kernel_pca.py
takseki/python-machine-learning-book
2
51617
import numpy as np from scipy.spatial.distance import pdist, squareform from scipy import exp from scipy.linalg import eigh def rbf_kernel_pca(X, gamma, n_components): """ RBF kernel PCA implementation. Parameters ------------ X: {NumPy ndarray}, shape = [n_samples, n_features] gamma: float ...
3.109375
3
Sources/Workflows/ONE「一个」/one.py
hzlzh/AlfredWorkflow.com
2,177
51618
<gh_stars>1000+ #!/usr/bin/python #coding=utf-8 # # # Copyright (c) 2016 fusijie <<EMAIL>> # # MIT Licence. See http://opensource.org/licenses/MIT # # Created on 2016-04-22 # import sys import os from workflow import Workflow, web reading_url = 'http://v3.wufazhuce.com:8000/api/reading/index' essay_url_prefix = 'http...
2.5
2
app/PyDrive/__init__.py
eduardo98m/Tree-Finder
1
51619
#from pydrive_functions import write_trees_csvs """ write_trees_csvs() df = get_trees_dataframes() df2 = get_image_ids(df, ids_file.images_ids) df2.to_csv('result.csv') """
2.625
3
stayhome/business/migrations/0031_request_lang.py
mageo/stayhomech
3
51620
# Generated by Django 3.0.4 on 2020-03-26 14:52 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('business', '0030_auto_20200326_1533'), ] operations = [ migrations.AddField( model_name='request', name='lang', ...
1.507813
2
projects/ide/sublime/src/Bolt/ui/write/highlight.py
boltjs/bolt
11
51621
<gh_stars>10-100 import sublime from ui.read import regions as read_regions from structs.highlight_list import * # Hmmm.... def highlight(view, regions, info): if regions != None: view.add_regions(info.name, regions, info.format, info.icon, info.mode) else: remove_highlight(view, info) def r...
2.34375
2
swan/__init__.py
INM-6/swan
3
51622
""" This module contains all the modules and subpackages required to run SWAN. The contents are organized in five folders: * src: contains all the important scripts, including src.main * gui: contains code that renders the graphical aspects of the tool * base: contains important classes for data base and ...
2.15625
2
guild/tests/samples/projects/remote-status/sleep.py
msarahan/guildai
694
51623
<reponame>msarahan/guildai import time seconds = 1 time.sleep(seconds)
1.617188
2
python_toolbox/wx_tools/drawing_tools/pens.py
hboshnak/python_toolbox
119
51624
<gh_stars>100-1000 # Copyright 2009-2017 <NAME>. # This program is distributed under the MIT license. import wx from python_toolbox import caching is_mac = (wx.Platform == '__WXMAC__') is_gtk = (wx.Platform == '__WXGTK__') is_win = (wx.Platform == '__WXMSW__') @caching.cache(max_size=100) def get_focus_pen(color=...
2.359375
2
Day05/day05.py
FunkyCracky/AdventOfCode2020
2
51625
<reponame>FunkyCracky/AdventOfCode2020 def calculateSeat(line, numRows, numColumns): def getSeatParameter(line, up, down, currentCharNum, numChars, minValue, maxValue): if line[currentCharNum] == up: if currentCharNum == numChars: return maxValue currentCharNum += 1 ...
3.71875
4
tests/components/sensibo/test_update.py
liangleslie/core
30,023
51626
"""The test for the sensibo update platform.""" from __future__ import annotations from datetime import timedelta from unittest.mock import patch from pysensibo.model import SensiboData from pytest import MonkeyPatch from homeassistant.config_entries import ConfigEntry from homeassistant.const import STATE_OFF, STAT...
2.125
2
trec2014/python/cuttsum/summarizer/filters.py
kedz/cuttsum
6
51627
<reponame>kedz/cuttsum from cuttsum.sentsim import SentenceLatentVectorsResource from cuttsum.summarizer.ap import APSummarizer, APSalienceSummarizer from cuttsum.summarizer.baseline import HACSummarizer import os import pandas as pd import numpy as np from datetime import datetime, timedelta from sklearn.metrics.pairw...
2.3125
2
tests/metrics/test_metric.py
ad12/meddlr
23
51628
<gh_stars>10-100 import unittest import torch from meddlr.metrics import Metric def metric_func(preds, targets, alpha, beta=0.1): return (alpha / beta) * (targets - preds).mean(dim=tuple(range(2, len(preds) + 1))) class MockMetric(Metric): def func(self, preds, targets, alpha, beta=0.1): # Return ...
2.328125
2
answers/hackerrank/Raw Input.py
FeiZhan/Algo-Collection
3
51629
#@result Submitted a few seconds ago • Score: 10.00 Status: Accepted Test Case #0: 0.01s Test Case #1: 0s Test Case #2: 0s # Enter your code here. Read input from STDIN. Print output to STDOUT print raw_input()
2.375
2
Ex027.py
CaioBaima/cursoemvideo-python
0
51630
nome = str(input('Digite o seu nome completo:\n')) lista = nome.split() print('Seu primeiro nome é:\n {}'.format(lista[0])) print('Seu último nome é:\n {}'.format(lista[-1]))
3.90625
4
start.py
War3Map/LynaBot
0
51631
import subprocess from flask import Flask from os import environ BOT_START_FILE = 'run_bot.py' # for start PYTHON_PROCESS = 'python3' # for testing PYTHON_PROCESS = r"C:\Python3.7\python.exe" app = Flask(__name__) @app.route("/", methods=["GET"]) def index(): return "Bot is On" print(f"Running {BOT_START_FIL...
2.390625
2
parcelhubPOS/commons.py
ngcw/parcelhubpos
0
51632
<gh_stars>0 from .models import User, Branch, UserBranchAccess, Terminal from django.http import HttpResponse, HttpResponseRedirect from django.contrib.sessions.models import Session from django.utils import timezone from django.contrib.auth import login CONST_branchid = 'branchid' CONST_terminalid = 'terminalid' CONST...
2.140625
2
mecha/contrib/bolt/utils.py
Arcensoth/mecha
0
51633
__all__ = [ "BoltQuoteHelper", "rewrite_traceback", "fake_traceback", "internal", "INTERNAL_CODE", "SAFE_BUILTINS", ] from bisect import bisect from dataclasses import dataclass, field from types import CodeType, TracebackType from typing import Dict, List, Set, TypeVar from mecha.utils impor...
2.359375
2
RemueveSecretos/RemueveSecrets.py
FrEaKAlL/RemueveSecretos
0
51634
<filename>RemueveSecretos/RemueveSecrets.py #!/usr/bin/python from progress.bar import Bar, ChargingBar from colorama import Fore, init, Style init(autoreset = True) from RemueveSecretos.ManejadorDeArchivos import readFile, writeFile, ls, readFile from RemueveSecretos.Secrets import ClsSecrets def IniciaFlujoSecretos(S...
2.28125
2
Settings.py
Jeket/japonicus
0
51635
#!/bin/python import os import js2py from pathlib import Path from configStrategies import cS from configIndicators import cI class _settings: def __init__(self, **entries): ''' print(entries) def iterate(self, DATA): for W in DATA.keys(): if type(DATA[W]) == ...
2.171875
2
class_conflict.py
MrSometimeswinmid/DoAn
4
51636
<filename>class_conflict.py from datetime import timedelta from typing import List, Set, Tuple from class_subject import * from class_schedule import * class Conflict: """Đại diện cho hai xung đột giữa hai Subject (bị chồng lịch học).""" def __init__(self, subject1: Subject, subject2: Subject): self....
2.9375
3
haskpy/conftest.py
jluttine/haskpy
2
51637
import sys import hypothesis.strategies as st from hypothesis import given def is_pytest(): return "pytest" in sys.modules def pytest_configure(config): # Workaround for Hypothesis bug causing flaky tests if they use characters # or text: https://github.com/HypothesisWorks/hypothesis/issues/2108 @gi...
2.671875
3
readTempHumidity.py
Iizuki/Raspberry-Pi-double-DHT22-temp-humidity-logger
0
51638
<filename>readTempHumidity.py import Adafruit_DHT #Function to read data from DHT22 sensor def readTempHumidity(pin, result, index): DHT_SENSOR_TYPE = Adafruit_DHT.DHT22 humidity, temperature = Adafruit_DHT.read_retry(DHT_SENSOR_TYPE, pin) #Save values result[index] = humidity result[index+1]...
3.21875
3
tests/test_pre_gen_project/test_check_valid_email_address_format.py
lorenzwalthert/govcookiecutter
41
51639
<gh_stars>10-100 from hooks.pre_gen_project import check_valid_email_address_format import pytest # Define test cases for the `TestCheckValidEmailAddressFormat` test class args_invalid_email_addresses = ["hello.world", "foo_bar"] args_valid_email_addresses = ["<EMAIL>", "foo@bar"] class TestCheckValidEmailAddressFor...
2.859375
3
bin/SampleQCI_pca_convert.py
jkaessens/gwas-assoc
0
51640
<gh_stars>0 #!/usr/bin/env python import sys import re import os from os.path import * import string import re import gzip import math import decimal import datetime from os import listdir import subprocess # may also need some of these: # import Ingos lib #sys.path.append(join(sys.path[0], "../../all_scripts")) sy...
2.046875
2
transmute_core/tests/frameworks/test_aiohttp/test_parsing.py
toumorokoshi/web-transmute
0
51641
<reponame>toumorokoshi/web-transmute import pytest @pytest.mark.asyncio async def test_parsing_multiiple_query_params(cli): resp = await cli.get("/multiple_query_params?tag=foo&tag=bar") ret_value = await resp.json() assert 200 == resp.status assert ret_value == "foo,bar" @pytest.mark.asyncio async ...
2.1875
2
Diffie_Hellman.py
ExpandingS/basic-diffie-hellman
0
51642
#!/usr/bin/env python3 #Basic Diffie Hellman import random, numpy, sys, argparse if "-h" in sys.argv or "--help" in sys.argv: print("Usage:") print("./Diffie_Hellman.py") print("./Diffie_Hellman.py XOR") print() print("XOR option replaces (mod) with ^, and outputs how often it works.") exit()...
3.4375
3
download_test.py
BowangLan/uw-tools
0
51643
<reponame>BowangLan/uw-tools from httpx import AsyncClient, Request import asyncio import timeit from util import with_async_timeit from rich import print from rich.progress import Progress, TransferSpeedColumn, BarColumn, TimeElapsedColumn, DownloadColumn import sys print(sys.argv) if len(sys.argv) == 1: size =...
2.375
2
aiohttp_remotes/utils.py
rgacote/aiohttp-remotes
1
51644
from collections.abc import Container, Sequence from ipaddress import (IPv4Address, IPv4Network, IPv6Address, IPv6Network, ip_address, ip_network) from .exceptions import IncorrectIPCount, UntrustedIP MSG = ("Trusted list should be a sequence of sets " "with either addresses or networks....
3.125
3
Part-03-Understanding-Software-Crafting-Your-Own-Tools/models/edx-platform/common/djangoapps/util/url.py
osoco/better-ways-of-thinking-about-software
3
51645
<reponame>osoco/better-ways-of-thinking-about-software<filename>Part-03-Understanding-Software-Crafting-Your-Own-Tools/models/edx-platform/common/djangoapps/util/url.py """ Utility functions related to urls. """ import sys from importlib import import_module, reload from django.conf import settings from django.urls ...
2.75
3
app/core/utils/to_json.py
JordanDekker/ContainR
0
51646
<filename>app/core/utils/to_json.py import pandas as pd import numpy as np import collections import json import math from statistics import median def seq_length_to_json(df): """Convert sequence length distribution to JSON object. Args: df: DataFrame containing a subset of sequence length. ...
3.359375
3
programs/signals.py
michael-xander/communique-webapp
0
51647
from django.db.models.signals import post_save from django.dispatch import receiver from communique.utils.utils_signals import generate_notifications from user.models import NotificationRegistration from .models import Program @receiver(post_save, sender=Program) def post_program_save_callback(sender, **kwargs): ...
2.078125
2
tests/base/channels/test_channel.py
DHaspel/cavsim
0
51648
<reponame>DHaspel/cavsim from unittest import TestCase from cavsim.base.channels.base_channel import BaseChannel as Channel from cavsim.measure import Measure class TestChannel(TestCase): def test___init__(self): # Invalid tests with self.assertRaises(TypeError): Channel(123, False) ...
2.671875
3
examples/push.py
in-void/smsapi-python-client
37
51649
import os from smsapi.client import SmsApiPlClient access_token = os.getenv('SMSAPI_ACCESS_TOKEN') client = SmsApiPlClient(access_token=access_token) def send_push(): r = client.push.send(app_id='app id', alert='push notification text') print(r.id, r.date_created, r.scheduled_date, r.summary.points, r....
2.3125
2
AutoEncoder/trainer.py
CharlesRenyh/Erroneous-Old-German-Text-Correction
0
51650
from collections import deque import string from torch.utils.data import DataLoader import torch import torch.nn as nn import torch.optim as optim from datasets import TextDataset from model import LSTMAE from generate import generate import numpy as np data_root = 'Data' max_length = 50 batch_size = 50 num_epochs = 1...
2.71875
3
testing/test_block.py
eberharf/cfl
6
51651
<filename>testing/test_block.py import pytest from cfl.block import Block # fake Block class for testing class BabyBlock(Block): def __init__(self, data_info, params): super().__init__(data_info=data_info, params=params) self.name = 'bb' # functions that need to be instantiated but don't do a...
2.8125
3
Pacote Dawload/Projeto progamas Python/ex1041 Coordenadas de um ponto.py
wagnersistemalima/Exercicios-Python-URI-Online-Judge-Problems---Contests
1
51652
#Ex 1041 Coordenadas de um ponto 10/04/2020 x, y = map(float, input().split()) if x > 0 and y > 0: print('Q1') elif x < 0 and y > 0: print('Q2') if x > 0 and y < 0: print('Q4') elif x < 0 and y < 0: print('Q3') elif x == 0 and y == 0: print('Origem')
3.625
4
main.py
azerpas/Crypto2discord
6
51653
<reponame>azerpas/Crypto2discord #coding=utf-8 import requests, json, datetime, time, re, BeautifulSoup s = requests.session() channelID = 0 # INPUT YOUR DEFAULT CHANNEL ID channels = [] # [{''}] s = requests.session() channelID = 0 # INPUT YOUR DEFAULT CHANNEL ID #channels = [] # [{''}] botToken = '' # INPUT YO...
2.75
3
config_vars.py
EPFL-LAP/fpl20-placement
3
51654
N = 10 I = 60 CROSSBAR_FEEDBACK_DELAY = 75e-12 CROSSBAR_INPUT_DELAY = 95e-12
1.039063
1
benchmarks/crisp/nrows.py
datavalor/fastg3
1
51655
# %% import timeit import tqdm from os import path import inspect import numpy as np import dill import init import fastg3.crisp as g3crisp from plot_utils import plot_bench from constants import N_REPEATS, N_STEPS, DILL_FOLDER from number_utils import format_number from dataset_utils import AVAILABLE_DATASETS, load_d...
2.25
2
home/kwatters/harry/gestures/howdoyoudo.py
rv8flyboy/pyrobotlab
63
51656
def howdoyoudo(): global helvar if helvar <= 2: i01.mouth.speak("I'm fine thank you") helvar += 1 elif helvar == 3: i01.mouth.speak("you have already said that at least twice") i01.moveArm("left",43,88,22,10) i01.moveArm("right",20,90,30,10) i01.moveHand("left",0,0,0,0,0,119) i01.moveH...
3.671875
4
classa/classa/report/bank_forecasting/bank_forecasting.py
erpcloudsystems/classa
0
51657
from __future__ import unicode_literals import frappe from frappe import msgprint, _ import datetime from frappe.utils import flt from erpnext.accounts.utils import get_balance_on from frappe.utils import (flt, getdate, get_url, now, nowtime, get_time, today, get_datetime, add_days) def execute(filters=None): col...
1.78125
2
dutil/jupyter/_jupyter.py
mysterious-ben/dutil
0
51658
<gh_stars>0 from IPython.display import display from dutil.transform import ht def dht(arr, n: int = 2) -> None: """Display first and last (top and bottom) entries""" display(ht(arr, n))
2.734375
3
test/test_instance_actions_audits_api.py
p-fruck/python-contabo
2
51659
""" Contabo API The version of the OpenAPI document: 1.0.0 Contact: <EMAIL> Generated by: https://openapi-generator.tech """ import unittest import pfruck_contabo from pfruck_contabo.api.instance_actions_audits_api import InstanceActionsAuditsApi # noqa: E501 class TestInstanceActionsAuditsApi(u...
1.851563
2
Utils/EnumTrainMethods.py
AndresOtero/TensorDecompositionMachineLearning
3
51660
<gh_stars>1-10 import Utils.TrainMethods as TM TRAIN_VISION_METHOD = "TRAIN_VISION_METHOD" TRAIN_TEXT_METHOD = "TRAIN_TEXT_METHOD" TRAIN_TEXT_BINARY_METHOD = "TRAIN_TEXT_BINARY_METHOD" TRAIN_METHODS = {TRAIN_VISION_METHOD: (TM.train_vision, TM.test_vision), TRAIN_TEXT_METHOD: (TM.train_text, TM.test_...
1.4375
1
lib/kb_emirge/kb_emirgeClient.py
kbaseapps/kb_emirge
0
51661
# -*- coding: utf-8 -*- ############################################################ # # Autogenerated by the KBase type compiler - # any changes made here will be overwritten # ############################################################ from __future__ import print_function # the following is a hack to get the basec...
2.015625
2
setup.py
simonpf/pARTS
3
51662
<gh_stars>1-10 from setuptools import setup, find_packages from os import path here = path.abspath(path.dirname(__file__)) with open(path.join(here, 'README.md'), encoding='utf-8') as f: long_description = f.read() setup( name='artssat', # Required version='0.0.5', # Required description='High-level...
1.460938
1
p23/solve.py
josephok/ProjectEuler
0
51663
import prime MAX = 28124 prime._refresh(MAX/2) abundants = [n for n in range(1, MAX) if sum(prime.all_factors(n)) > n+n] abundants_dict = dict.fromkeys(abundants, 1) total = 0 for n in range(1, MAX): sum_of_abundants = 0 for a in abundants: if a > n: break if abundants_dict.get(n - a):...
3
3
app/home/views.py
zhouzhuowei/movie_project
0
51664
<reponame>zhouzhuowei/movie_project<gh_stars>0 #coding:utf8 from . import home @home.route("/") def index(): return "<h1 style='color:green'>this is home</h1>"
1.78125
2
clcache/server/__main__.py
univert/aclcache
4
51665
# We often don't use all members of all the pyuv callbacks # pylint: disable=unused-argument import sys, hashlib import logging import os import pickle import signal import argparse import re import pyuv from ..__main__ import getObjectFileHash class HashCache: def __init__(self, loop, excludePatterns, disableWat...
2.15625
2
hw_asr/model/__init__.py
kostyayatsok/asr_project_template
0
51666
from hw_asr.model.baseline_model import BaselineModel from hw_asr.model.gru_model import GRUModel from hw_asr.model.jasper_model import JasperModel from hw_asr.model.deepspeech2_model import DeepSpeech2Model __all__ = [ "BaselineModel", "GRUModel", "JasperModel", "DeepSpeech2Model" ]
1.179688
1
riotwrapper/const/val_const.py
Victoraq/Riot-API-Wrapper
0
51667
# flake8: noqa # fmt: off """List of Valorant API available regions and endpoints.""" REGION_URL = { "BR": "https://br.api.riotgames.com", "EUN": "https://eun.api.riotgames.com", "AP": "https://ap.api.riotgames.com", "KR": "https://kr.api.riotgames.com", "LATAM": "https://latam.api.riotgames.com",...
1.171875
1
core_get/configuration/environment_settings.py
core-get/core-get
0
51668
from dataclasses import dataclass from pathlib import PurePath from typing import Optional @dataclass(frozen=True) class EnvironmentSettings: working_dir: PurePath project_dir: Optional[PurePath] app_dir: PurePath cache_dir: PurePath catalog_url: str
1.851563
2
mojo/tools/testing/mojom_fetcher/mojom_gn_tests.py
zbowling/mojo
1
51669
<reponame>zbowling/mojo<filename>mojo/tools/testing/mojom_fetcher/mojom_gn_tests.py # Copyright 2015 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import io import os.path import unittest from fakes import FakeMojomFile...
1.945313
2
exerciciosModuloIII/ex082-dividindoValoresVariasListas.py
ascaniopy/python
0
51670
num = list() pares = list() impares = list() while True: num.append(int(input('Digite um número: '))) resp = str(input('Quer continuar? [S/N] ')) if resp in 'Nn': break for i, v in enumerate(num): if v % 2 == 0: pares.append(v) elif v % 2 == 1: impares.append(v) print('=' ...
3.71875
4
wostools/sources/scopus.py
hp0404/python-wostools
19
51671
<reponame>hp0404/python-wostools<filename>wostools/sources/scopus.py from collections import defaultdict import logging import re from typing import Dict, Iterable, List, Optional, TextIO, Tuple from wostools.article import Article from wostools.exceptions import InvalidScopusFile logger = logging.getLogger(__name__...
2.734375
3
install_packages/ip_ipython.py
nagyistoce/devide.johannes
1
51672
<filename>install_packages/ip_ipython.py # Copyright (c) <NAME>, TU Delft. # All rights reserved. # See COPYRIGHT for details. import config from install_package import InstallPackage import os import shutil import sys import utils URL_BASE = "http://ipython.scipy.org/dist/" IPY_BASENAME = "ipython-0.10.2" IPY_ARCHI...
2.59375
3
test/viz/helpers/test_color_continuous_layer.py
CristianPachacama/cartoframes
1
51673
<gh_stars>1-10 import unittest try: from unittest.mock import Mock except ImportError: from mock import Mock from cartoframes.viz import helpers, Source class TestColorContinuousLayerHelper(unittest.TestCase): def setUp(self): self.orig_compute_query_bounds = Source._compute_query_bounds S...
2.65625
3
python/gjgwy/gjgwy.py
luckykiddie/quick-and-dirty
0
51674
#-*- coding: utf-8 -*- import xlrd import xlwt import re # 检查是否满足报考条件 def check(row_value): zy = row_value[11] if not checkZY(zy): return False xw = row_value[13] if not checkXW(xw): return False if checkSpecial(row_value): return False return True # 检查是否满足专业要求 def ...
2.734375
3
mozumder/template/components/__init__.py
mozumder/django-mozumder
1
51675
<reponame>mozumder/django-mozumder<gh_stars>1-10 from .component import code, Component from .components import Components from .raw import raw from .div import div
1.046875
1
healthtools_ec/models/user.py
CodeForAfrica/healthtools-ezolwaluko
0
51676
from flask_security import RoleMixin, Security, SQLAlchemyUserDatastore, UserMixin from sqlalchemy import Boolean, Column, DateTime, Integer, String, func from wtforms import PasswordField from wtforms.fields import EmailField from wtforms.validators import InputRequired from ..app import app, db from ..forms import F...
2.484375
2
tests/typed_list/test_opt.py
canyon289/Theano-PyMC
1
51677
<reponame>canyon289/Theano-PyMC import numpy as np import theano import theano.tensor as tt import theano.typed_list from tests.tensor.utils import rand_ranged from theano import In from theano.typed_list.basic import Append, Extend, Insert, Remove, Reverse from theano.typed_list.type import TypedListType class Test...
2.1875
2
server/athenian/api/models/web/jira_issue.py
athenianco/athenian-api
9
51678
from typing import List, Optional from athenian.api.models.web.base_model_ import AllOf, Model from athenian.api.models.web.jira_epic_issue_common import JIRAEpicIssueCommon from athenian.api.models.web.pull_request import PullRequest class _JIRAIssueSpecials(Model): """Details specific to JIRA issues.""" o...
2.34375
2
buzzard/_footprint_tile.py
ashnair1/buzzard
0
51679
<gh_stars>0 """>>> help(TileMixin)""" import numpy as np class TileMixin: """Private mixin for the Footprint class containing tiling subroutines""" _TILE_BOUNDARY_EFFECTS = {'extend', 'exclude', 'overlap', 'shrink', 'exception'} _TILE_OCCURRENCE_BOUNDARY_EFFECTS = {'extend', 'exception'} _TILE_BOUNDA...
2.125
2
students/k3342/laboratory_works/Kataeva_Veronika/laboratory_work_23/newspapers/newspapersapp/apps.py
KataevaVeronika/ITMO_ICT_WebProgramming_2020
0
51680
from django.apps import AppConfig class NewspapersappConfig(AppConfig): name = 'newspapersapp'
1.179688
1
bots/vpc_isolate.py
ayen-bsci/cloud-bots
68
51681
''' ##vpc-isolate What it does: turn off dns resource change network acl to new empty one with deny all add iam policy, to all users in the account, which limits vpc use: ec2 and sg use in the vpc Usage: AUTO: vpc_isolate Limitation: None ''' import boto3 from botocore.exception...
2.515625
3
igmibot.py
Lunaresk/igmibot
0
51682
<filename>igmibot.py from telegram import (InlineKeyboardButton, InlineKeyboardMarkup, ReplyKeyboardMarkup, KeyboardButton, ReplyKeyboardRemove) from telegram.ext import (CommandHandler, MessageHandler, ConversationHandler, CallbackQueryHandler, Filters) from ..errorCallback import error_callback from . import dbFuncs ...
2.421875
2
levels 2.0.py
el-jeu/game
0
51683
levelsMap = [ #level 1-1 ("g1","f1",[["ma1","ma3","ma5","b1","m1","e1","m1","b1","ma1","ma3","ma5"], ["ma2","ma4","ma6","b1","b1","b1","b1","b1","ma2","ma4","ma6"], ["b1","b1","b1","m1","b1","m1","b1","m1","b1","b1","b1"], ["m1","b1","b1","b1","b1","b1","b1","b1","b1","b1","m1...
1.53125
2
lunar_python/LunarTime.py
6tail/lunar-python
61
51684
# -*- coding: utf-8 -*- from . import NineStar from .util import LunarUtil class LunarTime: """ 时辰 """ def __init__(self, lunar_year, lunar_month, lunar_day, hour, minute, second): from . import Lunar self.__lunar = Lunar.fromYmdHms(lunar_year, lunar_month, lunar_day, hour, minute, se...
2.78125
3
web_scraping/ec2files/ec2file94.py
nikibhatt/Groa
1
51685
from scraper import * s = Scraper(start=167508, end=169289, max_iter=30, scraper_instance=94) s.scrape_letterboxd()
1.703125
2
cortex/raw/calls.py
BIDMCDigitalPsychiatry/LAMP-cortex
4
51686
""" Module for raw feature calls """ from ..feature_types import raw_feature @raw_feature( name="lamp.calls", dependencies=["lamp.calls"] ) def calls(_limit=10000, cache=False, recursive=False, **kwargs): """ Get all call data bounded by the time interval. Args: _...
2.71875
3
djangotasks/tests.py
godber/crunch.io-dashboard
2
51687
# # Copyright (c) 2010 by nexB, Inc. http://www.nexb.com/ - All rights reserved. # # Redistribution and use in source and binary forms, with or without modification, # are permitted provided that the following conditions are met: # # 1. Redistributions of source code must retain the above copyright notice, # ...
1.460938
1
ailearn/nn/losses.py
axi345/ailearn
39
51688
# -*- coding: utf-8 -*- # Copyright 2018 <NAME> & <NAME>. 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 # #...
2.90625
3
mhc_tools/tests/test_generate_peptides.py
ignatovmg/mhc-adventures
0
51689
import unittest import prody import numpy as np import pytest import itertools from path import Path from ..mhc_peptide import BasePDB from ..sampling.generate_peptides import PeptideSampler from .. import utils from ..helpers import isolate, isolated_filesystem @pytest.fixture() def default_mhc(): return utils...
2.03125
2
src/pytoydb/query_api.py
mansoor96g/py-toy-db
0
51690
# -*- coding: utf-8 -*- """ API для формирования запросов к хранилищу """ class Simple(object): """ Простейший API Запросы выглядят примерно так: data.query('a', 1)('b', 2) """ def __init__(self, dep, steps=None): self._dep = dep self._steps = steps or [] def __call__(self, na...
2.609375
3
dr_visibilities.py
jaycedowell/ovro_data_recorder
1
51691
#!/usr/bin/env python from __future__ import division, print_function try: range = xrange except NameError: pass import os import sys import h5py import json import time import numpy import ctypes import signal import logging import argparse import threading from functools import reduce from datetime impo...
1.640625
2
ifcb/tests/data/fileset_info.py
GobySoft/pyifcb
5
51692
<reponame>GobySoft/pyifcb<filename>ifcb/tests/data/fileset_info.py import os import sys import numpy as np from ifcb import DataDirectory TEST_DATA_DIR=os.path.join('ifcb','tests','data','test_data') WHITELIST = ['data','white'] TEST_FILES = { 'D20130526T095207_IFCB013': { 'n_rois': 19, 'n_targ...
1.914063
2
httpclient.py
timvm1108/CMPUT404-assignment-web-client
0
51693
<gh_stars>0 #!/usr/bin/env python3 # coding: utf-8 # Copyright 2016 <NAME>, https://github.com/tywtyw2002, and https://github.com/treedust # # 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 # ...
3.125
3
visualize_graph.py
yukw777/GATA-public
0
51694
<reponame>yukw777/GATA-public<filename>visualize_graph.py import yaml import json import networkx as nx from agent import Agent from dgu.utils import draw_graph def main( config_filename: str, data_filename: str, ckpt_filename: str, graph_filename: str ) -> None: with open(config_filename) as f: con...
2.546875
3
src/python/controller/controller_persist.py
AlekLT/seedsync
255
51695
# Copyright 2017, <NAME>, All rights reserved. import json from common import overrides, Constants, Persist, PersistError class ControllerPersist(Persist): """ Persisting state for controller """ # Keys __KEY_DOWNLOADED_FILE_NAMES = "downloaded" __KEY_EXTRACTED_FILE_NAMES = "extracted" ...
2.625
3
4-1/WIndow Programing/20180316/20125345.py
define16/Class
0
51696
cnt = 1; for i in [10, 2, 7] : print("%d : " % cnt , end = "" ); for j in range(1, i+1, 1) : print("■", end = ""); print(" (%d)" % i); cnt += 1;
3.515625
4
stacking_ensemble.py
eivistr/pan21-style-change-detection-stacking-ensemble
0
51697
import copy import numpy as np import pandas as pd import os import contextlib from sklearn.metrics import f1_score, accuracy_score from sklearn.model_selection import StratifiedKFold from sklearn.linear_model import LogisticRegression from sklearn.pipeline import make_pipeline from sklearn.preprocessing import Standa...
2.484375
2
Archive/plot_scripts/graph_MSL_0.1.py
96kernel/MSL_ThermalData_Visualizer
1
51698
<filename>Archive/plot_scripts/graph_MSL_0.1.py from matplotlib import pyplot as plt from matplotlib.dates import date2num, DateFormatter import pandas as pd import datetime as dt # load data file_loc = r'UEG_LGN2_RAWDATA.xlsx' df = pd.read_excel(file_loc, usecols=[0,1,2,3,4,5,6,7,8,9,10]) row_skip = 6 raw_date = ...
2.421875
2
Day 19/part2.py
jonomango/advent-of-code-2020
0
51699
import math import copy from functools import reduce def matches(line, rules, rule): # this is the base case if "\"" in rule: if len(line) > 0 and line[0] == rule[1]: return [1] else: return [] # rule = ['1', '2'] rule = rule.split(" ") # this stores the possible offsets ...
3.09375
3