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
test/synth_mcmc.py
chris-stock/pyglm
1
29600
# Run as script using 'python -m test.synth' import cPickle import os import scipy.io from models.model_factory import * from inference.gibbs import gibbs_sample from utils.avg_dicts import average_list_of_dicts from synth_harness import initialize_test_harness from plotting.plot_results import plot_results from popul...
2.265625
2
pysh/transforms/autoimport.py
drslump/pysh
3
29601
""" Every name reference is swapped for a call to ``__autoimport__``, which will check if it's part of the locals or globals, falling back to trying an import before giving up. """ from importlib import import_module from ast import NodeTransformer, copy_location, fix_missing_locations, \ AST, Call, Name, Load, St...
2.59375
3
spyre/spyre/widgets/task.py
zhong-lab/optics
1
29602
from PyQt5 import QtWidgets, QtCore, QtGui from pyqtgraph import SignalProxy class TaskWidget(QtWidgets.QWidget): def __init__(self, task, rate_limit=0.01, parent=None): super().__init__(parent=parent) self.task = task self.init_ui() proxy_config = { 'signal': self.task...
2.296875
2
tests/test_fluids_bw92.py
trhallam/digirock
0
29603
<gh_stars>0 """Test functions for pem.fluid.bw92 module """ import pytest from pytest import approx from _pytest.fixtures import SubRequest from hypothesis import given, settings, strategies as st import numpy as np import digirock.fluids.bw92 as bw92 from .strategies import n_varshp_arrays @pytest.fix...
2.03125
2
apps/site/api/views/abstract_views.py
LocalGround/localground
9
29604
<reponame>LocalGround/localground<filename>apps/site/api/views/abstract_views.py from localground.apps.lib.helpers import get_timestamp_no_milliseconds from localground.apps.site.api import filters from localground.apps.site import models from rest_framework import generics, status, exceptions from localground.apps.sit...
1.890625
2
mymoney/apps/banktransactiontags/tests/test_models.py
ychab/mymoney
67
29605
<reponame>ychab/mymoney<filename>mymoney/apps/banktransactiontags/tests/test_models.py import unittest from mymoney.apps.bankaccounts.factories import BankAccountFactory from mymoney.core.factories import UserFactory from ..factories import BankTransactionTagFactory from ..models import BankTransactionTag class Man...
2.375
2
users/migrations/0017_auto_20190828_1311.py
dhanupandey12/Blog
0
29606
# Generated by Django 2.1.5 on 2019-08-28 07:41 from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('users', '0016_friends'), ] operations = [ migrations.AlterModelOptions( name='friends', options={'verbose_name': 'Friend Lis...
1.90625
2
NLP/Platsbanken/CustomStopwords.py
lambda-snail/PythonMix
0
29607
<reponame>lambda-snail/PythonMix """ A list of stopwords to filter out, in addition to those that are already being filtered by the built-in toolkit. """ CustomStopwords = ['alltid', 'fler', 'ta', 'tar', 'sker', 'redan', 'who', 'what', 'gilla', 'big', 'something','fler', 'cv', 'snart', 'minst', '...
2.234375
2
root_gnn/trainer.py
Calvin-Qiu/TopReco
0
29608
import tensorflow as tf from tensorflow.compat.v1 import logging logging.set_verbosity("INFO") logging.info("TF Version:{}".format(tf.__version__)) try: import horovod.tensorflow as hvd no_horovod = False except ModuleNotFoundError: logging.warning("No horvod module, cannot perform distributed training") ...
2.15625
2
tests/test_vera.py
j-faria/vera
0
29609
<reponame>j-faria/vera # import pytest def test_imports(): import vera from vera import RV def test_dace(): from vera.query_dace import get_observations _ = get_observations('HD10180', verbose=False) def test_read_rdb(): from vera import RV from os.path import dirname, join here = dirn...
1.796875
2
UMDPythonhangtestudo.py
FourplayHangman/Hangman-Kules
0
29610
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Project: Hangman File: hangman.py Author: <NAME> Created: 2017-11-24 IDE: PyCharm Community Edition Synopsis: hangman.py [ARGUMENT] Description: A simple hangman game that runs in the command line. ...
3.53125
4
tutorialworkflowresult.py
olegxtend/cdl_2021_demo
5
29611
import json import os import typing import codecs import typing import os import json import dill from dataclasses import dataclass, field ENCODED_PICKLE = "encodedpickle" class TutorialJsonIOManager(typing.List[str]): """ TutorialJsonIOManager will read step results from a json file """ def __init_...
3.296875
3
examples/sim_dust.py
Guo-Jian-Wang/cmbNNCS
0
29612
import sys sys.path.append('../') sys.path.append('../..') import cmbnncs.utils as utils import cmbnncs.spherical as spherical import cmbnncs.simulator as simulator import numpy as np import time start_time = time.time() def sim_Dust(dust_seed, frequ, amplitude_randn, spectralIndex_randn, temp_randn): ### ComDust ...
2.109375
2
anima/env/nukeEnv.py
tws0002/anima
0
29613
<reponame>tws0002/anima<filename>anima/env/nukeEnv.py<gh_stars>0 # -*- coding: utf-8 -*- # Copyright (c) 2012-2018, <NAME> # # This module is part of anima-tools and is released under the BSD 2 # License: http://www.opensource.org/licenses/BSD-2-Clause import os import nuke from nukescripts import * from anima.env imp...
2.21875
2
trade_remedies_api/config/settings/bdd.py
uktrade/trade-remedies-api
1
29614
<gh_stars>1-10 from .base import * # noqa INSTALLED_APPS += [ "api_test", ] ROOT_URLCONF = "api_test.urls"
1.125
1
web/certificates/migrations/0011_doublecoutingregistration_doublecoutingregistrationinputoutput.py
MTES-MCT/biocarburants
4
29615
# Generated by Django 3.2.4 on 2021-07-22 09:40 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('core', '0175_lotv2_lots_v2_year_87d135_idx'), ('certificates', '0010_auto_20210509_1038'), ] operations = [...
1.625
2
floodsystem/plot.py
caizicharles/IA-Floodwarning
0
29616
from .datafetcher import fetch_measure_levels from .stationdata import build_station_list, update_water_levels from .flood import stations_highest_rel_level import numpy as np import matplotlib import matplotlib.pyplot as plt from datetime import datetime, timedelta from floodsystem.station import inconsistent_typical_...
2.828125
3
edx/problem_set_1/bob.py
spradeepv/dive-into-python
0
29617
<reponame>spradeepv/dive-into-python<gh_stars>0 s = raw_input() find = 'bob' count = 0 index = 0 while index < len(s): index = s.find(find, index) if index == -1: break index += 2 count += 1 print "Number of times bob occurs is:", count
3.625
4
documentstore_migracao/main/__init__.py
jamilatta/document-store-migracao
0
29618
<filename>documentstore_migracao/main/__init__.py """ module to methods to main """ import sys from .migrate_isis import migrate_isis_parser from .migrate_articlemeta import migrate_articlemeta_parser from .tools import tools_parser def main_migrate_articlemeta(): """ method main to script setup.py """ sys...
2.15625
2
zang/domain/fraud_control_rule_element.py
vlastikczech/zang-python
1
29619
<reponame>vlastikczech/zang-python<gh_stars>1-10 # -*- coding: utf-8 -*- """ zang.domain.fraud_control_rule_whitelisted ~~~~~~~~~~~~~~~~~~~ `FraudControlRuleElement` model """ from zang.domain.base_resource import BaseResource from zang.domain.fraud_control_rule import FraudControlRule class FraudControlRuleElement...
2.09375
2
.qt_for_python/uic/installer.py
thomascswalker/bettergameexporter
0
29620
# -*- coding: utf-8 -*- ################################################################################ ## Form generated from reading UI file 'installer.ui' ## ## Created by: Qt User Interface Compiler version 5.15.1 ## ## WARNING! All changes made in this file will be lost when recompiling UI file! ################...
1.984375
2
paginas/migrations/0014_auto_20190206_2343.py
igor-pontes/Dolex
0
29621
<reponame>igor-pontes/Dolex<gh_stars>0 # Generated by Django 2.1.5 on 2019-02-06 23:43 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('paginas', '0013_auto_20190206_1739'), ] operations = [ migrations.AlterField( model_name=...
1.523438
2
tap_gleantap/executor.py
Radico/tap-gleantap
0
29622
<gh_stars>0 import singer from tap_kit import TapExecutor from tap_kit.utils import (transform_write_and_count) LOGGER = singer.get_logger() class GleanExecutor(TapExecutor): def __init__(self, streams, args, client): """ Args: streams (arr[Stream]) args (dict) ...
2.296875
2
design_patterns/factory_andri.py
andricampagnaro/documentacoes_e_testes
0
29623
# import logging # logging.basicConfig(filename='example.log',level=logging.DEBUG) # logging.debug('This message should go to the log file') # logging.info('So should this') # logging.warning('And this, too ã') class ValidaSmart(): def __init__(self): self._carrega_modulos_externos() def _carrega_mod...
2.90625
3
codes/models/modules/sftmd_arch.py
Mark-sloan/IKC
1
29624
<reponame>Mark-sloan/IKC<filename>codes/models/modules/sftmd_arch.py ''' architecture for sftmd ''' import torch import torch.nn as nn import torch.nn.functional as F class Predictor(nn.Module): def __init__(self, input_channel=3, code_len=10, ndf=64, use_bias=True): super(Predictor, self).__init__() ...
2.140625
2
server/urls.py
Valchris/AngularJS-Django-Template
1
29625
<reponame>Valchris/AngularJS-Django-Template from django.conf.urls import include, url from django.contrib import admin from glue.views import * from glue.api import * urlpatterns = [ # Examples: # url(r'^$', 'server.views.home', name='home'), # url(r'^blog/', include('blog.urls')), url(r'^api/user/da...
1.679688
2
Webcam2YouTubeLive.py
JulianLiederer/ffmpeg-youtube-live
2
29626
#!/usr/bin/env python """ LIVE STREAM TO YOUTUBE LIVE using FFMPEG -- from webcam https://www.scivision.co/youtube-live-ffmpeg-livestream/ https://support.google.com/youtube/answer/2853702 Windows: get DirectShow device list from: ffmpeg -list_devices true -f dshow -i dummy """ from youtubelive_ffmpeg import youtu...
2.390625
2
nebula/dao/strategy_dao.py
threathunterX/nebula_web
2
29627
<reponame>threathunterX/nebula_web<gh_stars>1-10 #!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import absolute_import import json import logging from threathunter_common.util import millis_now from nebula_meta.model import Strategy from .base_dao import BaseDao, BaseDefaultDao from . import cache from ...
1.828125
2
src/21_zip.py
TheFlipbook/python_challenge
0
29628
<filename>src/21_zip.py # http://www.pythonchallenge.com/pc/bin/hex.html import bz2 import io import urllib.request import urllib.error import zipfile import zlib out_dir = "_out/idiot" prompt = "http://www.pythonchallenge.com/pc/hex/unreal.jpg" prompt_top = "http://www.pythonchallenge.com/pc/hex/" prompt_range = ...
3.09375
3
awards/signals.py
fgmacedo/django-awards
0
29629
<gh_stars>0 from django.dispatch import Signal badge_awarded = Signal(providing_args=["badge"])
1.289063
1
tests/test_auth/test_upload_passport.py
peterwade153/flybob
1
29630
import unittest from unittest.mock import patch, Mock from werkzeug.datastructures import FileStorage import io import json from app import app from app.models.base import db from app.models.user import User from app.auth.views import UserPassportphotoView from app.auth import views class AuthUploadPassportPhotoTes...
2.671875
3
qchem/tests/test_two_particle.py
theRoughCode/pennylane
1
29631
import os import numpy as np import pytest from pennylane import qchem from openfermion.hamiltonians import MolecularData ref_dir = os.path.join(os.path.dirname(os.path.realpath(__file__)), "test_ref_files") table_1 = np.array( [ [0.0, 0.0, 0.0, 0.0, 0.68238953], [0.0, 1.0, 1.0, 0.0, 0.68238953]...
1.585938
2
example_project/news_with_archive/migrations/0001_initial.py
richardbarran/django-minipub
7
29632
# Generated by Django 2.0 on 2018-02-14 13:39 from django.db import migrations, models import django.utils.timezone import model_utils.fields class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( name='Article', ...
1.84375
2
recipes/Python/578344_Simple_Finite_State_Machine_class_/recipe-578344.py
tdiprima/code
2,023
29633
#! /usr/bin/env python """ Generic finite state machine class Initialise the class with a list of tuples - or by adding transitions <NAME> - November 2012 Released under an MIT License - free to use so long as the author and other contributers are credited. """ class fsm(object): """ A simple to use f...
3.515625
4
self-citation-check.py
Darkbladecr/pyresearch
7
29634
<filename>self-citation-check.py from __future__ import division from optparse import OptionParser import numpy parser = OptionParser() parser.add_option("-i", "--input", dest="input", help="input file") (options, args) = parser.parse_args() def numpyImport(file): output = numpy.load("%s.npy" % file) output ...
2.8125
3
socialaccount/admin.py
establishment/django-establishment
1
29635
from django.contrib import admin from django import forms from establishment.accounts.utils import get_user_search_fields from .models import SocialApp, SocialAccount, SocialToken, SocialProvider class SocialAppForm(forms.ModelForm): class Meta: model = SocialApp exclude = [] widgets = {...
2.09375
2
tap_github/tap.py
edgarrmondragon/tap-github
0
29636
"""GitHub tap class.""" from typing import List from singer_sdk import Tap, Stream from singer_sdk import typing as th # JSON schema typing helpers from tap_github.streams import ( CommitsStream, CommunityProfileStream, IssueCommentsStream, IssueEventsStream, IssuesStream, PullRequestsStream...
2.328125
2
grand/backends/sqlbackend.py
aplbrain/grand
31
29637
<reponame>aplbrain/grand from typing import Hashable, Generator, Optional, Iterable import time import pandas as pd import sqlalchemy from sqlalchemy.pool import NullPool from sqlalchemy.sql import select from sqlalchemy import and_, or_, func from .backend import Backend _DEFAULT_SQL_URL = "sqlite:///" _DEFAULT_SQL...
2.390625
2
Searches/models.py
Sofia190/book_store_app
0
29638
<reponame>Sofia190/book_store_app<gh_stars>0 from django.db import models # Create your models here. from django.conf import settings from django.db import models from django.utils import timezone # Create your models here. class SearchQuery(models.Model): user = models.ForeignKey(settings.AUTH_USER_MODEL, b...
2.1875
2
non_semantic_speech_benchmark/distillation/write_savedmodel_to_disk.py
lix2k3/google-research
1
29639
<reponame>lix2k3/google-research<filename>non_semantic_speech_benchmark/distillation/write_savedmodel_to_disk.py # coding=utf-8 # Copyright 2021 The Google Research Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may o...
2.09375
2
event/migrations/0003_event_org.py
Ortus-Team/Moim
0
29640
# -*- coding: utf-8 -*- # Generated by Django 1.11.6 on 2018-01-10 08:34 from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('org', '0001_initial'), ('event', '0002_auto_2018010...
1.445313
1
mcp23008slave.py
notro/cp-smbusslave
0
29641
import digitalio import pulseio from smbusslave import SMBusSlave IODIR = 0x00 IPOL = 0x01 GPINTEN = 0x02 DEFVAL = 0x03 INTCON = 0x04 IOCON = 0x05 GPPU = 0x06 INTF = 0x07 INTCAP = 0x08 GPIO = 0x09 OLAT = 0x0a IOCON_SEQOP = 1 << 5 IOCON_ODR = 1 << 2 IOCON_INTPOL = 1 << 1 # Pull up on interrupt pins are not supported...
2.53125
3
src/main/python/counts_tools/exec/deviation_analysis.py
cday97/beam
123
29642
import ConfigParser from datetime import datetime import os import sys import numpy as np import pandas as pd import utils.counts import utils.counts_deviation __author__ = '<NAME>' # This script finds the days with the greatest deviation from some reference value (such as hourly means or medians) if __name__ == '_...
2.859375
3
boltstream/responses.py
geekpii/boltstream
1,735
29643
from django.http import HttpResponse class HttpResponseNoContent(HttpResponse): status_code = 204
1.414063
1
ChessRender/RenderFsmCommon/figure_manage.py
PavelLebed20/chess_classic
1
29644
############################### # MODULE: Object settings # # AUTHOR: <NAME> # # LAST UPDATE: 08/04/2019 # ############################### import copy from enum import Enum, IntEnum from direct.gui.OnscreenText import TransparencyAttrib BLACK = (0.15, 0.15, 0.15, 1) #BLACK = (0.0, 0.0, 0.0, 1) WHITE = (0...
2.328125
2
hostel_project/hostel_webapp/views.py
harsh-ux/hostel-app
0
29645
<gh_stars>0 from django.shortcuts import render from django.views import generic from django.shortcuts import redirect from django.utils import timezone from .models import Complaint from .forms import ComplaintForm class ComplaintList(generic.ListView): queryset = Complaint.objects.order_by('date') template_n...
2.09375
2
map_crawling/map_crawling_code/Map_crawling.py
yumei86/iRamen_linebot
16
29646
<gh_stars>10-100 from selenium import webdriver from selenium.webdriver.common.by import By from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.support import expected_conditions as EC from time import sleep import time import csv import pyautogui #-------將網頁開啟的動作換為背景執行---------- options...
2.59375
3
blamepipeline/preprocess/match_article_entry.py
jmmaki/BlamePipeline
0
29647
# encoding: utf-8 ''' Match articles with annotated data ''' from collections import defaultdict import argparse from blamepipeline.preprocess.dataloader import Dataset case1, case2 = 0, 0 def match_data(source): dataset = Dataset(source) articles = dataset.get_articles() entries = dataset.get_entries...
2.71875
3
res/TensorFlowPythonExamples/examples/while/__init__.py
bogus-sudo/ONE-1
255
29648
import tensorflow as tf i = tf.compat.v1.constant(0, name="Hole") c = lambda i: tf.compat.v1.less(i, 10) b = lambda i: tf.compat.v1.add(i, 1) r = tf.compat.v1.while_loop(c, b, [i], name="While")
2.71875
3
tests/prosperpy/overlays/test_bollinger_bands.py
CaptainBriot/prosperpy
2
29649
import unittest import decimal import prosperpy def get_prices(): prices = ['90.704', '92.900', '92.978', '91.802', '92.665', '92.684', '92.302', '92.773', '92.537', '92.949', '93.204', '91.067', '89.832', '89.744', '90.399', '90.739', '88.018', '88.087', '88.844', '90.778', '90.542',...
2.96875
3
projects/course_intro/raw_input.py
ProgressBG-Python-Course/ProgressBG-VC-Python
0
29650
<filename>projects/course_intro/raw_input.py machine_number = 43 user_number = int( raw_input("enter a number: ") ) print( type(user_number) ) if user_number == machine_number: print("Bravo!!!")
3.796875
4
algorithm.py
James0231/Data-Visualization-PJ
5
29651
<filename>algorithm.py import copy import numpy as np class FFDAlgorithm(object): def __init__(self, num_x, num_y, num_z, filename, object_points): #定义三坐标轴上控制点个数 self.cp_num_x = num_x self.cp_num_y = num_y self.cp_num_z = num_z self.object_points_initial = object_points def co...
2.921875
3
src/DeepReinforcementLearning/__init__.py
Quantum56/AlphaZero-AI
1
29652
# from AlphaZero-AI import game
0.980469
1
utilities/tests/testTwitterAPI.py
nikhilsajwan/uhackathon
4
29653
from django.test import TestCase from ..twitterAPI import search class TwitterTestCase(TestCase): """Unit test to ensure that search string is found in 100 new reddit posts returned from API""" def setUp(self): self.queryString = "Police" self.submissions = search(self.queryString) def test_submissions_contai...
3.046875
3
recipes/mio/all/conanfile.py
rockandsalt/conan-center-index
562
29654
<reponame>rockandsalt/conan-center-index from conans import ConanFile, tools import os required_conan_version = ">=1.33.0" class MioConan(ConanFile): name = "mio" description = "Cross-platform C++11 header-only library for memory mapped file IO." license = "MIT" topics = ("mio", "mmap", "memory-mappi...
2.015625
2
auto-test/tools/tcpreplay_tools.py
asterfusion/Tapplet
1
29655
import os import math from scapy.all import * from pytest_main import eth_config from pytest_main import dump_eth_config def getstatusoutput(cmd): pipe = os.popen(cmd + " 2>&1", 'r') text = pipe.read() sts = pipe.close() if sts is None: sts=0 if text[-1:] == "\n": text = text[:-1] return sts,...
2.171875
2
tests/test_statebus.py
invisible-college/tightrope
1
29656
// Test calls to statebus server var bus = require('statebus/server')(); bus.ws_client("/*", "ws://aws.local-box.org:45678"); x = bus.fetch("/paul/code"); console.log(JSON.stringify(x)); if (!x.written) { console.log("No member .written found, setting it now"); x.written = "here it is"; } save(x);
1.71875
2
src/pyams_utils/interfaces/intids.py
Py-AMS/pyams-utils
0
29657
<reponame>Py-AMS/pyams-utils # # Copyright (c) 2008-2015 <NAME> <tflorac AT ulthar.net> # All Rights Reserved. # # This software is subject to the provisions of the Zope Public License, # Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. # THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRES...
2.03125
2
reo/migrations/0083_merge_20201207_1317.py
akuam1/REopt_Lite_API
41
29658
<filename>reo/migrations/0083_merge_20201207_1317.py<gh_stars>10-100 # Generated by Django 2.2.13 on 2020-12-07 13:17 from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('reo', '0075_auto_20201125_1947'), ('reo', '0082_chpmodel_chp_unavailability_hourly'), ...
1.25
1
source/cifar/defense/base.py
DingfanChen/RelaxLoss
4
29659
import os import sys import time import torch import torch.nn as nn import random import numpy as np import torchvision.transforms as transforms FILE_DIR = os.path.dirname(os.path.abspath(__file__)) DATA_ROOT = os.path.join(FILE_DIR, '../../../data') sys.path.append(os.path.join(FILE_DIR, '../')) sys.path.append(os.pa...
2.34375
2
hangman.py
maritzapott/hangmangame
0
29660
# HANGMAN GAME from collections import namedtuple import main game_board = namedtuple('game_board', ['board', 'mistakes', 'letters', 'status']) def welcome(): """Starts the game.""" print("Welcome") word = main._choose_word() _print_start_game() _print_start_spaces(word) game_board.letters = []...
4.0625
4
shows/Text.py
fenceFoil/canopto
0
29661
<gh_stars>0 #!/bin/python3 import Canopto import pygame from pygame.locals import * import time import random import colorsys c = Canopto(2, 8, previewEnabled = True)
1.609375
2
ls/joyous/models/one_off_events.py
tjwalch/ls.joyous
72
29662
# ------------------------------------------------------------------------------ # Joyous events models # ------------------------------------------------------------------------------ import datetime as dt from django.db import models from django.db.models.query import ModelIterable from django.utils import timezone f...
1.734375
2
examples/titanic/assets/dataset/opener.py
eliaskousk/substra
119
29663
<reponame>eliaskousk/substra import os import pandas as pd import random import string import numpy as np import substratools as tools class TitanicOpener(tools.Opener): def get_X(self, folders): data = self._get_data(folders) return self._get_X(data) def get_y(self, folders): data =...
2.765625
3
test/integration/test_natural_language_understanding_v1.py
jsstylos/waston-developer-cloud-python-sdk
1,579
29664
# coding: utf-8 from unittest import TestCase import os import ibm_watson import pytest import json import time from ibm_watson.natural_language_understanding_v1 import Features, EntitiesOptions, KeywordsOptions @pytest.mark.skipif(os.getenv('NATURAL_LANGUAGE_UNDERSTANDING_APIKEY') is None, reason=...
2.453125
2
project/RealEstateMarketPlace/views/ListConversationsView.py
Mihaaai/RealEstateMarketplace
0
29665
<gh_stars>0 from django.views.generic import ListView from rest_framework import authentication, permissions from ..models import Message,Listing,User from django.db.models import Q class ListConversationsView(ListView): authentication_classes = (authentication.SessionAuthentication,) permission_classes = (p...
2.28125
2
image/src/binarization.py
Wookhwang/Tensorflow_by_wook
0
29666
<filename>image/src/binarization.py<gh_stars>0 import cv2 as cv def nothing(x): pass cv.namedWindow('Binary') cv.createTrackbar('threshold', 'Binary', 0, 255, nothing) cv.setTrackbarPos('threshold', 'Binary', 167) img_color = cv.imread('wallpaper-2994965.jpg', cv.IMREAD_COLOR) cv.imshow('Color', ...
3.078125
3
member_join.py
zStartKiller/BotDiscordPython
4
29667
<filename>member_join.py import asyncio import discord from discord import channel from discord.ext import commands import random from main import bot class member_joining(commands.Cog): def __init__(self, bot): self.bot = bot @commands.Cog.listener() async def on_member_join(self, mem...
2.859375
3
instauto/api/actions/structs/friendships.py
marvic2409/instauto
0
29668
from . import common as cmmn import logging import uuid from typing import Optional from instauto.api.structs import Surface logger = logging.getLogger(__name__) class _Base(cmmn.Base): _csrftoken: str = None radio_type: str = 'wifi-none' device_id: str = None _uid: str = None _uuid: str = None ...
2.296875
2
InteractiveBreak_Filtering/showAnswerFiltering.py
JoeGreiner/MorphologicalOperatorsDemo
0
29669
<reponame>JoeGreiner/MorphologicalOperatorsDemo from IPython.display import display from ipywidgets import widgets button = widgets.Button(description="Click for answer") output = widgets.Output() display(button, output) already_clicked = False def on_button_clicked(b): global already_clicked, button if not...
3.265625
3
respostas/migrations/0016_resposta_materia.py
Samio-Santos/Sistema_Questoes_Django
0
29670
<filename>respostas/migrations/0016_resposta_materia.py # Generated by Django 3.2 on 2021-07-02 21:43 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('respostas', '0015_alter_resposta_banca'), ] operations = [ migrations.AddField( ...
1.21875
1
libs/menus/menus.py
MilianoJunior/appSalva
0
29671
from kivymd.uix.boxlayout import MDBoxLayout from kivymd.uix.toolbar import MDToolbar class Menus(): def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) def __call__(self): box_central = MDBoxLayout(orientation='vertical') # criar componentes toolbar = MDToo...
2.3125
2
setup.py
t-ceccarini/deep-b-spline-approximation
0
29672
# -*- coding: utf-8 -*- """ Created on Thu Jan 13 23:29:22 2022 @author: Tommaso """ from setuptools import setup VERSION = '0.2.8' DESCRIPTION = 'A python package for bspline curve approximation using deep learning' # Setting up setup( name='deep-b-spline-approximation', packages=['deep_b_spline_approximati...
1.359375
1
source/db_api/crud/crud_documents.py
JungeAlexander/kbase_db_api
1
29673
<filename>source/db_api/crud/crud_documents.py from datetime import date from typing import Iterable from sqlalchemy.orm import Session from db_api import models, schemas def get_document(db: Session, document_id: str) -> models.Document: return db.query(models.Document).filter(models.Document.id == document_id...
2.46875
2
displ/wannier/update_dis.py
tflovorn/displ
4
29674
from argparse import ArgumentParser import os from displ.pwscf.parseScf import fermi_from_scf from displ.wannier.wannier_util import global_config from displ.wannier.build import Update_Disentanglement def _main(): parser = ArgumentParser(description="Update disentanglement window in W90 input") parser.add_arg...
2.28125
2
setup.py
maoterodapena/pysouliss
9
29675
<gh_stars>1-10 """Setup file for souliss package.""" import os from setuptools import setup, find_packages if os.path.exists('README.rst'): README = open('README.rst').read() else: README = '' setup( name='pysouliss', version='0.0.5', description='Python API for talking to a Souliss gateway gatewa...
1.390625
1
scriptlib/scriptfile.py
Orbtial/scriptlib
0
29676
<reponame>Orbtial/scriptlib ''' ScriptFile File Manager for the scriptlib package Developed by Orbtial ''' #Custom Imports from . import scriptui #Standard Imports import os def initPTPDIR(filePathAttr): """ Returns a string representation of the path to the file's parent directory. Should be initialised and stor...
2.890625
3
egg5_config.py
eastgenomics/egg5_dias_CEN_config
0
29677
<reponame>eastgenomics/egg5_dias_CEN_config import sys sys.path.append("/mnt/storage/apps/software/dias_config") from dias_dynamic_files import ( genes2transcripts, bioinformatic_manifest, genepanels_file, ) assay_name = "CEN" # Core Endo Neuro assay_version = "v1.1.4" ref_project_id = "project-Fkb6Gkj4...
1.804688
2
axiom/__init__.py
schehata/axiom-py
4
29678
<reponame>schehata/axiom-py """ Axiom Python Client """ __version__ = "0.1.0-beta.2" from .client import * from .datasets import *
0.699219
1
test_credentialData.py
mireille1999/Credential-Locker
0
29679
import unittest from credentialData import CredentialData class TestCredentials(unittest.TestCase): def setUp(self): """ setUp method """ self.new_credential = CredentialData("Instagram", "mimi", "mireille") def test_init(self): """ testing initialization ...
3.34375
3
scripts/study_case/ID_13/torch_geometric/transforms/random_rotate.py
kzbnb/numerical_bugs
8
29680
import numbers import random import math import torch from scripts.study_case.ID_13.torch_geometric.transforms import LinearTransformation class RandomRotate(object): def __init__(self, degrees, axis=0): if isinstance(degrees, numbers.Number): degrees = (-abs(degrees), abs(degrees)) a...
2.90625
3
hsmodels/schemas/base_models.py
hydroshare/hsmodels
0
29681
<filename>hsmodels/schemas/base_models.py from datetime import datetime from typing import Any, Callable, Dict, Optional, Union from pydantic import BaseModel class BaseMetadata(BaseModel): def dict( self, *, include: Union['AbstractSetIntStr', 'MappingIntStrAny'] = None, exclude:...
2.71875
3
overlay_camera/Server.py
toakarsky/OverlayCamera
0
29682
from flask import Flask, render_template, Response from .OverlayCamera import OverlayCamera from .settings import ROUTE app = Flask(__name__) def gen(camera): """Video streaming generator function.""" while True: frame = camera.get_frame() yield (b'--frame\r\n' b'Content-Type...
2.421875
2
backend/shrunk/client/search.py
kevinmonisit/shrunk
13
29683
"""Implements the :py:class:`SearchClient` class.""" from typing import Any, List from datetime import datetime, timezone from pymongo.collation import Collation import pymongo __all__ = ['SearchClient'] class SearchClient: """This class executes search queries.""" def __init__(self, *, db: pymongo.databa...
2.953125
3
tests/test_pinblock.py
adelosa/cardutil
0
29684
<gh_stars>0 import unittest from cardutil import pinblock class PinblockTestCase(unittest.TestCase): def test_pin_block_Iso0(self): self.assertEqual( b'\x04\x12\x26\xcb\xa9\x87\x6f\xed', pinblock.Iso0PinBlock(pin='1234', card_number='4441234567890123').to_bytes()) def test_vi...
2.875
3
tests/test_internal_devices.py
NotBobTheBuilder/gpiozero
1
29685
<reponame>NotBobTheBuilder/gpiozero<gh_stars>1-10 # GPIO Zero: a library for controlling the Raspberry Pi's GPIO pins # Copyright (c) 2019 <NAME> <<EMAIL>> # Copyright (c) 2019 <NAME> <<EMAIL>> # Copyright (c) 2019 <NAME> <<EMAIL>> # Copyright (c) 2018 SteveAmor <<EMAIL>> # # Redistribution and use in source and binary...
1.796875
2
ejercicio.py
inacayal/reservas
0
29686
def pedir_entero (mensaje,min,max): numero = input(mensaje.format(min,max)) if type(numero)==int: while numero <= min or numero>=max: numero = input("el numero debe estar entre {:d} y {:d} ".format(min,max)) return numero else: return "debes introducir un entero" valido...
4.09375
4
src/thirdparty/yaml/utils.py
third-party-dev/yaml
1
29687
<reponame>third-party-dev/yaml # from collections.abc import MutableMapping, MutableSequence, MutableSet from collections.abc import Sequence, Container # , Mapping, Set from collections import OrderedDict import contextlib from ruamel.yaml.constructor import ConstructorError from ruamel.yaml.nodes import MappingNode...
2.34375
2
ooobuild/dyn/rendering/repaint_result.py
Amourspirit/ooo_uno_tmpl
0
29688
# coding: utf-8 # # Copyright 2022 :Barry-Thomas-Paul: Moss # # 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 applicab...
1.921875
2
timetest.py
schaibo/gpio-
0
29689
<filename>timetest.py<gh_stars>0 # -*- coding: utf-8 -*- """ Created on Sun Jan 26 16:01:59 2014 @author: pi """ import time def delay(i): k=0 for j in range(i): k+=1 n=5000 j=0 a=time.time() i=1 c=time.time() d=c-a print d a=time.time() for i in range(n): j+=1 c=time.time() d=c-a print d ...
3.125
3
pySIC/reader.py
edoaxyz/image_to_hOCR
0
29690
############################################################ import pytesseract import os from reportlab.lib.pagesizes import letter from reportlab.pdfgen import canvas from reportlab.pdfbase import pdfmetrics from reportlab.pdfbase.ttfonts import TTFont ############################################################# R_...
2.34375
2
sciflo/event/pdict.py
hysds/sciflo
0
29691
""" pdict.py -- Implement a (remote) persistent dictionary that is accessed over a socket. The backend dictionary could be dbshelve, BSDDB, or even a relational table of (key, blob). *** The purpose is to have a bullet-proof, separate-process, persistent dictionary that is very fast, globa...
2.46875
2
tests/functional_tests.py
Ecotrust/OPCDB
0
29692
<gh_stars>0 from selenium import webdriver import unittest class FirefoxTest(unittest.TestCase): def setUp(self): self.browser = webdriver.Firefox() def tearDown(self): self.browser.quit() def test_page(self): #test method names must start with 'test' self.browser.get('http...
3.015625
3
python-stuff/performance_timing.py
mnky9800n/python-data-analysis-tools
2
29693
import timeit # bro, probably could just use %timeit if # you are on ipython. :-P starttime = timeit.default_timer() """ your code here """ endtime = timeit.default_timer() print(endtime - starttime)
2.5
2
hortiradar/database/restart_workers.py
mctenthij/big-tu-top10
7
29694
import os import re from subprocess import call from time import sleep supervisor_dir = "/etc/supervisor/conf.d/" _, _, files = next(os.walk(supervisor_dir)) for f in files: m = re.match("(hortiradar-worker\d)\.conf", f) if m: worker = m.group(1) call(["supervisorctl", "restart", worker]) ...
1.914063
2
service/main.py
release-depot/rtls
0
29695
<gh_stars>0 #!/usr/bin/env python """ Main runner for the service """ from flask import Flask from flask_restful import Api from resources.rtls import Rtls def create_app(): app = Flask(__name__) api = Api(app) api.add_resource(Rtls, '/rtls/', '/rtls/<string:package>/<string:change...
2.140625
2
ykdl/extractors/mgtv.py
163ui/ykdl
3
29696
#!/usr/bin/env python # -*- coding: utf-8 -*- from ykdl.util.html import default_proxy_handler, get_content from ykdl.util.match import match1, matchall from ykdl.extractor import VideoExtractor from ykdl.videoinfo import VideoInfo from ykdl.compact import install_opener, build_opener, HTTPCookieProcessor import json...
2.15625
2
codewars/7kyu/mohamedashrafamin/Ultimate_Array_Reverser/test_bench.py
mohamedashrafamin/Training_one
0
29697
<gh_stars>0 from main import reverse, reverse1 def test1(benchmark): assert benchmark(reverse, ["I", "like", "big", "butts", "and", "I", "cannot", "lie!"]) == \ ["!", "eilt", "onn", "acIdn", "ast", "t", "ubgibe", "kilI"] def test(benchmark): assert benchmark(reverse1, ["I", "like", "big", "butts"...
2.84375
3
scripts/instagramy.py
lathropd/instanewsroom
0
29698
from instagram.client import InstagramAPI from pprint import pprint test_access_token = "1890268.7c3f1ab.e1c64ca8df38410099d98bff8a868bb6" api = InstagramAPI(access_token=test_access_token) pprint( api.user_recent_media())
1.546875
2
rodario/registry.py
haliphax/rodario
4
29699
""" Actor registry for rodario framework """ # local from rodario import get_redis_connection from rodario.exceptions import RegistrationException # pylint: disable=C1001 class _RegistrySingleton(object): """ Singleton for actor registry """ def __init__(self, prefix=None): """ Initialize t...
2.53125
3