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 |
|---|---|---|---|---|---|---|
spcdist/utils.py | deep-spin/sparse_continuous_distributions | 8 | 47600 | <reponame>deep-spin/sparse_continuous_distributions<filename>spcdist/utils.py
import numpy as np
import scipy
def _eigvalsh_to_eps(spectrum, cond=None, rcond=None):
"""
Determine which eigenvalues are "small" given the spectrum.
This is for compatibility across various linear algebra functions
that s... | 2.375 | 2 |
Chapter23.ModuleCodingBasics/use_module2.py | mindnhand/Learning-Python-5th | 0 | 47601 | #!/usr/bin/env python3
#encoding=utf-8
#------------------------------------------------------
# Usage: python3 use_module2.py
# Description: module basic
#------------------------------------------------------
import module2
print(module2.sys)
print(module2.name)
print(module2.klass)
print('The dict of module2 ... | 3.09375 | 3 |
inside/cgi-bin/usercheck.py | osrf/cloudsim-legacy | 0 | 47602 | #!/usr/bin/env python
from __future__ import with_statement
from __future__ import print_function
import sys
import os
import Cookie
import cgi
import common
import cgitb
cgitb.enable()
EMAIL_VARNAME = 'openid.ext1.value.email'
# Are we using basic auth?
auth_type, email = common.web.get_auth_type()
if auth_type ==... | 2.203125 | 2 |
Regression/RegressionAdaBoost.py | lujunzju/MachineLearningForAirTicketPredicting | 47 | 47603 | # system library
import numpy as np
# user-library
import RegressionBase
# third-party library
from sklearn.tree import DecisionTreeRegressor
from sklearn.ensemble import AdaBoostRegressor
from sklearn.grid_search import GridSearchCV
from sklearn.metrics import mean_squared_error
from sklearn.learning_curve import v... | 2.421875 | 2 |
deeplearning/ml4pl/filesystem_paths.py | island255/ProGraML | 1 | 47604 | <filename>deeplearning/ml4pl/filesystem_paths.py<gh_stars>1-10
# Copyright 2019-2020 the ProGraML authors.
#
# Contact <NAME> <<EMAIL>>.
#
# 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
#
# ... | 2.796875 | 3 |
alipay/aop/api/response/AlipayMarketingDataDashboardBatchqueryResponse.py | articuly/alipay-sdk-python-all | 0 | 47605 | <reponame>articuly/alipay-sdk-python-all<filename>alipay/aop/api/response/AlipayMarketingDataDashboardBatchqueryResponse.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import simplejson as json
from alipay.aop.api.response.AlipayResponse import AlipayResponse
from alipay.aop.api.domain.DashBoardMeta import DashBoard... | 2.140625 | 2 |
boolmininfo/unused/boolean_minimization_stats.py | godzilla-but-nicer/boolmininfo | 0 | 47606 | <gh_stars>0
import numpy as np
from itertools import chain, combinations
# this function definetely has bad normalization right now (maybe counting
# wrong in general)
def find_wildcards(bool_node, inputs=3, norm=True, ones=False):
# we can rely on cana to redescribe things for us
pis = list(bool_node.pi_cove... | 2.375 | 2 |
marslab/imgops/poolutils.py | AndrewAnnex/marslab | 0 | 47607 | """utilities for watching worker pools"""
from collections.abc import Callable, Mapping
import logging
import time
from types import MappingProxyType
from typing import Optional, TYPE_CHECKING, Union
if TYPE_CHECKING:
from multiprocessing import Pool
from pathos.multiprocessing import ProcessPool
class Chang... | 2.40625 | 2 |
schedsi/cpu/request.py | z33ky/schedsi | 1 | 47608 | #!/usr/bin/env python3
"""Defines a :class:`Request`."""
import enum
import numbers
from schedsi.cpu import context
Type = enum.Enum('Type', ['current_time', 'resume_chain', 'idle', 'execute', 'timer'])
class Request:
"""A request to the CPU."""
def __init__(self, rtype, arg):
"""Create a :class:`R... | 2.953125 | 3 |
var/www/cgi-bin/ewmethodConf.py | DanielAndreasen/FASMA-web | 1 | 47609 | #!/home/daniel/Software/anaconda3/bin/python
# Import modules for CGI handling
import os
import cgi, cgitb
from ewDriver import ewdriver
from emailSender import sendEmail
def cgi2dict(form):
"""Convert the form from cgi.FieldStorage to a python dictionary"""
params = {'initial': False,
'fixtef... | 2.71875 | 3 |
common/utils.py | quentin-xia/Maticv | 0 | 47610 | <reponame>quentin-xia/Maticv
#/usr/bin/env python
#-*- coding:utf-8 -*-
import math,os
import numpy as np
from adb import Adb
from screencap import MinicapStream
import tempfile
import hashlib
import gl
import platform
if platform.system() is "Windows":
try:
import maticv.common.opencv.x32.cv2 as cv2
ex... | 2.625 | 3 |
src/directory_model.py | cmtools/fastapi-cli | 0 | 47611 | import typing as t
from file_model import File
class Dir:
path: str
files: t.List[File] = []
def __init__(self, path, files=[]):
self.path = path
self.files = files
| 2.8125 | 3 |
attention_cnn_lstm_classifer.py | junyongyou/Attention-boosted-deep-networks-for-video-classification | 11 | 47612 | <filename>attention_cnn_lstm_classifer.py
from keras import backend as K
from keras.layers import Input, Dense, Flatten, Activation, Dropout, Bidirectional, Permute, multiply
from keras.layers.recurrent import LSTM
from keras.callbacks import CSVLogger
from keras.models import Sequential, Model, load_model
from ke... | 2.71875 | 3 |
python/version-1.0/draw.py | calledtoconstruct/game-of-life | 1 | 47613 | <filename>python/version-1.0/draw.py
import time
from life import evolve
from life import is_alive
def draw(universe, width, height):
grid = ''
for y in range(0, height - 1):
line = ''
for x in range(0, width - 1):
if is_alive(universe, width, x, y):
line = line + ... | 3.875 | 4 |
common/models.py | AsfanUlla/pi-backend | 0 | 47614 | from pydantic import BaseModel, Field, EmailStr
from typing import Optional, List, Dict, Any
class SchemalessResponse(BaseModel):
data: Dict = {}
status_code: int = 200
message: Optional[str] = "Request Processed"
class EmailSchema(BaseModel):
sub: str
email_to: List[EmailStr]
body: Dict[str... | 2.453125 | 2 |
tridepth/extractor/extract_2d_mesh.py | syinari0123/tridepth | 81 | 47615 | import os
import sys
import tempfile
import subprocess
import cv2
import pymesh
import numpy as np
import torch
import triangle as tr
from tridepth import BaseMesh
from tridepth.extractor import calculate_canny_edges
from tridepth.extractor import SVGReader
from tridepth.extractor import resolve_self_intersection, cle... | 2.15625 | 2 |
migrations/versions/476b167aef80_initial_migration.py | joostsijm/ssg | 0 | 47616 | """initial_migration
Revision ID: 476b167aef80
Revises:
Create Date: 2019-01-03 17:03:37.684091
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '<KEY>'
down_revision = None
branch_labels = None
depends_on = None
def upgrade():
op.create_table('user',
... | 1.835938 | 2 |
scripts/eval.py | zehsilva/poissonmf_cs | 9 | 47617 | <reponame>zehsilva/poissonmf_cs
import matplotlib
#matplotlib.use('Agg')
import numpy as np
import matplotlib.pylab as plt
import pandas as pd
def results_k(k,test,res):
eval_list=[]
test=test.astype(int)
for i in xrange(res.shape[0]):
relevant = test[test[:,0]==i,1]
retrieved_k = np.array(sorted(zip(res[i],xr... | 2.28125 | 2 |
webserver/app/routes.py | hojinYang/tfrs-movierec-serving | 17 | 47618 | <gh_stars>10-100
from flask import render_template, redirect, url_for
import requests
import json
from app import app, db
from app.forms import LoginForm, RatingForm
from app.models import User, Movie, UserMovieRating
@app.route('/', methods=['GET', 'POST'])
@app.route('/index', methods=['GET', 'POST'])
def index():
... | 2.421875 | 2 |
code/ner/model/net.py | gilbert98xD/mtextos2122 | 2 | 47619 | """
## Minería de textos
Universidad de Alicante, curso 2021-2022
Esta documentación forma parte de la práctica "[Lectura y documentación de un sistema de
extracción de entidades](https://jaspock.github.io/mtextos2122/bloque2_practica.html)" y se
basa en el código del curso [CS230](https://github.com/cs230-stanford/c... | 3.359375 | 3 |
packages/conan/recipes/imath/conanfile.py | boberfly/aswf-docker | 3 | 47620 | <gh_stars>1-10
from conans import ConanFile, tools, CMake
import os
required_conan_version = ">=1.38.0"
class ImathConan(ConanFile):
name = "imath"
description = "Imath is a C++ and python library of 2D and 3D vector, matrix, and math operations for computer graphics."
topics = "conan", "imath", "python"... | 2.140625 | 2 |
chatbot_tutorial/views.py | BluRanger/django-chatbot-example | 7 | 47621 | <reponame>BluRanger/django-chatbot-example<filename>chatbot_tutorial/views.py
from django.views import generic
from django.views.decorators.csrf import csrf_exempt
import json
import requests
import random
from django.utils.decorators import method_decorator
from django.http.response import HttpResponse
from django.sho... | 2.546875 | 3 |
face_detection/__init__.py | Lanzarko/Real-Time-Face-Anonymizer | 2 | 47622 | <gh_stars>1-10
import warnings
from .detector import *
from .intel_inference import *
warnings.filterwarnings("ignore", category=DeprecationWarning)
| 1.054688 | 1 |
risk_normalization.py | howardbandy/risk_normalization | 1 | 47623 | <gh_stars>1-10
# CAR25onCSV.py
#
# A program to read a .CSV file that contains a list of trades
# and computes the safe-f and CAR25 metrics that best
# estimate the future performance of the system that produced
# these gains and losses.
# The risk_normalization library is managed by PyPi.
# Before runnin... | 2.703125 | 3 |
project/data/convertCSV2JSON-sector.py | 11096187/programmeerproject | 0 | 47624 | <filename>project/data/convertCSV2JSON-sector.py
# ConvertCSV2JSON
# Converts data in csv to json.
#
# Name: <NAME>
# Student nr: 11096187
# Date: 27-04-2018
#
# Data Processing
# Week 3
import csv
import json
from collections import OrderedDict
with open("newData/emissions-by-sector-percentages.csv", "r", encoding='... | 3.765625 | 4 |
project_3/resources/ptorch.py | kingspp/DS595-ReinforcementLearning | 0 | 47625 | <reponame>kingspp/DS595-ReinforcementLearning<filename>project_3/resources/ptorch.py
#!/usr/bin/env python
"""
PyTorch implementation of DQN
Paper: https://www.cs.toronto.edu/~vmnih/docs/dqn.pdf
"""
import argparse
import gym
from gym import wrappers
import numpy as np
import pdb
import os
import random
import time
i... | 2.6875 | 3 |
tests/conftest.py | zebbarry/todo | 1 | 47626 | import pytest
from flask import Flask
from todo import db as _db
@pytest.fixture
def test_app():
"""Set up test Flask application."""
# Set up Flask app
app = Flask(__name__)
# We will create database in memory
# That way, we don't worry about after cleaning/removing it after running tests
ap... | 2.515625 | 3 |
cli/roger_init.py | seomoz/roger-mesos-tools | 0 | 47627 | #!/usr/bin/python
from __future__ import print_function
import argparse
import json
import os
import sys
from cli.settings import Settings
import contextlib
@contextlib.contextmanager
def chdir(dirname):
'''Withable chdir function that restores directory'''
curdir = os.getcwd()
try:
os.chdir(dir... | 2.578125 | 3 |
tests/unit/records/targets/test_spectrum.py | cwegrzyn/records-mover | 36 | 47628 | import unittest
from records_mover.records.targets.spectrum import SpectrumRecordsTarget
from records_mover.records.existing_table_handling import ExistingTableHandling
from mock import Mock, patch, MagicMock
class TestSpectrum(unittest.TestCase):
@patch('records_mover.records.targets.spectrum.ParquetRecordsForma... | 2.265625 | 2 |
neosis_telephone_directory/telephone_directory/migrations/0003_contacts_profile_pic.py | borkarfaiz/neosis_telephone_directory | 0 | 47629 | # Generated by Django 3.0.11 on 2020-12-09 06:05
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('telephone_directory', '0002_auto_20201208_1801'),
]
operations = [
migrations.AddField(
model_name='contacts',
name... | 1.625 | 2 |
standalone/Mileage By Functional Class.py | RephenSoss/python | 3 | 47630 | import arcpy, os
FC_Frontage_Roads = arcpy.GetParameterAsText(0)
FC_Centerlines = arcpy.GetParameterAsText(1)
Routed_SubFiles = arcpy.GetParameterAsText(2)
District_Boundaries = arcpy.GetParameterAsText(3)
MPO_Boundaries = arcpy.GetParameterAsText(4)
outputFolder = arcpy.GetParameterAsText(5)
scracthSpace = outputFolde... | 2.46875 | 2 |
test/test_mod_import.py | kpagacz/NMDownloader | 0 | 47631 | <filename>test/test_mod_import.py
import unittest
import utils.mod_import as mod_import
import codecov
class ModListImporterTestCase(unittest.TestCase):
def setUp(self):
self.importer = mod_import.ModListImporter()
self.csv_header = "modids,names\n"
self.csv_values = ["1,abc\n"
... | 2.9375 | 3 |
limiar_matriz_quadrada.py | sliatecinos/saladeaula | 1 | 47632 | # Limiar da Matriz Quadrada :: github.com/sliatecinos
# ================================================================================
# Ref.externa: https://www.facebook.com/groups/608492105999336/permalink/2061101090738423/
# Entradas do usuario (lado, limiar, ordem da matriz)
lado_diagonal = input('Estarao "... | 4 | 4 |
backend/pah_fm/urls.py | w1stler/pah-fm | 8 | 47633 | """pah_fm URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/2.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 ... | 2.359375 | 2 |
src/msanalyzer/__init__.py | marcusbfs/msanalyzer | 0 | 47634 | from __future__ import annotations
__version__ = "3.8.0"
| 1.09375 | 1 |
deciphon_cli/console/env.py | EBI-Metagenomics/deciphon-cli | 0 | 47635 | import typer
import deciphon_cli.data as data
__all__ = ["app"]
app = typer.Typer()
@app.command()
def default():
typer.echo(data.env_example_content(), nl=False)
| 1.773438 | 2 |
wftests/ci/pylint_checker.py | YutakaMizugaki/warriorframework | 24 | 47636 | """
Get a list of file and run pylint on each of the files
on pull request source branch and target branch
"""
import sys
import subprocess
# from pylint import epylint as lint
def process_file_list(input_file, rc_file):
"""
Generate a list of files that need to be pylint
"""
filelist = open(input_... | 2.9375 | 3 |
draw_macros/drawEnvelope.py | nkarast/WWTheoryUncertainties | 0 | 47637 | import ROOT as rt
import glob
debug = 1
def setstyle():
rt.gStyle.SetOptStat(0);
rt.gStyle.SetFillColor(10);
rt.gStyle.SetFrameFillColor(10);
rt.gStyle.SetCanvasColor(10);
rt.gStyle.SetPadColor(10);
rt.gStyle.SetTitleFillColor(0);
rt.gStyle.SetStatColor(10);
rt.gStyle.SetCanvasBorderM... | 2.25 | 2 |
test.py | luch61008/olll | 0 | 47638 | import olll
import numpy as np
test1 = [[1,0,0,1,1,0,1],[0,1,0,5,0,0,0],[0,0,1,0,5,0,5]]
test2 = [[1,0,0,2,-1,1],[0,1,0,3,-4,-2],[0,0,1,5,-10,-8]]
test3 = [[1,0,0,1,1,0,1], [0,1,0,4,-1,0,-1], [0,0,1,1,1,0,1]]
test4 = [[1,0,0,2,5,3],[0,1,0,1,1,1,],[0,0,1,4,-2,0]]
test5 = [[1,0,0,0,0,0,2,1,1,2],[0,1,0,0,0,0,1,1,-1,-1],[... | 2.421875 | 2 |
custom_components/powercalc/sensors/energy.py | piio/homeassistant-powercalc | 0 | 47639 | from __future__ import annotations
import logging
from typing import Any
from homeassistant.components.integration.sensor import (
TRAPEZOIDAL_METHOD,
IntegrationSensor,
)
from homeassistant.components.sensor import DOMAIN as SENSOR_DOMAIN
from homeassistant.const import CONF_NAME, TIME_HOURS
from homeassista... | 1.976563 | 2 |
code/nearest_neighbor_classify.py | lionelmessi6410/Scene-recognition-with-bag-of-words | 22 | 47640 | <gh_stars>10-100
from __future__ import print_function
import numpy as np
import scipy.spatial.distance as distance
def nearest_neighbor_classify(train_image_feats, train_labels, test_image_feats):
###########################################################################
# TODO: ... | 3.34375 | 3 |
zd2.py | Valentina1502/OOP_1 | 0 | 47641 | <filename>zd2.py
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
'''
Реализовать класс Bankomat, моделирующий работу банкомата. В классе должны
содержаться поля для хранения идентификационного номера банкомата, информации о
текущей сумме денег, оставшейся в банкомате, минимальной и максимальной суммах,
которые позволя... | 2.5625 | 3 |
mesostat/visualization/recurrence.py | HelmchenLabSoftware/mesostat-dev | 0 | 47642 | import numpy as np
import matplotlib.pyplot as plt
import ipywidgets
from mesostat.utils.opencv_helper import cvWriter
from mesostat.utils.arrays import numpy_merge_dimensions
from sklearn.decomposition import PCA
def distance_matrix(data):
nDim, nTime = data.shape
dataExtr = np.repeat(data[..., None], nTime... | 2.6875 | 3 |
src/nti/mailer/tests/templates/__init__.py | NextThought/nti.mailer | 0 | 47643 | <reponame>NextThought/nti.mailer<gh_stars>0
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Make this directory a package.
| 1.257813 | 1 |
ggutilities.py | giannipele/geneticgame | 0 | 47644 | <gh_stars>0
import math
from vec2d import vec2d
def angle_to_direction(angle):
"""
Convert the angle to the normalized x,y direction,
:param angle:
:return:
"""
radians = angle * math.pi / 180
vx = math.cos(radians)
vy = math.sin(radians)
return vec2d((vx, vy)).normalized()
def a... | 3.703125 | 4 |
models/VGG_models.py | Gus-Lab/temporal_efficient_training | 5 | 47645 | import random
from models.layers import *
class VGGSNN(nn.Module):
def __init__(self):
super(VGGSNN, self).__init__()
pool = SeqToANNContainer(nn.AvgPool2d(2))
#pool = APLayer(2)
self.features = nn.Sequential(
Layer(2,64,3,1,1),
Layer(64,128,3,1,1),
... | 2.484375 | 2 |
programs/pygame/dwarf_fight/utils.py | xzpeter/pylibs | 0 | 47646 | import time
import math
import random
# Define some colors
black = ( 0, 0, 0)
white = ( 255, 255, 255)
green = ( 0, 255, 0)
blue = ( 0, 0, 255)
red = ( 255, 0, 0)
yellow = ( 255, 255, 0)
def debug (msg):
print "%s: %s" % (time.strftime("%D %H:%m:%S"), msg)
def warn (msg):
... | 3.375 | 3 |
src/check_jsonschema/parse_cli.py | dsch/check-jsonschema | 0 | 47647 | from __future__ import annotations
import argparse
import textwrap
from .catalog import CUSTOM_SCHEMA_NAMES, SCHEMA_CATALOG
from .formats import RegexFormatBehavior
from .transforms import TRANFORM_LIBRARY
BUILTIN_SCHEMA_NAMES = [f"vendor.{k}" for k in SCHEMA_CATALOG.keys()] + [
f"custom.{k}" for k in CUSTOM_SCH... | 2.5625 | 3 |
smoke/box/FeatureTimeSpaceGrid.py | minnieteng/smoke_project | 0 | 47648 | <reponame>minnieteng/smoke_project<filename>smoke/box/FeatureTimeSpaceGrid.py
import os
import json
import tarfile
import tempfile
import numpy as np
import numpy.ma as ma
import matplotlib.pyplot as plt
from datetime import datetime, timedelta
from pytz import timezone
from geopy.distance import distance
from scipy.op... | 2.75 | 3 |
cmt.py | developer0hye/CMT | 1 | 47649 | import torch
import torch.nn as nn
class CMT(nn.Module):
def __init__(self,
stem_channels: list):
super(CMT, self).__init__()
self.stem
def forward(self, x):
pass
| 2.421875 | 2 |
yearn/vaults_v2.py | nymmrx/yearn-exporter | 0 | 47650 | <filename>yearn/vaults_v2.py<gh_stars>0
from dataclasses import dataclass
from typing import List
from brownie import interface, web3
from brownie.network.contract import InterfaceContainer
from packaging import version
from yearn import strategies
from yearn import uniswap
from yearn.mutlicall import fetch_multicall... | 2.1875 | 2 |
Python/1-Fundamentals/cc_nestedif.py | armirh/Nucamp-SQL-Devops-Training | 2 | 47651 | <gh_stars>1-10
'''
priceIsRight = 15
if priceIsRight:
print("Price is too low!")
if priceIsRight:
print("Price is almost there!")
if priceIsRight:
print("Price is exactly that!")
if priceIsRight:
print("Price is too high!")
'''
priceIsRight = int(input("Enter y... | 3.921875 | 4 |
src/ggrc/migrations/versions/20130530013529_3288290c842a_add_log_events.py | Smotko/ggrc-core | 0 | 47652 | <reponame>Smotko/ggrc-core
# Copyright (C) 2013 Google Inc., authors, and contributors <see AUTHORS file>
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
# Created By: <EMAIL>
# Maintained By: <EMAIL>
"""Add log_events
Revision ID: 3288290c842a
Revises: <PASSWORD>
Create Date: 2013-05-... | 1.554688 | 2 |
plot_3T_SRF_GFR.py | plaresmedima/Basak_et_al_2018 | 0 | 47653 | <reponame>plaresmedima/Basak_et_al_2018
#This code reads the output files of fitAll.py
#and plots regreassion curve and Bland-Altman plot for SRF and total GFR for 3 T subgroup
#It also prints the correlation coefficient, mean difference, stdev difference,
#p-values of SRF and Total GFR for the 3T subgroup.
#S... | 2.859375 | 3 |
final_codes/challenge.py | CbGeSky/--1stECG | 9 | 47654 | import sys
import os
import numpy as np
import scipy.io as sio
import random
from decimal import Decimal
import argparse
import csv
from keras.models import load_model
import f_model
from f_preprocess import fill_length
# Usage: python rematch_challenge.py test_file_path
def arg_parse():
"""
Parse arguements... | 2.625 | 3 |
data/amazon/generate_data.py | ADALabUCSD/vista | 1 | 47655 | <filename>data/amazon/generate_data.py<gh_stars>1-10
# coding=utf-8
'''
Copyright 2018 <NAME> and <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... | 2.453125 | 2 |
sample_scripts/derived_unit_data.py | jnicho02/pywind | 7 | 47656 | #!/usr/bin/env python
# coding=utf-8
# This is free and unencumbered software released into the public domain.
#
# Anyone is free to copy, modify, publish, use, compile, sell, or
# distribute this software, either in source code form or as a compiled
# binary, for any purpose, commercial or non-commercial, and by any
... | 1.804688 | 2 |
minimal_bot.py | ffreemt/nonebot-plugin-guess-game | 3 | 47657 | """Run a minimal bot."""
import nonebot
from nonebot.adapters.cqhttp import Bot
nonebot.init()
app = nonebot.get_asgi()
driver = nonebot.get_driver()
driver.register_adapter("cqhttp", Bot)
nonebot.load_builtin_plugins()
nonebot.load_plugins("nonebot_plugin_guess")
if __name__ == "__main__":
# nonebot.run()
... | 1.921875 | 2 |
auto/AppTester/page/page.py | Strugglingrookie/oldboy2 | 1 | 47658 | from lib.appController import driver_queue
from lib.pyapp import Pyapp
import threading
# driver 多线程运行是进行线程之间的数据隔离
local = threading.local()
# 配置在实例化时,去mq中获取创建好的driver,如果调试page则需要传递driver
class BasePage(object):
def __init__(self, driver=None):
if driver is None:
local.driver = driver_queue.g... | 2.78125 | 3 |
data/transcoder_evaluation_gfg/python/COUNT_PAIRS_TWO_SORTED_ARRAYS_WHOSE_SUM_EQUAL_GIVEN_VALUE_X_2.py | mxl1n/CodeGen | 241 | 47659 | <gh_stars>100-1000
# Copyright (c) 2019-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
#
def f_gold ( arr1 , arr2 , m , n , x ) :
count , l , r = 0 , 0 , n - 1
while ( l < m and r >= 0 ) :
... | 2.875 | 3 |
src/web/modules/dataservice/control.py | unkyulee/elastic-cms | 2 | 47660 |
def get(p):
if not p['operation']:
from .controllers import default
return default.get(p)
elif p["operation"] == "json":
from .controllers import json
return json.get(p)
elif p["operation"] == "create":
from .controllers import create
return create.get(p)
... | 2.71875 | 3 |
tkdet/structures/__init__.py | tkhe/tkdetection | 1 | 47661 | <reponame>tkhe/tkdetection
from .boxes import *
from .image_list import *
from .instances import *
from .keypoints import *
from .masks import *
| 1.09375 | 1 |
swift/common/ring/__init__.py | vvechkanov/SwiftUml | 1 | 47662 | <gh_stars>1-10
from ring import RingData, Ring
from builder import RingBuilder
__all__ = [
'RingData',
'Ring',
'RingBuilder',
]
| 1.28125 | 1 |
API.py | TheNovi/NoviCypher | 0 | 47663 | from NoviCypher import FileCypher
from os import path
import sys
Version = '1.0.0b'
def encode(p, r, k, c):
print(f"encoding {p}\nrows={r}\nkey={k}\nchunk={c}")
FileCypher(p, rows=r, chunk=c, key=k)
input()
def decode(p, k):
print(f"Decoding {p}\nkey={k}")
if not FileCypher.decrypt_file(p, k):
input()
ar... | 3.34375 | 3 |
IT/Model/User.py | LionKingzlq/DjangoDemo | 0 | 47664 | <<<<<<< HEAD
from django.db import models
class Person(models.Model):
first_name = models.CharField(max_length=30)
=======
from django.db import models
class Person(models.Model):
first_name = models.CharField(max_length=30)
>>>>>>> b6ed3cb0427fc3b30fe2f4b569908246cfec5690
last_name = models.CharField... | 2.796875 | 3 |
fellbeast/object_tracker.py | wolfenfeld/fellbeast | 0 | 47665 | from typing import List
import cv2
from fellbeast.bounding_box import BoundingBox
from fellbeast.configurations import CHECK_FOR_NEW_FACE_FREQUENCY
from fellbeast.utils import get_closest_coordinate
OPENCV_OBJECT_TRACKERS = {
"csrt": cv2.TrackerCSRT_create,
"kcf": cv2.TrackerKCF_create,
"boosting": cv2.T... | 2.28125 | 2 |
loans/urls.py | FAenX/micro-finance | 0 | 47666 | from django.conf.urls import url
from loans.views import *
urlpatterns = [
# Client Loans (apply, view, list)
url(r'^client/(?P<client_id>\d+)/loan/apply/$', ClientLoanApplicationView.as_view(), name='clientloanapplication'),
url(r'^client/(?P<client_id>\d+)/loans/list/$', ClientLoansListView.as_view(), na... | 1.898438 | 2 |
exactdiag_4site2particles/fh.py | PedroMDuarte/thesis-hubbard | 2 | 47667 | import numpy as np
class lattice():
"""Contains functions to help out calculate matrices
in the Fermi-Hubbard model"""
def __init__(self, xs,ys,zs):
'''The dimensions of the grid are given to initialize the lattice.
Recommended max of 4 sites, otherwise it can take too long to
... | 3.671875 | 4 |
zinnia/views/channels.py | zapier/django-blog-zinnia | 0 | 47668 | """Views for Zinnia channels"""
from django.views.generic.list import ListView
from zinnia.models.entry import Entry
from zinnia.settings import PAGINATION
class EntryChannel(ListView):
"""View for displaying a custom selection of entries
based on a search pattern, useful for SEO/SMO pages"""
query = ''
... | 2.265625 | 2 |
lib/rts/player/Camera.py | Korky/BlenderGameEngineExperiments | 1 | 47669 | from bge import logic, events, render
from mathutils import Vector
class mouseScroll:
def __init__ (self, cont):
#get Dependencies
self.cont = cont
self.camera = cont.owner
self.mouse = logic.mouse
x = render.getWindowWidth()//2
y = render.get... | 2.734375 | 3 |
tests/test_connection.py | miiklay/pymapd | 0 | 47670 | <reponame>miiklay/pymapd
import pytest
from mapd.ttypes import TColumnType, TTypeInfo
from pymapd import OperationalError, connect
from pymapd.cursor import Cursor
from pymapd.connection import _parse_uri, ConnectionInfo
from pymapd._parsers import ColumnDetails, _extract_column_details
class TestConnect(object):
... | 2.15625 | 2 |
tests/test_img_proc.py | lukelu0520/boxdetect | 43 | 47671 | <filename>tests/test_img_proc.py
import cv2
import numpy as np
import sys
sys.path.append(".")
sys.path.append("../.")
from boxdetect import config, img_proc
def DefaultConfig():
cfg = config.PipelinesConfig()
cfg.width_range = (25, 50)
cfg.height_range = (25, 50)
cfg.scaling_factors = [1.0]
cfg.w... | 2.40625 | 2 |
setup.py | tmeiczin/pyautomount | 0 | 47672 | <reponame>tmeiczin/pyautomount
#!/usr/bin/env python
from setuptools import setup, find_packages
from subprocess import Popen, PIPE
setup(
name='pyautomount',
version='1.0.0',
author=['<NAME>'],
author_email='<EMAIL>',
license='LICENSE',
url='https://github.com/tmeiczin/pyautomount',
downl... | 1.679688 | 2 |
magenta/models/svg_vae/svg_decoder_anypair_joint_vae_one_model.py | hologerry/magenta | 0 | 47673 | # Copyright 2020 The Magenta Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... | 1.90625 | 2 |
app/auth/views.py | fushouhai/flask_11_28 | 0 | 47674 | <filename>app/auth/views.py
from flask import render_template, redirect, request, url_for, flash, session, current_app
from flask_login import login_user, logout_user, login_required, \
current_user
from . import auth
from .. import db
from ..models import User
from ..email import send_email
from .forms import Logi... | 2.375 | 2 |
Panalyzer/TraceParser/csv2np_buffered.py | dashazhangdake/gem5test | 0 | 47675 | import csv
import numpy as np
import time
from pathlib import Path
from Panalyzer.utils.wr_extractor import wr_extractor
from Panalyzer.TraceParser.logic_masking import *
def arm32buffered_csv2np(fcsv, buffersize, num_reg):
detailded_info = {'wr': None, 'regval': None, 'tick': None, 'masking': None, ... | 2.703125 | 3 |
tests/remediations/test_aws_guardduty_create_detector.py | 0xdabbad00/aws-remediations | 3 | 47676 | <filename>tests/remediations/test_aws_guardduty_create_detector.py
from unittest import mock, TestCase
from boto3 import Session
from src.remediations.aws_guardduty_create_detector import AwsGuardDutyCreateDetector
class TestAwsGuardDutyCreateDetector(TestCase):
@mock.patch.object(Session, 'client')
def test... | 2.453125 | 2 |
betterLogger/formatter.py | GreenJon902/BetterLogger | 0 | 47677 | <reponame>GreenJon902/BetterLogger<filename>betterLogger/formatter.py
import copy
from logging import Formatter as _Formatter
from betterLogger import colors
from betterLogger import config
from betterLogger.format_funcs import colored_format
class Formatter(_Formatter):
def __init__(self, use_color=False):
... | 2.640625 | 3 |
project/search_info/apps.py | Kaiser-Zheng/Lawsuit_Searching_Platform | 0 | 47678 | <filename>project/search_info/apps.py
from django.apps import AppConfig
class SearchInfoConfig(AppConfig):
name = 'search_info'
| 1.320313 | 1 |
src/test_generator/ast_assertion.py | AAU-PSix/canary | 0 | 47679 | from typing import Any
from .ast_expression import Expression
from .ast_statement import Statement
class Assertion(Statement):
def __init__(self, actual: Expression, expected: Expression) -> None:
self._actual = actual
self._expected = expected
@property
def actual(self) -> Expression:
... | 2.9375 | 3 |
pyrt/radiation.py | kconnour/planetary_disort | 10 | 47680 | <reponame>kconnour/planetary_disort
"""The :code:`radiation` module contains data structures for holding the
radiation variables used in DISORT.
"""
import numpy as np
class IncidentFlux:
"""A data structure for holding the incident fluxes.
IncidentFlux creates scalars for the incident beam and isotropic flu... | 2.953125 | 3 |
src/core/src/tortuga/cli/tortugaCli.py | sutasu/tortuga | 33 | 47681 | # Copyright 2008-2018 Univa 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... | 2.125 | 2 |
scientificpaperoperations/papersearchengine/django_paper_search.py | michaelfaerber/paperhunter | 4 | 47682 | <filename>scientificpaperoperations/papersearchengine/django_paper_search.py
#-------------------------------------------------------------------------------
# Name: Research papers search engine
# Purpose: A search engine which can search different fields.
#
# Author: <NAME>
#
... | 2.828125 | 3 |
src/evaluation_system/model/user.py | FREVA-CLINT/Freva | 2 | 47683 | '''
.. moduleauthor:: <NAME> / estani
This module manages the abstraction of a user providing thus all information about him/her that
might be required anywhere else.
'''
import pwd
import os
import sys
from ConfigParser import SafeConfigParser as Config
from evaluation_system.misc import config, utils
from evaluation... | 3.09375 | 3 |
python/sortalgorithm/quickSort.py | Turingu/leetcode | 1 | 47684 | <gh_stars>1-10
#!/usr/bin/env python
# -*- coding: utf-8 -*-
class QuickSort:
"""
快速排序
"""
def __init__(self):
pass
def quicksort(self, nums):
if len(nums) == 1 or len(nums) == 0:
return nums
less = []
greater = []
middle_num = nums.pop()
... | 4.09375 | 4 |
autoprover/gp/model.py | nclab-admin/autoprover | 0 | 47685 | """
define model for gp
"""
# from threading import Thread
# from queue import Queue
from multiprocessing import Pool
from random import random, randint
from math import floor
import operator
from autoprover.gp.gene import Gene
from autoprover.gp.rule import GeneRule
from autoprover.gp.action import GeneAction
from aut... | 2.609375 | 3 |
dgts_base.py | amirhertz/dgst | 39 | 47686 | <gh_stars>10-100
from custom_types import *
import options as options
from process_data import mesh_utils
import models.factory as factory
from models.single_mesh_models import SingleMeshGenerator
from models.mesh_handler import MeshHandler, MeshInference, load_template_mesh
class DGTS:
def __init__(self, opt: U... | 1.945313 | 2 |
src/SegnetModel.py | JasonChu1313/Satellite-Segmentation | 1 | 47687 | <gh_stars>1-10
from Model import Model
from Config import Config
from math import ceil
import readfile
import customer_init
import numpy as np
import time
import datetime
import util
import os
import random
from tempfile import TemporaryFile
from customer_init import orthogonal_initializer
import tensorflow as tf
from ... | 2.078125 | 2 |
tests/dbshell/fake_client.py | jpmallarino/django | 61,676 | 47688 | import sys
sys.exit(1)
| 1.03125 | 1 |
pythonjs/runtime/builtins.py | bpmbank/PythonJS | 319 | 47689 | # PythonJS builtins
# by <NAME> and <NAME> - copyright 2013
# License: "New BSD"
pythonjs.configure( runtime_exceptions=False )
pythonjs.configure( direct_operator='+' )
pythonjs.configure( direct_operator='*' )
pythonjs.configure( direct_keys=True )
_PythonJS_UID = 0
inline('IndexError = function(msg) {this.message... | 2.171875 | 2 |
feedmapper/migrations/0001_initial.py | benwhalley/django-feedmapper | 0 | 47690 | # -*- coding: utf-8 -*-
# Generated by Django 1.11.15 on 2018-11-26 10:42
from __future__ import unicode_literals
from django.db import migrations, models
import jsonfield.fields
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(... | 1.734375 | 2 |
static/_source.py | Manazius/blacksmith-bot | 3 | 47691 | # coding: utf-8
# BlackSmith general configuration file
# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
# Jabber server to connect
SERVER = 'example.com'
# Connecting Port
PORT = 5222
# Jabber server`s connecting Host
HOST = 'example.com'
# Using TLS (True - to enable, False - to disable)
SECURE ... | 1.6875 | 2 |
config.py | jahosp/telegram-bot-startkit | 0 | 47692 | <reponame>jahosp/telegram-bot-startkit
BOT_TOKEN='write here your token' | 1.117188 | 1 |
adversarial_music_generator/tune_finder_interface.py | hq9000/adversarial-music-generator | 0 | 47693 | <filename>adversarial_music_generator/tune_finder_interface.py
from abc import abstractmethod, ABC
from typing import List
from adversarial_music_generator.find_tunes_task import FindTunesTask
from adversarial_music_generator.models.tune import Tune
class TuneFinderInterface(ABC):
@abstractmethod
def find_tu... | 2.4375 | 2 |
markdownreveal/tests/test_local.py | markdownreveal/markdownreveal | 30 | 47694 | """
Markdownreveal local module tests.
"""
import json
import time
from hashlib import sha1
from pathlib import Path
from shutil import rmtree
from tarfile import TarInfo
from tempfile import mkdtemp
import pytest
from markdownreveal.local import clean_tar_members
from markdownreveal.local import initialize_localdir
f... | 2.3125 | 2 |
src/ndn/app_support/light_versec/grammar.py | tianyuan129/python-ndn | 0 | 47695 | <reponame>tianyuan129/python-ndn
# -----------------------------------------------------------------------------
# This piece of work is inspired by Pollere' VerSec:
# https://github.com/pollere/DCT
# But this code is implemented independently without using any line of the
# original one, and released under Apache Lice... | 2.15625 | 2 |
aoc2020/day8.py | Satertek/adventofcode | 0 | 47696 | <reponame>Satertek/adventofcode<filename>aoc2020/day8.py
import copy
def run_program(commands, part1=False):
acc = 0
i=0
instruction_list = []
while True:
if i == len(commands):
print(f"Successful exit at line {i+1}")
break
if i > len(commands):
... | 2.9375 | 3 |
drink_partners/conftest.py | henriquebraga/drink-partners | 0 | 47697 | <filename>drink_partners/conftest.py
import asyncio
import pytest
from aiohttp.client_reqrep import ClientRequest
from simple_settings.utils import settings_stub
from yarl import URL
from drink_partners import app as _app
from drink_partners.contrib.mongo.client import MongoClient
@pytest.fixture(scope='session')
d... | 2.046875 | 2 |
download/__init__.py | Vinaypatil-Ev/wantas | 0 | 47698 | from .gdrive import download_from_gdrive_with_id | 1.15625 | 1 |
TOPSIS-ARNAV-101803005/__init__.py | arnav2236/xtff-topsis | 0 | 47699 | <filename>TOPSIS-ARNAV-101803005/__init__.py
#version no.
__version__ =1.0.0 | 0.996094 | 1 |