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 |
|---|---|---|---|---|---|---|
app/sub_app2/views.py | darklab8/darklab_fastapi | 0 | 12794351 | from fastapi import APIRouter
router = APIRouter()
@router.get("/items2/{item_id}")
async def read_item2(item_id: int):
return {"item_id": item_id}
| 2.578125 | 3 |
sim/script/plot_score.py | bx3/perigee-bandit | 0 | 12794352 | <filename>sim/script/plot_score.py
#!/usr/bin/env python
import sys
import matplotlib.pyplot as plt
import pandas as pd
from collections import defaultdict
if len(sys.argv) < 3:
print('require input_file, outfile')
sys.exit(1)
filename = sys.argv[1]
outname = sys.argv[2]
s_line = []
miners = []
with open(filen... | 2.65625 | 3 |
tests/tests_custom_indicator.py | JustalK/Indicators | 0 | 12794353 | from src.init import Init
import pytest
def test_file1_method1():
x=5
y=6
assert x+1 == y,"test success"
def test_file1_method2():
x=5
y=6
assert x+1 == y,"test success"
| 2.390625 | 2 |
piCode/rotary_class.py | aaravzen/Synthy | 1 | 12794354 | <reponame>aaravzen/Synthy
#!/usr/bin/env python3
#
# Raspberry Pi Rotary Encoder Class
# $Id: rotary_class.py,v 1.4 2021/04/23 08:15:57 bob Exp $
#
# Author : <NAME>
# Site : http://www.bobrathbone.com
#
# This class uses standard rotary encoder with push switch
#
#
import RPi.GPIO as GPIO
class RotaryEncoder:
... | 2.921875 | 3 |
Buzznauts/__init__.py | eduardojdiniz/Buzznauts | 2 | 12794355 | #!/usr/bin/env python
# coding=utf-8
from __future__ import absolute_import, division, print_function
from .version import __version__ # noqa
from .Buzznauts import * # noqa
| 1.117188 | 1 |
chapter_8/produce_permutations.py | prabal1997/uva_judge | 1 | 12794356 | <reponame>prabal1997/uva_judge
import sys
import math
#NOTE: this program individually generates permutations iteratively
#string to be permuted
input_string = "pineapple";
not_unique = (len(input_string) > len(set(input_string)));
#number of nested loops we need, their starting and ending ranges, and their state
lo... | 3.546875 | 4 |
Chapter 02/438_chapter_2_basic_syntax.py | bpbpublications/A-Journey-to-Core-Python | 0 | 12794357 | <reponame>bpbpublications/A-Journey-to-Core-Python
# -*- coding: utf-8 -*-
"""Chapter 2 - Basic Syntax
Automatically generated by Colaboratory.
Original file is located at
https://colab.research.google.com/drive/1ZCgjPQh22xnQbcARKoosyaj5Ul10efpa
"""
#Interactive Mode Programming
#On Linux
# 1. $ python
# 2. P... | 3.109375 | 3 |
ML/code/linear_model.py | DistributedML/Biscotti | 61 | 12794358 | from __future__ import division
import numpy as np
import utils
import pdb
lammy = 0.1
verbose = 1
maxEvals = 10000
X = 0
y = 0
iteration = 1
alpha = 1e-2
d = 0
hist_grad = 0
def init(dataset):
global X
X = utils.load_dataset(dataset)['X']
global y
y = utils.load_dataset(dataset)['y']
global d
... | 2.5625 | 3 |
evan/site/views/errors.py | eillarra/evan | 0 | 12794359 | <filename>evan/site/views/errors.py
from django.shortcuts import render
from django.views.decorators.csrf import requires_csrf_token
from sentry_sdk import last_event_id
@requires_csrf_token
def server_error(request):
return render(
request,
"errors/500.html",
{
"sentry_event_i... | 1.984375 | 2 |
DPGAnalysis/Skims/python/DoubleMuon_cfg.py | ckamtsikis/cmssw | 852 | 12794360 | <reponame>ckamtsikis/cmssw<gh_stars>100-1000
import FWCore.ParameterSet.Config as cms
process = cms.Process("TEST")
process.source = cms.Source("PoolSource",
fileNames = cms.untracked.vstring('file:/afs/cern.ch/cms/CAF/CMSCOMM/COMM_GLOBAL/CRUZET3/CMSSW_2_1_2/src/DPGAnalysis/Skims/python/re... | 1.53125 | 2 |
generate_password.py | smlerman/generate_password | 0 | 12794361 | <reponame>smlerman/generate_password
#!/usr/bin/python3
import argparse
import random
import string
import sys
arg_parser = argparse.ArgumentParser()
arg_parser.add_argument("-l", "--length", dest="length", type=int, required=True)
arg_parser.add_argument("-s", "--symbols", dest="symbols", required=False, action="sto... | 3.5 | 4 |
edzapp/settings.py | jamesadney/edzapp-scraper | 1 | 12794362 | # Scrapy settings for edzapp project
#
# For simplicity, this file contains only the most important settings by
# default. All the other settings are documented here:
#
# http://doc.scrapy.org/topics/settings.html
#
from edzapp import constants
BOT_NAME = 'edzapp'
BOT_VERSION = '1.0'
SPIDER_MODULES = ['edzapp.spi... | 1.773438 | 2 |
tests/_jobs/hmmsearch/steps/test_hmm.py | agonopol/pyspark-hmm-search | 0 | 12794363 | from jobs.hmmsearch.steps.hmm import parse
def test_parse_hmm():
stream = parse(open("/data/src/tara-ocean-analysis/data/Pfam-A.hmm"))
hmms = [hmm for hmm in stream]
assert len(hmms) > 0
assert hmms[0]['EFFN'] == '19.774048'
| 2.484375 | 2 |
clovek.py | SamoFMF/Five-in-a-row | 0 | 12794364 | ####################
## IGRALEC ČLOVEK ##
####################
class Clovek():
def __init__(self, gui):
self.gui = gui
def igraj(self):
# To metodo kliče GUI, ko je igralec na potezi.
# Ko je clovek na potezi, čakamo na uporabniški
# vmesnik, da sporoči, da je uporabnik kliknil... | 2.65625 | 3 |
characters/forms.py | Sult/evehub | 0 | 12794365 | <filename>characters/forms.py
from django import forms
from .models import CharacterJournal, RefType
class FilterJournalForm(forms.Form):
def __init__(self, *args, **kwargs):
self.characterapi = kwargs.pop("characterapi")
super(FilterJournalForm, self).__init__(*args, **kwargs)
self.fiel... | 2.15625 | 2 |
regression/fwiNET_classifier.py | JayanthMouli/fwi-NET | 2 | 12794366 | <filename>regression/fwiNET_classifier.py<gh_stars>1-10
#fwiNET Random Forest regressor
#created by <NAME> 2019
###########################################################################################################################################
import numpy as np
import pandas
from keras.layers import Den... | 2.703125 | 3 |
2021/Day9/cave.py | dh256/adventofcode | 0 | 12794367 | <gh_stars>0
import re
class Cave:
def __init__(self,filename):
with open(filename,'r') as input_file:
lines = [line.strip('\n') for line in input_file]
self.locations = []
for line in lines:
self.locations.append([int(loc) for loc in re.findall(r'\d',line... | 3.1875 | 3 |
app.py | manisha-jaiswal/Artificial-Intelligence-and-COVID-19-Deep-Learning-Approaches-for-Diagnosis-and-Treatment | 0 | 12794368 | #!/usr/bin/env python
import os
import sys
from flask import Flask, request, jsonify, send_file, render_template
from io import BytesIO #used to help file-related input and output operations
from import Image, ImageOps #PILLOW is usd for data processing
import base64 #used to encode binary file such as image with scr... | 2.515625 | 3 |
main.py | AndrVLDZ/Cost_planning_program | 0 | 12794369 | <gh_stars>0
import profile
from tkinter import N
import SQLite_tools as sq
import sqlite3
from sqlite3 import Error
from dataclasses import dataclass
from typing import Any
from rich.console import Console
from rich.table import Table
import traceback
@dataclass(frozen=True)
class data:
db: str = 'Fare.db'
... | 3.1875 | 3 |
Pacote download/PythonExercíciosHARDMODE/ex014HM.py | RodrigoMASRamos/Projects.py | 0 | 12794370 | #ex014: Escreva um programa que converta um a temperatura digitada em ºC e converta para ºF
| 2.53125 | 3 |
example/03_GenerateRt.py | jaedong27/calipy | 1 | 12794371 | import numpy as np
import cv2
import glob
import sys
sys.path.append("../")
import calipy
Rt_path = "./CameraData/Rt.json"
TVRt_path = "./Cameradata/TVRt.json"
Rt_back_to_front = calipy.Transform(Rt_path).inv()
Rt_TV_to_back = calipy.Transform(TVRt_path)
Rt_TV_to_front = Rt_back_to_front.dot(Rt_TV_to_back)
#origin ... | 2.390625 | 2 |
array_api_tests/pytest_helpers.py | asmeurer/array-api-tests | 0 | 12794372 | <filename>array_api_tests/pytest_helpers.py<gh_stars>0
import math
from inspect import getfullargspec
from typing import Any, Dict, Optional, Sequence, Tuple, Union
from . import _array_module as xp
from . import dtype_helpers as dh
from . import shape_helpers as sh
from . import stubs
from .typing import Array, DataT... | 2.609375 | 3 |
pfpimgen/__init__.py | TheGuywithTheHat/phen-cogs | 0 | 12794373 | import json
from asyncio import create_task
from pathlib import Path
from redbot.core.bot import Red
from .pfpimgen import PfpImgen
with open(Path(__file__).parent / "info.json") as fp:
__red_end_user_data_statement__ = json.load(fp)["end_user_data_statement"]
# from https://github.com/phenom4n4n/Fixator10-Cogs... | 2.265625 | 2 |
examples/recognition/async_bot_lib.py | uhlive/python-sdk | 0 | 12794374 | <gh_stars>0
"""Mini Bot Framework (French), async version
This code is provided as-is for demonstration purposes only and is not
suitable for production. Use at your own risk.
"""
import asyncio
import base64
from typing import Dict
import sounddevice as sd # type: ignore
from aiohttp import ClientSession # type: i... | 2.046875 | 2 |
wildlifelicensing/apps/applications/tests/test_conditions.py | jawaidm/wildlifelicensing | 0 | 12794375 | from datetime import date
from django.test import TestCase
from django.shortcuts import reverse
from django_dynamic_fixture import G
from wildlifelicensing.apps.main.tests.helpers import get_or_create_default_customer, is_login_page, \
get_or_create_default_assessor, add_assessor_to_assessor_group, SocialClient, ... | 2.078125 | 2 |
examples/build_example5.py | berkeman/examples | 0 | 12794376 | def main(urd):
urd.build('example7')
| 1.078125 | 1 |
pruebas.py | hafid4827/bot-binomo-redesigned | 5 | 12794377 | from binomo import apiAlfaBinomo
if __name__ == '__main__':
aApiAlfa = apiAlfaBinomo('','', timeBotWait = 120, loginError = True) # timeBotWait 120seg (tiempo de espera hasta resolver el capcha), loginError True
aApiAlfa.actionDV('EURUSD') # par
aApiAlfa.buy("CALL") # compra o venta (PUT)
aApiAlfa.listO... | 1.90625 | 2 |
src/icemac/addressbook/browser/person/export.py | icemac/icemac.addressbook | 1 | 12794378 | from icemac.addressbook.i18n import _
from .interfaces import IBirthDate
import icemac.addressbook.browser.base
import zope.component
class ExportList(icemac.addressbook.browser.base.BaseView):
"""List available export formats."""
title = _('Export person data')
def exporters(self):
"""Iterable ... | 2.3125 | 2 |
src/privas/bases.py | sunoru/splatoon-privates | 1 | 12794379 | import os
PKG_PATH = os.path.abspath(os.path.dirname(__file__))
class PrivaError(Exception):
def __init__(self, code, message):
super().__init__(code, message)
def __str__(self):
return ': '.join(map(str, self.args))
class BasePriva:
"""Base class for Priva (private battl... | 3.03125 | 3 |
P2_ALF.py | manojkumar1053/P2_ALF | 0 | 12794380 | <reponame>manojkumar1053/P2_ALF<gh_stars>0
import glob
import os
import shutil
import time
import cv2
import matplotlib.pyplot as plt
import numpy as np
from moviepy.editor import VideoFileClip
########################################################################################################################
INP... | 2.671875 | 3 |
TeamX/TeamXapp/migrations/0043_auto_20190712_1449.py | rootfinlay/SageTeamX | 0 | 12794381 | <filename>TeamX/TeamXapp/migrations/0043_auto_20190712_1449.py
# Generated by Django 2.2.3 on 2019-07-12 13:49
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('TeamXapp', '0042_auto_20190712_1444'),
]
operations ... | 1.523438 | 2 |
server/User/serialize.py | adamA113/servize | 0 | 12794382 | <gh_stars>0
from rest_framework import serializers
from User.models import User,ProviderUser
class ProviderUserSerializer(serializers.ModelSerializer):
providerName = serializers.CharField(source='providerId.provider.name', read_only=True)
# providerName = serializers.CharField(source='providerId.provider.id'... | 2.234375 | 2 |
nodeeditor/dev_Surface.py | madhusenthilvel/NodeEditor | 53 | 12794383 | # implemenation of the compute methods for category
import numpy as np
import random
import time
import os.path
from os import path
import matplotlib.pyplot as plt
import scipy.interpolate
from nodeeditor.say import *
import nodeeditor.store as store
import nodeeditor.pfwrap as pfwrap
print ("reloaded: "+ __file__... | 2.046875 | 2 |
plugins/python/container/test/testdata.py | proglang/servercodetest | 0 | 12794384 | <reponame>proglang/servercodetest
user = """
#import os
def sort(lst):
for i in range(len(lst)):
for j in range(i+1, len(lst)):
if lst[i]>lst[j]:
tmp = lst[j]
lst[j] = lst[i]
lst[i] = tmp
return lst
def test_t1():
assert sort([])==[]
... | 3.125 | 3 |
venv/lib/python3.6/site-packages/ansible_collections/community/mysql/plugins/module_utils/user.py | usegalaxy-no/usegalaxy | 1 | 12794385 | <reponame>usegalaxy-no/usegalaxy
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
# This code is part of Ansible, but is an independent component.
# This particular file snippet, and this file snippet only, is BSD licensed.
# Modules you write using this snippet, which is embedde... | 1.507813 | 2 |
engine.py | VETURISRIRAM/smart-search | 4 | 12794386 | """
@author: <NAME>
@title: SmartSearch - An Intelligent Search Engine.
@date: 05/06/2019
"""
import time
import argparse
from crawl_all_sites import crawl_for_sites
from generate_data import create_documents
from generate_data import create_data_directory
from clean_documents import remove_extra_lines_an... | 3.25 | 3 |
test/quadrant.py | icyfankai/python | 0 | 12794387 | #!/usr/bin/python
def Quadrant(x,y):
if x>=0:
if y >=0:
print "1"
else:
print "2"
else:
if y >=0:
print "3"
else:
print "4"
x=input('what first num you input:')
y=input('what senced num you input:')
Quadrant(x,y)
| 4.0625 | 4 |
project10/objects.py | panda0881/Beginning-Python | 2 | 12794388 | from random import randrange
from pygame import *
import project10.config
class SquishSprite(pygame.sprite.Sprite):
def __init__(self, image):
pygame.sprite.Sprite.__init__(self)
self.image = pygame.image.__loader__(image).convert()
self.rect = self.image.get_rect()
screen = pygame... | 3.171875 | 3 |
tests/spot/sub_account/test_sub_account_api_get_ip_restriction.py | Banging12/binance-connector-python | 512 | 12794389 | import responses
import pytest
from binance.spot import Spot as Client
from tests.util import mock_http_response
from tests.util import random_str
from binance.lib.utils import encoded_string
from binance.error import ParameterRequiredError
mock_item = {"key_1": "value_1", "key_2": "value_2"}
key = random_str()
secr... | 2.078125 | 2 |
models/connect.py | appkabob/adobe_connect_controller | 0 | 12794390 | <gh_stars>0
import urllib.request
import xml.etree.ElementTree as ET
import constants
class Connect:
cookie = None
@classmethod
def __init__(cls):
cls.cookie = None
with urllib.request.urlopen('{}common-info'.format(constants.CONNECT_BASE_URL)) as response:
xml = response.read... | 2.546875 | 3 |
nfv/nfv-vim/nfv_vim/tables/_image_table.py | SidneyAn/nfv | 2 | 12794391 | #
# Copyright (c) 2015-2016 Wind River Systems, Inc.
#
# SPDX-License-Identifier: Apache-2.0
#
from nfv_vim import database
from nfv_vim.tables._table import Table
_image_table = None
class ImageTable(Table):
"""
Image Table
"""
def __init__(self):
super(ImageTable, self).__init__()
def... | 2.203125 | 2 |
mcmandelbrot/html.py | edsuom/AsynQueue | 0 | 12794392 | #!/usr/bin/env python
#
# mcmandelbrot
#
# An example package for AsynQueue:
# Asynchronous task queueing based on the Twisted framework, with task
# prioritization and a powerful worker interface.
#
# Copyright (C) 2015 by <NAME>,
# http://edsuom.com/AsynQueue
#
# See edsuom.com for API documentation as well as inform... | 2.890625 | 3 |
recipes/VoxCeleb/SpeakerRecShards/voxceleb_create_webdatasets.py | nikvaessen/speechbrain-recipes | 3 | 12794393 | <filename>recipes/VoxCeleb/SpeakerRecShards/voxceleb_create_webdatasets.py
################################################################################
#
# Converts the unzipped wav/<SPEAKER_ID>/<YT_VIDEO_ID>/<UTT_NUM>.wav folder
# structure of voxceleb into a WebDataset format
#
# Author(s): <NAME>
###############... | 2.03125 | 2 |
src/data/generate_n_steps.py | jeammimi/rnn_seg | 0 | 12794394 | from .generator_traj import generate_traj, EmptyError
from .motion_type import random_rot
from ..features.prePostTools import traj_to_dist
import numpy as np
def generate_n_steps(N, nstep, ndim, sub=False, noise_level=0.25):
add = 0
if ndim == 3:
add = 1
size = nstep
X_train = np.zeros((N, ... | 2.046875 | 2 |
testfiles/matrix1n2.py | Lytiker/Clustering | 0 | 12794395 | <filename>testfiles/matrix1n2.py
"""two distance matrices from an imputed training dataset with 54 attributes, from two
different row measures"""
import pandas as pd
import numpy as np
from cluster_programme import distance_matrix, distance_matrix2
import time
#read dataset with new atttributes
new_df=pd.read_csv('../... | 2.921875 | 3 |
src/slack_events/migrations/0014_slackevent_has_files.py | stefdworschak/slack-to-xapi | 2 | 12794396 | <gh_stars>1-10
# Generated by Django 3.1.1 on 2020-10-04 22:37
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('slack_events', '0013_auto_20201004_1326'),
]
operations = [
migrations.AddField(
model_name='slackevent',
... | 1.515625 | 2 |
packages/PIPS/pips/src/Passes/pyps/pipsmakerc2python.py | DVSR1966/par4all | 51 | 12794397 | <reponame>DVSR1966/par4all
#/usr/bin/env python
import sys
import re
usage= "usage: pipsmakerc2python.py rc-file.tex properties.rc pipsdep.rc [-loop|-module|-modules]"
if len(sys.argv) < 5:
print usage
exit(1)
texfile = sys.argv[1]
generator = sys.argv[4]
#Read propdep file and convert it into a map.
input = open... | 2.578125 | 3 |
inference_module.py | mpleung/ANI | 0 | 12794398 | import numpy as np, networkx as nx, math
from scipy.sparse.csgraph import dijkstra
from scipy.sparse import csr_matrix, identity
def make_Zs(Y,ind1,ind0,pscores1,pscores0,subsample=False):
"""Generates vector of Z_i's, used to construct HT estimator.
Parameters
----------
Y : numpy float array
... | 3.125 | 3 |
test/test_basic.py | plotlyst/qt-handy | 0 | 12794399 | from qtpy.QtWidgets import QLabel
from qthandy import opaque
def test_opaque(qtbot):
widget = QLabel('Test')
qtbot.addWidget(widget)
widget.show()
opaque(widget)
assert widget.graphicsEffect()
| 2.234375 | 2 |
scripts/00_cyt_plot_and_stats.py | lorenzo-bioinfo/ms_data_analysis | 0 | 12794400 | import pandas as pd
import seaborn as sns
from matplotlib import pyplot as plt
import math
#getting a list of cytokines names/labels
cyt_list = 'IL1B,IL2,IL4,IL5,IL6,IL7,CXCL8,IL10,IL12B,IL13,IL17A,CSF3,CSF2,IFNG,CCL2,CCL4,TNF,IL1RN,IL9,IL15,CCL11,FGF2,CXCL10,PDGFB,CCL5,VEGFA,CCL3'.split(',')
#getting dataframe from c... | 2.6875 | 3 |
testimage.py | sophia2798/sock_sorting | 0 | 12794401 | # THE FOLLOWING CODE CAN BE USED IN YOUR SAGEMAKER NOTEBOOK TO TEST AN UPLOADED IMAGE TO YOUR S3 BUCKET AGAINST YOUR MODEL
import os
import urllib.request
import boto3
from IPython.display import Image
import cv2
import json
import numpy as np
# input the S3 bucket you are using for this project and the file path fo... | 2.640625 | 3 |
src/hedera_proto/schedule_delete_pb2.py | HbarStudio/hedera-protobufs-python | 0 | 12794402 | <filename>src/hedera_proto/schedule_delete_pb2.py
# -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: schedule_delete.proto
"""Generated protocol buffer code."""
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.pro... | 1.445313 | 1 |
Howie-master/howie/core.py | Srinath-tr/Goferbot | 1 | 12794403 | import marshal
import os.path
import sys
import threading
import time
import traceback
# Howie-specific
import aiml
import configFile
import frontends
from frontends import *
class ActiveFrontEnd:
def __init__(self, inst, thread):
self._inst = inst
self._thread = thread
_frontends = {}
kernel = None
def _addFro... | 2.046875 | 2 |
scinoephile/ocr/segmentation/__init__.py | KarlTDebiec/scinoephile | 2 | 12794404 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# scinoephile.ocr.segmentation.__init__.py
#
# Copyright (C) 2017-2019 <NAME>
# All rights reserved.
#
# This software may be modified and distributed under the terms of the
# BSD license. See the LICENSE file for details.
################################### MODULES #... | 1.742188 | 2 |
menpo/visualize/widgets/tools.py | jacksoncsy/menpo | 0 | 12794405 | from collections import OrderedDict
from StringIO import StringIO
# Global variables to try and reduce overhead of loading the logo
MENPO_LOGO = None
MENPO_LOGO_SCALE = None
def logo(scale=0.3):
r"""
Creates a widget with Menpo Logo Image.
The structure of the widgets is the following:
logo.chi... | 2.875 | 3 |
zella-graphics/animation/main.py | whitmans-max/python-examples | 140 | 12794406 | #!/usr/bin/env python3
# date: 2020.05.29
# It use normal loop to animate point and checkMouse to close program on click
from graphics import * # PEP8: `import *` is not preferred
import random
import time
# --- main ---
win = GraphWin("My Window",500,500)
win.setBackground(color_rgb(0,0,0))
pt = Point(250, 250)
... | 3.703125 | 4 |
bloombox_tests/schema_tests.py | Bloombox/Python | 4 | 12794407 | # -*- coding: utf-8 -*-
"""
bloombox testsuite: schema tests
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:copyright: (c) Momentum Ideas Co., 2018
:license: This software makes use of the Apache License v2.
A copy of this license is included as ``LICENSE.md`` in
the root of the project.
"""
import... | 1.835938 | 2 |
atcoder/abc/29/C.py | utgw/programming-contest | 0 | 12794408 | <filename>atcoder/abc/29/C.py
import itertools
N = int(input())
A = list('abc')
for i in itertools.product(A, repeat=N):
print(''.join(i)) | 3.328125 | 3 |
jobcontroller/app.py | nsabine/openshift-batch-demo | 0 | 12794409 | import os
import argparse
from redis import StrictRedis
from rq import Queue
# use the kubernetes service environment variables to
# connect to the redis queue
REDIS_HOST = os.environ['REDIS_MASTER_SERVICE_HOST']
REDIS_PORT = os.environ['REDIS_MASTER_SERVICE_PORT']
# REDIS_URL = 'redis://' + REDIS_HOST + ':' + RE... | 2.28125 | 2 |
gaphor/ui/tests/test_diagrampage.py | 987Frogh/project-makehuman | 1 | 12794410 | import unittest
from gaphas.examples import Box
from gaphor import UML
from gaphor.application import Application
from gaphor.diagram.general.comment import CommentItem
from gaphor.ui.mainwindow import DiagramPage
class DiagramPageTestCase(unittest.TestCase):
def setUp(self):
Application.init(
... | 2.53125 | 3 |
scripts/slim_recommender.py | inpefess/recommender-systems-course | 0 | 12794411 | <filename>scripts/slim_recommender.py
# Copyright 2021-2022 <NAME>
#
# 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 ap... | 2.375 | 2 |
fsleyes/views/canvaspanel.py | pauldmccarthy/fsleyes | 12 | 12794412 | <filename>fsleyes/views/canvaspanel.py
#!/usr/bin/env python
#
# canvaspanel.py - Base class for all panels that display overlay data.
#
# Author: <NAME> <<EMAIL>>
#
"""This module provides the :class:`CanvasPanel` class, which is the base
class for all panels which display overlays using ``OpenGL``.
"""
import loggi... | 2.359375 | 2 |
voiceEmotions/voice assistance.py | Yuni0217/Face_the_Facts | 1 | 12794413 | <filename>voiceEmotions/voice assistance.py
#I can't install PyAudio on PyCharm Linux
import pyttsx3
import datetime
import speech_recognition as sr
import wikipedia
def speak (audio):
engine.say(audio)
engine.runAndWait()
engine = pyttsx3.init('espeak')
voices = engine.getProperty('voices')
if __name__=="__m... | 3.421875 | 3 |
scripts/upgrade_dev_files.py | Chaoste/d-matcher | 0 | 12794414 | import pandas as pd
files = [
'students_wt_15.csv',
'students_st_16.csv',
'students_wt_16.csv',
'students_st_17.csv',
]
for filename in files:
path = f'input/{filename}'
students = pd.read_csv(path, index_col=0)
print('From:', students.columns)
students = students[['hash', 'Sex', 'Nati... | 3.40625 | 3 |
paderbox/testing/testfile_fetcher.py | JanekEbb/paderbox | 0 | 12794415 | import urllib.request as url
from paderbox.io.cache_dir import get_cache_dir
def fetch_file_from_url(fpath, file=None):
"""
Checks if local cache directory possesses an example named <file>.
If not found, loads data from urlpath and stores it under <fpath>
Args:
fpath: url to the example repo... | 3.296875 | 3 |
welib/weio/fast_summary_file.py | moonieann/welib | 24 | 12794416 | <filename>welib/weio/fast_summary_file.py
import numpy as np
import pandas as pd
from io import open
import os
# Local
from .mini_yaml import yaml_read
try:
from .file import File, EmptyFileError
except:
EmptyFileError = type('EmptyFileError', (Exception,),{})
File=dict
# -------------------------------... | 2.640625 | 3 |
users/tests.py | GilbertTan19/Empire_of_Movies-deploy | 0 | 12794417 | from django.test import Client, TestCase
from django.contrib.auth import get_user_model
from django.urls import reverse, resolve
from .views import ProfileUpdateView
from .forms import CustomUserCreationForm
# Create your tests here.
class CustomUserTests(TestCase):
def test_create_user(self):
User = get... | 2.4375 | 2 |
communicator/memcached_comm.py | DS3Lab/LambdaML | 23 | 12794418 | <filename>communicator/memcached_comm.py
from storage import MemcachedStorage
from communicator import Communicator
from communicator import memcached_primitive, memcached_primitive_nn
class MemcachedCommunicator(Communicator):
def __init__(self, _storage, _tmp_bucket, _merged_bucket, _num_workers, _worker_index... | 2.421875 | 2 |
tests/unittests/test_exc.py | Cottonwood-Technology/ValidX | 19 | 12794419 | import pickle
from collections import deque
from datetime import datetime
from textwrap import dedent
import pytest
from dateutil.parser import isoparse
from pytz import UTC
from validx import exc
def test_validation_error():
te = exc.InvalidTypeError(expected=int, actual=str)
assert te.context == deque([])... | 2.5625 | 3 |
jaseci_core/jaseci/actions/vector.py | Gim3l/jaseci | 0 | 12794420 | <filename>jaseci_core/jaseci/actions/vector.py
"""Built in actions for Jaseci"""
from .module.vector_actions import * # noqa
| 1.15625 | 1 |
dataModules/comSystem.py | wordyallen/drfms | 1 | 12794421 | <filename>dataModules/comSystem.py
import numpy as np
from nvd3Format import nvd3Format
def comSystem(tx_msg, control_index):
tx_bs = []
for c in tx_msg:
byte = np.fromiter(format(ord(c),'b'), dtype=int)
if len(byte) == 6:
pad = np.concatenate(([0,0], byte))
else:
pad = np.concatenate(([0], byt... | 2.28125 | 2 |
tools/wix/_get_wix.py | psryland/rylogic_code | 2 | 12794422 | <gh_stars>1-10
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Notes:
# - This script creates the UserVars.py file.
# - It cannot make use of scripts in 'repo/script' because the UserVars.py file may not exist yet in a clean build.
import os, sys, urllib.request, zipfile
wix_dir = os.path.abspath(os.path.join(os.pa... | 2.390625 | 2 |
anuvaad-etl/anuvaad-extractor/sentence/etl-tokeniser/errors/errors_exception.py | ManavTriesStuff/anuvaad | 15 | 12794423 | class FormatError(Exception):
def __init__(self, code, message):
self._code = code
self._message = message
@property
def code(self):
return self._code
@property
def message(self):
return self._message
def __str__(self):
return self.__class__.__name_... | 2.875 | 3 |
alura/elasticsearch_001/example01.py | flaviogf/Cursos | 2 | 12794424 | <filename>alura/elasticsearch_001/example01.py
from requests import put, delete
response = delete('http://localhost:9200/customer')
print(response.json())
response = put('http://localhost:9200/customer?pretty')
print(response.json())
| 2.25 | 2 |
searx/engines/pubmed.py | xu1991/open | 4 | 12794425 | #!/usr/bin/env python
"""
PubMed (Scholar publications)
@website https://www.ncbi.nlm.nih.gov/pubmed/
@provide-api yes (https://www.ncbi.nlm.nih.gov/home/develop/api/)
@using-api yes
@results XML
@stable yes
@parse url, title, publishedDate, content
More info on api: https://www.ncbi.nlm.n... | 2.34375 | 2 |
nad_logging_service/tests/logger/exception_test.py | KaiPrince/NAD-Logging-Service | 0 | 12794426 | """
* Project Name: NAD-Logging-Service
* File Name: exception_test.py
* Programmer: <NAME>
* Date: Sun, Nov 15, 2020
* Description: This file contains exception tests for the Logger app.
"""
import pytest
from .sample_data import exception_logs as sample_logs
@pytest.mark.parametrize("data", sample_logs)
def... | 2.25 | 2 |
tests/bugs/core_2230_test.py | FirebirdSQL/firebird-qa | 1 | 12794427 | <gh_stars>1-10
#coding:utf-8
#
# id: bugs.core_2230
# title: Implement domain check of input parameters of execute block
# decription:
# tracker_id: CORE-2230
# min_versions: []
# versions: 3.0
# qmid: None
import pytest
from firebird.qa import db_factory, python_act, Action
from firebir... | 2.015625 | 2 |
venv/Lib/site-packages/xlsxwriter/__init__.py | IFFP-Team-IT/ScrapingApec | 1 | 12794428 | <gh_stars>1-10
__version__ = '1.4.3'
__VERSION__ = __version__
from .workbook import Workbook
| 0.964844 | 1 |
pythonapm/contrib/django/wrapper.py | nextapm/pythonapm | 0 | 12794429 |
from importlib import import_module
from pythonapm.instrumentation import instrument_method
from pythonapm.logger import agentlogger
from pythonapm import constants
methods = [
'process_request',
'process_view',
'process_exception',
'process_template_response',
'process_response'
]
def instru... | 2.171875 | 2 |
cloudnetpy/metadata.py | griesche/cloudnetpy-1 | 1 | 12794430 | """Initial Metadata of Cloudnet variables for NetCDF file writing."""
from typing import NamedTuple, Optional
class MetaData(NamedTuple):
long_name: Optional[str] = None
standard_name: Optional[str] = None
units: Optional[str] = None
comment: Optional[str] = None
definition: Optional[str] = None
... | 2.5 | 2 |
nipype/algorithms/rapidart.py | satra/NiPypeold | 0 | 12794431 | <filename>nipype/algorithms/rapidart.py
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
"""
The rapidart module provides routines for artifact detection and region of
interest analysis.
These functions include:
* ArtifactDetect: performs artifact det... | 2.296875 | 2 |
sendsecure/client.py | xmedius/sendsecure-python | 0 | 12794432 | <gh_stars>0
import json
from .utils import *
from .helpers import *
from .exceptions import *
from .json_client import *
class Client:
"""
Gets an API Token for a specific user within a SendSecure enterprise account.
@param enterprise_account:
The SendSecure enterprise account
@param user... | 2.828125 | 3 |
website/app/api/views.py | yqh231/cloudmusic_api | 4 | 12794433 | import re
from flask import request
from website.app.api import api
from spider.database import *
from website.app.util import JsonSuccess, JsonError, ParamCheck, Param, error
@api.route('/popular_songs_list', endpoint='get_popular_song_list')
@error
@ParamCheck({'type': Param(int),
'offset': Param(in... | 2.578125 | 3 |
src/olympia/stats/tests/test_models.py | Osmose/olympia | 0 | 12794434 | <filename>src/olympia/stats/tests/test_models.py
# -*- coding: utf-8 -*-
import json
from django.core import mail
from olympia.amo.tests import TestCase
from olympia.addons.models import Addon
from olympia.stats.models import Contribution
from olympia.stats.db import StatsDictField
from olympia.users.models import Us... | 2 | 2 |
lsh_random_projecion.py | alexunder193/Machine-Learning | 0 | 12794435 | <gh_stars>0
import numpy as np
import pandas as pd
from numpy import dot
from numpy import random
import os
import os.path
from sklearn.feature_extraction.text import TfidfVectorizer
from sklearn.pipeline import make_pipeline
from sklearn.decomposition import TruncatedSVD
from sklearn.metrics.pairwise import c... | 2.53125 | 3 |
tests/linkedin_login.py | fdjlss/linkedin_hunting | 0 | 12794436 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# linkedin_login.py
from selenium import webdriver
from webdriver_manager.chrome import ChromeDriverManager
import parameters
# install webdrive when needed
driver = webdriver.Chrome(ChromeDriverManager().install())
# driver.get method() will navigate to a page given by... | 3.03125 | 3 |
tasklist/views.py | marcbperez/django-tasklist | 1 | 12794437 | from .models import Task
from django.http import HttpResponse
def index(request):
collection = Task.objects.all()
return HttpResponse(collection)
| 1.609375 | 2 |
parsifal/apps/activities/migrations/0003_auto_20210906_0158.py | ShivamPytho/parsifal | 342 | 12794438 | <reponame>ShivamPytho/parsifal
# Generated by Django 3.2.6 on 2021-09-06 01:58
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('reviews', '0035_auto_20210829_0005'),
migrations.swa... | 1.6875 | 2 |
py-data/peewee/problems/api-related/1/correct-usages/SqliteDatabase.py | ualberta-smr/NFBugs | 3 | 12794439 | <gh_stars>1-10
import datetime
import decimal
import hashlib
import logging
import operator
import re
import sys
import threading
import uuid
from bisect import bisect_left
from bisect import bisect_right
from collections import deque
from collections import namedtuple
import sqlite3
try:
from collections import Or... | 1.921875 | 2 |
urizen/generators/locations/lfd_worm_simple.py | misagai/urizen | 0 | 12794440 | #!/usr/bin/python3
import random
from urizen.core.map import Map
NORTH = 'N'
SOUTH = 'S'
EAST = 'E'
WEST = 'W'
class LFD_WormSimpleFactory(object):
def generate(self, w, h, length=None, turn_chance=0.4):
if not length:
length = int(w*h/2)
return self._gen_main(w, h, length, turn_ch... | 3.21875 | 3 |
powerline_owmweather/__init__.py | suoto/powerline-owmweather | 0 | 12794441 | from .weather import weather
| 1.195313 | 1 |
01/script_2.py | FiniteSingularity/aoc-2021 | 0 | 12794442 | with open('./input', encoding='utf8') as file:
measurements = [int(value) for value in file]
last = 99999
increasing = 0
for i, measurement in enumerate(measurements):
if i > 1:
sliding_sum = sum(measurements[i-2:i+1])
if sliding_sum > last:
increasing += 1
last = sliding_s... | 3.5 | 4 |
ch29/globalnonlocal.py | eroicaleo/LearningPython | 1 | 12794443 | X = 11
def g1():
print(X)
def g2():
global X
X = 22
def h1():
X = 33
def nested():
print(X)
nested()
def h2():
X = 33
def nested():
nonlocal X
X = 44
nested()
print(X)
if __name__ == '__main__':
g1()
g2()
g1()
h1()
h2()
| 3.390625 | 3 |
osg_configure/configure_modules/bosco.py | brianhlin/osg-configure | 1 | 12794444 | <gh_stars>1-10
"""
Module to handle attributes related to the bosco jobmanager
configuration
"""
import errno
import os
import logging
import subprocess
import pwd
import shutil
import stat
import re
from osg_configure.modules import utilities
from osg_configure.modules import configfile
from osg_configure.modules im... | 2.09375 | 2 |
tlidb/TLiDB/datasets/TLiDB_dataset.py | alon-albalak/TLiDB | 0 | 12794445 | import os
import json
from urllib.request import urlopen
from io import BytesIO
from zipfile import ZipFile
import numpy as np
from torch.utils.data import Dataset
def download_and_unzip(url, extract_to='.'):
print(f"Waiting for response from {url}")
http_response = urlopen(url)
print(f"Downloading data f... | 2.6875 | 3 |
sqlalchemy_django/middleware.py | jayvdb/sqlalchemy_django | 0 | 12794446 | <gh_stars>0
# -*- coding: utf-8 -*-
'''
Created on 2017-6-22
@author: hshl.ltd
'''
# https://blndxp.wordpress.com/2016/03/04/django-get-current-user-anywhere-in-your-code-using-a-middleware/
from __future__ import absolute_import, division, print_function, unicode_literals
try:
from threading import... | 2.34375 | 2 |
lockbot/controllers/ping.py | preyneyv/iot-door-opener | 0 | 12794447 | from starlette.responses import PlainTextResponse
def ping(_):
return PlainTextResponse('')
| 1.382813 | 1 |
fuzzinator/igalia/fuzzinator/call/__init__.py | pmatos/jsc32-fuzz | 0 | 12794448 | <gh_stars>0
# Copyright (c) 2021 <NAME>, Igalia S.L.
# Copyright (c) 2020 <NAME>, Igalia S.L.
#
# Licensed under the BSD 3-Clause License
# <LICENSE.rst or https://opensource.org/licenses/BSD-3-Clause>.
# This file may not be copied, modified, or distributed except
# according to those terms.
from .remotefile_writer_d... | 1.109375 | 1 |
download_summaries.py | charlesjlee/WikiNovelPlots | 0 | 12794449 | <filename>download_summaries.py
import pandas as pd
import requests
import sys
from tenacity import retry, wait_exponential, stop_after_attempt
from tqdm import tqdm
tqdm.pandas()
pd.options.display.max_columns = None
def looks_like_plot(s):
# effective for novels according to https://github.com/markriedl/WikiPlo... | 2.96875 | 3 |
kader/migrations/0004_auto_20180210_2104.py | hanbei/kdmanager | 0 | 12794450 | <reponame>hanbei/kdmanager<gh_stars>0
# Generated by Django 2.0.1 on 2018-02-10 21:04
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('kader', '0003_fight_tournament'),
]
operations = [
migrations.CreateModel(
name='Training'... | 1.765625 | 2 |