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 |
|---|---|---|---|---|---|---|
G53IDS/run.py | jayBana/InventoryMan | 0 | 23200 | from server.controller.app import app as webapp
# import Flask app so that it can be launched with gunicorn
app = webapp
| 1.640625 | 2 |
tests/perf/test-prop-write.py | wenq1/duktape | 4,268 | 23201 | <reponame>wenq1/duktape
def test():
obj = { 'xxx1': 1, 'xxx2': 2, 'xxx3': 4, 'xxx4': 4, 'foo': 123 }
i = 0
while i < 1e7:
obj['foo'] = 234
obj['foo'] = 234
obj['foo'] = 234
obj['foo'] = 234
obj['foo'] = 234
obj['foo'] = 234
obj['foo'] = 234
obj... | 2.578125 | 3 |
clickhouse_driver/numpy/result.py | fasttrack-solutions/clickhouse-driver | 823 | 23202 | <reponame>fasttrack-solutions/clickhouse-driver<filename>clickhouse_driver/numpy/result.py<gh_stars>100-1000
from itertools import chain
import numpy as np
import pandas as pd
from pandas.api.types import union_categoricals
from ..progress import Progress
from ..result import QueryResult
class NumpyQueryResult(Quer... | 2.59375 | 3 |
sandbox/riskModelsResultsEval.py | danbirks/PredictCode | 0 | 23203 | <filename>sandbox/riskModelsResultsEval.py
# -*- coding: utf-8 -*-
"""
Created on Wed May 15 10:22:47 2019
@author: lawdfo
Purpose:
Read in the csv results file generated by (e.g.) riskModelsParamSweep.py
and report back some useful statistics.
"""
# Some fairly standard modules
import os, csv, lzma
impo... | 2.125 | 2 |
HIV model/others.py | omisolaidowu/HIV-story-telling | 0 | 23204 | <gh_stars>0
'''
-*- coding: utf-8 -*-
Created on Fri Jan 17 12:34:15 2020
@author: Paul
'''
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
from sklearn.model_selection import train_test_split
df=pd.read_excel(r'C:\Users\Paul\Desktop\Python projects\HIV_3.xlsx')
... | 2.8125 | 3 |
iproxy/ip_select.py | tempoker/third | 0 | 23205 | #-*- conding:utf-8 -*-
#2018-02-02 11:04:54
import time,random,requests
from lxml import etree
from fake_useragent import UserAgent
import urllib.request as ur
from pymongo import MongoClient
from multiprocessing.dummy import Pool as ThreadPool
client = MongoClient('localhost',27017)
db = client['test']
ip_list = db[... | 2.4375 | 2 |
utils/node_data_snapshot.py | nigelbowden/wlanpi-chat-bot | 0 | 23206 | #!/usr/bin/python3
# -*- coding: utf-8 -*-
"""
Read & write snapshot of node status data dumped to local file system.
This data is used to detect things like sytem changes that may need to be reported.
"""
import json
import time
import logging
import os
import socket
import psutil
import netifaces as ni
logging.ba... | 2.890625 | 3 |
micropsi_core/world/island/__init__.py | brucepro/micropsi2 | 119 | 23207 | #!/usr/local/bin/python
# -*- coding: utf-8 -*-
"""
"""
__author__ = 'joscha'
__date__ = '03.08.12'
| 1.15625 | 1 |
settings/DataLogger_HS2_settings.py | bopopescu/Lauecollect | 0 | 23208 | counter_name = 'I0_PIN'
Size = wx.Size(1007, 726)
logfile = '/net/helix/data/anfinrud_1502/Logfiles/I0_PIN-2.log'
average_count = 1
max_value = 11
min_value = 0
start_fraction = 0.401
reject_outliers = False
outlier_cutoff = 2.5
show_statistics = True
time_window = 172800
| 1.25 | 1 |
register_printer/generators/uvm_generator/print_uvm.py | zhangyiant/RegisterPrinter | 0 | 23209 | <filename>register_printer/generators/uvm_generator/print_uvm.py
import re
import os
import os.path
import logging
from register_printer.template_loader import get_template
LOGGER = logging.getLogger(__name__)
def print_uvm_block(block, out_path):
uvm_block_name = block.block_type.lower() + "_reg_model"
fil... | 2.3125 | 2 |
django/blog/statistics.py | nekrassov01/docker-django-blog | 0 | 23210 | """
開発初期段階では、サイトレポートをVIEWに直書きしていた
パフォーマンス改善のため、バッチ処理に変更
このVIEWは今は使われていないが、一応残しておく
"""
from django.conf import settings
from django.db.models import Q, Count
from django.utils import html
from .models import Post, Category, Tag
from datetime import datetime
from janome.tokenizer import Tokenizer
from janome... | 2.4375 | 2 |
config/__init__.py | IMBINGO95/FairMOT | 0 | 23211 | <filename>config/__init__.py
# -*- coding: utf-8 -*-
# @Time : 2021/1/27 22:33
# @Author : BINGO
# @School: 浙江大学
# @Campany: 竺星
# @FileName: __init__.py.py
| 1.289063 | 1 |
xnmt/expression_seqs.py | esalesky/xnmt-devel | 4 | 23212 | <gh_stars>1-10
from typing import Optional, Sequence
import dynet as dy
import numpy as np
from xnmt import batchers
class ExpressionSequence(object):
"""A class to represent a sequence of expressions.
Internal representation is either a list of expressions or a single tensor or both.
If necessary, both forms... | 2.8125 | 3 |
test/unit/test_localdb.py | muchu1983/104_cameo | 0 | 23213 | <reponame>muchu1983/104_cameo<filename>test/unit/test_localdb.py<gh_stars>0
# -*- coding: utf-8 -*-
"""
Copyright (C) 2015, <NAME>
Contributed by <NAME> (<EMAIL>)
This file is part of BSD license
<https://opensource.org/licenses/BSD-3-Clause>
"""
import unittest
import logging
from cameo.localdb import LocalDbForCurre... | 2.0625 | 2 |
complex_venv/lib/python3.7/site-packages/test/test_graph_list_of_file_inputs.py | lubianat/complex_bot | 1 | 23214 | <filename>complex_venv/lib/python3.7/site-packages/test/test_graph_list_of_file_inputs.py<gh_stars>1-10
import unittest
from shexer.shaper import Shaper
from test.const import G1, BASE_FILES, G1_NT, default_namespaces, BASE_FILES_GENERAL
from test.t_utils import file_vs_str_tunned_comparison
import os.path as pth
... | 2.25 | 2 |
geoscilabs/gpr/Wiggle.py | jcapriot/geosci-labs | 2 | 23215 | <filename>geoscilabs/gpr/Wiggle.py<gh_stars>1-10
import numpy as np
def PrimaryWave(x, velocity, tinterp):
return tinterp + 1.0 / velocity * x
def ReflectedWave(x, velocity, tinterp):
time = np.sqrt(x ** 2 / velocity ** 2 + tinterp ** 2)
return time
| 2.953125 | 3 |
tests/test_mxnet.py | haoxintong/byteps | 1 | 23216 | <reponame>haoxintong/byteps
# Copyright 2018 Uber Technologies, Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
... | 2.03125 | 2 |
frux_app_server/migrations/versions/299e2bc265af_favorites.py | camidvorkin/frux-app-server | 3 | 23217 | <gh_stars>1-10
"""Favorites
Revision ID: <KEY>
Revises: <PASSWORD>
Create Date: 2021-06-25 17:24:27.020289
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '<KEY>'
down_revision = '<PASSWORD>'
branch_labels = None
depends_on = None
def upgrade():
# ### com... | 1.53125 | 2 |
src/lib/libpasteurize/fixes/fix_newstyle.py | thonkify/thonkify | 17 | 23218 | <filename>src/lib/libpasteurize/fixes/fix_newstyle.py<gh_stars>10-100
u"""
Fixer for "class Foo: ..." -> "class Foo(object): ..."
"""
from lib2to3 import fixer_base
from lib2to3.fixer_util import LParen, RParen, Name
from libfuturize.fixer_util import touch_import_top
def insert_object(node, idx):
node.insert_c... | 2.390625 | 2 |
pinochle/Game.py | Atrus619/DeckOfCards | 1 | 23219 | <reponame>Atrus619/DeckOfCards
from pinochle.State import State
from classes.Deck import Deck
from classes.Hand import Hand
from pinochle.MeldUtil import MeldUtil
from pinochle.Meld import Meld
from pinochle.Trick import Trick
from pinochle.MeldTuple import MeldTuple
from util.Constants import Constants as cs
from util... | 2.578125 | 3 |
.eggs/py2app-0.14-py3.6.egg/py2app/recipes/matplotlib.py | stfbnc/mtsa_py | 17 | 23220 | import os
def check(cmd, mf):
m = mf.findNode('matplotlib')
if m is None or m.filename is None:
return None
if cmd.matplotlib_backends:
backends = {}
for backend in cmd.matplotlib_backends:
if backend == '-':
pass
elif backend == '*':
... | 2.359375 | 2 |
app/core/migrations/0009_auto_20210214_2113.py | Valentin-Golyonko/FlaskTestRPi | 0 | 23221 | # Generated by Django 3.1.6 on 2021-02-14 18:13
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('core', '0008_auto_20210214_2039'),
]
operations = [
migrations.AlterField(
model_name='device',
name='ip_address',
... | 1.617188 | 2 |
grabber.py | serj12342/pstreehunter | 1 | 23222 | import requests
import re
pattern_hashes = "^[a-f0-9]{64}$"
pattern_url = "https?:\/\/.*"
pattern_ip = "(?:(?:\d|[01]?\d\d|2[0-4]\d|25[0-5])\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d|\d)(?:\/\d{1,2})?"
pattern_domain = "^[a-zA-Z0-9][a-zA-Z0-9-_]{0,61}[a-zA-Z0-9]{0,1}\.([a-zA-Z]{1,6}|[a-zA-Z0-9-]{1,30}\.[a-zA-Z]{2,3})$"
head... | 2.578125 | 3 |
prac2_2.py | JulianAZW/bookish-lamp | 1 | 23223 | <reponame>JulianAZW/bookish-lamp
# -*- coding: utf-8 -*-
"""
Created on Thu Mar 17 19:08:54 2022
@author: julian
"""
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
def heatmap(df):
correlation_matrix = df.corr().round(2)
print(correlation_matrix)
sns_h = sns.heatmap(data=corr... | 2.78125 | 3 |
bookworm/ocr/ocr_dialogs.py | xingkong0113/bookworm | 36 | 23224 | # coding: utf-8
import wx
import wx.lib.sized_controls as sc
from dataclasses import dataclass
from functools import partial
from wx.adv import CommandLinkButton
from bookworm import app
from bookworm import config
from bookworm import typehints as t
from bookworm.i18n import LocaleInfo
from bookworm.concurrency impor... | 2.03125 | 2 |
nginx_rtmp_wizard/models.py | Gerhut/nginx-rtmp-wizard | 0 | 23225 | <gh_stars>0
from django.conf import settings
from django.core import validators
from django.db import models
DEFAULT_RTMP_PORT = 1935
class Server(models.Model):
listen = models.PositiveIntegerField(
default=DEFAULT_RTMP_PORT,
unique=True,
validators=[
validators.MinValueValid... | 2.015625 | 2 |
fsmonitor/polling.py | ljmccarthy/fsmonitor | 26 | 23226 | # Copyright (c) 2012 <NAME> <<EMAIL>>
#
# This is free software released under the MIT license.
# See COPYING file for details, or visit:
# http://www.opensource.org/licenses/mit-license.php
#
# The file is part of FSMonitor, a file-system monitoring library.
# https://github.com/shaurz/fsmonitor
import sys, os, time,... | 2.03125 | 2 |
cogs/commands.py | ibx34/logger | 0 | 23227 | import math
import random
import string
from datetime import datetime, timedelta
from textwrap import dedent
import config
import discord
from discord.ext import commands
import asyncio
class etc(commands.Cog):
def __init__(self, bot):
self.bot = bot
@commands.command(name="clear")
async def _m... | 2.328125 | 2 |
dataset_generator/learning/imitation/tensorflow/_layers.py | rjean/duckie-segmentation | 1 | 23228 | <filename>dataset_generator/learning/imitation/tensorflow/_layers.py<gh_stars>1-10
import tensorflow as tf
L2_LAMBDA = 1e-04
def _residual_block(x, size, dropout=False, dropout_prob=0.5, seed=None):
residual = tf.layers.batch_normalization(x) # TODO: check if the defaults in Tf are the same as in Keras
resi... | 2.59375 | 3 |
test_API/demo4.py | UppASD/aiida-uppasd | 2 | 23229 | <filename>test_API/demo4.py
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon Aug 23 15:15:05 2021
@author: qichen
"""
from aiida.plugins import DataFactory, CalculationFactory
from aiida.engine import run
from aiida.orm import Code, SinglefileData, Int, Float, Str, Bool, List, Dict, ArrayData, XyData,... | 1.84375 | 2 |
pyqt_horizontal_selection_square_graphics_view/__init__.py | berty-2007/pyqt-horizontal-selection-square-graphics-view | 1 | 23230 | from .horizontalSelectionSquareGraphicsView import *
from .selectionSquare import * | 1.015625 | 1 |
src/tests/t_kadm5_hook.py | tizenorg/platform.upstream.krb5 | 372 | 23231 | <reponame>tizenorg/platform.upstream.krb5<gh_stars>100-1000
#!/usr/bin/python
from k5test import *
plugin = os.path.join(buildtop, "plugins", "kadm5_hook", "test",
"kadm5_hook_test.so")
hook_krb5_conf = {
'all' : {
"plugins" : {
"kadm5_hook" : {
"module" :... | 1.546875 | 2 |
src/visaplan/plone/tools/setup/_get_object.py | visaplan/plone.tools | 1 | 23232 | <reponame>visaplan/plone.tools<gh_stars>1-10
# -*- coding: utf-8 -*- äöü vim: sw=4 sts=4 et tw=79
"""
Tools für Produkt-Setup (Migrationsschritte, "upgrade steps"): _tree
"""
# Python compatibility:
from __future__ import absolute_import
# Standard library:
from posixpath import normpath
# Zope:
from Products.CMFCor... | 2.078125 | 2 |
tests/test_remove.py | sanjaymsh/Fiona | 1 | 23233 | <gh_stars>1-10
import logging
import sys
import os
import itertools
from .conftest import requires_gpkg
import pytest
import fiona
from fiona.errors import DatasetDeleteError
def create_sample_data(filename, driver, **extra_meta):
meta = {
'driver': driver,
'schema': {
'geometry': 'P... | 2.1875 | 2 |
taylor_based_methods.py | PabloAMC/TFermion | 4 | 23234 | <filename>taylor_based_methods.py
import math
import sympy
import numpy as np
from scipy.special import binom
import scipy
class Taylor_based_methods:
def __init__(self, tools):
self.tools = tools
# Taylorization (babbush2016exponential)
# Let us know calcula the cost of performing Phase Estimat... | 2.265625 | 2 |
contoh_2.py | sumarouno/4x4-Matrix-Keypad-Library-for-CHIP | 0 | 23235 | <reponame>sumarouno/4x4-Matrix-Keypad-Library-for-CHIP
#!/usr/bin/python3
from time import sleep
from sys import exit
import keypad_4x4_lib_sumar
kp =keypad_4x4_lib_sumar.keypad()
# Setup variables
attempt = "0000"
passcode = "<PASSWORD>"
counter = 0
# Loop while waiting for a keypress
while True:
# Loop to get a... | 3.125 | 3 |
apps/images/migrations/0001_initial.py | coogger/coogger | 48 | 23236 | <reponame>coogger/coogger<gh_stars>10-100
# Generated by Django 3.0.3 on 2020-02-28 13:21
import django.utils.timezone
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = []
operations = [
migrations.CreateModel(
name="Image... | 1.75 | 2 |
models/AI-Model-Zoo/VAI-1.3-Model-Zoo-Code/caffe/cf_facerec-resnet64_112_96_11G_1.3/code/get_aligned_face/api/detect_api.py | guochunhe/Vitis-AI | 1 | 23237 | # Copyright 2019 Xilinx Inc.
#
# 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 writing, ... | 1.773438 | 2 |
utilities/visualisation/log_file_plotter.py | bootml/agent | 0 | 23238 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
__author__ = 'cnheider'
import csv
import matplotlib.pyplot as plt
import utilities as U
# print(plt.style.available)
plot_style = 'fivethirtyeight'
# plot_style='bmh'
# plot_style='ggplot'
plt.style.use('seaborn-poster')
plt.style.use(plot_style)
plt.rcParams['axes.e... | 2.390625 | 2 |
ex3.py | SuPoPoo/python-exercise | 0 | 23239 | print("I will now count my chickens:")
print ("Hens",25+30/6)
print ("Roosters",100-25*3%4)
print("How I will count the eggs:")
print(3+2+1-5+4%2-1/4+6)
print("Is it true that 3+2<5-7?")
print(3+2<5-7)
print("What is 3+2?", 3+2)
print("What is 5-7?", 5-7)
print("Oh,that's why it's false")
print("How about some... | 4.25 | 4 |
datasets/few_shot_test_pickle.py | PengWan-Yang/few-shot-transformer | 4 | 23240 | <filename>datasets/few_shot_test_pickle.py
import pickle
# modify validation data
_few_shot_pickle_file = 'few_shot_test_data.pkl'
_few_shot_file = open(_few_shot_pickle_file, 'rb')
data_few_shot = pickle.load(_few_shot_file)
_few_shot_pickle_file = 'few_shot_val_data.pkl'
_few_shot_file = open(_few_shot_pickle_fi... | 2.4375 | 2 |
3/node.py | Pavel3P/Machine-Learning | 0 | 23241 | <reponame>Pavel3P/Machine-Learning
import numpy as np
class Node:
def __init__(self,
gini: float,
num_samples_per_class: np.ndarray,
) -> None:
self.gini: float = gini
self.num_samples_per_class: np.ndarray = num_samples_per_class
self.pre... | 3.09375 | 3 |
nemo/collections/nlp/utils/evaluation_utils.py | ParikhKadam/NeMo | 1 | 23242 | # =============================================================================
# Copyright 2020 NVIDIA. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://ww... | 2.5 | 2 |
fdk_client/common/date_helper.py | kavish-d/fdk-client-python | 0 | 23243 | from datetime import datetime
import pytz
from .constants import TIMEZONE
timezone = pytz.timezone(TIMEZONE)
def get_ist_now():
"""Returns Indian Standard Time datetime object.
Returns:
object -- Datetime object
"""
return datetime.now(timezone)
| 3.296875 | 3 |
recipes/LibriParty/generate_dataset/get_dataset_from_metadata.py | JasonSWFu/speechbrain | 3,913 | 23244 | """
LibriParty Dataset creation by using official metadata.
Author
------
<NAME>, 2020
<NAME>, 2020
"""
import os
import sys
import speechbrain as sb
from hyperpyyaml import load_hyperpyyaml
from speechbrain.utils.data_utils import download_file
from local.create_mixtures_from_metadata import create_mixture
import js... | 2.578125 | 3 |
tests/test_py4gh.py | iCAN-PCM/py4gh | 0 | 23245 | import subprocess
from pathlib import Path
import pytest
# from py4gh import __version__
from py4gh.utility import decrypt_files, encrypt_files, get_files
# def test_version():
# assert __version__ == "0.1.0"
@pytest.fixture(scope="session")
def keys(tmpdir_factory):
test_pub1 = tmpdir_factory.mktemp("data... | 1.976563 | 2 |
test/sca/test_rpa.py | scrambler-crypto/pyecsca | 0 | 23246 | from unittest import TestCase
from parameterized import parameterized
from pyecsca.ec.context import local
from pyecsca.ec.mult import LTRMultiplier, BinaryNAFMultiplier, WindowNAFMultiplier, LadderMultiplier, \
DifferentialLadderMultiplier
from pyecsca.ec.params import get_params
from pyecsca.sca.re.rpa import M... | 2.171875 | 2 |
sorting-and-searching/selection-sort.py | rayruicai/coding-interview | 0 | 23247 | import unittest
# time complexity O(n**2)
# space complexity O(1)
def selection_sort(arr):
n = len(arr)
while n >= 2:
value_max = arr[0]
index_max = 0
for i in range(1, n):
if arr[i] > value_max:
value_max = arr[i]
index_max = i
arr[... | 3.84375 | 4 |
createExeWindows.py | intel/RAAD | 0 | 23248 | # !/usr/bin/python3
# -*- coding: utf-8 -*-
# *****************************************************************************/
# * Authors: <NAME>, <NAME>
# *****************************************************************************/
import os, datetime, traceback, optparse, shutil
import PyInstaller.__main__
... | 2.71875 | 3 |
day10/django/app4/dateview/updateTeachPlan.py | Vanessa-kriby/Python | 0 | 23249 | from app1.models import *
from app1.util.utils import *
def updateTeachPlan(request):
'''
get:
http://127.0.0.1:8000/app4/updateTeachPlan?tpno=001&credit=7.0&teach_date=2019-08-22&evaluation_method=考查
调用参数:
tpno:计划编号
credit:学分
teach_date:开课日期
... | 2.265625 | 2 |
tests/test_tradera.py | paeronskruven/lw | 0 | 23250 | import lw.sources.tradera
def test_valid_query():
results = lw.sources.tradera.TraderaSource().query('a')
assert len(list(results)) > 0
def test_invalid_query():
results = lw.sources.tradera.TraderaSource().query('abc123')
assert len(list(results)) == 0
| 2.1875 | 2 |
app/app/process_data.py | yongjjang/book-rental-service | 0 | 23251 | from .database import db_session, init_db
from .models import User, Book, BookRental
from sqlalchemy import func
import datetime
import logging
init_db()
def get_tables(db_table):
"""
@author : <NAME>
:param db_table: database table in model.py
:type db_table: database model Object
... | 2.984375 | 3 |
cmdb_v0.1/apps/detail/models.py | codemaker-man/projects | 1 | 23252 | # -*- coding:utf-8 -*-
from django.db import models
import django.utils.timezone as timezone
# 用户登录信息表(服务器、虚拟机)
class ConnectionInfo(models.Model):
# 用户连接相关信息
ssh_username = models.CharField(max_length=10, default='', verbose_name=u'ssh用户名', null=True)
ssh_userpasswd = models.CharField(max_length=40, defa... | 2.078125 | 2 |
tests/__init__.py | pywikibot-catfiles/file-metadata | 10 | 23253 | <filename>tests/__init__.py
# -*- coding: utf-8 -*-
from __future__ import (division, absolute_import, unicode_literals,
print_function)
# flake8: noqa (unused import and line too long due to links)
import os
import random
import string
import struct
import wave
try:
import unittest
exce... | 2.109375 | 2 |
src/api/dataflow/batch/periodic/backend/validator/processings_validator.py | Chromico/bk-base | 84 | 23254 | # -*- coding: utf-8 -*-
"""
Tencent is pleased to support the open source community by making BK-BASE 蓝鲸基础平台 available.
Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
BK-BASE 蓝鲸基础平台 is licensed under the MIT License.
License for BK-BASE 蓝鲸基础平台:
------------------------------------------... | 1.445313 | 1 |
tests/test_build_endpoint.py | lsst-sqre/ltd-dasher | 0 | 23255 | """Test app.routes.build."""
import responses
mock_product_data = {
"bucket_name": "lsst-the-docs",
"doc_repo": "https://github.com/lsst-sqre/test-059.git",
"domain": "test-059.lsst.io",
"fastly_domain": "n.global-ssl.fastly.net",
"published_url": "https://test-059.lsst.io",
"root_domain": "l... | 1.945313 | 2 |
HW2/heart.py | MohammadJRanjbar/Data-Mining | 0 | 23256 | from sklearn import tree
from matplotlib import pyplot as plt
from sklearn.model_selection import cross_val_score
from sklearn.model_selection import train_test_split
from sklearn import model_selection
from sklearn import metrics
import numpy as np
import pandas as pd
import seaborn as sns
from sklearn.neighbors impor... | 3.015625 | 3 |
backend/api/migrations/0002_auto_20210517_0943.py | luxu/django-vue-luxu | 0 | 23257 | # Generated by Django 3.2 on 2021-05-17 12:43
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('api', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='Pavilhao',
fiel... | 1.773438 | 2 |
Module 2/Chapter08/template_simple.py | real-slim-chadi/Python_Master-the-Art-of-Design-Patterns | 73 | 23258 | __author__ = 'Chetan'
from abc import ABCMeta, abstractmethod
class AbstractClass(metaclass=ABCMeta):
def __init__(self):
pass
@abstractmethod
def operation1(self):
pass
@abstractmethod
def operation2(self):
pass
def template_method(self):
print("Defining the... | 3.765625 | 4 |
tests/test_home.py | jeroenterheerdt/nexia | 0 | 23259 | <reponame>jeroenterheerdt/nexia<filename>tests/test_home.py<gh_stars>0
"""Tests for Nexia Home."""
import json
import os
from os.path import dirname
import unittest
import pytest
from nexia.home import NexiaHome
def load_fixture(filename):
"""Load a fixture."""
test_dir = dirname(__file__)
path = os.pa... | 2.40625 | 2 |
FarmSwapG.py | resake/DuelsFarm | 0 | 23260 | <filename>FarmSwapG.py
import re
import time
import aiohttp
CHANGE_CLOTHES = True
# Use swap gear
ACCOUNT_ID = '<KEY>'
# account id goes here
class DuelsAPI:
def __init__(self, account_id, **kwargs):
self.account_id = account_id
self.API_ENTRY = kwargs.get('api_entry_url',
... | 2.328125 | 2 |
data/landice-5g/tiff_to_shp.py | scottsfarley93/IceSheetsViz | 0 | 23261 | import os
for filename in os.listdir("rasters"):
print filename
f = filename.replace(".tiff", "")
tiff = "rasters/" + filename
out = "shapefiles/" + f + ".shp"
cmd = "gdal_polygonize.py " + tiff + " -f 'ESRI Shapefile' " + out
os.system(cmd)
| 2.671875 | 3 |
we_sensesim.py | y95847frank/GenSense | 3 | 23262 | import numpy as np
import sys
import utils
import os
from collections import defaultdict
from nltk.corpus import wordnet as wn
from scipy.spatial.distance import cosine
from scipy.spatial.distance import correlation
from numpy.linalg import norm
from scipy.stats import spearmanr, pearsonr
from utils import trim
import... | 2.375 | 2 |
dlkit/abstract_osid/calendaring/queries.py | UOC/dlkit | 2 | 23263 | """Implementations of calendaring abstract base class queries."""
# pylint: disable=invalid-name
# Method names comply with OSID specification.
# pylint: disable=no-init
# Abstract classes do not define __init__.
# pylint: disable=too-few-public-methods
# Some interfaces are specified as 'markers' and inclu... | 2.78125 | 3 |
scripts/republish_s3_products.py | hysds/grq2 | 1 | 23264 | <filename>scripts/republish_s3_products.py
#!/usr/bin/env python
from __future__ import print_function
from __future__ import unicode_literals
from __future__ import division
from __future__ import absolute_import
from future import standard_library
standard_library.install_aliases()
import json
import requests
import ... | 2.21875 | 2 |
tensorflow/emo_tflearn.py | lukewegryn/emo_net | 4 | 23265 | <gh_stars>1-10
# First check the Python version
import sys
if sys.version_info < (3,4):
print('You are running an older version of Python!\n\n' \
'You should consider updating to Python 3.4.0 or ' \
'higher as the libraries built for this course ' \
'have only been tested in Python 3.4... | 2.65625 | 3 |
strivial/__init__.py | watsosc/strivial | 0 | 23266 | <reponame>watsosc/strivial<gh_stars>0
import os
import logging
from logging import Formatter, FileHandler
from flask import Flask
def create_app(test_config=False):
app = Flask(__name__, instance_relative_config=True)
if test_config:
app.config.from_object('config.TestingConfig')
else:
app.... | 2 | 2 |
model_functions.py | blowe615/flower_classifier | 1 | 23267 | import torch
from torch import nn
import torch.nn.functional as F
#from helper_functions import process_image
class DeepNetworkClassifier(nn.Module):
def __init__(self, input_units, output_units, hidden_units,p_drop=0.2):
'''
Builds a classifier for a pretrained deep neural network for the flower d... | 3.59375 | 4 |
src/pages/random.py | jojo935/Kemono2 | 0 | 23268 | from flask import Blueprint, redirect, url_for, g
from ..utils.utils import make_cache_key
from ..internals.cache.redis import get_conn
from ..internals.cache.flask_cache import cache
from ..internals.database.database import get_cursor
from ..lib.artist import get_artist, get_random_artist_keys
from ..lib.po... | 2.171875 | 2 |
rljax/algorithm/tqc.py | kew96/rljax | 56 | 23269 | <gh_stars>10-100
from functools import partial
from typing import List
import haiku as hk
import jax
import jax.numpy as jnp
import numpy as np
from rljax.algorithm.sac import SAC
from rljax.network import ContinuousQuantileFunction, StateDependentGaussianPolicy
from rljax.util import quantile_loss
class TQC(SAC):
... | 2.09375 | 2 |
benchmark_constructor/file_normalizers/ContactSelectFileNormalizer.py | Kortemme-Lab/benchmark_set_construct | 0 | 23270 | <reponame>Kortemme-Lab/benchmark_set_construct<filename>benchmark_constructor/file_normalizers/ContactSelectFileNormalizer.py
import os
from .FileNormalizer import FileNormalizer
class ContactSelectFileNormalizer(FileNormalizer):
'''ContactSelectFileNormalizer creates a pymol script that selects
residues which... | 2.3125 | 2 |
neurovault/apps/statmaps/tests/test_qa.py | abitrolly/NeuroVault | 68 | 23271 | import os
import nibabel as nb
import numpy as np
from django.test import TestCase
from neurovault.apps.statmaps.models import BaseStatisticMap
from neurovault.apps.statmaps.utils import is_thresholded, infer_map_type
class QATest(TestCase):
def setUp(self):
this_path = os.path.abspath(os.path.dirname(... | 2.203125 | 2 |
src/crawler/input_data/spiders/bitcointalk.py | HofmannZ/global-ai-hackathon--truth-coin | 5 | 23272 | # -*- coding: utf-8 -*-
import scrapy
class BitcointalkSpider(scrapy.Spider):
name = 'bitcointalk'
allowed_domains = ['bitcointalk.org']
start_urls = [
'https://bitcointalk.org/index.php?board=1.0',
]
def parse(self, response):
topics = response.css('div.tborder table.bordercolor'... | 2.34375 | 2 |
fugue/column/functions.py | kvnkho/fugue | 547 | 23273 | from typing import Any, Optional
import pyarrow as pa
from fugue.column.expressions import (
ColumnExpr,
_FuncExpr,
_to_col,
function,
)
from triad import Schema
def coalesce(*args: Any) -> ColumnExpr:
"""SQL ``COALESCE`` function
:param args: If a value is not :class:`~fugue.column.expressi... | 2.9375 | 3 |
chapters/10/src/biglittle/entity/user.py | PacktPublishing/-Learn-MongoDB-4.0 | 13 | 23274 | <reponame>PacktPublishing/-Learn-MongoDB-4.0<filename>chapters/10/src/biglittle/entity/user.py
# biglittle.entity.user
# tell python where to find module source code
import os,sys
sys.path.append(os.path.realpath('../../../src'))
from biglittle.entity.base import Base
class Name(Base) :
formFieldPrefix = 'name_'
... | 2.15625 | 2 |
gaia-sdk-python/conftest.py | leftshiftone/gaia-sdk | 0 | 23275 | # enabled testing relative paths | 1.132813 | 1 |
backend/app/utils.py | dashdashforce/int20h-test-photo-viewer | 0 | 23276 |
from functools import reduce
from itertools import groupby
from operator import add, itemgetter
def merge_records_by(key, combine):
return lambda first, second: {
k: first[k] if k == key else combine(first[k], second[k])
for k in first
}
def merge_list_of_records_by(key, combine):
keypr... | 3.609375 | 4 |
main/validadorCPF/cpf.py | LuizMoreira-py/cadastro | 0 | 23277 | class Cpf:
def __init__(self, documento):
documento = str(documento)
if self.cpf_eh_valido(documento):
self.cpf = documento
else:
raise ValueError("CPF inválido!")
def cpf_eh_valido(self, documento):
if len(documento) == 11:
return True
... | 3.234375 | 3 |
backend/venue_scraper.py | illicitonion/edfringeplanner | 0 | 23278 | from selenium import webdriver
from config import Config
from db import cursor
def get_venues():
driver = webdriver.Chrome()
try:
driver.get("https://tickets.edfringe.com/venues")
while True:
venues_container = driver.find_element_by_class_name("venues")
for venue in ... | 3.125 | 3 |
Source Files/auth.py | clever-username/baseball-card-inventory | 1 | 23279 | <gh_stars>1-10
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""This program prompts for a password."""
import authentication
import getpass
def login(username, maxattempts=3):
"""This function takes input from a user and checks the password.
Arg:
username(str): String input from user.
... | 4.40625 | 4 |
tests/test_utils.py | yehzhang/dscraper | 1 | 23280 | import unittest
import logging
import xml.etree.ElementTree as et
import dscraper.utils as utils
logger = logging.getLogger(__name__)
class TestUtils(unittest.TestCase):
XML_FILES = (
'tests/resources/1.xml',
)
def setUp(self):
pass
| 2.109375 | 2 |
CameraCalibration.py | lsmanoel/StereoVision | 0 | 23281 |
import numpy as np
import cv2
import glob
from matplotlib import pyplot as plt
class CameraCalibration():
def __init__(self):
pass
# ===========================================================
# ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
@staticmethod
def find_chess(frame... | 3.109375 | 3 |
app/database/base.py | CabetoDP/fastapi-crud | 0 | 23282 | from app.database.base_class import Base
from app.models.place import Place | 1.210938 | 1 |
yolox/models/simo_fpn.py | RawFisher/YOLOX | 0 | 23283 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2014-2021 Megvii Inc. All rights reserved.
import torch
import torch.nn as nn
from .sdc_darknet import SDCCSPDarknet
# from .simo_darknet import SIMOCSPDarknet
from .network_blocks import BaseConv, CSPLayer, DWConv
from .network_blocks import get_activatio... | 2.234375 | 2 |
benchmark/mysql_benchmark.py | AlonFischer/SpatialDatabaseBench | 1 | 23284 | from benchmark.benchmark import Benchmark
from mysqlutils.mysqladapter import MySQLAdapter
class MysqlBenchmark(Benchmark):
"""Abstract parent class for mysql benchmarks"""
def __init__(self, adapter, title, repeat_count=7):
super().__init__(title, repeat_count=repeat_count)
self.adapter = ad... | 2.375 | 2 |
packages/core/minos-microservice-networks/tests/test_networks/test_exceptions.py | sorasful/minos-python | 247 | 23285 | import unittest
from minos.common import (
MinosException,
)
from minos.networks import (
MinosNetworkException,
)
class TestExceptions(unittest.TestCase):
def test_type(self):
self.assertTrue(issubclass(MinosNetworkException, MinosException))
if __name__ == "__main__":
unittest.main()
| 2.484375 | 2 |
Weltantschauung/__init__.py | area42/Weltanschauung- | 0 | 23286 | from .Weltantschauung import Weltantschauung
| 1.125 | 1 |
api/messages/csv_file.py | pikanezi/Roadkill | 0 | 23287 | __author__ = 'Vincent'
from protorpc import messages
class CsvFile(messages.Message):
file = messages.BytesField(1, required=True)
name = messages.StringField(2, required=False) | 2.125 | 2 |
run.py | whyjay/memoryGAN | 44 | 23288 | import os
import numpy as np
import tensorflow as tf
from models.config import Config
from models.memory_gan import MemoryGAN
from models.test_generation import test_generation
from models.train import train
from utils import pp, visualize, to_json
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3'
flags = tf.app.flags
flags.... | 2.203125 | 2 |
web/impact/impact/views/calendar_reminder_view.py | masschallenge/impact-api | 5 | 23289 | from django.views import View
from django.http import HttpResponseRedirect
from add2cal import Add2Cal
from pytz import timezone
import datetime
from django.http import (
JsonResponse,
HttpResponse
)
ADD2CAL_DATE_FORMAT = "%Y%m%dT%H%M%S"
CALENDAR_CONTENT_TYPE = 'text/calendar'
OUTLOOK_LINK_TYPE = 'outlook'
GOO... | 2.234375 | 2 |
slixmpp/plugins/xep_0421/stanza.py | cnngimenez/slixmpp | 0 | 23290 | <reponame>cnngimenez/slixmpp
"""
Slixmpp: The Slick XMPP Library
Copyright (C) 2020 "Maxime “<NAME> <<EMAIL>>"
This file is part of Slixmpp.
See the file LICENSE for copying permission.
"""
from slixmpp.xmlstream import ElementBase
NS = 'urn:xmpp:occupant-id:0'
class OccupantId(ElementBase):
'... | 1.90625 | 2 |
poseidon/dags/traffic_counts/traffic_counts_jobs.py | panda-tech/poseidon-airflow | 0 | 23291 | """Traffic counts _jobs file."""
import pandas as pd
import logging
from subprocess import Popen, PIPE
from trident.util import general
conf = general.config
fy = general.get_FY_year()
def get_traffic_counts(out_fname='traffic_counts_file'):
"""Get traffic counts file from shared drive."""
logging.info(f'Ret... | 2.53125 | 3 |
metaquantome/modules/run_viz.py | jj-umn/metaquantome | 4 | 23292 | import os
import subprocess
import json
from metaquantome.util.utils import BASE_DIR
from metaquantome.classes.SampleGroups import SampleGroups
def run_viz(plottype, img, infile, strip=None,
mode=None, meancol=None, nterms='5', target_rank=None, barcol=6, # barplot, stacked_bar
textannot=Non... | 2.25 | 2 |
src/mtweepy/__init__.py | Souvic/mtweepy | 1 | 23293 | import json
import multiprocessing
import os
import requests
from requests_oauthlib import OAuth1
from time import sleep
import tweepy
def get_users_single(x,auth,output_folder):
while(True):
url=f"https://api.twitter.com/1.1/users/lookup.json?user_id={','.join([str(i) for i in x])}"
if(type... | 2.765625 | 3 |
pyUSID/io/hdf_utils/model.py | rajgiriUW/pyUSID | 25 | 23294 | # -*- coding: utf-8 -*-
"""
Utilities for reading and writing USID datasets that are highly model-dependent (with or without N-dimensional form)
Created on Tue Nov 3 21:14:25 2015
@author: <NAME>, <NAME>
"""
from __future__ import division, print_function, absolute_import, unicode_literals
from warnings import warn
... | 1.828125 | 2 |
TaxPy/data_processing/export_reads.py | stenglein-lab/TaxAssessor | 0 | 23295 | #!/usr/bin/python
import json
import timeit
import re
import TaxPy.db_management.db_wrap as TaxDb
from itertools import izip
def retrieveReads(userName,fileName,fileId,parentTaxId,query):
time1 = timeit.default_timer()
taxTree = loadTaxTree(userName,fileName)
time2 = timeit.default_timer()
print str... | 2.28125 | 2 |
python/caliper-reader/setup.py | slabasan/Caliper | 220 | 23296 | <filename>python/caliper-reader/setup.py<gh_stars>100-1000
# Copyright (c) 2020-20201, Lawrence Livermore National Security, LLC.
# See top-level LICENSE file for details.
#
# SPDX-License-Identifier: BSD-3-Clause
import setuptools
from codecs import open
from os import path
here = path.abspath(path.dirname(__file__)... | 1.789063 | 2 |
programming_fundamentals/python_part_2/common_vars.py | tobaidullah/2 | 629 | 23297 | #! /usr/bin/env python
"""
Learning Series: Network Programmability Basics
Module: Programming Fundamentals
Lesson: Python Part 2
Author: <NAME> <<EMAIL>>
common_vars.py
Illustrate the following concepts:
- Code reuse
imported into other examples
"""
shapes = ["square", "triangle", "circle"]
books = [
{
... | 3.609375 | 4 |
forms.py | godsgift/gdohs | 0 | 23298 | from flask_wtf import Form
from wtforms import TextField, PasswordField, validators, IntegerField, BooleanField, SelectField, SubmitField
from wtforms.validators import Required, Length, Email, ValidationError, Regexp, EqualTo, NumberRange
from wtforms.widgets import SubmitInput
class SignUp(Form):
username = TextFie... | 3.359375 | 3 |
ossdbtoolsservice/metadata/contracts/object_metadata.py | DaeunYim/pgtoolsservice | 33 | 23299 | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... | 2.234375 | 2 |