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
python/ray/dataframe/dataframe.py
cnheider/ray
0
12778351
from __future__ import absolute_import from __future__ import division from __future__ import print_function import pandas as pd from pandas.api.types import is_scalar from pandas.util._validators import validate_bool_kwarg from pandas.core.index import _ensure_index_from_sequences from pandas._libs import lib from pa...
2.765625
3
panbib.py
fmrchallenge/tlzoo
3
12778352
<reponame>fmrchallenge/tlzoo #!/bin/env python """panbib - map tlzoo YAML data into various formats """ from __future__ import print_function import argparse import os.path import glob import yaml def find_db(): """ Assume that ref/ directory is at same level as this file (panbib.py). """ ref_path =...
2.765625
3
src/io/create_jsons_from_csv.py
libercapital/dados_publicos_cnpj_receita_federal
7
12778353
import json import os import pandas as pd from src import DATA_FOLDER, UNZIPED_FOLDER_NAME from src.io import CNAE_JSON_NAME, NATJU_JSON_NAME, QUAL_SOCIO_JSON_NAME, MOTIVOS_JSON_NAME, PAIS_JSON_NAME, \ MUNIC_JSON_NAME from src.io.get_last_ref_date import main as get_last_ref_date def main(ref_date=No...
2.6875
3
day18.py
bloy/adventofcode-2017
0
12778354
#!env python import aoc import collections import pprint import re ISINT = re.compile(r'^-?[0-9]+$') def parse_data(lines): return [line.split() for line in lines] def valueof(v, registers): if v is None: return None if ISINT.match(v): return int(v) return registers[v] def solve...
3
3
openregistry/assets/core/events.py
EBRD-ProzorroSale/openregistry.assets.core
0
12778355
<gh_stars>0 # -*- coding: utf-8 -*- class AssetInitializeEvent(object): """ Asset initialization event. """ def __init__(self, asset): self.asset = asset
1.9375
2
fileresponse/asgi.py
ephes/django-fileresponse
2
12778356
<reponame>ephes/django-fileresponse<gh_stars>1-10 # AUTOGENERATED! DO NOT EDIT! File to edit: nbs/02_asgi.ipynb (unless otherwise specified). __all__ = ['get_asgi_application'] # Cell import django from fileresponse.handlers import AsyncFileASGIHandler def get_asgi_application(): """ Similar to django.cor...
1.820313
2
test/test_list_transactions_by_address_response_item.py
xan187/Crypto_APIs_2.0_SDK_Python
0
12778357
""" CryptoAPIs Crypto APIs 2.0 is a complex and innovative infrastructure layer that radically simplifies the development of any Blockchain and Crypto related applications. Organized around REST, Crypto APIs 2.0 can assist both novice Bitcoin/Ethereum enthusiasts and crypto experts with the development of thei...
1.851563
2
scraper/storage_spiders/thayroicom.py
chongiadung/choinho
0
12778358
<reponame>chongiadung/choinho # Auto generated by generator.py. Delete this line if you make modification. from scrapy.spiders import Rule from scrapy.linkextractors import LinkExtractor XPATH = { 'name' : "//h1[@class='post-title entry-title item_name']", 'price' : "//div[@class='prod_pricebox_price_final']/s...
2.015625
2
tests/test_environment.py
NGalandim/roboai-python-cli
3
12778359
from robo_bot_cli.main import cli def test_activate_environment(runner): result = runner.invoke(cli, ['environment', 'activate', 'integration']) assert result.exit_code == 0 assert 'The connection to the integration environment was successfully established.' in result.output def test_create_environment...
2.453125
2
leetcode/course_schedule.py
dxmahata/codinginterviews
0
12778360
<gh_stars>0 """ There are a total of n courses you have to take, labeled from 0 to n - 1. Some courses may have prerequisites, for example to take course 0 you have to first take course 1, which is expressed as a pair: [0,1] Given the total number of courses and a list of prerequisite pairs, is it possible for you ...
4.15625
4
src/bank/bankia/__init__.py
sunbit/banking
0
12778361
from .scrapping import login, get_account_transactions, get_credit_card_transactions from .parsing import parse_account_transaction, parse_credit_card_transaction
1.078125
1
river_crossing_riddle.py
Sanchitraina1999/eAI
1
12778362
"""River Crossing Riddle""" from search_solver import SearchSolver class RiverCrossingRiddle(SearchSolver): """Class to solve River Crossing riddle""" def __init__(self, boat_capacity): agents = ["robot", "fox", "chicken", "chicken-feed"] agent_states = [0, 1] self.capacity = boat_ca...
3.703125
4
anaf/core/api/views.py
tovmeod/anaf
2
12778363
<gh_stars>1-10 from rest_framework import viewsets from anaf.core.rendering import API_RENDERERS from anaf.core.models import User as Profile, AccessEntity, Group, Perspective, Object, Module import serializers from anaf.viewsets import AnafViewSet class CoreBaseViewSet(AnafViewSet): module = 'anaf.core' class...
2.296875
2
restapi/models.py
AymenQ/tarteel.io
0
12778364
from __future__ import unicode_literals from django.db import models class DemographicInformation(models.Model): session_id = models.CharField(max_length=32, blank=True) # This could be used to store different platforms such as android, # ios, web if different identification methods are used for each one....
2.359375
2
services/web/server/src/simcore_service_webserver/storage_api.py
GitHK/osparc-simcore-forked
0
12778365
""" Storage subsystem's API: responsible of communication with storage service """ import logging from pprint import pformat from aiohttp import web from yarl import URL from servicelib.rest_responses import unwrap_envelope from .storage_config import get_client_session, get_storage_config log = logging.getLogger(...
2.140625
2
twodlearn/bayesnet/bayesnet.py
danmar3/twodlearn
0
12778366
<filename>twodlearn/bayesnet/bayesnet.py """Definition of several bayesian neural-networks """ import numbers import warnings import numpy as np import tensorflow as tf import twodlearn as tdl from twodlearn import common import twodlearn.feedforward as tdlf import tensorflow_probability as tfp from collections import...
2.25
2
scrapers/NOW-norwich/councillors.py
DemocracyClub/LGSF
4
12778367
<filename>scrapers/NOW-norwich/councillors.py from lgsf.councillors.scrapers import CMISCouncillorScraper class Scraper(CMISCouncillorScraper): base_url = "https://cmis.norwich.gov.uk/live/Councillors.aspx"
1.523438
2
src/masoniteorm/commands/MakeObserverCommand.py
yubarajshrestha/orm
0
12778368
<filename>src/masoniteorm/commands/MakeObserverCommand.py import os import pathlib from cleo import Command from inflection import camelize, underscore class MakeObserverCommand(Command): """ Creates a new observer file. observer {name : The name of the observer} {--m|model=None : The na...
2.4375
2
sdk/python/pulumi_azure_native/documentdb/__init__.py
pulumi-bot/pulumi-azure-native
0
12778369
<gh_stars>0 # coding=utf-8 # *** WARNING: this file was generated by the Pulumi SDK Generator. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** # Export this package's modules as members: from ._enums import * from .cassandra_cluster import * from .cassandra_data_center import * fro...
1.078125
1
Algorithm/Array/985. Sum of Even Numbers After Queries.py
smsubham/Data-Structure-Algorithms-Questions
0
12778370
<filename>Algorithm/Array/985. Sum of Even Numbers After Queries.py #https://leetcode.com/problems/sum-of-even-numbers-after-queries/ # Time Complexity: O(N+Q) where N is the length of A and Q is the number of queries. #Space Complexity: O(Q) class Solution: def sumEvenAfterQueries(self, nums: List[int], queries: ...
3.765625
4
kattiskitten/language_detector.py
FelixDQ/kattis-kitten
0
12778371
import glob import re import pkgutil import kattiskitten.languages as languages SUPPORTED_LANGUAGES = [] LANGUAGE_EXTENSIONS = {} CONFIGS = {} for importer, language, ispkg in pkgutil.iter_modules(languages.__path__): SUPPORTED_LANGUAGES.append(language) config = importer.find_module(language).load_module(lan...
2.703125
3
powernad/Object/AdKeyword/RequestObject/CreateAdKeywordObject.py
devkingsejong/python---PowerNad
34
12778372
class CreateAdKeywordObject: def __init__(self, keyword): self.bidAmt = None self.customerId = None self.keyword = keyword self.useGroupBidAmt = None self.userLock = None
2.203125
2
model_function_tests/fr/test_rule_based_tagger.py
UCREL/pymusas-models
0
12778373
import spacy from spacy.tokens import Doc from spacy.vocab import Vocab TEST_TOKENS = ['Une', 'banque', 'est', 'une', 'institution', 'financière', '.', '5'] TEST_POS = ['DET', 'NOUN', 'AUX', 'DET', 'NOUN', 'ADJ', 'PUNCT', 'NUM'] TEST_SPACES = [True] * len(TEST_TOKENS) def test_single_UPOS_contextual() -> None: ...
2.6875
3
arrays_tricks.py
dremdem/pythons_handy_stuffs
0
12778374
<reponame>dremdem/pythons_handy_stuffs a = [1, 3, 4, 5] a.insert(1, 2) print(a)
2.828125
3
exercises/zh/solution_03_09_01.py
Jette16/spacy-course
2,085
12778375
from spacy.lang.zh import Chinese from spacy.tokens import Token nlp = Chinese() # 注册词符的扩展属性"is_country",其默认值是False Token.set_extension("is_country", default=False) # 处理文本,将词符"新加坡"的is_country属性设置为True doc = nlp("我住在新加坡。") doc[3]._.is_country = True # 对所有词符打印词符文本及is_country属性 print([(token.text, token._.is_country) ...
2.984375
3
python/matching-brackets/matching_brackets.py
tamireinhorn/exercism
0
12778376
<gh_stars>0 OPENINGS_DICT = {'}': '{', ')': '(', ']': '['} CLOSINGS = list(OPENINGS_DICT.keys()) OPENINGS = list(OPENINGS_DICT.values()) def is_paired(input_string): # The gist of this is, you build a stack of the openings:, like (, [, {. openings_stack = [] for element in input_string: if elemen...
3.6875
4
python/wordSim.py
jfmyers/String-Similarity
3
12778377
from charPairs import CharPairs from decimal import * #Word Similarity Algorithm #Similarity(string1, string2) = 2 * number of incommon char. pairs / sum of total number of char. pairs in each string class similarity: def __init__(self,string1, string2): #get character pairs for string1 strChar1 = C...
3.640625
4
generic_api/generics/entity.py
guestready/generic_api
1
12778378
class GenericEntity: def __init__(self, *args, **kwargs): pass def is_valid(self): raise NotImplementedError @property def data(self): raise NotImplementedError
2.296875
2
test/test_prompts.py
arpansahoo/wikipedia-speedruns
12
12778379
<reponame>arpansahoo/wikipedia-speedruns import enum import pytest PROMPTS = [ { "start" : "Johns Hopkins University", "end" : "Baltimore", }, { "start" : "A", "end" : "B", }, ] @pytest.fixture() def prompt_set(cursor): query = "INSERT INTO sprint_prompts (prompt...
2.1875
2
setup.py
jhgg/jeev
18
12778380
import os import jeev from setuptools import setup, find_packages def read(fname): return open(os.path.join(os.path.dirname(__file__), fname)).read() setup( name="jeev", version=jeev.version.split('-')[0] + 'b0', author="<NAME>", author_email="<EMAIL>", description="A simple chat bot, at you...
1.648438
2
hipotenusa/__init__.py
agucova/cs42
0
12778381
<reponame>agucova/cs42 import check50 @check50.check() def triangulo_1(): """triangulo_1""" check50.run("python3 hipotenusa.py").stdin("3\n4", prompt=False).stdout("Hipotenusa: 5", regex=False).exit(0) @check50.check() def triangulo_2(): """triangulo_2""" check50.run("python3 hipotenusa.py").stdin("6\...
3
3
misc/permissions.py
jokedurnez/Psychosis
0
12778382
#!/usr/bin/python2 import os for par, dirs, files in os.walk(os.environ.get("BIDSDIR")): print(par) if par.startswith(os.path.join(os.environ.get("BIDSDIR"),'derivatives/')): for d in dirs: os.chmod(par + '/' + d, 0770) for f in files: os.chmod(par + '/' + f, 0660) el...
2.640625
3
day05/python/subesokun/main.py
matason/aoc-2018
17
12778383
def reactLetters(a, b): return a.upper() == b.upper() and ((a.islower() and b.isupper()) or (b.islower() and a.isupper())) def reactPolymer(polymer): reacted_polymer = '' i = 0 polymer_len = len(polymer) while i < len(polymer): if i < polymer_len - 1 and reactLetters(polymer[i], polymer[i +...
3.734375
4
gym_gathering/observations/basic_generators.py
NeoExtended/gym-gathering
0
12778384
from typing import Tuple import gym import numpy as np from gym_gathering.observations.base_observation_generator import ObservationGenerator class SingleChannelObservationGenerator(ObservationGenerator): def __init__( self, maze: np.ndarray, random_goal: bool, goal_range: int, ...
2.46875
2
SLpackage/private/pacbio/pythonpkgs/pysiv2/lib/python2.7/site-packages/pysiv2/custom/test_report_metrics.py
fanglab/6mASCOPE
5
12778385
<filename>SLpackage/private/pacbio/pythonpkgs/pysiv2/lib/python2.7/site-packages/pysiv2/custom/test_report_metrics.py<gh_stars>1-10 from collections import defaultdict from unittest import SkipTest import operator as OP import logging import json import os.path from pbcommand.pb_io.report import load_report_from_json...
2.421875
2
Game/spriteFunc.py
murrayireland/Neural-Net-Game-2019
1
12778386
from sprites import * import pygame import random import os import subprocess class Mixin: #dd clouds and fire to game def add_sprite(self,event,coOrds = None): #Check coOrds are valid clouds and fire to game (coOrds = None is used to random generate a sprite's coOrds) if (coOrds == None) or (coOrds[...
3.015625
3
solution/00004-count_words.py
wuooyun/show-me-the-code
0
12778387
#!/usr/bin/env python3 from collections import OrderedDict filepath = r"C:\Users\Yun\Downloads\python-3.9.0-docs-text\library\code.txt" dict_words = OrderedDict() with open(filepath,'r') as f: words = f.read().lower().replace('\n','').split(' ') set_words = set(words) set_words.remove('') for word in set_words: ...
3.375
3
.ipynb_checkpoints/generate_docs-checkpoint.py
EricCacciavillani/eFlow
1
12778388
<filename>.ipynb_checkpoints/generate_docs-checkpoint.py # Import libs import os return getmarkdown(mod) # Taken from utils.sys_utils def get_all_directories_from_path(directory_path): """ directory_path: Given path that already exists. Returns: Returns back a set a directories with the p...
2.859375
3
tembozapp/param.py
fazalmajid/temboz
55
12778389
<reponame>fazalmajid/temboz<gh_stars>10-100 ######################################################################## # # Parameter file for Temboz # ######################################################################## # number of RSS feeds fetched in parallel feed_concurrency = 20 # Maximum number of articles sh...
1.820313
2
test/cli/compute-scripts/with-init-and-finalize.py
SabineEmbacher/xcube
97
12778390
<filename>test/cli/compute-scripts/with-init-and-finalize.py # noinspection PyUnusedLocal def compute(variable_a, variable_b, input_params=None, **kwargs): a = input_params.get('a', 0.5) b = input_params.get('b', 0.5) return a * variable_a + b * variable_b def initialize(input_cubes, input_var_names, inpu...
2.578125
3
tests/test_deprecated.py
cloudblue/connect-python-sdk
13
12778391
# -*- coding: utf-8 -*- # This file is part of the Ingram Micro Cloud Blue Connect SDK. # Copyright (c) 2019-2020 Ingram Micro. All Rights Reserved. import pytest from mock import patch from connect.exceptions import Message from connect.resources.base import BaseResource from .common import Response def test_depr...
2.234375
2
interlink/migrations/0001_initial.py
FarsetLabs/farset-nadine
0
12778392
<filename>interlink/migrations/0001_initial.py # -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations from django.conf import settings class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ...
1.78125
2
Python/Courses/Python-Tutorials.Zulkarnine-Mahmud/00.Fundamentals/10.0-Debugging.py
shihab4t/Books-Code
0
12778393
<gh_stars>0 user_name = input("You name: ") value = 1 new_string = value + user_name print(new_string)
3.578125
4
zvmsdk/tests/unit/test_utils.py
FerrySchuller/python-zvm-sdk
0
12778394
<gh_stars>0 # Copyright 2017 IBM Corp. # # 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...
1.929688
2
rules/rule.py
harsh07021999/fuzzython
16
12778395
from predicate import Predicate __author__ = '' class Rule(object): """ Base class for fuzzy rules """ __COUNT = 0 __slots__ = ('_antecedent', '_consequent', '_weight', '_number') def __init__(self, antecedent, consequent, weight=1): """ Initialize a rule ...
3.375
3
src/pbn_api/migrations/0027_przemapuj_rok_publikacji.py
iplweb/django-bpp
1
12778396
# Generated by Django 3.0.14 on 2021-08-17 22:16 import warnings from django.core.paginator import Paginator from django.db import migrations from bpp.util import pbar def value(elem, *path, return_none=False): v = None if elem.versions: for _elem in elem.versions: if _elem["current"]: ...
1.945313
2
demo/admin.py
DevKor-Team/devkor_hackathon_back
0
12778397
from django.contrib import admin from .models import Demo, Emoji, Tag, TechStackTag, Comment admin.site.register(Demo) admin.site.register(Tag) admin.site.register(TechStackTag) admin.site.register(Comment) admin.site.register(Emoji)
1.359375
1
.buildkite/dagster-buildkite/dagster_buildkite/images/versions.py
asamoal/dagster
0
12778398
<filename>.buildkite/dagster-buildkite/dagster_buildkite/images/versions.py<gh_stars>0 import os import yaml def get_image_version(image_name: str) -> str: root_images_path = os.path.join( os.path.dirname(os.path.realpath(__file__)), "..", "..", "..", "..", "python...
2.09375
2
src/evaluator/evaluator.py
JonasFrey96/RPOSE
0
12778399
<gh_stars>0 import os import sys os.chdir(os.path.join(os.getenv("HOME"), "RPOSE")) sys.path.insert(0, os.getcwd()) sys.path.append(os.path.join(os.getcwd() + "/src")) sys.path.append(os.path.join(os.getcwd() + "/core")) sys.path.append(os.path.join(os.getcwd() + "/segmentation")) import coloredlogs coloredlogs.inst...
1.742188
2
app/user_agents.py
cclauss/personfinder
1
12778400
#!/usr/bin/python2.7 # Copyright 2010 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ...
2.390625
2
visual_dynamics/utils/tests/test_generator.py
alexlee-gk/visual_dynamics
30
12778401
<reponame>alexlee-gk/visual_dynamics import tempfile import numpy as np from nose2 import tools from visual_dynamics.utils import DataContainer, DataGenerator container_fnames = [tempfile.mktemp() for _ in range(4)] num_steps_per_traj = [100] * 4 + [50] * 12 + [100] + [150] * 6 num_trajs_per_container = [4, 12, 1, 6...
2.140625
2
maas/plugins/neutron_metadata_local_check.py
claco/rpc-openstack
0
12778402
<reponame>claco/rpc-openstack<gh_stars>0 #!/usr/bin/env python # Copyright 2014, Rackspace US, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LIC...
1.84375
2
covidsafescan/__main__.py
micolous/covidsafescan
1
12778403
<filename>covidsafescan/__main__.py #!/usr/bin/env python3 import base64 import bleak import asyncio import traceback import argparse import sys import datetime import json APPLE_ID = 0x4c WITHINGS_ID = 1023 STAGING_UUID = '17e033d3-490e-4bc9-9fe8-2f567643f4d3' PRODUCTION_UUID = 'b82ab3fc-1595-4f6a-80f0-fe094cc218f9' ...
2.65625
3
pylabnet/network/client_server/hdawg.py
wi11dey/pylabnet
10
12778404
from pylabnet.network.core.service_base import ServiceBase from pylabnet.network.core.client_base import ClientBase class Service(ServiceBase): def exposed_set_direct_user_register(self, awg_num, index, value): return self._module.set_direct_user_register(awg_num, index, value) def exposed_get_direc...
2.453125
2
ppgan/solver/lr_scheduler.py
pcwuyu/PaddleGAN
40
12778405
<filename>ppgan/solver/lr_scheduler.py # Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserve. # # 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/...
2.25
2
Python/to-lower-case.py
Ravan339/LeetCode
4
12778406
<gh_stars>1-10 # https://leetcode.com/problems/to-lower-case/submissions/ class Solution: def toLowerCase(self, str): """ :type str: str :rtype: str """ return str.lower()
3.09375
3
file_explorer/seabird/dat_file.py
sharksmhi/file_explorer
0
12778407
<filename>file_explorer/seabird/dat_file.py from file_explorer.file import InstrumentFile class DatFile(InstrumentFile): suffix = '.dat' def _save_info_from_file(self): """ Binary file, sort of """ pass def _save_attributes(self): pass
2.640625
3
tests/test_vcs_verify_read_a_isofill.py
scottwittenburg/vcs
11
12778408
import basevcstest class TestVCSVerify(basevcstest.VCSBaseTest): def testReadIsofill(self): iso = self.x.getisofill("a_isofill") assert(iso.levels != [])
1.898438
2
api/routers/search.py
Amsterdam/fixxx-cspp-mini-crm-api
1
12778409
from fastapi import APIRouter, Depends, Request from sqlalchemy.orm import Session from api import search from ..dependencies import get_user router = APIRouter() # Dependency def get_db(request: Request): return request.state.db @router.get("/api/v1/search/{key}") def search_schools_and_contacts(key, db: Sess...
2.390625
2
anime_downloader/extractors/vidstream.py
danielb2/anime-downloader
0
12778410
<reponame>danielb2/anime-downloader import logging import re import sys from anime_downloader.extractors.base_extractor import BaseExtractor from anime_downloader.sites import helpers logger = logging.getLogger(__name__) class VidStream(BaseExtractor): def _get_data(self): url = self.url.replace('https://...
2.671875
3
summary_chart.py
DA04/fitness_tracker_data_parsing
0
12778411
# Stacked Histogram with minutes spent on training type from monthly perspective import psycopg2 import pandas as pd import matplotlib.pyplot as plt from datetime import datetime import seaborn as sns from matplotlib.pyplot import figure # get session data summary with sport split conn = psycopg2.connect(host="localho...
2.953125
3
grand_contest/012/A.py
FGtatsuro/myatcoder
0
12778412
import sys input = sys.stdin.readline sys.setrecursionlimit(10 ** 7) n = int(input()) a = sorted(list(map(int, input().split()))) ans = 0 for i in range(n): ans += a[(3 * n) - (2*i + 2)] print(ans)
2.75
3
descriptive/descriptive/doctype/industries/test_industries.py
ujjwalkumar93/descriptive
0
12778413
<gh_stars>0 # Copyright (c) 2022, k2s.co and Contributors # See license.txt # import frappe import unittest class TestIndustries(unittest.TestCase): pass
1.070313
1
fast_autoGrad/autoGrad.py
juliaprocess/ml_libs
4
12778414
#!/usr/bin/env python #This example show how to use pytorch to #solve a convex optimization problem # Optimize x^T A x + b^T x # A = [1 0;0 2] , b = [1, 2] , solution = -[1/2 1/2] import torch from torch.autograd import Variable import numpy as np from minConf_PQN import * dtype = torch.FloatTensor #dtype = torch....
3.34375
3
tests/test_version.py
kelsin/mypyprox
0
12778415
<filename>tests/test_version.py import io import contextlib import unittest from mypyprox import version class TestTypes(unittest.TestCase): def test_version(self): self.assertTrue(isinstance(version.__version__, str)) def test_main(self): out = io.StringIO() with contextlib.redirect...
2.734375
3
LC/557c.py
szhu3210/LeetCode_Solutions
2
12778416
class Solution(object): def reverseWords(self, s): """ :type s: str :rtype: str """ words = s.split(' ') words = map(lambda x: x[::-1], words) res = ' '.join(words) return res
3.40625
3
scripts/EmailWorstCorrections/email_worst_correction_lambda_function.py
Ivan-Nebogatikov/ChineseCorrector
0
12778417
<reponame>Ivan-Nebogatikov/ChineseCorrector import json import boto3 from boto3.dynamodb.conditions import Attr from time import strftime, gmtime client = boto3.Session( aws_access_key_id='<KEY>', aws_secret_access_key='a' ) dynamodb = client.resource('dynamodb', region_name='us-east-2') table = dynamodb.Tabl...
2.140625
2
gamelib/data.py
sirtango/LordPong
0
12778418
import os.path ROOT = os.path.join(os.path.dirname(__file__), '..') DATA = os.path.join(ROOT, 'data') def scenefile(scenename, filename): return os.path.join(os.path.join(DATA, scenename), filename) def datafile(filename): return os.path.join(DATA, filename)
2.5
2
examples/add_custom_field_options.py
iskunk/hub-rest-api-python
68
12778419
<reponame>iskunk/hub-rest-api-python<filename>examples/add_custom_field_options.py #!/usr/bin/env python import argparse import json import logging import sys from blackduck.HubRestApi import HubInstance parser = argparse.ArgumentParser("Modify a custom field") parser.add_argument("object", choices=["BOM Component"...
2.625
3
stage2_cINN/AE/modules/ckpt_util.py
CJWBW/image2video-synthesis-using-cINNs
85
12778420
<gh_stars>10-100 import os, hashlib import requests from tqdm import tqdm URL_MAP = { "vgg_lpips": "https://heibox.uni-heidelberg.de/f/607503859c864bc1b30b/?dl=1" } CKPT_MAP = { "vgg_lpips": "modules/lpips/vgg.pth" } MD5_MAP = { "vgg_lpips": "d507d7349b931f0638a25a48a722f98a" } def download(url, local_...
2.265625
2
main.py
ovshake/cobra
22
12778421
<filename>main.py def main(config): from COBRA import Solver solver = Solver(config) cudnn.benchmark = True return solver.train() if __name__ == '__main__': import argparse parser = argparse.ArgumentParser() parser.add_argument('--compute_all', type=bool, default=False) parser.add_argument('--mode', type=str,...
2.125
2
tests/test_characters_already_hired_as_lines.py
Pelmen323/Kaiserreich_Jenkins_PyTests
0
12778422
<gh_stars>0 ########################## # Test script to check for characters have already hired lines if having > 1 advisors roles # By Pelmen, https://github.com/Pelmen323 ########################## import re from ..test_classes.generic_test_class import ResultsReporter from ..test_classes.characters_class import Char...
2.59375
3
resources/ytyp.py
Markus1812/Sollumz
1
12778423
<reponame>Markus1812/Sollumz from .codewalker_xml import * from .ymap import EntityListProperty, ExtensionsListProperty from numpy import float32 class YTYP: file_extension = ".ytyp.xml" @staticmethod def from_xml_file(filepath): return CMapTypes.from_xml_file(filepath) @staticmethod de...
2.359375
2
tests/toolbox/test_Sloppy_derived_parameters.py
yuanz271/PyDSTool
0
12778424
<filename>tests/toolbox/test_Sloppy_derived_parameters.py """ Test of the derived_parameters feature (i.e. "RHSdefs" is True) and also the feature that allows inclusion of the right-hand of an ODE into another ODE. This is essentially a small extension on the following tutorial example: http://www.ni.gsu.edu/...
2.484375
2
project/experiments/exp_800_mile_stone/src/old/tmp_which_nodes_are_slow_read_tensorboard.py
liusida/thesis-bodies
0
12778425
import pandas as pd from common.tflogs2pandas import tflog2pandas import glob df_results = pd.DataFrame() filenames = glob.glob("output_data/tensorboard/model-*/PPO_1") for filename in filenames: print(filename) df = tflog2pandas(filename) df = df[df["metric"]=="time/fps"] average_fps = df["value"].me...
2.640625
3
deeplearning4j-core/src/main/resources/scripts/plot.py
atssada/deeplearning4j
2
12778426
<reponame>atssada/deeplearning4j import math from matplotlib.pyplot import hist, title, subplot, scatter, plot import matplotlib.pyplot as plt import numpy as np from PIL import Image import seaborn # improves matplotlib look and feel import sys import time ''' Optimization Methods Visualalization Graph tools to help...
3.296875
3
LeetCode/1723. Find Minimum Time to Finish All Jobs/solution.py
InnoFang/oh-my-algorithms
19
12778427
""" 60 / 60 test cases passed. Runtime: 64 ms Memory Usage: 14.5 MB """ class Solution: def minimumTimeRequired(self, jobs: List[int], k: int) -> int: def dfs(workers, idx, limit): if idx >= len(jobs): return True for i in range(len(workers)): if worke...
2.765625
3
the-platform-service-upgrade/healthcare/resources/disease/diabetes/model/net_handler.py
vivekbarsagadey/the-platform
1
12778428
<filename>the-platform-service-upgrade/healthcare/resources/disease/diabetes/model/net_handler.py from tensorflow.python import keras import os BASE_FOLDER = os.path.abspath(os.path.dirname(__name__)) NEXT_PATH = "/healthcare/resources/disease/diabetes/model/save/" FULL_PATH = BASE_FOLDER + NEXT_PATH class nethandle...
2.59375
3
app/main/forms.py
mercy-shii/Vblog
0
12778429
from flask_wtf import FlaskForm from wtforms import StringField,TextAreaField,FileField,SubmitField from wtforms.validators import Required class CommentForm(FlaskForm): title = StringField('Comment title',validators= [Required()]) comment = TextAreaField('Comment review') submit = SubmitField('submit') ...
2.65625
3
code/hwcloud/hws_service/evs_service.py
Hybrid-Cloud/cloud_manager
0
12778430
<gh_stars>0 __author__ = 'Administrator' import json from heat.engine.resources.hwcloud.hws_service import HWSService class EVSService(HWSService): def __init__(self, ak, sk, region, protocol, host, port): super(EVSService, self).__init__(ak, sk, 'EVS', region, protocol, host, port) def list(self, p...
2.015625
2
mendeley/client_library.py
ScholarTools/ST_mendeley_python
0
12778431
# -*- coding: utf-8 -*- """ The goal of this code is to support hosting a client library. This module should in the end function similarly to the Mendeley Desktop. Syncing ------------------------------------------- Jim's next goals ---------------- 1) Handle deleted IDs - needs an API update 2) Me...
2.25
2
imagr_site/imagr_site/settings.py
defzzd/django-imagr
0
12778432
""" Django settings for imagr_site project. For more information on this file, see https://docs.djangoproject.com/en/1.7/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.7/ref/settings/ """ # Build paths inside the project like this: os.path.join(BASE_DIR, ...)...
1.929688
2
modules.py
amanwalia92/VisionChess
0
12778433
import cv2 import numpy as np import time ''' Parameters Used inside Code ''' #Gaussian kernel size used for blurring G_kernel_size = (3,3) #canny thresholding parameters canny_u_threshold = 200 canny_l_threshold = 80 # define the upper and lower boundaries of the HSV pixel # intensities to be considered 'skin' low...
3.015625
3
mcedit_ui/layer_item.py
LagoLunatic/MinishEdit
10
12778434
from PySide2.QtGui import * from PySide2.QtCore import * from PySide2.QtWidgets import * import traceback from mclib.visual_zone import VisualZone class LayerItem(QGraphicsRectItem): def __init__(self, room, layer_index, renderer, main_window): super().__init__() self.room = room self.layer_index...
2.40625
2
examples/myemph.py
fractaledmind/pandocfilters
1
12778435
#!/usr/bin/env python from pandocfilters import toJSONFilter, RawInline """ Pandoc filter that causes emphasis to be rendered using the custom macro '\myemph{...}' rather than '\emph{...}' in latex. Other output formats are unaffected. """ def latex(s): return RawInline('latex', s) def myemph(k, v, f, meta): if...
2.46875
2
nsynth.py
ifrit98/music-transformer
1
12778436
<gh_stars>1-10 import os import numpy as np import matplotlib.pyplot as plt from magenta.models.nsynth import utils from magenta.models.nsynth.wavenet import fastgen from IPython.display import Audio def load_encoding(fname, sample_length=None, sr=16000, ckpt='model.ckpt-200000'): audio = utils.load_audio(fname, s...
2.234375
2
httpclient.py
MensahDev/CMPUT404-assignment-web-client-master
0
12778437
#!/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 # # http:/...
3.484375
3
huasheng/huashengtoutiao_app.py
IMWoolei/Tiring-Spiders
16
12778438
<filename>huasheng/huashengtoutiao_app.py # -*- coding: utf-8 -*- # @Author : Leo import json import time import uuid import base64 import requests from Crypto.Cipher import AES from Crypto.Util.Padding import pad """ 花生头条APP 正文内容获取,根据web-js流程提取 AES对称加密 """ class HuashengToutiao: """花生头条APP""" def __ini...
2.234375
2
qg_kelvin/analysis/energy.py
bderembl/mitgcm_configs
1
12778439
<filename>qg_kelvin/analysis/energy.py #!/usr/bin/env python import numpy as np import matplotlib.pyplot as plt import MITgcmutils as mit import scipy.io.netcdf as netcdf plt.ion() flag_tile = 1 dir0 = '/run/media/bderembl/workd/MITgcm/myrun/test_kw_energetics/run04/' #dir0 = '/home/bderembl/work/MITgcm/myrun/test_kw...
1.804688
2
convert/__init__.py
zyronix/maske
0
12778440
import keepalived plugins_dic = {} plugins_dic['keepalived'] = keepalived
1.257813
1
mdnb/model.py
trslater/mdnb
0
12778441
<gh_stars>0 from dataclasses import dataclass from functools import cached_property from pathlib import Path from typing import Union from urllib.parse import urlsplit import markdown @dataclass(frozen=True) class Document: """Represents a single document in the project""" md_path: Path md_dir: Path ...
2.71875
3
src/ggplib/statemachine/depthcharges.py
richemslie/ggplib
11
12778442
import time import random from ggplib.util import log def depth_charges(sm, seconds): # play for n seconds seconds = float(seconds) log.info("depth_charges() : playing for %s seconds" % seconds) role_count = len(sm.get_roles()) # cache some objects joint_move = sm.get_joint_move() base...
2.71875
3
examples/worker/simplejob.py
pooya/disco
786
12778443
from disco.job import SimpleJob class SimpleJob(SimpleJob): def map(self, worker, task, **jobargs): worker.output(task, partition=None).file.append('hello world!') def reduce(self, worker, task, **jobargs): worker.output(task, partition=None).file.append('goodbye world!')
2.765625
3
moment/test/test_add_operator.py
KrixTam/pymoment
1
12778444
import unittest from moment import moment from datetime import timedelta class TestAddOperator(unittest.TestCase): def test_day(self): a = moment('20201228').add(3, 'd') b = moment('20201228') + timedelta(days=3) self.assertEqual(a, b) def test_second(self): a = moment('20201...
3.46875
3
benwaonline_auth/schemas.py
goosechooser/benwaonline-auth
0
12778445
<filename>benwaonline_auth/schemas.py from marshmallow import Schema, fields, post_load from benwaonline_auth.models import User, Token, Client class UserSchema(Schema): user_id = fields.Str() refresh_token = fields.Nested("TokenSchema", exclude=("user",)) created_on = fields.DateTime() @post_load ...
2.25
2
python/contrib/garbage_picture/src/classify.py
Dedederek/samples
0
12778446
#!/usr/bin/env python # encoding: utf-8 import sys import os import acl from flask import Flask, g from flask_restful import reqparse, Api, Resource from flask_httpauth import HTTPTokenAuth import base64 from utils import * from acl_dvpp import Dvpp from acl_model import Model from acl_image import AclImage from ima...
2.140625
2
cards/picture_help_card.py
lamanchy/stackoverflow
0
12778447
<filename>cards/picture_help_card.py import os from PIL import Image from cards.text_help_card import TextHelpCard from colors import getrgb from language import get_language from pil_quality_pdf.rendering import mm_to_px from pil_quality_pdf.transformation import resize class PictureHelpCard(TextHelpCard): DX = ...
2.828125
3
B_Python_and_friends/solutions/ex1_5.py
oercompbiomed/CBM101
7
12778448
n = 15 for i in range(n): k = (n-i)//2 print(' '*k, '*'*i)
3.078125
3
raft/server.py
kurin/py-raft
62
12778449
from __future__ import print_function import sys import time import uuid import copy import random import logging import threading try: import Queue except ImportError: # for python3 import queue as Queue import msgpack import raft.store as store import raft.tcp as channel import raft.log as log def make_se...
2.34375
2
filesystem/test/testbasefile.py
redmond-penguin/musicplayer
0
12778450
import unittest from filesystem.basefile import BaseFile import os class TestBaseFile(unittest.TestCase): def setUp(self): os.mknod("/tmp/testfile") if not os.path.isfile("/tmp/testfile"): raise Exception("Cannot create /tmp/testfile") self.file = BaseFile("/tmp/testfile") ...
3.203125
3