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
advanced/part13-17_asteroids/src/main.py
Hannah-Abi/python-pro-21
0
34600
# WRITE YOUR SOLUTION HERE:
1.304688
1
example.py
davehenton/tf-lyrics
0
34601
<gh_stars>0 from tflyrics import Poet, LyricsGenerator artists = ['<NAME>', '<NAME>', 'The Beatles'] gen = LyricsGenerator(artists, per_artist=5) ds = gen.as_dataset(batch_size=4) p = Poet() p.train_on(ds, n_epochs=10) poem = p.generate(start_string='Hey ', n_gen_chars=1000) print(poem)
2.6875
3
netvisor/schemas/companies/list.py
fastmonkeys/netvisor.py
3
34602
<reponame>fastmonkeys/netvisor.py # -*- coding: utf-8 -*- """ netvisor.schemas.companies.list ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ :copyright: (c) 2013-2016 by <NAME>. :license: MIT, see LICENSE for more details. """ from marshmallow import Schema, fields, post_load from ..fields import Boolean, List cla...
2.140625
2
merge_delim.py
brendane/miscellaneous_bioinfo_scripts
0
34603
#!/usr/bin/env python2.7 import sys infiles = sys.argv[1:] data = [] genes = [] for i, fname in enumerate(infiles): sys.stderr.write(fname + '\n') d = [] with open(fname, 'rb') as ihandle: for j, line in enumerate(ihandle): g, c = line.strip().split() if i != 0 and g != gene...
2.4375
2
provider/facebook.py
marinewater/pyramid-social-auth
2
34604
from provider.base import BaseProvider class FacebookProvider(BaseProvider): def __init__(self, client_id, client_secret, name, redirect_uri, state=None): """ :param client_id: :param client_secret: :param name: :param redirect_uri: :param state: ...
2.453125
2
eratosthenes/preprocessing/color_transforms.py
GO-Eratosthenes/start-code
1
34605
import numpy as np from .image_transforms import mat_to_gray def rgb2hcv(Blue, Green, Red): """transform red green blue arrays to a color space Parameters ---------- Blue : np.array, size=(m,n) Blue band of satellite image Green : np.array, size=(m,n) Green band of satellite image...
3.53125
4
Week3/Hospitalisations_ClassificationCase/import.py
PenelopeCorsica/AppliedML2021
13
34606
import pandas as pd X_train = pd.read_csv("X_train.csv") df_y = pd.read_csv("y_train.csv") y_train = df_y["y"] X_test = pd.read_csv("X_test.csv")
2.890625
3
redash/handlers/embed.py
steedos/redash
0
34607
import logging from flask import render_template, request, redirect, session, url_for, flash from flask.ext.restful import abort from flask_login import current_user, login_required from redash import models, settings from redash.wsgi import app from redash.utils import json_dumps @app.route('/embed/query/<query_id...
1.96875
2
test_vs_model_DEMs.py
drewleonard42/CoronaTemps
1
34608
<reponame>drewleonard42/CoronaTemps # -*- coding: utf-8 -*- """ Script to produce synthetic AIA data based on arbitrary model DEMs and test the results of the tempmap code against the model. Created on Mon Jul 28 16:34:28 2014 @author: <NAME> """ import numpy as np from matplotlib import use, rc use('agg') rc('savef...
2.140625
2
tests/test_set_up_logger.py
dennlinger/hypergraph-document-store
0
34609
from unittest import TestCase import os class TestSet_up_logger(TestCase): def test_set_up_logger(self): from utils import set_up_logger from logging import Logger logger = set_up_logger("test", "test.log") self.assertIsInstance(logger, Logger) os.remove("test.log")
2.671875
3
rubicon_reminders_cli.py
ZG34/StratNotes
6
34610
# the comments in this file were made while learning, as reminders # to RUN APP IN CMD PROMPT: cd to this directory, or place in default CMD directory: # then run 'python rubicon_reminders_cli.py' from os import listdir from datetime import datetime # this assigns dt variable as date + timestamp dt = (datetime.now()...
3.78125
4
script/generate_user.py
MTDzi/data_nanodegree_project_5
0
34611
<reponame>MTDzi/data_nanodegree_project_5<filename>script/generate_user.py import os from airflow import models, settings from airflow.contrib.auth.backends.password_auth import PasswordUser user = PasswordUser(models.User()) user.username = os.environ['AIRFLOW_UI_USER'] user.password = os.environ['AIRFLOW_UI_PASSWOR...
1.992188
2
generic_functions.py
MrHellYea/Art-Gallery-SQL
0
34612
def get_remain(cpf: str, start: int, upto: int) -> int: total = 0 for count, num in enumerate(cpf[:upto]): try: total += int(num) * (start - count) except ValueError: return None remain = (total * 10) % 11 remain = remain if remain != 10 else 0 ...
3.359375
3
src/generic.py
jfecroft/Hamilton
0
34613
<filename>src/generic.py """ generic functions """ from yaml import load def reduce_output(func, item, *args, **kwargs): """ simple function to reduce output from existing functions if func returns an iterable - just return item """ def inner_func(*args, **kwargs): return func(*args, **kwa...
3.109375
3
app/app.py
raevilman/aws_lambda_python_skeleton
3
34614
<reponame>raevilman/aws_lambda_python_skeleton<gh_stars>1-10 import json from app.event import Event from app.responder import send_ok_response from app.utils import get_logger # Setup logging logger = get_logger("app") def run(event: Event): logger.info(event.http_path()) logger.info(event.http_method()) ...
2.0625
2
blender/arm/logicnode/transform/LN_set_object_location.py
Lykdraft/armory
0
34615
from arm.logicnode.arm_nodes import * class SetLocationNode(ArmLogicTreeNode): """Use to set the location of an object.""" bl_idname = 'LNSetLocationNode' bl_label = 'Set Object Location' arm_version = 1 def init(self, context): super(SetLocationNode, self).init(context) self.add_i...
2.640625
3
lichess/client.py
qe/lichess
0
34616
<filename>lichess/client.py from .enums import * from .utils import * from .exceptions import * import logging import requests import urllib logger = logging.getLogger(__name__) VALID_PERF_TYPES = [_.value for _ in PerfType] class Client: def __init__(self, token=None): self.url = "https://lichess.org/"...
2.859375
3
src/mcedit2/widgets/infopanel.py
elcarrion06/mcedit2
673
34617
""" ${NAME} """ from __future__ import absolute_import, division, print_function, unicode_literals import logging import time import weakref from PySide import QtGui from mcedit2.widgets.layout import Column log = logging.getLogger(__name__) class InfoPanel(QtGui.QWidget): def __init__(self, attrs, signals...
2.484375
2
venv/lib/python3.7/site-packages/MDAnalysis/selections/__init__.py
dtklinh/GBRDE
2
34618
# -*- Mode: python; tab-width: 4; indent-tabs-mode:nil; coding:utf-8 -*- # vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4 # # MDAnalysis --- https://www.mdanalysis.org # Copyright (c) 2006-2017 The MDAnalysis Development Team and contributors # (see the file AUTHORS for the full list of names) # # Released under t...
1.835938
2
cs15211/PalindromePermutation.py
JulyKikuAkita/PythonPrac
1
34619
__source__ = 'https://leetcode.com/problems/palindrome-permutation/' # https://github.com/kamyu104/LeetCode/blob/master/Python/palindrome-permutation.py # Time: O(n) # Space: O(1) # # Description: Leetcode # 266. Palindrome Permutation # # Given a string, determine if a permutation of the string could form a palindrom...
4
4
others/edge/face_identification/sphereface20/tflite/postprocess/eval.py
luluseptember/inference
4
34620
<filename>others/edge/face_identification/sphereface20/tflite/postprocess/eval.py """ To calculate the verification accuracy of LFW dataset """ # MIT License # # Copyright (c) 2018 <NAME> # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation fi...
1.796875
2
LDAR_Sim/src/ldar_sim_main.py
sinakiaei/LDAR_Sim
2
34621
# ------------------------------------------------------------------------------ # Program: The LDAR Simulator (LDAR-Sim) # File: LDAR-Sim main # Purpose: Interface for parameterizing and running LDAR-Sim. # # Copyright (C) 2018-2021 Intelligent Methane Monitoring and Management System (IM3S) Group # # ...
1.890625
2
results/try_different_variance_maps.py
osagha/turktools
0
34622
<reponame>osagha/turktools<gh_stars>0 import pandas as pd import matplotlib.pyplot as plt import seaborn as sns import numpy as np from sympy import Symbol, solve from sympy.abc import a, b, c from fit_beta import fit_beta_mean_uncertainty, kl_dirichlet RESULTS_FILE = "../results/results_beta_exp.csv" FILTER_BY = "ran...
2.796875
3
conf_testing/lib/HABAppTests/test_base.py
pailloM/HABApp
0
34623
<filename>conf_testing/lib/HABAppTests/test_base.py import logging import threading import typing import HABApp from HABApp.core.events.habapp_events import HABAppException from ._rest_patcher import RestPatcher log = logging.getLogger('HABApp.Tests') LOCK = threading.Lock() class TestResult: def __init__(self...
2.09375
2
dags/connect_to_oracle_and_sql.py
whatwouldaristotledo/docker-airflow
0
34624
<gh_stars>0 from airflow.models import DAG from airflow.utils.dates import days_ago from airflow.operators.python_operator import PythonOperator from datetime import datetime import pandas as pd import urllib import random import cx_Oracle import pyodbc import sqlalchemy args={ 'owner': 'BI', ### start date is u...
2.59375
3
tests/test_packages/test_skills/test_tac_negotiation/test_helpers.py
bryanchriswhite/agents-aea
126
34625
# -*- coding: utf-8 -*- # ------------------------------------------------------------------------------ # # Copyright 2018-2019 Fetch.AI Limited # # 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 ...
1.617188
2
go/vumitools/metrics_worker.py
lynnUg/vumi-go
0
34626
# -*- test-case-name: go.vumitools.tests.test_metrics_worker -*- from twisted.internet.defer import inlineCallbacks, returnValue from twisted.internet.task import LoopingCall from vumi import log from vumi.worker import BaseWorker from vumi.config import ConfigInt, ConfigError from vumi.persist.model import Manager ...
1.9375
2
rastervision/new_version/learner/classification_learner.py
carderne/raster-vision
1
34627
<filename>rastervision/new_version/learner/classification_learner.py import warnings warnings.filterwarnings('ignore') # noqa from os.path import join, isfile, isdir import zipfile import torch from torchvision import models import torch.nn as nn import torch.nn.functional as F from torch.utils.data import DataLoader...
2.28125
2
scraping/get-list-2/scrapes/scrapes/spiders/amazon_listspider.py
hvarS/AmazonPrivacy
0
34628
<gh_stars>0 import scrapy import pandas as pd import time import random import string import os class QuotesSpider(scrapy.Spider): name = "amazonspione" def start_requests(self): os.mkdir("./products") list_of_urls = [] link_file = "./names.csv" df1 = pd.read_csv(link_file) ...
2.921875
3
data_pipeline/db/file_query_results.py
iagcl/data_pipeline
16
34629
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
2.03125
2
scripts/use_dataframe_with_info.py
HK3-Lab-Team/pytrousse
0
34630
<reponame>HK3-Lab-Team/pytrousse<filename>scripts/use_dataframe_with_info.py import os import time from trousse.dataset import Dataset df_sani_dir = os.path.join( "/home/lorenzo-hk3lab/WorkspaceHK3Lab/", "smvet", "data", "Sani_15300_anonym.csv", ) metadata_cols = ( "GROUPS TAG DATA_SCHEDA NOME ID...
2.453125
2
tests/test_spatial_sort.py
Ruibin-Liu/Despace
2
34631
import sys from os.path import exists from unittest.mock import patch import numpy as np # type: ignore import pytest from despace.spatial_sort import SortND sys.path.append("..") coords_1d = np.array([1.0, 0.1, 1.5, -0.3, 0.0]) sorted_coords_1d = np.array([-0.3, 0.0, 0.1, 1.0, 1.5]) coords_2d = np.array( [[1...
2.078125
2
examples/pendulum/Train_Pendulum.py
JayLago/Hankel-DLDMD
0
34632
<reponame>JayLago/Hankel-DLDMD """ Author: <NAME>, SDSU, 2021 """ import tensorflow as tf import pickle import datetime as dt import os import sys sys.path.insert(0, '../../') import HDMD as dl import LossDLDMD as lf import Data as dat import Training as tr # ==============================================...
2.140625
2
FIST.py
IGN-Styly/FIST
2
34633
import json def is_valid(smc_type): # checks if smc_type is valid if smc_type == 'vmt': return True elif smc_type == 'flt': return True elif smc_type == 'nfl': return True else: return False def parse_vmt(contract): try: contract.get('value') cont...
2.84375
3
john_zelle_python3/gpa.py
alirkaya/programming-textbook-solutions
0
34634
class Student: def __init__(self, name, hours, qpoints): self.name = name self.hours = float(hours) self.qpoints = float(qpoints) def get_name(self): return self.name def get_hours(self): return self.hours def get_qpoints(self): return self.qpoints ...
3.953125
4
{{cookiecutter.project_name}}/Data/sample_treatment/simple_repeat.py
piperwelch/SymbulationProjectTemplate
0
34635
<filename>{{cookiecutter.project_name}}/Data/sample_treatment/simple_repeat.py #a script to run several replicates of several treatments locally #You should create a directory for your result files and run this script from within that directory seeds = range(21, 41) verts = [0.3] h_mut_rate = [0.1, 0.5, 1.0] import s...
2.015625
2
First Unique Character in a String.py
frank0215/Leetcode_python
0
34636
<filename>First Unique Character in a String.py<gh_stars>0 class Solution: def firstUniqChar(self, s): table = {} for ele in s: table[ele] = table.get(ele, 0) + 1 # for i in range(len(s)): # if table[s[i]] == 1: # return i for ele in s: ...
3.296875
3
tests/list_tests.py
kzawisto/mc
0
34637
from hamcrest import * from nose.tools import eq_ from mc import List, Some, Nothing,add def test_list_map(): eq_(List([1, 2, 3]).map(lambda x: x * 2), [2, 4, 6]) def test_list_flat_map(): eq_(List([1, 3]).flat_map(lambda x: (x * 2, x * 4)), [2, 4, 6, 12]) def test_list_filter(): eq_(List([1, 2, 3]).f...
2.359375
2
src/groktoolkit/__init__.py
zopefoundation/groktoolkit
2
34638
import sys import re import os import commands HOST = 'grok.zope.org' RELEASEINFOPATH = '/var/www/html/grok/releaseinfo' def _upload_gtk_versions(packageroot, version): # Create the releaseinfo directory for this version. cmd = 'ssh %s "mkdir %s/%s"' % (HOST, RELEASEINFOPATH, version) print(cmd + '\n') ...
2.234375
2
obywatele/migrations/0020_auto_20201225_1624.py
soma115/wikikracja
7
34639
# Generated by Django 3.1 on 2020-12-25 15:24 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('obywatele', '0019_auto_20201225_1621'), ] operations = [ migrations.AlterField( model_name='uzytkownik', name='busines...
1.789063
2
Darlington/phase1/python Basic 2/day 21 solution/qtn1.py
CodedLadiesInnovateTech/-python-challenge-solutions
6
34640
<gh_stars>1-10 #program to compute and print sum of two given integers (more than or equal to zero). # If given integers or the sum have more than 80 digits, print "overflow". print("Input first integer:") x = int(input()) print("Input second integer:") y = int(input()) if x >= 10 ** 80 or y >= 10 ** 80 or x + y >= 10...
4.0625
4
app/cli/__init__.py
Hacker-1202/Selfium
14
34641
<reponame>Hacker-1202/Selfium """ Selfium CLI Tools ~~~~~~~~~~~~~~~~~~~ All cli functions used in Selfium project; :copyright: (c) 2021 - Caillou and ZeusHay; :license: MIT, see LICENSE for more details. """ from .logo import * from .clear import * from .welcome import * from .tokenError import *
0.878906
1
controllers/mainController.py
jersobh/zfs-resty
11
34642
import uuid from datetime import datetime, timedelta from controllers import zfsController import jwt import pam import render JWT_SECRET = "<KEY>" JWT_ALGORITHM = "HS256" JWT_EXP_DELTA_SECONDS = 4300 async def index(request): return render.json({'error': 'nothing to see here...'}, 200) async def auth(request...
2.59375
3
agent/stubs/retina.py
yoshi-ono/WM_Hackathon
9
34643
<reponame>yoshi-ono/WM_Hackathon import torch.nn as nn import torch import torchvision from utils.image_filter_utils import get_dog_image_filter, conv2d_output_shape from utils.writer_singleton import WriterSingleton class Retina(nn.Module): STEP = 0 @staticmethod def get_default_config(): config = { ...
2.375
2
aws_sso/utils/registry.py
rkhullar/many-sso
2
34644
from typing import Callable, Dict, Type def register_action(action: str, mapping_name: str = '__actions__'): # https://stackoverflow.com/questions/3589311/get-defining-class-of-unbound-method-object-in-python-3/25959545#25959545 class RegistryHandler: def __init__(self, fn: Callable): se...
3.140625
3
tools/waf-tools/f_cppcheck.py
TerraWilly/foxbms-2
1
34645
#!/usr/bin/env python # -*- coding: utf-8 -*- # @copyright &copy; 2010 - 2021, Fraunhofer-Gesellschaft zur Foerderung der # angewandten Forschung e.V. All rights reserved. # # BSD 3-Clause License # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the fol...
1.078125
1
updater/models.py
h4ck3rm1k3/srtracker
1
34646
from sqlalchemy.ext.declarative import declarative_base from sqlalchemy import Column, Integer, String, DateTime, Sequence Base = declarative_base() class Subscription(Base): __tablename__ = 'subscriptions' id = Column(Integer, Sequence('subscription_id_seq'), primary_key=True) sr_id = Column(...
2.5
2
setup.py
writememe/motherstarter
33
34647
#!/usr/bin/env python # Motherstarter setup file from setuptools import setup, find_packages from motherstarter import __version__, __author__ # Open and read README file with open("README.md", "r", encoding="utf-8") as f: README = f.read() # Setup requirements to be installed requirements = [] with open("requi...
1.546875
2
rgw/v2/tests/s3_swift/test_dynamic_bucket_resharding.py
rpratap-bot/ceph-qe-scripts
0
34648
<reponame>rpratap-bot/ceph-qe-scripts """ test_dynamic_bucket_resharding - Test resharding operations on bucket Usage: test_dynamic_bucket_resharding.py -c <input_yaml> <input_yaml> Note: any one of these yamls can be used test_manual_resharding.yaml test_dynamic_resharding.yaml Operation: Create use...
2.03125
2
example/schema.py
devind-team/devind-django-dictionaries
0
34649
import graphene from typing import cast from graphene_django import DjangoObjectType from graphene_django.debug import DjangoDebug from django.contrib.auth import get_user_model import devind_dictionaries.schema class UserType(DjangoObjectType): class Meta: model = get_user_model() fields = ('...
2.078125
2
fuzzi-gen/fuzzi/evaluation/pate.py
hengchu/fuzzi-impl
4
34650
import numpy as np def main(): from fuzzi.evaluation import pate_train from fuzzi.generated import pate_label predictions = pate_label.outputs truth = [x[-1] for x in pate_label.db_test] print(predictions) print(truth) print('PATE accuracy = %f' % (np.mean(predictions == truth)))
2.65625
3
bedrock/app/utils/jinja.py
ronbeltran/webapp2-bedrock
1
34651
<reponame>ronbeltran/webapp2-bedrock import os import webapp2 import jinja2 import config from app.utils.compressor import WEBASSETS_ENV JINJA_ENV = jinja2.Environment( autoescape=lambda x: True, extensions=['jinja2.ext.autoescape', 'webassets.ext.jinja2.AssetsExtension'], loader=jinja2....
1.96875
2
Mundo 3/ex094.py
adonaifariasdev/cursoemvideo-python3
0
34652
# Crie um programa que leia nome, sexo e idade de várias pessoas, guardando os dados # de cada pessoa em um dicionário e todos os dicionários em uma lista. No final, mostre: # A) Quantas pessoas foram cadastradas B) A média de idade C) Uma lista com as mulheres # D) Uma lista de pessoas com idade acima da média dados ...
3.890625
4
lonet.py
johan12345/lonet.py
1
34653
import argparse import os import re import urllib.parse import requests from bs4 import BeautifulSoup from pushbullet import Pushbullet pushbullet = None def download_file(url, dir): local_filename = dir + '/' + urllib.parse.unquote_plus(url.split('/')[-1], encoding='iso-8859-1') if os.path.exists(local_fil...
3.046875
3
multiagent/scenarios/simple_spread_random_one.py
enikon/MACP
0
34654
<filename>multiagent/scenarios/simple_spread_random_one.py import random from multiagent.scenarios.commons import * from multiagent.scenarios.simple_spread import Scenario as S class Scenario(S): def make_world(self): world = World() # set any world properties first world.dim_c = 2 ...
2.875
3
tests/unit/seed/test_extra_install.py
hauntsaninja/virtualenv
1
34655
from __future__ import absolute_import, unicode_literals import os import subprocess import pytest from virtualenv.discovery.py_info import PythonInfo from virtualenv.run import run_via_cli from virtualenv.util.path import Path from virtualenv.util.subprocess import Popen CURRENT = PythonInfo.current_system() CREAT...
1.914063
2
pyhanko_certvalidator/_types.py
MatthiasValvekens/certvalidator
4
34656
<reponame>MatthiasValvekens/certvalidator # coding: utf-8 import inspect def type_name(value): """ Returns a user-readable name for the type of an object :param value: A value to get the type name of :return: A unicode string of the object's type name """ if inspect.isclass...
3.140625
3
allofw.node/binding.gyp
donghaoren/AllofwModule
3
34657
{ "targets": [ { "target_name": "allofw", "include_dirs": [ "<!@(pkg-config liballofw --cflags-only-I | sed s/-I//g)", "<!(node -e \"require('nan')\")" ], "libraries": [ "<!@(pkg-config liballofw --libs)", "<!@(pkg-config glew --libs)", ], "cflag...
1.085938
1
LeetCode-All-Solution/Python3/LC-0388-Longest-Absolute-File-Path.py
YuweiYin/Algorithm_YuweiYin
0
34658
#!/usr/bin/env python # -*- coding:utf-8 -*- """================================================================= @Project : Algorithm_YuweiYin/LeetCode-All-Solution/Python3 @File : LC-0388-Longest-Absolute-File-Path.py @Author : [YuweiYin](https://github.com/YuweiYin) @Date : 2022-04-20 ========================...
3.75
4
main.py
DeadCodeProductions/dead
20
34659
<reponame>DeadCodeProductions/dead #!/usr/bin/env python3 import copy import hashlib import logging import os import random import re import subprocess import sys import tempfile import time from multiprocessing import Pool from pathlib import Path from typing import Any, Dict, Optional, cast import requests import ...
2
2
pathod/__init__.py
illera88/mitmproxy
6
34660
import os import sys import warnings warnings.warn( "pathod and pathoc modules are deprecated, see https://github.com/mitmproxy/mitmproxy/issues/4273", DeprecationWarning, stacklevel=2 ) def print_tool_deprecation_message(): print("####", file=sys.stderr) print(f"### {os.path.basename(sys.argv[0...
1.851563
2
urchin/fs/mp3file.py
kellen/urchinfs
2
34661
<reponame>kellen/urchinfs #!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import absolute_import import os import logging from fnmatch import fnmatch import mutagen from mutagen.easyid3 import EasyID3 import urchin.fs.default import urchin.fs.json import urchin.fs.plugin import urchin.fs.mp3 MP3_GLOB ...
2.171875
2
tests/model/test_qubic.py
Reathe/Qubic
0
34662
import unittest from model.curseur import Curseur from model.pion import PionBlanc, PionNoir from model.qubic import Qubic class TestQubic(unittest.TestCase): def test_poser(self): q = Qubic() q.poser((0, 7, 0)) self.assertTrue(q.get_pion((0, 0, 0)) == PionBlanc) self.assertFalse(q.get_pion((0, 1, 0))) q....
2.890625
3
sherpa_client/models/project_status.py
kairntech/sherpa-client
0
34663
from typing import Any, Dict, Type, TypeVar, Union import attr from ..models.sherpa_job_bean import SherpaJobBean from ..types import UNSET, Unset T = TypeVar("T", bound="ProjectStatus") @attr.s(auto_attribs=True) class ProjectStatus: """ """ project_name: str status: str pending_job: Union[Unset,...
2.078125
2
notify.py
MoveOnOrg/merkle
0
34664
<reponame>MoveOnOrg/merkle import os import sys import slackweb from pywell.entry_points import run_from_cli DESCRIPTION = 'Send notification to Slack.' ARG_DEFINITIONS = { 'SLACK_WEBHOOK': 'Web hook URL for Slack.', 'SLACK_CHANNEL': 'Slack channel to send to.', 'TEXT': 'Text to send.' } REQUIRED_ARGS...
2.28125
2
src/lib/earlystopping.py
dreizehnutters/pcapae
0
34665
from os import path, makedirs, walk ,remove, scandir, unlink from numpy import inf from torch import save as t_save from lib.utils import sort_human, BOLD, CLR class EarlyStopping: def __init__(self, log_path, patience=7, model=None, verbose=False, exp_tag=""): """Early stops the training if validation ...
2.34375
2
ldapauthenticator/__init__.py
jbmarcille/ldapauthenticator
0
34666
from ldapauthenticator.ldapauthenticator import LDAPAuthenticator __all__ = [LDAPAuthenticator]
1.085938
1
tests/test_tc100.py
radoering/flake8-type-checking
19
34667
""" This file tests the TC100 error: >> Missing 'from __future__ import annotations' import The idea is that we should raise one of these errors if a file contains any type-checking imports and one is missing. One thing to note: futures imports should always be at the top of a file, so we only need to check one ...
2.359375
2
scripts/plot_sorting.py
t1mm3/fluid_coprocessing
2
34668
<filename>scripts/plot_sorting.py #!/bin/env python2 import matplotlib as mpl mpl.use('pgf') pgf_with_pgflatex = { "pgf.texsystem": "pdflatex", "pgf.rcfonts": False, "pgf.preamble": [ r"\usepackage[utf8x]{inputenc}", r"\usepackage[T1]{fontenc}", # r"\usepackage{cmbright}", ...
2.453125
2
morf-python-api/build/lib/morf/utils/caching.py
jpgard/morf
14
34669
# Copyright (c) 2018 The Regents of the University of Michigan # and the University of Pennsylvania # # 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 li...
1.648438
2
tests/basic/lambda4.py
Slater-Victoroff/pyjaco
38
34670
la = [] for x in range(5): la.append(lambda x: (lambda q: q + x)(x)) print la[3](1)
3.328125
3
python/ctypes/hello_rust/hello_rust_ctypes.py
JamesMcGuigan/ecosystem-research
1
34671
from ctypes import * rust = cdll.LoadLibrary("./target/debug/libhello_rust.dylib") answer = rust.times2(64) print('rust.times2(64)', rust.times2(64))
1.679688
2
black_jack.py
brynpatel/Deck-of-cards
0
34672
<filename>black_jack.py from deck_of_cards import * def check(card1, card2): if card1.number == card2.number: check = True #Add special cards elif card1.suit == card2.suit: check = True else: check = False return check def turn(myCard, myHand, opponentsHand, deck): ...
3.78125
4
dashboard/settings.py
hosseinmoghimi/instamarket
3
34673
<filename>dashboard/settings.py from instamarket import settings ON_SERVER=settings.ON_SERVER ON_HEROKU=settings.ON_HEROKU ON_MAGGIE=settings.ON_MAGGIE REMOTE_MEDIA=settings.REMOTE_MEDIA ON_SERVER=settings.ON_SERVER DEBUG=settings.DEBUG BASE_DIR=settings.BASE_DIR COMING_SOON=settings.COMING_SOON MYSQL=settings.MYSQL ...
1.671875
2
mindpile/Utility/memo.py
MelbourneHighSchoolRobotics/Mindpile
2
34674
import functools def memoise(func): @functools.wraps(func) def wrapper(*args, **kwargs): if not wrapper.hasResult: wrapper.result = func(*args, **kwargs) wrapper.hasResult = True return wrapper.result wrapper.result = None wrapper.hasResult = False return wr...
3.15625
3
tests/__init__.py
UOC/dlkit
2
34675
<filename>tests/__init__.py # Pytest fixtures to get different DLKit configs during tests # Implemented from documentation here: # https://docs.pytest.org/en/latest/unittest.html import pytest @pytest.fixture(scope="class", params=['TEST_SERVICE', 'TEST_SERVICE_FUNCTIONAL']) def dlkit_service_confi...
2.25
2
dataloaders.py
mrubio-chavarria/project_2
0
34676
#!/venv/bin python """ DESCRIPTION: This file contains wrappers and variations on DataLoader. """ # Libraries import os from random import shuffle import torch import numpy as np from torch.utils.data import Dataset from resquiggle_utils import parse_resquiggle, window_resquiggle from torch import nn class Combined...
2.5625
3
setup.py
bkanchan6/high-res-stereo
0
34677
<filename>setup.py from setuptools import setup, find_packages import os version = "0.0.1" if "VERSION" in os.environ: version = os.environ["VERSION"] setup( name="high-res-stereo", version=version, description="high-res-stereo", author="<NAME>", author_email="<EMAIL>", packages=find_pack...
1.4375
1
main.py
tokudaek/image-viewer
0
34678
<filename>main.py<gh_stars>0 #!/usr/bin/env python3 """ Image viewer based on Tkinter and integrated to the database. """ ##########################################################IMPORTS import argparse import os import tkinter import tkinter.messagebox import tkinter.filedialog import tkinter.font import PIL import P...
2.671875
3
ozellikler/tarih.py
ny4rlk0/nyarlko
0
34679
import datetime as suan def al(text): try: zaman=suan.datetime.now() saat=zaman.strftime("%H") dakika=zaman.strftime("%M") saniye=zaman.strftime("%S") gun=zaman.strftime("%A") ay=zaman.strftime("%B") yil=zaman.strftime("%Y") if gun=="Monday...
3.296875
3
examples/xlnet/utils/processor.py
qinzzz/texar-pytorch
746
34680
<filename>examples/xlnet/utils/processor.py # Copyright 2019 The Texar Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LI...
2.453125
2
src/pyhf_benchmark/plot.py
pyhf/pyhf-benchmark
3
34681
<reponame>pyhf/pyhf-benchmark import json import pandas as pd import time import matplotlib.pyplot as plt ylabels = [ "CPU Utilization (%)", "Disk I/O Utilization (%)", "Process CPU Threads In Use", "Network Traffic (bytes)", "System Memory Utilization (%)", "Process Memory Available (non-swap)...
2.78125
3
serial.py
Tythos/SeRes
0
34682
<reponame>Tythos/SeRes """Serial objects are responsible for: * Maintaining specific catalogues of Format and Protocol parsers * Serializing and deserializing Python objects to and from dictionary equivalents Eventually, the second item will need to support more complex types, such as user-defined enumerations. F...
2.4375
2
Scraper.py
Warthog710/FFXIV-Alert-API
0
34683
import requests import atexit from apscheduler.schedulers.background import BackgroundScheduler from bs4 import BeautifulSoup class lodeStoneScraper: def __init__(self): self.__URL = 'https://na.finalfantasyxiv.com/lodestone/worldstatus/' self.__statistics = {} self.update_page() ...
2.8125
3
futbol-news/backend/app/app/models/search_term.py
davidespicolomina/proyecto-personal
0
34684
<gh_stars>0 from sqlalchemy import Column, Integer, String from app.db.base_class import Base class SearchTerm(Base): id = Column(Integer, primary_key=True, index=True) term = Column(String, nullable=False, comment="Término de búsqueda para filtros", unique=True, index=True)
2.46875
2
trufimonitor/configParser.py
trufi-association/trufi-monitor-backend
0
34685
<reponame>trufi-association/trufi-monitor-backend<filename>trufimonitor/configParser.py<gh_stars>0 """ It converts Strings in the format # to deactivate commands just comment them out by putting a # to the beginning of the line # optional commands can be deactivated by putting a # to the lines' beginning and activated...
3.15625
3
app/core/serializers.py
jblanquicett92/django_celery_app
0
34686
<reponame>jblanquicett92/django_celery_app from rest_framework import serializers from .models import Event, Notification class EventSerializer(serializers.ModelSerializer): class Meta: model = Event exclude = ('id', 'moved_to', 'received_timestamp',) class EventExcludeIDSerializer(serializers.Mod...
1.921875
2
modules/plugin_tablecheckbox.py
jredrejo/sqlabs
1
34687
<gh_stars>1-10 # -*- coding: utf-8 -*- # This plugins is licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php # Authors: <NAME> <<EMAIL>> from gluon import * class TableCheckbox(FORM): def __init__(self, id_getter=lambda row: row.id, tablecheckbox_var='tablechec...
1.992188
2
src/py_dss_interface/models/Sensors/SensorsV.py
davilamds/py_dss_interface
8
34688
<reponame>davilamds/py_dss_interface # -*- encoding: utf-8 -*- """ Created by eniocc at 11/10/2020 """ import ctypes from py_dss_interface.models import Bridge from py_dss_interface.models.Base import Base from py_dss_interface.models.Sensors.SensorsS import SensorsS from py_dss_interface.models.Text.Text import Text...
2.609375
3
netapp/santricity/models/v2/__init__.py
NetApp/santricity-webapi-pythonsdk
5
34689
from __future__ import absolute_import # import models into model package from netapp.santricity.models.v2.access_volume_ex import AccessVolumeEx from netapp.santricity.models.v2.add_batch_cg_members_request import AddBatchCGMembersRequest from netapp.santricity.models.v2.add_consistency_group_member_request impo...
1.320313
1
config/wsgi.py
e2718281/template_test
0
34690
""" WSGI config for test_project project. It exposes the WSGI callable as a module-level variable named ``application``. For more information on this file, see https://docs.djangoproject.com/en/1.10/howto/deployment/wsgi/ """ import os import sys from django.core.wsgi import get_wsgi_application # This allows easy...
1.804688
2
app/app/migrations/0001_initial.py
poornachandrakashi/covid-cough-prediction
3
34691
# Generated by Django 2.1.1 on 2020-04-05 06:12 from django.db import migrations, models class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( name='Response', fields=[ ('id', models.AutoField...
1.867188
2
apps/brew/settings.py
martync/zython
0
34692
SRM_TO_HEX = { "0": "#FFFFFF", "1": "#F3F993", "2": "#F5F75C", "3": "#F6F513", "4": "#EAE615", "5": "#E0D01B", "6": "#D5BC26", "7": "#CDAA37", "8": "#C1963C", "9": "#BE8C3A", "10": "#BE823A", "11": "#C17A37", "12": "#BF7138", "13": "#BC6733", "14": "#B26033", ...
1.179688
1
egs/codeswitching/asr/local_yzl23/test_libsndfile.py
luyizhou4/espnet
0
34693
from ctypes.util import find_library as _find_library print(_find_library('sndfile')) print('test fine')
1.382813
1
tests/test_utils.py
vnmabus/incense
78
34694
<filename>tests/test_utils.py from incense import utils def test_find_differing_config_keys(loader): assert utils.find_differing_config_keys(loader.find_by_ids([1, 2])) == {"epochs"} assert utils.find_differing_config_keys(loader.find_by_ids([1, 3])) == {"optimizer"} assert utils.find_differing_config_key...
2.234375
2
tdd/run.py
LarsAsplund/vunit_tdd
10
34695
<gh_stars>1-10 #!/usr/bin/env python3 """VUnit run script.""" from pathlib import Path from vunit import VUnit prj = VUnit.from_argv() lib = prj.add_library("lib") root = Path(__file__).parent lib.add_source_files(root / "src" / "*.vhd") lib.add_source_files(root / "test" / "*.vhd") prj.main()
1.84375
2
tests/test_regular.py
atiqm/adapt
0
34696
""" Test functions for regular module. """ import pytest import numpy as np from sklearn.linear_model import LinearRegression, LogisticRegression from sklearn.base import clone import tensorflow as tf from tensorflow.keras import Sequential, Model from tensorflow.keras.layers import Dense from tensorflow.keras.optimiz...
2.546875
3
tests/test_env_var.py
sfelix-martins/laradock-up-env
2
34697
import unittest from multienv.config import Config from multienv.env_var import EnvVar from multienv.exceptions import InvalidYamlFileException, \ EnvVarContainerBuildNotFoundException class EnvVarTestCase(unittest.TestCase): def test_get_containers_to_rebuild_with_existent_env_var(self): config = Co...
2.71875
3
Payload_Type/apollo/mythic/agent_functions/assembly_inject.py
n0pe-sled/Apollo
0
34698
from mythic_payloadtype_container.MythicCommandBase import * import json from uuid import uuid4 from os import path from mythic_payloadtype_container.MythicRPC import * import base64 import donut class AssemblyInjectArguments(TaskArguments): def __init__(self, command_line): super().__init__(command_line)...
2.296875
2
Lab_Week_05_-_Value_Functions,_Policies_and_Policy_Iteration/Solutions/recycling_robot/recycling_robot_environment.py
annasu1225/COMP0037-21_22
0
34699
''' Created on 4 Feb 2022 @author: ucacsjj ''' import random from enum import Enum import numpy as np from gym import Env, spaces from .robot_states_and_actions import * # This environment affords a much lower level control of the robot than the # battery environment. It is partially inspired by the AI Gymn Frozen...
2.96875
3