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
amocrm_api_client/token_provider/impl/standard/__init__.py
iqtek/amocrm_api_client
0
12783851
<filename>amocrm_api_client/token_provider/impl/standard/__init__.py from .StandardTokenProviderFactory import StandardTokenProviderFactory
1.203125
1
elevation/models.py
michael-weinstein/Elevation
96
12783852
import numpy as np import elevation.model_comparison import os import pandas import multiprocessing cur_dir = os.path.dirname(os.path.abspath(__file__)) class CFDModel(object): def __init__(self, cfd_table=None, cfd_table_file=None): if cfd_table is None: #print "Loading CFD table from...
2.28125
2
environments/SmartMonitor.py
KMarino/hrl-ep3
17
12783853
import os import collections import pdb import gym import gym.envs.mujoco import time import csv import json import shutil import numpy as np import random from . import ant_env from . import proprioceptive_humanoid_env from . import maze_ant from . import maze_humanoid # Wrapper that records everything we might care ...
2
2
euler49.py
dchourasia/euler-solutions
0
12783854
<filename>euler49.py ''' The arithmetic sequence, 1487, 4817, 8147, in which each of the terms increases by 3330, is unusual in two ways: (i) each of the three terms are prime, and, (ii) each of the 4-digit numbers are permutations of one another. There are no arithmetic sequences made up of three 1-, 2-, or 3-digit p...
3.640625
4
addons14/sale_timesheet_rounded/models/sale.py
odoochain/addons_oca
1
12783855
<filename>addons14/sale_timesheet_rounded/models/sale.py # Copyright 2019 Camptocamp SA # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl) from odoo import api, models class SaleOrderLine(models.Model): _inherit = "sale.order.line" def _get_delivered_quantity_by_analytic(self, additional_domain...
1.71875
2
pyscf/scf/test/test_addons.py
robert-anderson/pyscf
7
12783856
<filename>pyscf/scf/test/test_addons.py #!/usr/bin/env python # Copyright 2014-2018 The PySCF Developers. 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://w...
1.757813
2
alipay/aop/api/domain/MiniAppFirstCategoryInfo.py
articuly/alipay-sdk-python-all
0
12783857
<reponame>articuly/alipay-sdk-python-all #!/usr/bin/env python # -*- coding: utf-8 -*- import simplejson as json from alipay.aop.api.constant.ParamConstants import * from alipay.aop.api.domain.MiniAppSecondCategoryInfo import MiniAppSecondCategoryInfo class MiniAppFirstCategoryInfo(object): def __init__(self): ...
1.992188
2
bin/get_from_ustream.py
cleiver/codeandtalk.com
60
12783858
#!/usr/bin/env python3 import argparse import json import os from pyquery import PyQuery import re import requests # given a URL such as http://www.ustream.tv/recorded/102894434 # fetch the details of the presentation def main(): parser = argparse.ArgumentParser() parser.add_argument('-u', '--url', help='URL...
3.03125
3
examples/validation/core/04_update_template.py
Kitware/trame
42
12783859
<gh_stars>10-100 from trame.app import get_server from trame.widgets import html, trame from trame.ui.html import DivLayout LINE_COUNT = 1 # ----------------------------------------------------------------------------- # Trame setup # ----------------------------------------------------------------------------- serv...
2.671875
3
egs/vwm/tts1/loadXvector.py
mapledxf/espnet
0
12783860
#!/usr/bin/env python # coding=utf-8 import kaldiio x=kaldiio.load_mat("/home/zlj/dxf/espnet/egs/vwm/tts1/decode/tts/xvectors/xvector.1.ark:4") spemb = torch.FloatTensor(x).to(device) print(str(x))
2.421875
2
core/src/main/python/wlsdeploy/aliases/__init__.py
CarolynRountree/weblogic-deploy-tooling
0
12783861
""" Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved. The Universal Permissive License (UPL), Version 1.0 This package provides the WLST knowledge base used by the rest of the code to understand how to perform their work across WebLogic versions and WLST modes. """
0.800781
1
armulator/armv6/memory_types.py
matan1008/armulator
16
12783862
from abc import ABCMeta, abstractmethod class MemoryType(object): __metaclass__ = ABCMeta @abstractmethod def __init__(self, size): self.size = size def __getitem__(self, (address, size)): return self.read(address, size) def __setitem__(self, address_size, value): self.w...
3.59375
4
combiner/management/commands/fixtures.py
storrellas/idrink
0
12783863
<filename>combiner/management/commands/fixtures.py from django.core.management.base import BaseCommand, CommandError from combiner.models import Ingredient, Drink class Command(BaseCommand): help = 'Closes the specified poll for voting' # def add_arguments(self, parser): # parser.add_argument('...
2.328125
2
week_3/mapReduce_tasks/problem4.py
FireAndBlood12/db-coursera
0
12783864
import MapReduce import sys """ Word Count Example in the Simple Python MapReduce Framework """ mr = MapReduce.MapReduce() # ============================= # Do not modify above this line def mapper(record): # key: document identifier # value: document contents key = record[0] friend = record[1] ...
3.703125
4
cli/tests/integrations/test_package.py
ConnectionMaster/dcos-cli
1
12783865
<reponame>ConnectionMaster/dcos-cli import contextlib import json import os import pkg_resources import six from dcos import package, subcommand from dcos.errors import DCOSException import pytest from mock import patch from .common import (assert_command, assert_lines, delete_zk_nodes, exec_com...
1.796875
2
cogs/reddit/gamedeals.py
santoshpanna/Discord-Bot
0
12783866
import praw, os, discord, requests from steamstorefront import SteamStoreFront from datetime import datetime from collections import deque from bs4 import BeautifulSoup from common import common, database from ..helpers import steam, gamedeals, guild from ..helpers.gamedeals import isFromAcceptableStore class GameDea...
2.59375
3
examples/settings.py
fakegit/googlevoice-1
156
12783867
import pprint from googlevoice import Voice def run(): voice = Voice() voice.login() pprint.pprint(voice.settings) __name__ == '__main__' and run()
1.914063
2
models/Simple_LSTM.py
Pheithar/Animal-Sounds
1
12783868
<filename>models/Simple_LSTM.py<gh_stars>1-10 import numpy as np import torch import torch.nn as nn import torch.nn.functional as F from torch.utils.data import DataLoader from tqdm import tqdm import torchvision import torchvision.transforms as transforms import matplotlib.pyplot as plt import seaborn as sns from...
2.5625
3
examples/1_clap_for_everything.py
InnovativeInventor/pykeybasebot
117
12783869
<reponame>InnovativeInventor/pykeybasebot<gh_stars>100-1000 #!/usr/bin/env python3 ################################### # WHAT IS IN THIS EXAMPLE? # # This bot listens in one channel and reacts to every text message. ################################### import asyncio import logging import os import sys import pykeyba...
2.75
3
RegionMap-datagen.py
derrickmehaffy/EliteDangerousRegionMap
8
12783870
#!/bin/env python3 from PIL import Image from numpy import asarray import json regionmap = asarray(Image.open('RegionMap.png')) region1 = 42 * 4 regions = [ None, "Galactic Centre", "Empyrean Straits", "Ryker's Hope", "Odin's Hold", "Norma Arm", "Arcadian Stream", "Izanami", "Inner...
2.46875
2
biblescrapeway/cli.py
jonathanvanschenck/biblescrapeway
0
12783871
import click import json from pathlib import Path from .query import query CONTEXT_SETTINGS = dict(help_option_names=['-h', '--help']) def _format_line(obj, _format): if _format == 'refstr': return obj.to_string() if _format == 'str': return '`{}` ({})'.format(obj.text,obj.version) def _for...
2.5
2
final report/svm.py
core-not-dumped/Introduction_to_Artificial_Intelligence
0
12783872
# -*- coding: utf-8 -*- from hw7_util import * class Preprocessing(AI_util): def Calculate_Binary(self, data: List[Tuple[str, List[str], int]]) -> List[Tuple[str, List[float], int]]: """ *** You should implement this function with raw code *** *** When you code, you have to erase this comme...
3.265625
3
numba/cuda/tests/cudapy/test_cuda_autojit.py
meawoppl/numba
1
12783873
<gh_stars>1-10 from __future__ import print_function from numba import unittest_support as unittest from numba import cuda import numpy as np class TestCudaAutojit(unittest.TestCase): def test_device_array(self): @cuda.autojit def foo(x, y): i = cuda.grid(1) y[i] = x[i] ...
2.4375
2
level_3/module/ghost_module.py
yogeshwari-vs/2D-Paramotoring-Pygame
2
12783874
import os import pygame import random from level_3.module import background_module from level_3.module import foreground_module from level_3.module import player_module class Ghost(): """ Describes ghost obstacles. """ # Loading ghost images num_of_imgs = 6 list_of_lists = [] path = r'level_3/Utils/Pics/Ghost...
3.296875
3
CombineAndRegress.py
FVL2020/2DImage2BMI
1
12783875
import json from sklearn.metrics import mean_squared_error, mean_absolute_error import numpy as np from model import Dfembeding from sklearn.kernel_ridge import KernelRidge import torch from PIL import Image from utils import * import csv import torch.utils.data as data import pandas as pd def mean_absol...
2.328125
2
alliancepy/cache.py
karx1/alliancepy
6
12783876
import pickle class Cache: def __init__(self): self._filename = "alliancepy.txt" self._cache = {} def __enter__(self): try: with open(self._filename, "rb") as file: d = pickle.load(file) for key, value in d.items(): self....
3.390625
3
tests/integration/examples/multiply/test_example_multiply_configs.py
drohde/deepr
0
12783877
"""Test for examples.multiply.configs""" import logging import deepr as dpr import deepr.examples.multiply logging.basicConfig(level=logging.INFO) PATH_CONFIG = dpr.io.Path(deepr.examples.multiply.__file__).parent / "configs" def test_example_multiply_configs(tmpdir): """Test for examples.multiply.configs""...
2.15625
2
app/models.py
stefanbschneider/feelya
1
12783878
<reponame>stefanbschneider/feelya import datetime from django.db import models from django.urls import reverse from django.contrib.auth.models import User class Entry(models.Model): name = models.CharField(max_length=100) date = models.DateField('date tracked', default=datetime.date.today) owner = models...
2.21875
2
workflow/utils_link_pred.py
skojaku/residual2vec
2
12783879
import numpy as np from scipy import sparse def fit_glove_bias(A, emb): N = A.shape[0] row_sum = np.array(A.sum(axis=1)).reshape(-1).astype(float) col_sum = np.array(A.sum(axis=0)).reshape(-1).astype(float) emb_sum = np.array(emb @ np.array(np.sum(emb, axis=0)).reshape((-1, 1))).reshape(-1) row_s...
2.4375
2
rapp_speech_detection_google/src/speech_recognition_google.py
DEVX1/NAOrapp-Pythonlib
0
12783880
<gh_stars>0 #!/usr/bin/env python2 # -*- coding: utf-8 -*- #Copyright 2015 RAPP #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...
2.078125
2
apps/shows/migrations/0010_show_social.py
jorgesaw/oclock
0
12783881
# Generated by Django 2.2.13 on 2020-10-04 06:53 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('socials', '0004_auto_20201004_0347'), ('shows', '0009_auto_20201004_0137'), ] operations = [ migra...
1.484375
1
Labs/Unit1Lesson3.py
CAP1Sup/SieskoPythonLabs
0
12783882
# <NAME> # 9/9/19 # This program will ask the user for a few words and then create a story like a Mad Libs paper. def main(): name = input("Please put in the name of a person: ") verb1 = input("Please input a verb in infinitive form: ") noun = input("Please input a proper noun: ") ability = input("Pleas...
4.25
4
assignment_dashboard/config.py
osteele/assignment-dashboard
0
12783883
<filename>assignment_dashboard/config.py import os class BaseConfig(object): DEBUG_TB_INTERCEPT_REDIRECTS = False SECRET_KEY = os.environ.get('SECRET_KEY', 'change me in production') db_path = os.path.abspath(os.path.join(os.path.dirname(__file__), '../data/database.db')) SQLALCHEMY_DATABASE_URI = o...
2.03125
2
Python/Stacks/BalancedBrackets/BalancedBrackets.py
zseen/hackerrank-challenges
0
12783884
#!/bin/python3 import math import os import random import re import sys BRACKETS_DICT = {"(": ")", "[": "]", "{": "}"} def printIsBalanced(brackets): result = isBalanced(brackets) if result: print("YES") else: print("NO") def isBalanced(brackets): stack = [] for bracket in bra...
3.890625
4
os_brick/caches/__init__.py
KioxiaAmerica/os-brick
61
12783885
<filename>os_brick/caches/__init__.py # Licensed under the Apache License, Version 2.0 (the "License"); you may not # use this file except in compliance with the License. You may obtain a copy of # the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in w...
2.28125
2
py_helloworld/test/run.py
mingshi-wang/fp20
2
12783886
<filename>py_helloworld/test/run.py """Universal launcher for unit tests""" import argparse import logging import os import sys import unittest def main(): """Parse args, collect tests and run them""" # Disable *.pyc files sys.dont_write_bytecode = True # Add ".." to module search path cur_dir =...
2.921875
3
exercises/python/data-types/basic/nested-list.py
rogeriosantosf/hacker-rank-profile
0
12783887
<filename>exercises/python/data-types/basic/nested-list.py # Given the names and grades for each student in a class of students, # store them in a nested list and print the name(s) of any student(s) # having the second lowest grade. # Note: If there are multiple students with the second lowest grade, # order their...
4.25
4
pepper_snp/modules/python/MakeImages.py
Samteymoori/pepper
0
12783888
import os from pepper_snp.modules.python.ImageGenerationUI import UserInterfaceSupport def make_images(bam_file, draft_file, region, output_path, total_threads, downsample_rate): output_dir = UserInterfaceSupport.handle_output_directory(os.path.abspath(output_path)) chr_list, bed_list = UserInterfaceSupport....
2.234375
2
terminusdb_client/woqldataframe/__init__.py
KarenImmanuel/terminusdb-client-python
1
12783889
<gh_stars>1-10 from .woqlDataframe import ( # noqa EmptyException, extract_column, extract_header, query_to_df, result_to_df, type_map, type_value_map, )
1.28125
1
react_front_end/src/tools/copy-layout.py
benthomasson/performance_test
1
12783890
<gh_stars>1-10 #!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (c) 2018 <NAME> """ Usage: copy-layout [options] <from> <to> Options: -h, --help Show this page --debug Show debug logging --verbose Show verbose logging """ from docopt import docopt import logging impo...
2.296875
2
bluebottle/events/migrations/0015_auto_20200226_0838.py
terrameijar/bluebottle
10
12783891
# -*- coding: utf-8 -*- # Generated by Django 1.11.15 on 2020-02-26 07:38 from __future__ import unicode_literals from datetime import datetime from timezonefinder import TimezoneFinder import pytz from django.db import migrations from django.utils import timezone tf = TimezoneFinder() def set_timezone(apps, schem...
2.0625
2
MFGPextreme/core/acquisitions.py
umbrellagong/MFGPextreme
1
12783892
import numpy as np from scipy.linalg import cho_solve, inv from scipy.stats import norm from scipy.interpolate import InterpolatedUnivariateSpline from sklearn.mixture import GaussianMixture as GMM from .utils import custom_KDE import time class Acq(object): ''' The base acq class. ''' def ...
2.21875
2
django_business_logic/django_business_logic/apps/posts/internal_services/usecases.py
gonzaloamadio/django_business_logic
2
12783893
# -*- coding: utf-8 -*- """Concentrate the heavy business logic of the operations of an application. It knows all Models that should be part of the flow and knows the API/services of those models. It also orchestrate all the side-effects and therefore can make the use of other use cases/services. """ from django.utils...
2.625
3
data/normalize/normalize.py
18645956947/TripleIE
0
12783894
<gh_stars>0 import re with open('question.txt', 'r', encoding='utf-8') as f: questions = f.readlines() def select_question(question): global normalize_list # 是否为并列问题, 拆分成多个问题, '和'关键字 m_and_1 = re.search(r'(.*)(和)+(.*)', question) if m_and_1: question_list = deal_and_question(question) ...
2.890625
3
cocojson/run/viz.py
TeyrCrimson/cocojson
0
12783895
<reponame>TeyrCrimson/cocojson import argparse from cocojson.tools import viz def main(): ap = argparse.ArgumentParser() ap.add_argument('json', help='Path to coco json') ap.add_argument('imgroot', help='Path to img root') ap.add_argument('--outdir', help='Path to output dir, leave out to not write ou...
2.546875
3
app/auth/forms.py
chenke91/ihaveablog
0
12783896
#coding=utf-8 from flask.ext.wtf import Form from wtforms import StringField, SubmitField, PasswordField from wtforms.validators import Required, Email, Length, EqualTo from app.models import User class RegisterForm(Form): username = StringField('用户名', validators=[Required('请输入用户名')]) email = StringField('邮箱'...
2.875
3
solutions/official/utils.py
kurazu/pycon_quiz
0
12783897
from functools import wraps def cached(func): cache = {} @wraps(func) def cached_wrapper(*args): if args not in cache: cache[args] = func(*args) return cache[args] return cached_wrapper
2.921875
3
utils/data/load_raw_data.py
codeKgu/BiLevel-Graph-Neural-Network
20
12783898
<reponame>codeKgu/BiLevel-Graph-Neural-Network from collections import defaultdict from glob import glob from os.path import join, basename import networkx as nx import numpy as np from scipy.sparse import csr_matrix from tqdm import tqdm from utils.data.dataset import BiGNNDataset from utils.data.graph import Graph,...
2.25
2
very_scratch/server/example5/websocketserver.py
ibrahemesam/Fos
3
12783899
#!/usr/bin/env python import socket import threading import config import websocketclient class WebSocketServer: """ Handle the Server, bind and accept new connections, open and close clients connections. """ def __init__(self): self.clients = [] def start(self): """ S...
3.03125
3
pycaption/scc/translator.py
vpaul-dev/pycaption-github-release-notes
183
12783900
from pycaption.scc.constants import CHARACTERS, SPECIAL_CHARS, EXTENDED_CHARS ALL_CHARACTERS = {**CHARACTERS, **SPECIAL_CHARS, **EXTENDED_CHARS} COMMAND_LABELS = { "9420": "Resume Caption Loading", "9429": "Resume Direct Captioning", "9425": "Roll-Up Captions--2 Rows", "9426": "Roll-Up Captions--3 Rows...
2.328125
2
point.py
akitoakihito/python_slam
2
12783901
import numpy as np # class for 3D points in an image frame class Point(object): # class constructor def __init__(self, img_map, location, color): self.point = location self.frames = [] self.idx = [] self.color = np.copy(color) self.id = img_map.max_point img_map...
2.96875
3
src/vgm/ym2151/config.py
cybermats/vgm_extractor
0
12783902
import copy import json from enum import Enum, IntFlag, Flag from json import JSONEncoder from typing import Any, List, Dict from vgm.command import VgmCommand, VgmCommandType class Waveform(Enum): SAW = 0 SQUARE = 1 TRIANGLE = 2 NOISE = 3 def repr_json(self): return self.name class Op...
2.625
3
problem14.py
prashdash112/Project-Euler-solutions
1
12783903
''' The following iterative sequence is defined for the set of positive integers: n → n/2 (n is even) n → 3n + 1 (n is odd) Using the rule above and starting with 13, we generate the following sequence: 13 → 40 → 20 → 10 → 5 → 16 → 8 → 4 → 2 → 1 It can be seen that this sequence (starting at 13 and finishin...
4.3125
4
tests/gen/test_trade_data_generation.py
PontusHultkrantz/tcapy
0
12783904
"""Tests out the code for generating randomised test trades/orders. """ from __future__ import print_function __author__ = 'saeedamen' # <NAME> / <EMAIL> # # Copyright 2017 Cuemacro Ltd. - http//www.cuemacro.com / @cuemacro # # See the License for the specific language governing permissions and limitations under th...
2.0625
2
piprot/models/messages.py
emichal/piprot
0
12783905
<gh_stars>0 class Messages: NOT_ROTTEN: str = "{package} ({version}) is up to date" IGNORED: str = "Ignoring updates for {package}." CANNOT_FETCH: str = "Skipping {package} ({version}). Cannot fetch info from PyPI" NO_DELAY_INFO: str = ( "{package} ({current_version}) is out of date. " "...
2.28125
2
temp.py
CAES-Python/Coffee_maker_analog
0
12783906
# -*- coding: cp850 -*- from kivy.app import App from kivy.clock import Clock from kivy.clock import Clock as clock from kivy.config import Config from kivy.gesture import Gesture,GestureDatabase from kivy.graphics.vertex_instructions import (Rectangle, Ellipse) from ki...
2.390625
2
python_qt_client/widgets/menu_bar.py
rhedgeco/hyper_visualizer_clientserver
0
12783907
from PySide2.QtCore import QCoreApplication from PySide2.QtWidgets import QMenuBar, QMenu def _quit(): QCoreApplication.quit() class MenuBar(QMenuBar): def __init__(self): super().__init__() file_action = self.addMenu(QMenu('File')) file_action.menu().addAction('New Project') ...
2.5625
3
python_basics/fib.py
jakubczaplicki/projecteuler
0
12783908
<gh_stars>0 def fibr(n): if n<=1: return 1 else: return n+fibr(n-1) def fibi(n): i=0 m=0 while i < n: i += 1 m += i return m for n in xrange(0,10): print n, fibi(n), fibr(n) mygenerator = (x*x for x in range(3)) for i in mygenerator: print i print "...
3.796875
4
app/section_1/__init__.py
Shah-imran/Database_app
0
12783909
<reponame>Shah-imran/Database_app<filename>app/section_1/__init__.py<gh_stars>0 from flask import Blueprint section_1 = Blueprint('section_1', __name__) from . import views
1.226563
1
hwilib/devices/trezorlib/messages/MessageType.py
tomatoskittles/HWI
9
12783910
# Automatically generated by pb2py # fmt: off Initialize = 0 Ping = 1 Success = 2 Failure = 3 ChangePin = 4 WipeDevice = 5 GetEntropy = 9 Entropy = 10 LoadDevice = 13 ResetDevice = 14 Features = 17 PinMatrixRequest = 18 PinMatrixAck = 19 Cancel = 20 ClearSession = 24 ApplySettings = 25 ButtonRequest = 26 ButtonAck = 27...
1.328125
1
train.py
lichen-lab/DeepChrInteract
0
12783911
# -*- coding:utf-8 -*- import os os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2' # Remove unnecessary information import numpy as np # cpu_count = 4 # 因为服务器没有图形界面,所以必须这样弄 import matplotlib matplotlib.use('Agg') from matplotlib import pyplot as plt # 好看的打印格式 def fancy_print(n = None, c = None, s...
2.328125
2
yepes/contrib/slugs/management/commands/collect_slugs.py
samuelmaudo/yepes
0
12783912
# -*- coding:utf-8 -*- from __future__ import unicode_literals from django.core.management.base import BaseCommand, CommandError from yepes.contrib.slugs import SlugHistory class Command(BaseCommand): help = 'Populates the slug history.' requires_system_checks = True def add_arguments(self, parser): ...
2.171875
2
webscraper.py
kmilouh/pln_project
0
12783913
#!/usr/bin/python3 # -*- coding: utf-8 -*- # -------------------------------------------------------------------------------- # Librerías from bs4 import BeautifulSoup import requests import time import json import os from json import dumps import anyjson from datastore import SubSecction from log_helper import LogHel...
2.265625
2
pybuild/main.py
892768447/python3-android
1
12783914
<reponame>892768447/python3-android import logging from .package import import_package built_packags: set = set() logger = logging.getLogger(__name__) def build_package(pkgname: str) -> None: if pkgname in built_packags: return pkg = import_package(pkgname) need_prepare = False logger.i...
2.203125
2
tox_helpers/run_integration_tests.py
sivchand/smart_open
2,047
12783915
<reponame>sivchand/smart_open """Runs integration tests.""" import os import subprocess os.environ['PYTEST_ADDOPTS'] = "--reruns 3 --reruns-delay 1" subprocess.check_call( [ 'pytest', 'integration-tests/test_207.py', 'integration-tests/test_http.py', ] ) if os.environ.get('AWS_ACCESS_...
1.9375
2
players.py
TexasChainstoreManager/chessrisk
1
12783916
import global_vars as gv import random # TODO: importing ai modules programmatically using the imp module. from ai import simpleton from ai import learning_simpleton ai_modules = { 'simpleton': simpleton.Simpleton, 'learning_simpleton': learning_simpleton.LearningSimpleton } chosen_ai_modules = [...
2.84375
3
cnnclassifier.py
schurterb/kmeansconv
2
12783917
<reponame>schurterb/kmeansconv<gh_stars>1-10 # -*- coding: utf-8 -*- """ Created on Sat Sep 17 17:34:12 2016 @author: user 2D convolutional classifier for mnist data set unsupervised learning """ import os from sh import mkdir import configparser import theano from theano import tensor as T from theano.tensor.nnet ...
2.5
2
python/main.py
Luke-Larsen/DarkMiner
3
12783918
# Version 1 #TODO clean up these imports now that we are doing more modular processing import sys, signal,platform,os,time,subprocess,configparser,multiprocessing,easygui,requests from Communicate import * from functions import LinuxIdleTime,WindowsIdleTime #Script Version ScriptVersion = '1.0' #SHA256 of your downtim...
2.125
2
templates/app/kvm/actions.py
Jumpscale/ays_jumpscale8
0
12783919
def install(job): cuisine = job.service.executor.cuisine # install kvm cuisine.systemservices.kvm.install() # start libvirt-bin job.service.executeActionJob('start', inprocess=True) job.service.model.actions['uninstall'].state = 'new' job.service.saveAll() def start(job): cuisine = jo...
2.09375
2
flappybird.py
hxg10636/flappygame
0
12783920
import pygame import sys #define bird class class Bird(object): def __init__(self): self.birdRect = pygame.Rect(65,50,50,50) self.birdStatus = [pygame.image.load("flappybirdassets/assets/1.png"), pygame.image.load("flappybirdassets/assets/2.png"), ...
3.265625
3
spec/rackspace.py
jmvrbanac/requests-cloud-auth
1
12783921
from mock import patch from specter import Spec, expect from requests_cloud_auth import rackspace from spec import get_keystone_v2_auth_resp class AuthenticationToRackspace(Spec): class PasswordAuthentication(Spec): def before_all(self): self.auth = rackspace.RackspacePasswordAuth( ...
2.296875
2
manage.py
kongminhao/flask-blueprint-with-docker
0
12783922
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # @Time : 17/3/21 下午5:32 import os from app import create_app, db from flask_script import Manager from flask_migrate import Migrate, MigrateCommand app = create_app(os.getenv('FLASK_CONFIG') or 'default') manager = Manager(app) migrate = Migrate(app, db) manager.add_...
1.90625
2
src/domaindiscovery/models/response.py
whois-api-llc/domain-discovery-py
0
12783923
import copy import datetime import re from .base import BaseModel import sys if sys.version_info < (3, 9): import typing _re_date_format = re.compile(r'^\d\d\d\d-\d\d-\d\d$') _re_datetime_format = re.compile( r'^(\d\d\d\d-\d\d-\d\dT\d\d:\d\d:\d\d)\+(\d\d):(\d\d)$') def _datetime_value(values: dict, key: st...
2.53125
3
instance/versions/2425b6924b1c_13migration.py
kalister5/pitch
0
12783924
"""13Migration Revision ID: 2425b<PASSWORD>c Revises: <PASSWORD> Create Date: 2018-09-08 18:25:12.151586 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = '2<PASSWORD>' down_revision = '<PASSWORD>' branch_labels = None depends_on = None def upgrade(): # ###...
1.507813
2
lib/datasets/augmentation.py
ParikhKadam/HybridPose
369
12783925
import numpy as np import cv2 import pdb # https://github.com/zju3dv/clean-pvnet/blob/master/lib/datasets/augmentation.py def debug_visualize(image, mask, pts2d, sym_cor, name_prefix='debug'): from random import sample cv2.imwrite('{}_image.png'.format(name_prefix), image * 255) cv2.imwrite('{}_mask.png'....
2.734375
3
recipes/nsimd/2.x/conanfile.py
rockandsalt/conan-center-index
562
12783926
import os from conans import ConanFile, CMake, tools required_conan_version = ">=1.33.0" class NsimdConan(ConanFile): name = "nsimd" homepage = "https://github.com/agenium-scale/nsimd" description = "Agenium Scale vectorization library for CPUs and GPUs" topics = ("hpc", "neon", "cuda", "avx", "simd"...
1.882813
2
5_Pham_Ngo_Tien_Dung/1.1.py
huong-rose/student-practices
0
12783927
<reponame>huong-rose/student-practices # Write a program that prints ‘Hello World’ to the screen. print("hello world!")
3.3125
3
tests/api/serializers.py
quangvinh1225/drf-generators
0
12783928
from rest_framework.serializers import ModelSerializer from api.models import Category, Post class CategorySerializer(ModelSerializer): class Meta: model = Category class PostSerializer(ModelSerializer): class Meta: model = Post
1.921875
2
ramp-utils/ramp_utils/testing.py
frcaud/ramp-board
13
12783929
<reponame>frcaud/ramp-board<filename>ramp-utils/ramp_utils/testing.py<gh_stars>10-100 import os HERE = os.path.dirname(__file__) def database_config_template(): """Return the path a template database configuration file. Returns ------- filename : str The database configuration filename. ...
2.21875
2
tests/functional/regressions/test_issue87.py
matt-koevort/tartiflette
530
12783930
import pytest @pytest.mark.asyncio @pytest.mark.ttftt_engine @pytest.mark.parametrize( "query,errors", [ ( """ subscription Sub { newDog { name } newHuman { name } } ...
2.046875
2
src/my/kadenze/lesson1/ConvolutionTF.py
AlfredNeverKog/BrainCarya
0
12783931
<reponame>AlfredNeverKog/BrainCarya import tensorflow as tf import numpy as np import math import matplotlib.pyplot as plt from PIL import Image """ a = tf.constant([1.0, 2.0, 3.0, 4.0, 5.0, 6.0], shape=[2, 3], name='a') b = tf.constant([1.0, 2.0, 3.0, 4.0, 5.0, 6.0], shape=[3, 2], name='b') c = tf.matmul(a, b) # Cre...
2.578125
3
tcorr_image/tcorr_export_default_from_daily.py
USGS-ET/ssebop-gee-beta
28
12783932
import argparse from builtins import input import datetime import logging import pprint import sys import ee import openet.ssebop as ssebop import utils # from . import utils def main(ini_path=None, overwrite_flag=False, delay_time=0, gee_key_file=None, max_ready=-1): """Compute default Tcorr image ass...
1.984375
2
fbchat/_events/_delta_type.py
JabLuszko/fbchat
1,042
12783933
<reponame>JabLuszko/fbchat import attr import datetime from ._common import attrs_event, Event, UnknownEvent, ThreadEvent from .. import _util, _threads, _models from typing import Sequence, Optional @attrs_event class ColorSet(ThreadEvent): """Somebody set the color in a thread.""" #: The new color. Not li...
2.46875
2
distributed/protocol/tests/test_highlevelgraph.py
crusaderky/distributed
1,358
12783934
<gh_stars>1000+ import ast import pytest import dask import dask.array as da import dask.dataframe as dd from distributed.diagnostics import SchedulerPlugin from distributed.utils_test import gen_cluster np = pytest.importorskip("numpy") pd = pytest.importorskip("pandas") from numpy.testing import assert_array_equ...
2.140625
2
CLEAN/enviroment/ChemEnv.py
tsteternlieb/DrugDesignThesis
2
12783935
<filename>CLEAN/enviroment/ChemEnv.py from audioop import add import copy import torch, random, dgl import networkx as nx from rdkit import Chem import dgl.data from .Utils import permute_mol, permute_rot, SanitizeNoKEKU, mol_to_graph_full, MolFromGraphsFULL, permuteAtomToEnd import os device = None class Ch...
1.960938
2
NewsSentiment/knowledge/knowledgeutils.py
jamie-iai/NewsMTSC
46
12783936
def find_key_original_or_lc(data: dict, data_keys_lower: dict, key: str): # try to get the key as it is from the dict if key in data.keys(): return data[key] # if not contained, try whether if using case insensitivity we find an entry if key.lower() in data_keys_lower.keys(): return data...
3.328125
3
buildcage/__init__.py
Zhang-Dante/buildcage
0
12783937
<reponame>Zhang-Dante/buildcage from buildcage import src
0.929688
1
basic_algorithms/DQN.py
ChrisRanger/RL_study
0
12783938
import numpy as np import os import gym import torch import torch.nn as nn import collections import copy import random # hype-params learn_freq = 5 #经验池攒一些经验再开启训练 buffer_size = 20000 #经验池大小 buffer_init_size = 200 #开启训练最低经验条数 batch_size = 32 #每次sample的数量 learning_rate = 0.001 #学习率 GAMMA = 0.99 # reward折扣因子 class Mode...
2.828125
3
common/cards.py
castellanprime/Discard
0
12783939
class Card: def __init__(self, card_colour, other_colour): self.card_colour = card_colour self.other_colour = other_colour def __repr__(self): return "{0}:{1}".format(self.card_colour, self.other_colour) class NormalCard(Card): def __init__(self, card_colour, shape_colour, shape): super().__init__(self, ...
3.28125
3
evaluate_VOC_val.py
briqr/CSPN
17
12783940
# You can use this code to evaluate the trained model of CSPN on VOC validation data, adapted from SEC import numpy as np import pylab import scipy.ndimage as nd import imageio from matplotlib import pyplot as plt from matplotlib import colors as mpl_colors import krahenbuhl2013 import sys sys.path.insert(0,'/home...
2.296875
2
example_snippets/multimenus_snippets/Snippets/SciPy/Physical and mathematical constants/CODATA physical constants/P/proton mass energy equivalent in MeV.py
kuanpern/jupyterlab-snippets-multimenus
0
12783941
<filename>example_snippets/multimenus_snippets/Snippets/SciPy/Physical and mathematical constants/CODATA physical constants/P/proton mass energy equivalent in MeV.py constants.physical_constants["proton mass energy equivalent in MeV"]
1.265625
1
demo/due-server/servo.py
wovo/hwpy
0
12783942
<reponame>wovo/hwpy<filename>demo/due-server/servo.py """ Demo for a hobby servo """ import sys, time sys.path.append( "../.." ) import hwpy print( __doc__ ) servo = hwpy.servo( hwpy.gpo( hwpy.arduino.d2 )) while True: for x in range( 0, 100, 5 ): servo.write( x / 100.0 ) time.sleep( 0.1 ) for x...
2.75
3
intake_streamz/source.py
martindurant/intake-streamz
7
12783943
from intake.source.base import DataSource from intake.source import import_name class StreamzSource(DataSource): name = 'streamz' container = 'streamz' """ """ def __init__(self, method_chain, start=False, metadata=None, **kwargs): """ method_chain: list[tuple(str, dict)] ...
2.390625
2
code_styles/generate_styles.py
tylerbutler/shared_assets
0
12783944
# coding=utf-8 from pygments.formatters.html import HtmlFormatter from pygments.styles import get_all_styles __author__ = '<NAME> <<EMAIL>>' ''' Run this script to output all registered Pygments styles as flat CSS files in the current directory. Other styles that can be installed using pip: pygments-style-github py...
2.453125
2
gssapi/raw/named_tuples.py
E-Tahta/python-gssapi
2
12783945
from collections import namedtuple AcquireCredResult = namedtuple('AcquireCredResult', ['creds', 'mechs', 'lifetime']) InquireCredResult = namedtuple('InquireCredResult', ['name', 'lifetime', 'usage', 'mechs']) InquireCr...
2.046875
2
cos_tests/test_base.py
baylee-d/cos.io
0
12783946
<reponame>baylee-d/cos.io import pytest # noqa from django.test import TestCase import website.settings.base as base import os from urllib.parse import urlparse class VariableValueTest(TestCase): def test_project_dir(self): """ Checks that the directory for the project is pointing to the right place ""...
2.71875
3
optic_store/optic_store/report/salary_report_for_bank/salary_report_for_bank.py
iptelephony/optic_store
14
12783947
<gh_stars>10-100 # Copyright (c) 2013, 9T9IT and contributors # For license information, please see license.txt from __future__ import unicode_literals import frappe from functools import partial from toolz import compose, pluck, concatv, merge, groupby, excepts, first from optic_store.utils import pick from optic_st...
1.789063
2
bot/decorators.py
MrLokans/bank_telegram_bot
2
12783948
<gh_stars>1-10 """ Useful decorators """ import functools import telegram from bot.exceptions import BotLoggedError from bot.settings import logging logger = logging.getLogger('telegrambot') def log_exceptions(bot_func): @functools.wraps(bot_func) def wrapper(bot, update, *args, **kwargs): try: ...
2.46875
2
AudioBook GUI code/main.py
GuruprasadaShridharHegde/Python-AudioBook
1
12783949
from tkinter import Tk from tkinter.filedialog import askopenfilename from gtts import gTTS import PyPDF2 import os Tk().withdraw() filelocation = askopenfilename() basename = os.path.basename(filelocation) filename = os.path.splitext(basename)[0] with open(filelocation, 'rb') as f: text = P...
3.09375
3
__Training__/Python - HackerRank/3. Strings/Text Wrap.py
JUD210/Study-Note
0
12783950
# https://www.hackerrank.com/challenges/text-wrap/problem import textwrap def wrap(string, max_width): # return "\n".join(string[i:i+max_width] for i in range(0, len(string), max_width)) return textwrap.fill(string, max_width) if __name__ == "__main__": string, max_width = input(), int(input()) # ...
3.890625
4