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/test/match_pattern.py
elsid/master
0
12787751
# coding: utf-8 from os.path import dirname, realpath, join from subprocess import check_output from hamcrest import assert_that, equal_to BASE_DIR = dirname(realpath(__file__)) DATA_DIR = join(BASE_DIR, 'data') MODEL_DIR = join(DATA_DIR, 'model') PATTERN_DIR = join(DATA_DIR, 'pattern') MATCH_DIR = join(DATA_DIR, 'ma...
2.234375
2
test/IECoreMaya/FnSceneShapeTest.py
bradleyhenke/cortex
386
12787752
########################################################################## # # Copyright (c) 2013, Image Engine Design Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistribu...
1.039063
1
01-DesenvolvimentoDeSistemas/02-LinguagensDeProgramacao/01-Python/01-ListaDeExercicios/02-Aluno/Roberto/exc0071.py
moacirsouza/nadas
1
12787753
print(""" 071) Crie um programa que simule o funcionamento de uma caixa eletrônico. No início, pergutne ao usuário qual será o valor a ser sacado(número inteiro) e o programa vai informar quantas cédulas de cada valor serão entregues. OBS. Considere que o caixa possui cédulas de R$50, R$20, R$10 e R$1. """) print('=' ...
4.1875
4
models/glove.py
felixnext/disaster_pipeline
0
12787754
'''Module to load and use GloVe Models. Code Inspiration from: https://www.kaggle.com/jhoward/improved-lstm-baseline-glove-dropout ''' import os import numpy as np import pandas as pd import urllib.request from zipfile import ZipFile from sklearn.base import BaseEstimator, TransformerMixin from sklearn.cluster import...
2.875
3
medium/103-Binary Tree Zigzag Level Order Traversal.py
Davidxswang/leetcode
2
12787755
""" https://leetcode.com/problems/binary-tree-zigzag-level-order-traversal/ Given a binary tree, return the zigzag level order traversal of its nodes' values. (ie, from left to right, then right to left for the next level and alternate between). For example: Given binary tree [3,9,20,null,null,15,7], 3 / \ 9 ...
4.0625
4
simulation-ros/src/turtlebot2i/turtlebot2i_safety/src/test_run.py
EricssonResearch/scott-eu
19
12787756
<filename>simulation-ros/src/turtlebot2i/turtlebot2i_safety/src/test_run.py #!/usr/bin/env python """ Edited from navigation.py in turtlebot2i_navigation module """ import rospy import actionlib from nav_msgs.msg import Odometry from move_base_msgs.msg import MoveBaseAction, MoveBaseGoal import geometry_msgs.msg ...
2.578125
3
guildwars2/database.py
Maselkov/GW2Bot
75
12787757
<filename>guildwars2/database.py import asyncio import collections import datetime import re import time import discord from discord.ext import commands from discord_slash.context import ComponentContext from discord_slash.utils.manage_components import (create_actionrow, ...
2.21875
2
syn_net/data_generation/_mp_make.py
lilleswing/SynNet
14
12787758
""" This file contains a function to generate a single synthetic tree, prepared for multiprocessing. """ import pandas as pd import numpy as np # import dill as pickle # import gzip from syn_net.data_generation.make_dataset import synthetic_tree_generator from syn_net.utils.data_utils import ReactionSet path_reactio...
2.953125
3
moya/testprojects/expose/site/py/exposed.py
moyaproject/moya
129
12787759
from __future__ import unicode_literals from moya.expose import View class TestView(View): name = "hello" def get(self, context): return "Hello, World"
1.882813
2
src/auth.py
bplusv/ufs-casting-agency
0
12787760
<filename>src/auth.py import os from functools import wraps import json import enum from flask import request, _request_ctx_stack, abort from urllib.request import urlopen from jose import jwt class UserRole(enum.Enum): CASTING_ASSISTANT = 1 CASTING_DIRECTOR = 2 EXECUTIVE_PRODUCER = 3 class Auth: @...
2.5625
3
CLIStubs/SwitchBigCLI.py
vikin91/sdn-switches-benchmarking-framework
0
12787761
<gh_stars>0 import logging from SSHConnection import SSHConnection class SwitchBigCLI(SSHConnection): def __init__(self, switch_description): log_namespace = "Monitor.Switch"+switch_description["model"]+'CLI' self.logger = logging.getLogger(log_namespace) self.log_id = "Switch"+switch_des...
2.40625
2
main.py
schwarz/reddit-vip-flairs
0
12787762
<filename>main.py """ Automatically flair submissions with comments by interesting people. """ from dotenv import load_dotenv, find_dotenv import logging import praw import os def main(): logging.basicConfig(format='{asctime} - {name} - [{levelname}] {message}', style='{') log = logging.getLogger(__name__) ...
3.03125
3
nbexchange/plugin/list.py
jgwerner/nbexchange
7
12787763
import glob import json import os import re import sys from urllib.parse import quote, quote_plus import nbgrader.exchange.abc as abc from dateutil import parser from traitlets import Bool, Unicode from .exchange import Exchange # "outbound" is files released by instructors (.... but there may be local copies!) # "...
2.5625
3
src/ansys/mapdl/core/xpl.py
Miiicah/pymapdl
1
12787764
"""Contains the ansXpl class.""" import json import pathlib import random import string import weakref from ansys.api.mapdl.v0 import mapdl_pb2 import numpy as np from .common_grpc import ANSYS_VALUE_TYPE from .errors import MapdlRuntimeError def id_generator(size=6, chars=string.ascii_uppercase): """Generate a...
2.40625
2
rnnt/args.py
lahiruts/Online-Speech-Recognition
201
12787765
<reponame>lahiruts/Online-Speech-Recognition<gh_stars>100-1000 from absl import flags FLAGS = flags.FLAGS flags.DEFINE_string('name', 'rnn-t-v5', help='session name') flags.DEFINE_enum('mode', 'train', ['train', 'resume', 'eval'], help='mode') flags.DEFINE_integer('resume_step', None, help='model step') # dataset flag...
1.804688
2
nodel/framework/common.py
ary4n/nodel
0
12787766
import os import random import string def create_init_file(base_dir): open(os.path.join(base_dir, '__init__.py'), 'a').close() def create_file(base_dir, name, other): with open(os.path.join(base_dir, name), 'w') as f: with open(other) as o: f.write(o.read()) def create_git_ignore(base_dir): path = os.pat...
2.34375
2
inventory/test_inventory.py
detrout/htsworkflow
0
12787767
<reponame>detrout/htsworkflow<gh_stars>0 from __future__ import absolute_import, print_function from django.test import TestCase from django.test.utils import setup_test_environment, \ teardown_test_environment from django.db import connection from django.conf import settings from django.contrib.auth.models impo...
2.15625
2
apps/leaflet_ts/leaflet_ts/views/main.py
earthobservatory/displacement-ts-server
0
12787768
<gh_stars>0 from datetime import datetime from subprocess import check_output import hashlib from flask import render_template, Blueprint, g, redirect, session, request, url_for, flash, abort from flask_login import login_required, login_user, logout_user, current_user from flask import request from leaflet_ts import a...
2.234375
2
setup.py
bopopescu/railguns
0
12787769
<reponame>bopopescu/railguns<gh_stars>0 import os from setuptools import find_packages, setup with open(os.path.join(os.path.dirname(__file__), 'README.md')) as readme: README = readme.read() os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir))) setup( name='railguns', version=...
1.53125
2
problemsets/Codeforces/Python/A691.py
juarezpaulino/coderemite
0
12787770
""" * * Author: <NAME>(coderemite) * Email: <EMAIL> * """ n=int(input()) a=input() print('NYOE S'[(n<2 and a.count('1')) or (n>1 and a.count('0')==1)::2])
3.046875
3
Python/Exercicio013.py
BarbaraGomes97/Desafios.cpp
0
12787771
# Conversor de temperatura de C° para F° import colorama colorama.init() print('\033[32;1mConversor de temperaturas\033[m') temp = float(input('Digite a temperatura em C°: ')) print(f'{temp} C° é equivalente a {(9*temp/5)+32} F°')
3.53125
4
making_decisions/python/bmi_calculator.py
kssim/EFP
1
12787772
<filename>making_decisions/python/bmi_calculator.py # Pratice 19. BMI Calculator # Output: # Your BMI is 19.5. # You are within the ideal weight range. # Or # Your BMI is 32.5. # You are overweight. You should see your doctor. # Formula: # bmi = (weight / (height x height)) x 703 # Standard: # BMI 18.5 ~ ...
4.5
4
measures/querysets.py
uktrade/tamato
14
12787773
<reponame>uktrade/tamato<gh_stars>10-100 from django.contrib.postgres.aggregates import StringAgg from django.db.models import Case from django.db.models import CharField from django.db.models import F from django.db.models import Func from django.db.models import Q from django.db.models import QuerySet from django.db....
2.171875
2
test_utils.py
jodietrich/wgan_domain_adaptation
4
12787774
import logging import numpy as np import tensorflow as tf from collections import OrderedDict import utils from clf_model_multitask import predict def get_latest_checkpoint_and_log(logdir, filename): init_checkpoint_path = utils.get_latest_model_checkpoint_path(logdir, filename) logging.info('Checkpoint pat...
2.296875
2
RF/controllers/schedule.py
JaronrH/RF
2
12787775
<filename>RF/controllers/schedule.py<gh_stars>1-10 from flask.ext.classy import FlaskView, route from components import featureBroker from flask import render_template, request from datetime import datetime class ScheduleController(FlaskView): route_base = '/schedule/' interface = featureBroker.RequiredFeatur...
2.40625
2
examples/classify_text.py
Hironsan/google-natural-language-sampler
12
12787776
<reponame>Hironsan/google-natural-language-sampler<gh_stars>10-100 import argparse from google.cloud import language from google.cloud.language import enums from google.cloud.language import types def main(text): client = language.LanguageServiceClient() document = types.Document( content=text, ...
2.765625
3
intellectmoney/helpers.py
ZvonokComGroup/django-intellectmoney
0
12787777
<gh_stars>0 import hashlib from intellectmoney import settings def checkHashOnReceiveResult(data): return getHashOnReceiveResult(data) == data.get('hash') def getHashOnReceiveResult(data): secretKey = settings.SECRETKEY serviceName = data.get('serviceName', '') eshopId = data.get('eshopId', '') ...
2.109375
2
selenium_toolbox/buster_captcha_solver/buster_captcha_solver.py
JingerTea/undetetable_selenium
0
12787778
import requests import os import zipfile def buster_captcha_solver(dir, unzip = False): url = "https://api.github.com/repos/dessant/buster/releases/latest" r = requests.get(url) # Chrome name = r.json()["assets"][0]["name"] dl_url = r.json()["assets"][0]["browser_download_url"] pa...
2.875
3
users-backend/users/internal_api/tests/queries/test_user_by_email.py
pauloxnet/pycon
2
12787779
<gh_stars>1-10 from ward import test from users.tests.api import internalapi_graphql_client from users.tests.factories import user_factory from users.tests.session import db @test("correctly gets the user when sending a valid email") async def _( internalapi_graphql_client=internalapi_graphql_client, db=db, ...
2.421875
2
src/climsoft_api/api/observationfinal/router.py
faysal-ishtiaq/climsoft-api
0
12787780
<filename>src/climsoft_api/api/observationfinal/router.py<gh_stars>0 import climsoft_api.api.observationfinal.schema as observationfinal_schema import fastapi from climsoft_api.api import deps from climsoft_api.services import observationfinal_service from climsoft_api.utils.response import get_success_response, \ ...
2.03125
2
AlgorithmsAndDataStructures/mod3/Backpack.py
BootyAss/bmstu
0
12787781
<gh_stars>0 import math from functools import reduce class BackpackSolver: def __init__(self, maxWeight): if maxWeight < 0: raise(Exception) self.maxWeight = maxWeight; self.stuff = [] def add(self, weight, value): if weight < 0 or value < 0: raise(Exc...
2.875
3
backend/providers.py
sshaman1101/what-about-blank
0
12787782
<filename>backend/providers.py<gh_stars>0 import json import asyncio import threading from datetime import datetime from urllib.parse import urlparse from aiohttp import ClientSession from backend import config, storage, const class BaseJSONProvider: def __init__(self, url, prov_id=None, headers=None): s...
2.84375
3
session-5/tests/test_5.py
jasoriya/CADL_Kadenze
1
12787783
<reponame>jasoriya/CADL_Kadenze import matplotlib matplotlib.use('Agg') import tensorflow as tf import numpy as np from libs import utils from libs import dataset_utils from libs import charrnn from libs import vaegan from libs import celeb_vaegan def test_alice(): charrnn.test_alice() def test_trump(): ch...
2.15625
2
Pacote Dawload/Projeto progamas Python/ex1095 Sequencia I J1 For.py
wagnersistemalima/Exercicios-Python-URI-Online-Judge-Problems---Contests
1
12787784
# ex1095 Sequencia i j1 numero = 1 for c in range(60, -1, -5): # para cada número entre 0, 60, faça a contagem regressiva de 60, saltiando de 5 em 5 print('I={} J={}'.format(numero, c)) numero = numero + 3 # Numero começa com 1, salta de 3 em 3, ate a contagem regressiva chegar a 0
3.46875
3
src/reuters.py
Ekkehard/DL-Benchmarks
1
12787785
<filename>src/reuters.py # Python Implementation: Reuters benchmark # -*- coding: utf-8 -*- ## # @file reuters.py # # @version 1.0.1 # # @par Purpose # Run a Reuters newswires classification task using keras. # # @par Comments # This is the third experiment of Chollet's book ...
2.78125
3
word_embedding_train.py
Astromis/PhraseSegmentation
0
12787786
# -*- coding: utf-8 -*- from __future__ import division import gensim import nltk import smart_open import json from sentence_extracor import segment_sentences_tok from gensim.models import TfidfModel from gensim.corpora import Dictionary import warnings warnings.filterwarnings("ignore", message="numpy.dtype size chang...
2.5
2
src/block/celery/address.py
Andyye-jx/block_onchain
0
12787787
import re import json import inject import logging import requests from bs4 import BeautifulSoup from fake_useragent import UserAgent from celery import Celery from block.celery import APITask from block.config import RedisCache, Config from block.libs.dingding import DingDing logger = logging.getLogger(__name__) curre...
2.1875
2
notebooks/fpqNodeMap.py
Leguark/map2loop
0
12787788
<gh_stars>0 #!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Mon Jul 27 14:29:18 2020 fpqNodeMap plots a map of nodes from an input file of x,y nodes input: name of ascii text file of x,y nodes options: colour of nodes grid, on/off @author: davidhealy """ import fracpaq as fpq im...
2.921875
3
PS/this_is_coding_test.py
tkxkd0159/dsalgo
0
12787789
# This is coding test class Greedy: def __init__(self): pass @staticmethod def change(n): count = 0 coin_types = [500, 100, 50, 10] for c in coin_types: count += n // c n %= c return count @staticmethod def max_plus(case): n,...
3.421875
3
homeassistant/components/rituals_perfume_genie/const.py
RubenKelevra/core
1
12787790
"""Constants for the Rituals Perfume Genie integration.""" DOMAIN = "rituals_perfume_genie" COORDINATORS = "coordinators" DEVICES = "devices" ACCOUNT_HASH = "account_hash" HUBLOT = "hublot" SENSORS = "sensors"
0.882813
1
corenlp_client/__corenlp_client.py
Jason3900/corenlp_client
12
12787791
# -*- coding:UTF-8 -*- import requests import warnings import os import re from nltk import Tree from subprocess import Popen import subprocess import time import shlex import multiprocessing from urllib import parse class CoreNLP: def __init__(self, url=None, lang="en", annotators=None, corenlp_dir=None, local_po...
2.484375
2
ai4good/webapp/apps.py
titorenko/compartmental-model
0
12787792
import dash import dash_bootstrap_components as dbc from flask import Flask from ai4good.runner.facade import Facade from ai4good.webapp.model_runner import ModelRunner flask_app = Flask(__name__) dash_app = dash.Dash( __name__, server=flask_app, routes_pathname_prefix='/sim/', suppress_callback_excep...
1.929688
2
__init__.py
SsnL/amcmc
0
12787793
__all__ = ['structure', 'inference']
1.015625
1
freeze.py
ayushb1126/memoji_fer2013
0
12787794
<gh_stars>0 recursive function to find hcf of two numbers.
1.289063
1
helper/gtrans.py
shivaroast/AidenBot
0
12787795
<gh_stars>0 ''' Google Translate helper module (c) 2018 - laymonage ''' from googletrans import Translator def translate(text): ''' Translate astr from src language to dest. ''' text = text.split(maxsplit=2) gtrans = Translator() try: result = gtrans.translate(text[2], src=text[0], de...
3
3
flaskblog/forms.py
jianwang0212/wp4
0
12787796
<gh_stars>0 from flask_wtf import FlaskForm from wtforms import StringField, PasswordField, SubmitField, BooleanField, SelectField, RadioField, SelectMultipleField from wtforms.validators import DataRequired, Length, Email, EqualTo, ValidationError, Required from flaskblog.models import User, Category from wtforms.widg...
2.8125
3
mysite/myapp/admin.py
pl3nny/csc648-team05_pl3nny
0
12787797
from django.contrib import admin from .models import UserData from .models import Posts from .models import HazardType from .models import Message from .models import Comments from .models import PostImageCollection # Register your models here. admin.site.register(HazardType) admin.site.register(UserData) admin.site....
1.445313
1
example.py
zlgenuine/python_xmind_2
32
12787798
#-*- coding: utf-8 -*- import xmind from xmind.core.const import TOPIC_DETACHED from xmind.core.markerref import MarkerId w = xmind.load("test.xmind") # load an existing file or create a new workbook if nothing is found s1=w.getPrimarySheet() # get the first sheet s1.setTitle("first sheet") # set its title r1=s1.getR...
2.6875
3
setup.py
yukihiko-shinoda/asynccpu
3
12787799
<gh_stars>1-10 #!/usr/bin/env python """The setup script.""" from setuptools import find_packages, setup # type: ignore with open("README.md", encoding="utf-8") as readme_file: readme = readme_file.read() # Since new process created by multiprocessing calls setuptools.setup method # when the test is executed vi...
1.617188
2
gsm_layer3_protocol/sms_protocol/sms_submit.py
matan1008/gsm-layer3-protocol
0
12787800
<reponame>matan1008/gsm-layer3-protocol<filename>gsm_layer3_protocol/sms_protocol/sms_submit.py from construct import * import gsm_layer3_protocol.sms_protocol.tpdu_parameters as tpdu_parameters from gsm_layer3_protocol.enums import tp_mti as tp_mti_enum from gsm_layer3_protocol.sms_protocol.tp_user_data import tp_ud_s...
2.140625
2
src/Acts/orchestrator.py
sumantp89/SelfielessActs
0
12787801
<filename>src/Acts/orchestrator.py from flask import Flask, request import requests from time import sleep import os import json from threading import Thread, Lock BASE_URL = '/api/v1/' MIGRATIONS_FOLDER = os.path.abspath('db_migrations') open_ports = [] curr_port_index = 0 requests_count = 0 port_lock = Lock() reques...
2.28125
2
ctrace/runner.py
gzli929/ContactTracing
4
12787802
import concurrent.futures import csv from ctrace.utils import max_neighbors import functools import itertools import logging import time from collections import namedtuple from typing import Dict, Callable, List, Any, NamedTuple import traceback import shortuuid import tracemalloc from tqdm import tqdm ...
2.390625
2
acmicpc.net/problem/2606.py
x86chi/problem-solving
1
12787803
<gh_stars>1-10 from typing import List def solution(graph: List[List[int]]): length = len(graph) check = [False] * length count = [0] def dfs(x=0): check[x] = True for y in graph[x]: if not check[y]: count[0] += 1 dfs(y) dfs() ret...
3.28125
3
apps/jetpack/tests/test_views.py
mozilla/FlightDeck
6
12787804
<filename>apps/jetpack/tests/test_views.py<gh_stars>1-10 import os import commonware import json from jinja2 import UndefinedError from nose.tools import eq_ from nose import SkipTest from mock import patch, Mock from test_utils import TestCase from django.conf import settings from django.contrib.auth.models import U...
2.0625
2
tests/rl/test_logger.py
SunsetWolf/qlib
1
12787805
<filename>tests/rl/test_logger.py # Copyright (c) Microsoft Corporation. # Licensed under the MIT License. from random import randint, choice from pathlib import Path import re import gym import numpy as np import pandas as pd from gym import spaces from tianshou.data import Collector, Batch from tianshou.policy impo...
2.265625
2
tests/config/test_environment.py
henry1jin/alohamora
5
12787806
<filename>tests/config/test_environment.py import tempfile from blaze.config.environment import PushGroup, Resource, ResourceType, EnvironmentConfig from tests.mocks.config import get_env_config def create_resource(url): return Resource(url=url, size=1024, order=1, group_id=0, source_id=0, type=ResourceType.HTML)...
2.359375
2
metamodels/lstm.py
Jackil1993/metainventory
3
12787807
from simulations import simulation, simulation2 from pandas import DataFrame from pandas import Series from pandas import concat from sklearn.metrics import mean_squared_error from sklearn.preprocessing import MinMaxScaler from keras.models import Sequential from keras.layers import Dense, Bidirectional from keras.laye...
2.9375
3
app/database.py
faylau/microblog
0
12787808
#coding=utf-8 """ 1. SQLAlchemy-migration现在是openstack社区维护的一个项目,主要用于实现SQLAlchemy相 关数据误置的创建、版本管理、迁移等功能;它对SQLAlchemy的版本有一定要求;它对于一般项 目而言并不是必需的; 2. 下面的db_create、db_migrate、db_upgrade、db_downgrade等方法均使用SQLAlchemy- migration实现; 3. 如果不需要实现数据库版本管理及迁移,可以不使用SQLAlchemy-migration。 """ import os.path # from migrate.versioning imp...
2.453125
2
tools/todos.py
mrjrty/rpaframework
518
12787809
<gh_stars>100-1000 #!/usr/bin/env python3 import argparse import json import os import re import sys from collections import defaultdict from contextlib import contextmanager from io import StringIO from pathlib import Path from pylint.lint import Run TODO_PATTERN = re.compile(r"(todo|fixme|xxx)[\:\.]?\s*(.+)", re.I...
2.390625
2
accounts/tests/tests_logout.py
oratosquilla-oratoria/django-blog
0
12787810
<filename>accounts/tests/tests_logout.py from django.contrib.auth import get_user from django.contrib.auth.models import User from django.test import TestCase from django.urls import resolve, reverse from .. import views class LogOutTest(TestCase): def setUp(self): username = 'Vasyan' password = ...
2.59375
3
viruses/phage_num/marine_deep_subsurface/marine_deep_subusrface_phage_num.py
milo-lab/biomass_distribution
21
12787811
<reponame>milo-lab/biomass_distribution # coding: utf-8 # In[1]: # Load dependencies import pandas as pd import numpy as np from scipy.stats import gmean import matplotlib.pyplot as plt get_ipython().magic('matplotlib inline') import sys sys.path.insert(0, '../../../statistics_helper') from CI_helper import * # # ...
2.453125
2
src/lambda_tests.py
erikj23/lambda-manager
1
12787812
import boto3 import json def get_client() -> boto3.Session: return boto3.client("lambda") def external_lambda_tests() -> None: basic_call() def basic_call() -> None: lambda_client = get_client() response = lambda_client.list_functions( MaxItems=10 ) pretty_print(...
2.171875
2
probe.py
moisesbenzan/python-sdk
0
12787813
import re import os import sys import time import atexit import platform import traceback import logging import base64 import random from contextlib import contextmanager from blackfire import profiler, VERSION, agent, generate_config, DEFAULT_CONFIG_FILE from blackfire.utils import IS_PY3, get_home_dir, ConfigParser, ...
1.835938
2
basta/apps.py
lorenzosp93/basta_app
1
12787814
<gh_stars>1-10 from django.apps import AppConfig class BastaConfig(AppConfig): name = 'basta'
1.15625
1
src/price_scraper.py
AndPerCast/DeepPantry
1
12787815
<reponame>AndPerCast/DeepPantry<gh_stars>1-10 """Real-time web scraper for product prices. This module aims at easing product price information gathering from a certain website. Author: <NAME> """ from bs4 import BeautifulSoup import requests from typing import Tuple, List SOURCE_URL: str = "https://www.trolle...
3.234375
3
dsketch/experiments/classifiers/models.py
yumaloop/DifferentiableSketching
0
12787816
<reponame>yumaloop/DifferentiableSketching<filename>dsketch/experiments/classifiers/models.py<gh_stars>0 import importlib import torch.nn as nn import torch.nn.functional as F from dsketch.experiments.shared.utils import list_class_names class MnistCNN(nn.Module): def __init__(self): super().__init__() ...
2.25
2
third_party/a2c_ppo_acktr/main.py
jyf588/SimGAN
30
12787817
# MIT License # # Copyright (c) 2017 <NAME> and (c) 2020 Google LLC # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to u...
1.367188
1
test/unit/test_apply.py
asmacdo/openshift-restclient-python
1
12787818
<reponame>asmacdo/openshift-restclient-python # Test ConfigMapHash and SecretHash equivalents # tests based on https://github.com/kubernetes/kubernetes/pull/49961 from openshift.dynamic.apply import merge tests = [ dict( last_applied = dict( kind="ConfigMap", metadata=dict(name="fo...
2.484375
2
pgcolorbar/__init__.py
franzhaas/pgcolorbar
5
12787819
""" PgColorbar. A colorbar to use in PyQtGraph """ from .misc import __version__
1.132813
1
Teoria/3/3.py
camilaffonseca/Learning_Python
1
12787820
<reponame>camilaffonseca/Learning_Python # coding: utf-8 # Estruturas condicionais # mensagem = input('Você > ') # while mensagem != 'sair': # if mensagem == 'ola': # print('Robô - Olá também!') # elif mensagem == 'bom dia': # print('Robô - Bom dia para você também!') # elif mensagem == 't...
4.125
4
src/perfomance_test/main.py
roman-baldaev/elastic_vs_sphinx_test
0
12787821
from search_test import SearchTest, SearchTestElastic if __name__ == "__main__": test = SearchTestElastic(timeout=50, file_for_save= '/home/roman/Projects/ElasticMongoTest/test_results_csv/ElasticsearchTest.csv') # test.search_substrings_or(['Colorado', 'USA', 'President', 'Washi...
2.625
3
eight/main.py
yumenetwork/isn-tkinter
0
12787822
<gh_stars>0 from tkinter import * root = Tk() root.geometry("300x300") # Fonctions def quitter(): root.quit() root.destroy() def left(event): x1, y1, x2, y2 = draw.coords(ball) draw.coords(ball, x1 - 5, y1, x2 - 5, y2) def right(event): x1, y1, x2, y2 = draw.coords(ball) draw.coords(ball,...
3.015625
3
services/web/server/src/simcore_service_webserver/version_control_models_snapshots.py
Surfict/osparc-simcore
0
12787823
<filename>services/web/server/src/simcore_service_webserver/version_control_models_snapshots.py<gh_stars>0 import warnings from datetime import datetime from typing import Any, Callable, Optional, Union from uuid import UUID, uuid3 from pydantic import ( AnyUrl, BaseModel, Field, PositiveInt, Stric...
2.078125
2
flamingo/core/errors.py
rohieb/flamingo
0
12787824
<gh_stars>0 class FlamingoError(Exception): pass class DataModelError(FlamingoError): pass class MultipleObjectsReturned(DataModelError): def __init__(self, query, *args, **kwargs): self.query = query return super().__init__(*args, **kwargs) def __str__(self): return 'multi...
2.796875
3
tests/exploratory/grad_fns.py
varun19299/FeatherMap
14
12787825
import torch import torch.nn as nn import torch.nn.functional as F from torch.nn import Parameter V1 = Parameter(torch.randn(3, 3, requires_grad=True)) V2 = Parameter(torch.randn(3, 3, requires_grad=True)) W = torch.randn(2, 2) bias = torch.zeros(2) def update(V, W): V = torch.matmul(V1, V2.transpose(0, 1)) ...
2.96875
3
opslib/restparser.py
OpenSwitchNOS/openswitch-ops-restd
0
12787826
#!/usr/bin/env python # Copyright (C) 2015-2016 Hewlett-Packard Enterprise Development Company, L.P. # 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 # # ...
1.960938
2
py_script/myplot.py
zhz03/software_development
0
12787827
<gh_stars>0 """ This is my plotting obj/feature """ import matplotlib.pyplot as plt class myplot(): def __init__(self): pass def plot2y1x(self,x,y1,y2): """ This function is to plot 2 data with the same x variable in the same figurse :param x: :param y1: :param...
3.34375
3
modules/utils.py
inconvergent/axidraw-xy
29
12787828
<gh_stars>10-100 # -*- coding: utf-8 -*- from numpy import array from numpy import column_stack from numpy import cos from numpy import linspace from numpy import pi from numpy import reshape from numpy import row_stack from numpy import sin from numpy import logical_or from numpy.random import random TWOPI = 2.0*pi...
2.046875
2
kwat/vcf/__init__.py
KwatME/ccal
5
12787829
from .ANN import ANN from .COLUMN import COLUMN from .count_variant import count_variant from .read import read from .read_row import read_row
0.972656
1
secretupdater/secretupdater/headerclient.py
matthope/k8s-secret-updater
5
12787830
# Copyright 2019 Nine Entertainment Co. # # 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...
1.984375
2
tinykit/__init__.py
iromli/timo
0
12787831
<reponame>iromli/timo from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals __version__ = "0.2-dev" from .db import Database # noqa from .models import Model # noqa
1.023438
1
src/quilla/hookspecs/configuration.py
microsoft/quilla
55
12787832
<filename>src/quilla/hookspecs/configuration.py ''' Hooks that are related to configuration, such as logger configs, parser additions, etc. ''' from enum import Enum from logging import Logger from argparse import ( ArgumentParser, Namespace ) from typing import ( Type, TypeVar, Optional, ) from qu...
2.609375
3
tests/test_date_timestamp_conformance.py
uk-gov-mirror/moj-analytical-services.mojap-arrow-pd-parser
0
12787833
import pytest import datetime import pandas as pd import pyarrow as pa import numpy as np from arrow_pd_parser.parse import ( pa_read_csv_to_pandas, pa_read_json_to_pandas, ) def pd_datetime_series_to_list(s, series_type, date=False): fmt = "%Y-%m-%d" if date else "%Y-%m-%d %H:%M:%S" if series_type ==...
2.796875
3
Module 1 - Functional programming/3. Loops/solutions/5. factorial.py
codific/Python-course-BFU
1
12787834
number = int(input('Enter a number: ')) # Classical approach using for loop fac = 1 for n in range(1, number + 1): fac *= n # Using the math module # from math import factorial # fac = factorial(number) print(f'{number}! = {fac}')
4.09375
4
ruml/utils.py
irumata/ruml
3
12787835
import sklearn from sklearn.linear_model import LinearRegression import catboost import pandas as pd import copy import lightgbm as lgb import xgboost as xgb from sklearn.model_selection import train_test_split, KFold, cross_val_score, StratifiedKFold, GridSearchCV from sklearn.metrics import mean_absolute_error, r2_sc...
2.234375
2
configs/network_configs.py
t-zhong/WaPIRL
7
12787836
<gh_stars>1-10 # -*- coding: utf-8 -*- """ Configurations for CNN architectures. """ ALEXNET_BACKBONE_CONFIGS = ALEXNET_ENCODER_CONFIGS = dict( batch_norm='bn', local_response_norm='lrn', ) VGGNET_BACKBONE_CONFIGS = VGGNET_ENCODER_CONFIGS = { '16': { 'channels': [[64, 64, 'M'], [128, 128, '...
1.507813
2
blog-server/tests/repositories/test_post_repository.py
rob-blackbourn/blog-engine
1
12787837
import asyncio import pytest from motor.motor_asyncio import AsyncIOMotorClient from blog.repositories import PostRepository @pytest.mark.asyncio async def test_create_blog(db): post_repository = PostRepository() collection = db['posts'] result = await collection.insert_one({'name': 'Rob'}) assert ...
2.078125
2
crawler/factory.py
bmwant/chemister
0
12787838
<gh_stars>0 """ Create `Grabber` instances for list of resources we need to grab information from. """ import importlib import yaml import settings from utils import get_logger from crawler.models.resource import Resource from crawler.scheduled_task import ScheduledTask from crawler.proxy import Proxy from crawler.ca...
2.515625
3
odk_aggregation_tool/aggregation/readers.py
lindsay-stevens/odk_aggregation_tool
0
12787839
import os import xlrd from xlrd import XLRDError from xlrd.book import Book from xlrd.sheet import Sheet from collections import OrderedDict from typing import Iterable, List, Dict, Tuple import logging import traceback logger = logging.getLogger(__name__) logger.addHandler(logging.NullHandler()) def read_xml_files(...
2.640625
3
src/clikit/api/resolver/command_resolver.py
finswimmer/clikit
1
12787840
from clikit.api.args import RawArgs from .resolved_command import ResolvedCommand class CommandResolver(object): """ Returns the command to execute for the given console arguments. """ def resolve( self, args, application ): # type: (RawArgs, Application) -> ResolvedCommand rais...
2.265625
2
decorators/has_state_decorator/_add_state_methods/_add_from_pointer.py
ozgen92/classier
0
12787841
from classier.decorators.has_state_decorator.options import ATTRIBUTE_OPTIONS from classier.decorators.has_state_decorator.options import METHOD_OPTIONS from classier.objects import ClassMarker from classier.decorators import _MARK_ATTRIBUTE_NAME from classier.decorators.has_state_decorator import _MARK_TYPE_NAME impor...
2.203125
2
gamelib/scenes/map.py
CTPUG/suspended_sentence
2
12787842
"""Neurally implanted schematic for moving around on the ship. It is illegal for prisoners in transit to activate such an implant. Failure to comply carries a minimum sentence of six months. Many parts of the ship are derelict and inaccessible. """ from pyntnclick.i18n import _ from pyntnclick.state i...
3.140625
3
tests/test_ayab_image.py
shiluka/knitlib
0
12787843
# -*- coding: utf-8 -*- # This file is part of Knitlib. It is based on AYAB. # # Knitlib is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any l...
2
2
moneymour/api_client.py
moneymour/api-client-python
0
12787844
import requests import json from moneymour import environments from moneymour.crypto_utils import Signature API_BASE_URL = 'https://api.moneymour.com' API_SANDBOX_BASE_URL = 'https://api.sandbox.moneymour.com' API_STAGE_BASE_URL = 'https://api.stage.moneymour.com' API_DEVELOPMENT_BASE_URL = 'http://localhost:3000' E...
2.59375
3
stellar-csv-creator/main.py
usertxt/stellar-csv-creator
2
12787845
<gh_stars>1-10 import csv import json import logging import sys import os import re from datetime import datetime import requests import requests_cache from PySide2 import QtGui, QtCore, QtWidgets, QtSql from gui.main_window import Ui_MainWindow from gui.styles import dark from utils.about_dialog import AboutDialog f...
2.15625
2
scripts/adbconnect.py
acmerobotics/relic-recovery
32
12787846
<filename>scripts/adbconnect.py from subprocess import run, Popen, PIPE, DEVNULL from time import sleep import sys, os RC_PACKAGE = 'com.qualcomm.ftcrobotcontroller' RC_ACTIVITY = 'org.firstinspires.ftc.robotcontroller.internal.FtcRobotControllerActivity' ADB_PORT = 5555 PROFILE_FILENAME = 'temp.xml' WIFI_DIRECT_PREF...
2.5625
3
tests/test_zscii.py
swilcox/yazm-py
0
12787847
<reponame>swilcox/yazm-py<filename>tests/test_zscii.py from zscii import zscii_to_ascii def test_zscii_to_ascii(): pass
1.421875
1
maxt/members/tests.py
flynnguy/maxt_project
0
12787848
<reponame>flynnguy/maxt_project<filename>maxt/members/tests.py<gh_stars>0 from django.test import TestCase from django.contrib.auth.models import User from django.urls import reverse from . templatetags.member_filters import active_page_class from . models import Member class ModelTests(TestCase): def setUp(sel...
2.40625
2
kubernetes_typed/client/models/v1alpha1_policy.py
sobolevn/kubernetes-typed
22
12787849
<filename>kubernetes_typed/client/models/v1alpha1_policy.py<gh_stars>10-100 # Code generated by `typeddictgen`. DO NOT EDIT. """V1alpha1PolicyDict generated type.""" from typing import TypedDict, List V1alpha1PolicyDict = TypedDict( "V1alpha1PolicyDict", { "level": str, "stages": List[str], ...
1.671875
2
test/test_paver.py
oneconcern/stompy
17
12787850
import os import logging logging.basicConfig(level=logging.INFO) import numpy as np import matplotlib.pyplot as plt from stompy.grid import paver from stompy.spatial.linestring_utils import upsample_linearring,resample_linearring from stompy.grid import paver from stompy.spatial import field,constrained_delaunay,wkb2...
2.15625
2