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 |
|---|---|---|---|---|---|---|
lunchmoney/__init__.py | Christofon/lunchmoney-python | 0 | 42700 | <reponame>Christofon/lunchmoney-python
from .tags import Tags
from .categories import Categories
import os
import requests
# TODO maybe only for testing needed
# LUNCHMONEY_API_KEY = os.environ.get('LUNCHMONEY_API_KEY', None)
from dotenv import load_dotenv
load_dotenv()
LUNCHMONEY_API_KEY = os.getenv('LUNCHMONEY_API_K... | 2.234375 | 2 |
global_finprint/annotation/migrations/0018_migrate_obs_to_event.py | GlobalFinPrint/global_finprint | 0 | 42701 | from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('annotation', '0017_auto_20160516_0030'),
]
operations = [
migrations.RunSQL('''
-- migrate initial observations to an event
insert into anno... | 1.976563 | 2 |
python-opencv-face-detection.py | mattwang137/Python-portfolio | 0 | 42702 | <reponame>mattwang137/Python-portfolio<filename>python-opencv-face-detection.py
#!/usr/bin/python3
#encoding:utf-8
import numpy as np
import cv2,os,dlib
"""
Develop Subject: python-opencv-face-detection
Developer: <NAME>
Python environment: version 3.6
"""
def faceDetection():
cap=cv2.VideoCapture... | 3.015625 | 3 |
Queue.py | sookoor/PythonInterviewPrep | 0 | 42703 | <filename>Queue.py
class Queue:
def __init__(self):
self.in_stack = []
self.out_stack = []
# Transfer values in stack1 to stack2
def stack_transfer(self, stack1, stack2):
while stack1:
stack2.append(stack1.pop())
def enqueue(self, value):
self.in_stack.appen... | 3.875 | 4 |
src/Stele/analysis/analysis_ipg/fixes/LegendSettings_ui.py | SherwinGroup/Stele | 1 | 42704 | <reponame>SherwinGroup/Stele<gh_stars>1-10
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'C:\Users\FELLab\Documents\GitHub\Interactivepg-waffle\interactivePG\fixes\LegendSettings.ui'
#
# Created by: PyQt5 UI code generator 5.6
#
# WARNING! All changes made in this file will be lost!
fro... | 1.890625 | 2 |
maps/bboxes.py | CharlesRethman/HEA-Baselines-ZA-2015-Oct | 0 | 42705 | <reponame>CharlesRethman/HEA-Baselines-ZA-2015-Oct
l = iface.activeLayer()
iter = l.getFeatures()
geoms = []
for feature in iter:
geom = feature.geometry()
if not(geom.isMultipart()):
l.boundingBox(feature.id())
geoms.append(geom)
| 2.140625 | 2 |
inference/sentiment_inference.py | MiguelPeralvo/teslamonitor | 0 | 42706 | <reponame>MiguelPeralvo/teslamonitor
import numpy as np
import matplotlib
import datetime
matplotlib.use('TkAgg')
from fastai.text import *
import sys
sys.excepthook = sys.__excepthook__ # See https://groups.io/g/insync/topic/13778827?p=,,,20,0,0,0::recentpostdate%2Fsticky,,,20,2,0,13778827
import json
from vaderSenti... | 2.5625 | 3 |
h/schemas.py | ssin122/test-h | 2 | 42707 | # -*- coding: utf-8 -*-
"""Classes for validating data passed to views."""
from __future__ import unicode_literals
import copy
import jsonschema
from jsonschema.exceptions import best_match
class ValidationError(Exception):
pass
class JSONSchema(object):
"""
Validate data according to a Draft 4 JSON S... | 2.71875 | 3 |
after/app.py | littlepea/python-admin-business-logic-talk | 0 | 42708 | <filename>after/app.py
import urllib2
import json
from aqi import Station
from cache import cache
API_BASE = 'https://api.openaq.org/v1/latest'
def _get_city_url(city):
return '{}?city={}'.format(API_BASE, city)
def _load_results(url):
try:
response = urllib2.urlopen(url)
results = json.l... | 3.03125 | 3 |
week1/1.12 tasks of the week/step02 interval.py | project-cemetery/stepik-programming-on-python | 7 | 42709 | def is_in_interval(n):
return (-15 < n <= 12) or (14 < n < 17) or (19 <= n)
print(is_in_interval(int(input())))
| 3.640625 | 4 |
index/urls.py | Zeble1603/cv-django | 1 | 42710 | """cv URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/3.1/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-based view... | 2.65625 | 3 |
mp1/assignment1/models/__init__.py | syfrankie/DS498-DL | 0 | 42711 | from models.SVM import *
from models.Perceptron import *
from models.Softmax import *
from models.Logistic import *
| 1.140625 | 1 |
lib/sysusage.py | Tormir/Beats | 0 | 42712 | #!/usr/bin/python3.6
import os, subprocess, json, argparse
def Parser():
parser = argparse.ArgumentParser(description='Process metrix from system')
parser.add_argument('-C', metavar='Command', type=str, help='Command which process started, delimiter is ":::", e.g. command:command', required=True)
return p... | 2.703125 | 3 |
24.py | arvinddoraiswamy/LearnPython | 10 | 42713 | <reponame>arvinddoraiswamy/LearnPython<filename>24.py
import configparser
config = configparser.ConfigParser()
print("Read the file")
config.read("config_24.txt")
print("\n")
print("Once you read you get the data in and can play with it")
l1 = config.sections()
print(config[l1[0]]['User'])
print("\n")
print("To access... | 3.296875 | 3 |
manufacturer/migrations/0002_manufacturer_website.py | skaaldig/borrowing | 0 | 42714 | # Generated by Django 2.0.13 on 2019-05-06 17:02
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('manufacturer', '0001_move_manufacturer_and_rename'),
]
operations = [
migrations.AddField(
model_name='manufacturer',
... | 1.671875 | 2 |
download/ABCD_download.py | ThomasYeoLab/ABCD_scripts | 2 | 42715 | <gh_stars>1-10
# coding: utf-8
# In[36]:
import pandas
import os
import sys
import datetime
from nda_aws_token_generator import *
from pathlib import Path
# In[37]:
def update_aws_config(username,password,web_service_url='https://nda.nih.gov/DataManager/dataManager'):
generator = NDATokenGenerator(web... | 2.640625 | 3 |
scripts/common/base.py | gokhankesler/python-etl-design | 0 | 42716 | <filename>scripts/common/base.py<gh_stars>0
from sqlalchemy import create_engine
from sqlalchemy.orm import Session
from sqlalchemy.orm import declarative_base
engine = create_engine(
'postgresql+psycopg2://postgres:password@localhost:1234/postgres'
)
session = Session(engine)
Base = declarative_base() | 1.828125 | 2 |
main.py | projectweekend/3spot | 0 | 42717 | <reponame>projectweekend/3spot
import json
from time import sleep
from boto import sqs
from boto.dynamodb2.table import Table
from boto.dynamodb2.exceptions import ConditionalCheckFailedException
from worker import config
from worker.models import Account
from worker.logs import get_logger
LOGGER = get_logger()
FEED_... | 2.15625 | 2 |
pytest_railflow_testrail_reporter/plugin.py | athulvis/railflow-pytest-plugin | 0 | 42718 | <filename>pytest_railflow_testrail_reporter/plugin.py
import re
from datetime import datetime
from collections import OrderedDict
import warnings
import json
import pytest
from _pytest.mark.structures import Mark
_py_ext_re = re.compile(r"\.py$")
def warning_on_one_line(message, category, filename, lineno, file=Non... | 2.140625 | 2 |
procHeaders.py | pummelator/flipnote-id | 1 | 42719 |
from math import ceil
from objects import *
global VERBOSE_OUT
VERBOSE_OUT = False
# Converts a series of bytes from a list into a String by interpreting them as ASCII values
def asciiBytesToString(headerBytes, byteStart, byteEnd):
string = ""
for i in range(byteStart, byteEnd):
string += chr(header... | 3.671875 | 4 |
tests/futures/account/test_cancel_batch_orders.py | leozaragoza/binance-connector-python | 3 | 42720 | import responses
from urllib.parse import urlencode
from tests.util import random_str
from tests.util import mock_http_response
from binance.futures import Futures as Client
from binance.error import ParameterRequiredError, ClientError
mock_item = {"key_1": "value_1", "key_2": "value_2"}
mock_exception = {"code": -11... | 2.4375 | 2 |
code/print_built_ins.py | runxel/archicad-python | 1 | 42721 | # <https://
# Prints all built-in property names into a file
from archicad import ACConnection
conn = ACConnection.connect()
assert conn
acc = conn.commands
built_ins = acc.GetAllPropertyNames()
with open('built_ins_list.txt', 'w') as f:
print(built_ins, file=f)
| 2.78125 | 3 |
specializers/array_map/array_map.py | shoaibkamil/asp | 12 | 42722 | # really dumb example of using tree transformations w/asp
import asp.codegen.ast_tools as ast_tools
import asp.codegen.python_ast as ast
import asp.codegen.cpp_ast as cpp
#import asp.codegen.ast_explorer as ast_explorer
class Converter(ast_tools.ConvertAST):
pass
class ArrayMap(object):
def __init__(self):
... | 2.234375 | 2 |
House_Prices_model 1.py | GauravRajwada/Machine | 0 | 42723 | # -*- coding: utf-8 -*-
"""
Created on Sat Apr 25 17:31:47 2020
@author: Gaurav
"""
import pandas as pd
import numpy as np
df=pd.read_csv("E:/Kaggel compitiion/House Prices Advanced Regression Techniques/After analizing/train.csv")
df1=pd.read_csv("E:/Kaggel compitiion/House Prices Advanced Regression Techn... | 2.65625 | 3 |
pylisten/correlation.py | deeuu/pylisten | 0 | 42724 | import krippendorff
import pandas as pd
import numpy as np
from . import utils
def r_to_z(r):
return np.arctanh(r)
def z_to_r(z):
return np.tanh(z)
def confidence_interval(r, conf_level=95, stat=np.mean):
z = r_to_z(r)
ci = utils.bootstrap_ci(z, stat=stat, conf_level=conf_level)
ci = z_to_r(c... | 2.609375 | 3 |
tests/test_extract.py | Andrew-Chen-Wang/words-in-political-media | 0 | 42725 | <reponame>Andrew-Chen-Wang/words-in-political-media
import pytest
from dotenv import dotenv_values
from src import BASE_DIR
from src.extract import extract_youtube_videos
from src.models import Channel, Video
from tests.utils import get_db_uri
class TestExtract:
# I would do extensive testing... but I'm so lazy ... | 2.171875 | 2 |
backend/examples/admin.py | daobook/doccano | 2 | 42726 | <reponame>daobook/doccano<gh_stars>1-10
from django.contrib import admin
from .models import Example, Comment
class ExampleAdmin(admin.ModelAdmin):
list_display = ('text', 'project', 'meta')
ordering = ('project',)
search_fields = ('text',)
class CommentAdmin(admin.ModelAdmin):
list_display = ('use... | 1.984375 | 2 |
partools/utils/header.py | paularnaud2/PyTools | 0 | 42727 | <filename>partools/utils/header.py
from . import g
from .log import log
from .log import log_print
from .csv import csv_to_list
def get_header(in_path, csv=False):
"""Returns the header of a file
- csv: if True, the returned header is a list containing each csv field
"""
with open(in_path, 'r', enco... | 3.625 | 4 |
unipipeline/brokers/uni_broker_message_manager.py | aliaksandr-master/unipipeline | 0 | 42728 | <filename>unipipeline/brokers/uni_broker_message_manager.py
class UniBrokerMessageManager:
def reject(self) -> None:
raise NotImplementedError(f'method reject must be specified for class "{type(self).__name__}"')
def ack(self) -> None:
raise NotImplementedError(f'method acknowledge must be spec... | 2.359375 | 2 |
main.py | hsnakkaya/XpyFollowers | 0 | 42729 | <filename>main.py
from XpyFollowers import*
# scraper(27, 28, 'twitter_list')
nodes_process(27, 'twitter_list')
edges_process(27)
| 1.757813 | 2 |
tests/test_subprocess_extension.py | npcole/latexbuild | 27 | 42730 | <filename>tests/test_subprocess_extension.py<gh_stars>10-100
import os
import unittest
from subprocess import CalledProcessError
from latexbuild.subprocess_extension import check_output_cwd
#######################################################################
# Define constants
######################################... | 2.125 | 2 |
FastAutoAugment/nas/arch_trainer.py | sytelus/fast-autoaugment | 0 | 42731 | from typing import Optional, Callable
import os
import torch
from torch.utils.data import DataLoader
from torch import Tensor
from torch.optim.optimizer import Optimizer
from torch.optim.lr_scheduler import _LRScheduler
from overrides import overrides, EnforceOverrides
from ..common.config import Config
from ..commo... | 2.09375 | 2 |
pydpi/utils.py | hchsiao/python-svlog | 3 | 42732 | <filename>pydpi/utils.py
import os.path
import subprocess
import shutil
import anyconfig
from ruamel.yaml import YAML
import sys
this_dir, this_filename = os.path.split(__file__)
tmpl_dir = os.path.join(this_dir, "templates/")
home_dir = os.path.expanduser('~')
config_file = os.path.join(home_dir, '.python-svlog-cfg'... | 2.046875 | 2 |
fastapi_amis_admin/__init__.py | cnss63/fastapi_amis_admin | 0 | 42733 | <gh_stars>0
__version__ = "0.0.16"
__url__ = "https://github.com/amisadmin/fastapi_amis_admin"
| 0.941406 | 1 |
pytan3/tests/test_utils/test_crypt.py | lifehackjim/pytan3 | 3 | 42734 | # -*- coding: utf-8 -*-
"""Test suite for pytan3."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import pytest
import pytan3
import re
def test_encrypt_decrypt():
"""Test encrypt / decrypt with valid key."""
... | 2.71875 | 3 |
tests/test_convert.py | sairamkiran9/table2ascii | 24 | 42735 | <reponame>sairamkiran9/table2ascii<filename>tests/test_convert.py<gh_stars>10-100
from table2ascii import alignment, table2ascii as t2a
import pytest
def test_header_body_footer():
text = t2a(
header=["#", "G", "H", "R", "S"],
body=[["1", "30", "40", "35", "30"], ["2", "30", "40", "35", "30"]],
... | 2.640625 | 3 |
tartiflette/language/ast/base.py | remorses/tartiflette-whl | 530 | 42736 | <gh_stars>100-1000
__all__ = (
"Node",
"DefinitionNode",
"ExecutableDefinitionNode",
"TypeSystemDefinitionNode",
"TypeSystemExtensionNode",
"TypeDefinitionNode",
"TypeExtensionNode",
"SelectionNode",
"ValueNode",
"TypeNode",
)
class Node:
__slots__ = ()
class DefinitionNo... | 2.15625 | 2 |
apps/areas/migrations/0003_auto_20210215_1959.py | windVane369/meiduo | 0 | 42737 | <filename>apps/areas/migrations/0003_auto_20210215_1959.py<gh_stars>0
# Generated by Django 3.1.6 on 2021-02-15 11:59
from django.db import migrations, models
import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [
('areas', '0002_auto_20210215_1956'),
]
operations ... | 1.585938 | 2 |
Python/Algorithms/1805.py | DimitrisJim/leetcode_solutions | 2 | 42738 | <filename>Python/Algorithms/1805.py
from string import ascii_lowercase
class Solution:
trans_table = {ord(i): ' ' for i in ascii_lowercase}
def numDifferentIntegers(self, word: str) -> int:
seen = set()
# Translation map translates "[a-z] => ' '"
for i in word.translate(self.trans_tab... | 3.40625 | 3 |
opcvCapImg01_drawID_outImg.py | zgw426/OpenCV_SamplesForMyself | 0 | 42739 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import cv2
from PIL import Image
targetImg = "test-img02.png"
aruco = cv2.aruco
dictionary = aruco.getPredefinedDictionary(aruco.DICT_4X4_50)
outputImg = "edit01-" + targetImg[0:-4]+".png"
def arReader( argTargetImg , argOutputImg ):
img = cv2.imread( argTargetI... | 3.03125 | 3 |
testcases/sharpe_analyzer_test.py | tibkiss/pyalgotrade | 2 | 42740 | <filename>testcases/sharpe_analyzer_test.py
# PyAlgoTrade
#
# Copyright 2012 <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... | 2.53125 | 3 |
src/app_object.py | pockeleewout/DataCleaner-public | 1 | 42741 | import flask
import config
# The main flask app that will run the whole show
flask_app: flask.Flask = flask.Flask(__name__)
# Load the configuration from the Config class
flask_app.config.from_object(config.LocalConfig)
| 1.867188 | 2 |
sphinx_github_changelog/changelog.py | mondeja/sphinx-github-changelog | 6 | 42742 | <reponame>mondeja/sphinx-github-changelog<filename>sphinx_github_changelog/changelog.py
from typing import Any, Dict, Iterable, List, Optional
import requests
from docutils import nodes
# types-docutils (from typeshed) is usable but incomplete.
# docutils-stubs is more complete but
# https://github.com/tk0miya/docuti... | 2.328125 | 2 |
genesets/search_indexes.py | greenelab/tribe | 4 | 42743 | import re
from haystack import indexes
from genesets.models import Geneset
try:
from celery_haystack.indexes import CelerySearchIndex as SearchIndex
except ImportError:
from haystack.indexes import SearchIndex
NONWORD = re.compile('\W+')
class GenesetIndex(SearchIndex, indexes.Indexable):
text = inde... | 2.359375 | 2 |
ProjectEuler/problem12.py | SameerRao22/python | 0 | 42744 | <filename>ProjectEuler/problem12.py<gh_stars>0
import math
def factorize(num):
factors= 0
for x in range(1, int((math.sqrt(num))+1)):
if int(num)%x == 0:
if num/x == x:
factors += 1
else:
factors += 2
return factors
def triangleNum(n):
number = 0
for x in range(1,int(n)+1):
number += x
retu... | 3.453125 | 3 |
server.py | Daerdemandt/blog | 0 | 42745 | #!/usr/bin/env python3
import http.server
import socketserver
from urllib.parse import parse_qsl as parse_query, urlparse as parse_url
from abc import abstractmethod, ABC as abstractclass
import json
class ContentEncoder(abstractclass):
@abstractmethod
def get_type():
pass
@abstractmethod
def encode(self, conten... | 2.84375 | 3 |
energenie/Handlers/__init__.py | klattimer/pyenergenie | 0 | 42746 | import os
import importlib, inspect
import logging
from ..Config import Config
class Handler:
_protocol = None
_description = None
_args = {}
@classmethod
def describe(cls):
return {
'protocol': cls.protocol,
'description': cls.description,
'args': cls.... | 2.453125 | 2 |
tf_pwa/fit_improve.py | ReynLieu/tf-pwa | 4 | 42747 | <gh_stars>1-10
from warnings import warn
import numpy as np
# from numpy import xrange
# from scipy.optimize.linesearch import line_search_wolfe1, line_search_wolfe2
from scipy.optimize import OptimizeResult
class LineSearchWarning(RuntimeWarning):
pass
message_dict = {
0: "Optimization terminated success... | 2.234375 | 2 |
code/evaluate_trained_gans.py | alexban94/msci_project | 0 | 42748 | <reponame>alexban94/msci_project<gh_stars>0
import os, sys, time
import shutil
import yaml
import random
import numpy as np
import cupy
from copy import deepcopy
import argparse
import chainer
from chainer import training, serializers
from chainer.training import extension
from chainer.training import extensions
sys.... | 1.992188 | 2 |
awkward_pandas/accessor.py | martindurant/awkward_extras | 0 | 42749 | import functools
import inspect
import pandas as pd
import awkward1 as ak
from .series import AwkwardSeries
from .dtype import AwkardType
funcs = [n for n in dir(ak) if inspect.isfunction(getattr(ak, n))]
@pd.api.extensions.register_series_accessor("ak")
class AwkwardAccessor:
def __init__(self, pandas_obj):
... | 2.328125 | 2 |
awsrun/student/tasks.py | veb61/eec-289-ucd | 0 | 42750 | <filename>awsrun/student/tasks.py
import os
import time
from abc import ABC, abstractmethod, ABCMeta
from common.commands import Compress, Upload, SendMsg, Download, Decompress
from common.configuration import AWSConfig
from common.protocol import IOTask, AWSMsg, AWSIDRegistration
from common.resources import Folder, ... | 2.296875 | 2 |
test/unittests/plans_tests.py | sonntagsgesicht/dcf | 16 | 42751 | # -*- coding: utf-8 -*-
# dcf
# ---
# A Python library for generating discounted cashflows.
#
# Author: sonntagsgesicht, based on a fork of Deutsche Postbank [pbrisk]
# Version: 0.4, copyright Saturday, 10 October 2020
# Website: https://github.com/sonntagsgesicht/dcf
# License: Apache License 2.0 (see LICENSE f... | 2.765625 | 3 |
Chapter08/transformers_textgen.py | arifmudi/Advanced-Deep-Learning-with-Python | 107 | 42752 | <reponame>arifmudi/Advanced-Deep-Learning-with-Python
import torch
from transformers import TransfoXLLMHeadModel, TransfoXLTokenizer
device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu")
# Instantiate pre-trained model-specific tokenizer and the model itself
tokenizer = TransfoXLTokenizer.from_pretr... | 2.78125 | 3 |
test/performance-regression/full-apps/qmcpack/src/GUI/Wavefunction.py | FeiyangJin/hclib | 55 | 42753 | <gh_stars>10-100
import pygtk
import gtk
import IO
import numpy
class TilingMatrix(gtk.Frame):
def __init__(self):
gtk.Frame.__init__(self, 'Orbital tiling')
self.matrix = numpy.array([[1,0,0],[0,1,0],[0,0,1]])
self.set_label('Orbital tiling')
self.TileTable = gtk.Table(3,3)
... | 2.40625 | 2 |
splikes/connections/__init__.py | bblais/Plasticnet | 0 | 42754 | from .BCM import BCM_LawCooper
from .BCM import BCM
from .BCM import BCM_LawCooper_Offset
from .BCM import BCM_TwoThreshold
from .calcium import calcium
from .STDP import STDP
from .Triplet import Gerstner2006
from .Triplet import Triplet_BCM
from .Triplet import Triplet_BCM_LawCooper
from .Triplet import Triplet_BCM_L... | 0.949219 | 1 |
variables_and_loops.py | justinerafa/ASTR-119-session-2 | 0 | 42755 | import numpy as np #we use numpy alot
def main():
i = 0 #declare i = 0
n = 10 #declare n = 10
x = 119.0 #float x, these have a .
#we can use numpy to quickly make arrays
y = np.zeros(n, dtype=float) #declares 10 zeros
#we can use for loops to iterate through a variable
for i in range(n): #i in r... | 4.15625 | 4 |
lib/bot/question/detector.py | mageirakos/donkeybot | 10 | 42756 | # bot modules
from bot.question.emails import EmailQuestion
from bot.question.issues import IssueQuestion
from bot.question.comments import CommentQuestion
import bot.config as config
# general python
import re
import nltk
from nltk.tokenize import PunktSentenceTokenizer
class QuestionDetector:
"""Utilizes regex... | 3.28125 | 3 |
support/pushsources/publishtool.py | username-is-already-taken2/photon | 2 | 42757 | #! /usr/bin/python3
#
# Copyright (C) 2015 VMware, Inc. All rights reserved.
# publishtool for working with photonpublish
#
# Author(s): <NAME>
#
import sys
import getopt
from photonpublish import photonPublish
from publishconst import publishConst
const = publishConst()
class publishTool:
def __init__... | 2.078125 | 2 |
src/controllers/search.py | bcartwri96/sermon-skeleton | 1 | 42758 | <gh_stars>1-10
# page designed for the search implementation, to be cleaned up in
# the future!
import src.models.models as ml
import src.scripts.index as scripts
from sqlalchemy import and_, or_
def search_master(query, author, book_bible, series):
# naive search. check and rank the match as it
# appears to ... | 2.515625 | 3 |
cassandra-helper/copy_keyspace.py | HolmesProcessing/toolbox | 0 | 42759 | <gh_stars>0
#!/usr/bin/env python2.7
import pika
import json, os
import magic
import time
import ast
from sys import argv
from cassandra.cluster import Cluster
from cassandra.auth import PlainTextAuthProvider
from cassandra import query
from sets import Set
def print_usage():
print("USAGE: %s KEYSPACE_FROM KEYSPACE_T... | 2.53125 | 3 |
nets/vgg.py | bubbliiiing/faster-rcnn-tf2 | 133 | 42760 | from tensorflow.keras.layers import (Conv2D, Dense, Flatten, MaxPooling2D,
TimeDistributed)
def VGG16(inputs):
x = Conv2D(64,(3,3),activation = 'relu',padding = 'same',name = 'block1_conv1')(inputs)
x = Conv2D(64,(3,3),activation = 'relu',padding = 'same', name = 'bl... | 2.765625 | 3 |
py3/classes/sysflow/sysflow/type/__init__.py | sthagen/sysflow-telemetry-sf-apis | 12 | 42761 | from ...schema_classes import SchemaClasses
ContainerType = SchemaClasses.sysflow.type.ContainerTypeClass
OID = SchemaClasses.sysflow.type.OIDClass
SFObjectState = SchemaClasses.sysflow.type.SFObjectStateClass
| 1.289063 | 1 |
grand_tour.py | reedessick/pointy-Poisson | 0 | 42762 | #!/usr/bin/python
usage = """grand_tour.py [--options] gps gps gps..."""
description="""a script that generates a pointed follow-up of possible auxiliary couplings, sweeping through a variety of windows and snr thresholds"""
import numpy as np
from laldetchar.idq import idq
from laldetchar.idq import event
import g... | 2.984375 | 3 |
powerpod/types.py | bucko909/powerpod | 3 | 42763 | from collections import namedtuple
import datetime
import calendar
import struct
import sys
class StructType(object):
"""
Automatically uses SHAPE to pack/unpack simple structs.
"""
@classmethod
def from_binary(cls, data):
try:
return cls(*cls._decode(*struct.unpack(cls.SHAPE, data)))
except:
sys.stderr... | 3.140625 | 3 |
library/models/sort.py | pipebio/api-examples | 2 | 42764 |
class Sort:
col_id: str
sort: str
def __init__(self, col_id, sort):
self.col_id = col_id
self.sort = sort
@staticmethod
def from_json(json: dict):
if not json:
raise Exception('Error. Sort was not defined but should be.')
sort = Sort()
# colId... | 3.28125 | 3 |
unique_names_generator/data/animals.py | ravi-ojha/py-unique-names-generator | 2 | 42765 | <reponame>ravi-ojha/py-unique-names-generator<filename>unique_names_generator/data/animals.py
ANIMALS = [
"aardvark",
"aardwolf",
"albatross",
"alligator",
"alpaca",
"amphibian",
"anaconda",
"angelfish",
"anglerfish",
"ant",
"anteater",
"antelope",
"antlion",
"ape... | 2.015625 | 2 |
cea/technologies/thermal_storage.py | VMarty/CityEnergyAnalyst | 1 | 42766 | <reponame>VMarty/CityEnergyAnalyst
"""
thermal storage
"""
from __future__ import division
import pandas as pd
from math import log
__author__ = "<NAME>"
__copyright__ = "Copyright 2015, Architecture and Building Systems - ETH Zurich"
__credits__ = ["<NAME>", "<NAME>", "<NAME>"]
__license__ = "MIT"
__version__ = "0.1... | 2.90625 | 3 |
plugins/plugin_base.py | Robinson04/inoft_vocal_framework | 11 | 42767 | <reponame>Robinson04/inoft_vocal_framework
from abc import abstractmethod
from typing import Any
class PluginBase:
# Exist to make it easier to detect if a class if a plugin of any class type.
pass
class PluginCodeGenerationBase(PluginBase):
# from inoft_vocal_framework.botpress_integration.generator im... | 2.734375 | 3 |
part1.py | sebastiankeshuqi/Apply-Classification-Tree-to-Red-Wine-Quality | 1 | 42768 | import numpy as np
import matplotlib as plt
from collections import Counter
from math import log
import sys
import time
class ListQueue:
def __init__(self, capacity):
self.__capacity = capacity
self.__data = [None] * self.__capacity
self.__size = 0
self.__front = 0
... | 3.421875 | 3 |
authors/apps/articles/migrations/0015_merge_20190122_1103.py | andela/Ah-backend-guardians | 0 | 42769 | # Generated by Django 2.1.5 on 2019-01-22 11:03
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('articles', '0012_auto_20190122_0826'),
('articles', '0014_auto_20190121_1631'),
]
operations = [
]
| 1.367188 | 1 |
settings/iview.py | symeonp/choronzon | 0 | 42770 | # Name of the campaign
CampaignName = 'iview-campaign'
# Name of the parser module. The parser module must be
# in the chromosome/parsers directory.
Parser = 'PNG'
# The path of the initial corpus
InitialPopulation = 'C:\\tmp\\png'
# The fitness algorithms that will be used by Chronzon
# and the weight of each one. ... | 2.140625 | 2 |
one/image.py | OpenNebula/addon-linstor | 11 | 42771 | # -*- coding: utf-8 -*-
"""
OpenNebula Driver for Linstor
Copyright 2018 LINBIT USA LLC
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required... | 2.0625 | 2 |
utils/create_submissiontest_like.py | iarai/NeurIPS2019-traffic4cast | 24 | 42772 | <reponame>iarai/NeurIPS2019-traffic4cast<gh_stars>10-100
#!/usr/bin/env/python3
# Copyright 2019 Institute of Advanced Research in Artificial Intelligence (IARAI) GmbH.
# IARAI licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the Li... | 2.296875 | 2 |
hyperspeed/video.py | bovesan/mistika-hyperspeed | 3 | 42773 | #!/usr/bin/env python
import sys, os, subprocess, string, re, math
def tc2frames(tc, Framerate):
frames = int(tc.split(':')[3])
frames += int(tc.split(':')[2]) * Framerate
frames += int(tc.split(':')[1]) * Framerate * 60
frames += int(tc.split(':')[0]) * Framerate * 60 * 60
return frames
def frame... | 3.140625 | 3 |
genie/cbs.py | karawoo/Genie | 10 | 42774 | from .seg import seg
class cbs(seg):
'''
cbs file type extends from seg files
'''
_fileType = "cbs"
| 1.914063 | 2 |
nncf/__init__.py | gnomonsis/nncf_pytorch | 0 | 42775 | """
Copyright (c) 2019-2020 Intel Corporation
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in w... | 1.59375 | 2 |
testcube_client/utils.py | tobyqin/testcube-client | 1 | 42776 | import json
import logging
from os import environ
from os.path import basename, getsize, getmtime, splitext, exists
import arrow
from .settings import config
def env_to_json():
"""convert current env variables to json text."""
return json.dumps(dict(environ))
def get_default_run_name():
"""try to get ... | 2.609375 | 3 |
game.py | INE-UFSC/jogo-da-forca-grupo-2-2021-2-1 | 1 | 42777 | <filename>game.py
import os
def _verify_endgame(word, check_word_in_used_letters, num_lifes):
word_only_alpha = [c.lower() for c in word if c.isalpha()]
if check_word_in_used_letters == len(word_only_alpha):
print('> Parabéns você venceu')
return True
if num_lifes == 0:
print('> A... | 3.734375 | 4 |
Variation_to_Multihead_Attention/Decoder.py | namanjaswani27/Abstractive_Text_Summarization_using_Encoder-Decoder-Architecture | 0 | 42778 | <reponame>namanjaswani27/Abstractive_Text_Summarization_using_Encoder-Decoder-Architecture<filename>Variation_to_Multihead_Attention/Decoder.py
# Code adapted from https://bastings.github.io/annotated_encoder_decoder/
import torch.nn as nn
import torch
import torch.nn.functional as F
from Attention import *
class Dec... | 2.9375 | 3 |
injectedConsole/plugin_util/xml_tkinter.py | ChenyangGao/SigilPlugin_injectedConsole | 11 | 42779 | #!/usr/bin/env python3
# coding: utf-8
__author__ = 'ChenyangGao <https://chenyanggao.github.io/>'
__version__ = (0, 0, 3)
__all__ = ['TkinterXMLConfigParser']
# Reference:
# - [python > docs > tkinter](docs.python.org/3/library/tkinter.html)
# - [Tk tutorial](https://tk-tutorial.readthedocs.io/en/latest/)
# ... | 2.09375 | 2 |
env/lib/python3.6/site-packages/pandas/computation/api.py | anthowen/duplify | 4 | 42780 | # flake8: noqa
from pandas.computation.eval import eval
from pandas.computation.expr import Expr
| 1.15625 | 1 |
server/sender.py | kleanlins/wireless-paint | 0 | 42781 | <filename>server/sender.py
from _thread import start_new_thread
from time import sleep
import numpy as np
import simpleaudio as sa
import bitarray
import timeit
text = 'eae'
ba = bitarray.bitarray()
ba.frombytes(text.encode('utf-8'))
data = ba.tolist()
data_bit = []
for each in data:
if each:
data_bit... | 3.046875 | 3 |
ROS/my_initials.py | PrathmeshBele/Autumn-of-Automation | 0 | 42782 | <reponame>PrathmeshBele/Autumn-of-Automation<filename>ROS/my_initials.py
#!/usr/bin/env python
import rospy
from geometry_msgs.msg import Twist
from turtlesim.msg import Pose
import math
import time
from std_srvs.srv import Empty
x=0
y=0
yaw=0
def poseCallback(pose_message):
global x, y, yaw
x = pose_message... | 2.28125 | 2 |
data_cleanup/tests/test_views.py | yashpatel12/CPIMS-api-newtest | 3 | 42783 | <filename>data_cleanup/tests/test_views.py
from unittest import TestCase
from data_cleanup.views import validate_age
class TestAgeValidation(TestCase):
def test_age_provided_is_okay(self):
"""An integer is acceptable"""
self.assertTrue(validate_age(10))
def test_age_provided_is_not_valid(sel... | 3.015625 | 3 |
src/nebulo/lexer.py | olirice/nebulo | 76 | 42784 | from pygments.lexer import RegexLexer
from pygments.token import Comment, Keyword, Name, Number, Operator, Punctuation, String, Text
__all__ = ["GraphQLLexer"]
class GraphQLLexer(RegexLexer):
"""
Pygments GraphQL lexer for mkdocs
"""
name = "GraphQL"
aliases = ["graphql", "gql"]
filenames = ... | 2.375 | 2 |
resources/test/mythboxtest/ui/test_livetv.py | bopopescu/ServerStatus | 0 | 42785 | <reponame>bopopescu/ServerStatus
import unittest
from mockito import Mock, when, any
from mythbox.ui.livetv import LiveTvWindow
from mythbox.mythtv.domain import Channel, TVProgram
class LiveTvWindowTest(unittest.TestCase):
def testConstructor(self):
fanArt = Mock()
when(fanArt).pickPost... | 2.28125 | 2 |
cru_robot/des_pub.py | chula-eic/NukeBot | 0 | 42786 | <filename>cru_robot/des_pub.py
#!/usr/bin/env python3
import rospy
from std_msgs.msg import String
from cru_robot.msg import FloatList
pub = rospy.Publisher('destination', FloatList, queue_size=10)
servo_pub = rospy.Publisher('servo', String, queue_size=10)
queue = []; #DECLARE QUEUE/FLOATLIST QUEUE HERE
state = 0
d... | 2.5 | 2 |
lisp_s_expressions.py | nogumbi/LISP-Interpreter | 0 | 42787 | import re
import lisp_parser as lp
def cons(expression):
"""
cons
Is used to compose larger s-expressions from smaller expressions.
(cons a b), expects b to be a list and returns a new list with a as the
first element followed by all the elements of b
:param string
:return: string
"""
... | 4.09375 | 4 |
l10n_br_eletronic_document/wizard/export_nfe.py | pedrogoncalvesk/odoo-brasil | 0 | 42788 | import os
import io
import base64
import os.path
from zipfile import ZipFile
from odoo import api, fields, models
class ExportNfe(models.TransientModel):
_name = 'wizard.export.nfe'
_description = "Exporta NF-e"
start_date = fields.Date(string=u"Data Inicial", required=True)
end_date = fields.Date(st... | 2.390625 | 2 |
server.py | health-line/health-line-backend | 0 | 42789 | from flask import Flask
from flask import jsonify
from flask_sqlalchemy import SQLAlchemy
from sqlalchemy import text
from flask_cors import CORS, cross_origin
import os
app = Flask(__name__)
CORS(app)
app.config['SQLALCHEMY_DATABASE_URI'] = os.environ['SQLALCHEMY_DATABASE_URI']
db = SQLAlchemy(app)
db.engine.execute... | 3.046875 | 3 |
example_runner.py | AmirPupko/pandas-to-sql | 18 | 42790 | from copy import copy
import sqlite3
import pandas as pd
import pandas_to_sql
from pandas_to_sql.testing.utils.fake_data_creation import create_fake_dataset
from pandas_to_sql.conventions import flatten_grouped_dataframe
# table_name = 'random_data'
# df, _ = create_fake_dataset()
# df_ = pandas_to_sql.wrap_df(df, tab... | 2.734375 | 3 |
pymovingintelligence_ha/__init__.py | cyberjunky/python-movingintelligence-ha | 0 | 42791 | """Home Assistant Python 3 API wrapper for Moving Intelligence."""
import datetime
import logging
from .utils import Utils
_LOGGER = logging.getLogger("pymovingintelligence_ha")
class MovingIntelligence:
"""Class for communicating with the Moving Intelligence API."""
def __init__(
self,
use... | 2.796875 | 3 |
function/omaseq.py | allmwh/the_return_of_the_rings | 0 | 42792 | <gh_stars>0
import re
import json
import requests
from Bio import SeqIO
from Bio.Seq import Seq
from pathlib import Path
from tqdm.notebook import trange
from Bio.SeqRecord import SeqRecord
from function.utilities import fasta_to_seqlist
from function.utilities import find_human_sequence
def uniprot_id_consistance_c... | 2.328125 | 2 |
min-blockchain/app/views/__init__.py | JoMingyu/Blockchain-py | 12 | 42793 | from flask_restful import Api
class ViewInjector:
def __init__(self, app=None):
if app is not None:
self.init_app(app)
def init_app(self, app):
from app.views.blockchain import Node, Chain, Mine, Transaction
api = Api(app)
api.add_resource(Node, '/node')
... | 2.296875 | 2 |
solaredge/__init__.py | sahilrajan81/alexa-solaredge | 3 | 42794 | """
This package contains a variety of utilities particular
to the SolarEdge portal
""" | 0.863281 | 1 |
pytest_monitor/__init__.py | ErnestinaQiu/pytest-monitor | 0 | 42795 | __version__ = "1.6.3"
__author__ = "<NAME>"
| 1.03125 | 1 |
setup.py | r0cketr1kky/DeepPixel | 33 | 42796 | <gh_stars>10-100
from setuptools import setup, find_packages
import pathlib
HERE = pathlib.Path(__file__).parent
VERSION = '0.0.1'
PACKAGE_NAME = 'DeepPixel'
AUTHOR = '<NAME>'
AUTHOR_EMAIL = '<EMAIL>'
URL = 'https://github.com/smaranjitghose/deepixel'
KEYWORDS = "deep-pixel deeplearing computervision iqa explainable-... | 1.390625 | 1 |
tests/test_context.py | 20c/ngage | 8 | 42797 | import os
import pytest
import ngage.cli
this_dir = os.path.dirname(__file__)
data_dir = os.path.join(this_dir, "data")
@pytest.fixture()
def ctx():
return ngage.cli.Context(home=os.path.join(data_dir, "config", "tst0"))
host_tst0 = "tst0.example.com"
host_tst1 = "tst1.example.com"
host_tst2 = "tst2.example.... | 2.109375 | 2 |
omd/versions/1.2.8p15.cre/share/check_mk/modules/packaging.py | NCAR/spol-nagios | 0 | 42798 | <gh_stars>0
#!/usr/bin/python
# -*- encoding: utf-8; py-indent-offset: 4 -*-
# +------------------------------------------------------------------+
# | ____ _ _ __ __ _ __ |
# | / ___| |__ ___ ___| | __ | \/ | |/ / |
# | | | | '_ \ / _... | 1.554688 | 2 |
pms/student/admin.py | iammeliodas/pms_django | 0 | 42799 | from django.contrib import admin
# Register your models here.
from import_export.admin import ImportExportModelAdmin
from .models import StudentDetails,RegisterdStudents
@admin.register(StudentDetails)
class StudentDetailsAdmin(ImportExportModelAdmin):
pass
admin.site.register(RegisterdStudents) | 1.53125 | 2 |