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 |
|---|---|---|---|---|---|---|
dolweb/urls.py | YggDrazil/DolphinWeb | 0 | 12773751 | from django.conf import settings
from django.conf.urls import patterns, include, url
from django.conf.urls.static import static
from django.contrib import admin
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
# Monkey patching ftw...
import dolweb.utils.monkey
admin.autodiscover()
urlpatterns = p... | 1.921875 | 2 |
alipay/aop/api/response/AlipayMarketingRecruitPlanQueryResponse.py | antopen/alipay-sdk-python-all | 213 | 12773752 | <reponame>antopen/alipay-sdk-python-all<gh_stars>100-1000
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.response.AlipayResponse import AlipayResponse
from alipay.aop.api.domain.RecruitEnrollRule import RecruitEnrollRule
class AlipayMarketingRecruitPlanQueryResponse(AlipayResponse):
... | 1.828125 | 2 |
main.py | ferizoozoo/Simple-brute-force-password-hacker | 0 | 12773753 | <reponame>ferizoozoo/Simple-brute-force-password-hacker
import sys
from password_checker import PasswordChecker
from client import Client
def main():
ip_address, port = sys.argv[1:3]
client = Client(ip_address, int(port))
password_checker = PasswordChecker(client)
password = password_checker.crack_pass... | 2.6875 | 3 |
cogs/commands/useful.py | scottwedge/Villager-Bot | 0 | 12773754 | <gh_stars>0
from discord.ext import commands
import discord
import arrow
from googlesearch import search
from random import choice
class Useful(commands.Cog):
def __init__(self, bot):
self.bot = bot
self.g = self.bot.get_cog("Global")
self.tips = ["Made by Iapetus11#6821 & TrustedMercury#1... | 2.765625 | 3 |
src/python/pants/backend/python/pex_util.py | AllClearID/pants | 0 | 12773755 | <filename>src/python/pants/backend/python/pex_util.py
# coding=utf-8
# Copyright 2016 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
u... | 2.453125 | 2 |
localite/api.py | stim-devices/dev-localite | 0 | 12773756 | <filename>localite/api.py<gh_stars>0
from localite.flow.mitm import start, kill
from localite.coil import Coil
| 1.21875 | 1 |
python/matrix/matrix.py | ropable/exercism | 0 | 12773757 | <filename>python/matrix/matrix.py
class Matrix:
def __init__(self, matrix_string: str):
# Split matrix_string into lines, split lines on whitespace and cast elements as integers.
self.matrix = [[int(j) for j in i.split()] for i in matrix_string.splitlines()]
def row(self, index: int) -> list[in... | 3.59375 | 4 |
setup.py | goyalankit/cgtop | 0 | 12773758 | from setuptools import setup
#from cgtop import __version__
setup(
name='cgtop',
version=0.0,
description='A cgroup resource viewer',
long_description=open('README.md').read(),
keywords='top for cgroups',
author='<NAME>',
author_email='<EMAIL>',
url='https://github.com/goyalankit/cgtop'... | 1.359375 | 1 |
security.py | alexhendra/Learn-Flask-RestFul | 0 | 12773759 | <gh_stars>0
from werkzeug.security import safe_str_cmp
from models.user import UserModel
# users = [
# User(1, 'bob', 'asdf')
# ]
# username_mapping = {
# 'bob': {
# 'id': 1,
# 'username': 'bob',
# 'password': '<PASSWORD>'
# }
# }
# userid_mapping = {
# 1: {
# 'id': 1,
... | 2.609375 | 3 |
src/smach_based_introspection_framework/online_part/smach_modifier/modify_user_sm.py | birlrobotics/smach_based_introspection_framework | 7 | 12773760 | import copy
import types
from smach_based_introspection_framework.online_part.framework_core.states import (
RollBackRecovery,
)
import introspection_execute
from smach_based_introspection_framework.online_part.robot_screen_visualization.setter import(
show_anomaly_detected,
show_everyhing_is_good,
)
def r... | 2.15625 | 2 |
mandarinizer.py | JackBDu/image-mandarinizer | 2 | 12773761 | <reponame>JackBDu/image-mandarinizer
#!/usr/bin/env python
# encoding=utf-8
# you need to install opencv before running the script import cv2
import sys # exit
import time # sleep
import argparse # argparse
try:
import cv2
except ImportError as error:
print "ImportError:", error.args[0]
sys.exit(1... | 2.875 | 3 |
rest_rpc/training/core/hypertuners/tune_interface.py | aimakerspace/synergos_rest | 0 | 12773762 | <gh_stars>0
#!/usr/bin/env python
####################
# Required Modules #
####################
# Generic/Built-in
import inspect
import os
from typing import Dict, List, Tuple, Union, Callable, Any
# Libs
import ray
from ray import tune
from ray.tune.ray_trial_executor import RayTrialExecutor
from ray.tune.suggest... | 1.796875 | 2 |
examples/NameTableGeneration.py | SavagePencil/RetroGraphicsToolkit | 8 | 12773763 | <gh_stars>1-10
import os
from PIL import Image
from rgtk.BitSet import BitSet
from rgtk.ColorEntry import ColorEntry
from rgtk.ColorRemap import ColorRemap
from rgtk.ColorRemapsIntoStagingPalettesEvaluator import ColorRemapsIntoStagingPalettesEvaluator
from rgtk.constraint_solver import ConstraintSolver
from rgtk.Ind... | 1.84375 | 2 |
convertme/fimi/fimi_writer.py | mikulatomas/convertme | 2 | 12773764 | from convertme import WriterInterface, Dataset
class FimiWriter(WriterInterface):
def write(self, dataset, output):
for row in dataset.bools:
attributes = []
for attribute, _ in enumerate(row):
if row[attribute]:
attributes.append(str(attribut... | 2.84375 | 3 |
twisted/websocket/test_ws_client.py | eigenphi/gcommon | 3 | 12773765 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# created: 2014-12-02
"""Demo and test program to verify WS server."""
import sys
from autobahn.twisted.websocket import WebSocketClientFactory
from autobahn.twisted.websocket import WebSocketClientProtocol
from twisted.internet import reactor
from twisted.python import log... | 2.578125 | 3 |
cookbook/migrations/0007_auto_20191226_0852.py | mhoellmann/recipes | 0 | 12773766 | <reponame>mhoellmann/recipes
# Generated by Django 3.0.1 on 2019-12-26 07:52
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('cookbook', '0006_recipe_image'),
]
operations = [
migrations.RenameField(
model_name='recipe',
... | 1.84375 | 2 |
koku/masu/apps.py | Vasyka/koku | 2 | 12773767 | #
# Copyright 2021 Red Hat Inc.
# SPDX-License-Identifier: Apache-2.0
#
"""Masu application configuration module."""
from django.apps import AppConfig
class MasuConfig(AppConfig):
"""Masu application configuration."""
name = "masu"
def ready(self):
"""Determine if app is ready on application sta... | 1.703125 | 2 |
electrumsv/wallet_database/cache.py | Breavyn/electrumsv | 0 | 12773768 | <filename>electrumsv/wallet_database/cache.py<gh_stars>0
"""
Due to database latency and concurrency problems that will result in race conditions, all access
needs to be authoritatively cached above the database. This also reduces the locking overhead as
there will be no reads or
"""
import threading
import time
from ... | 2.28125 | 2 |
8ball.py | Alex-Bydder/8-ball_Project | 1 | 12773769 | <filename>8ball.py<gh_stars>1-10
import random
# Responses to said usr_question
random_responses = ['Certainly', 'Likely', 'Possibly', 'Unlikely', 'Not going to happen', 'Most likely']
ran_num_response = random.randint(0, len(random_responses))
# What user asks
usr_question = (input('Ask a question: '))
# Ensuring t... | 3.609375 | 4 |
src/dataset.py | sulaimanvesal/vertebraeSegementation | 6 | 12773770 | <filename>src/dataset.py<gh_stars>1-10
"""
@Author: <NAME>
Date: Tuesday, 04, 2020
"""
import numpy as np
import cv2
import pandas as pd
from skimage.exposure import match_histograms
from matplotlib import pyplot as plt
from albumentations import (
PadIfNeeded,
HorizontalFlip,
VerticalFlip... | 2.25 | 2 |
deep500/frameworks/reference/custom_operators/python/sum_op.py | khoaideptrai/deep500 | 90 | 12773771 | <reponame>khoaideptrai/deep500
import numpy as np
from deep500.lv0.operators.operator_interface import CustomPythonOp
class SumOp(CustomPythonOp):
def __init__(self, input_descriptors, output_descriptors):
super(SumOp, self).__init__(input_descriptors, output_descriptors)
self._input_desc = input_d... | 2.375 | 2 |
utils_tests.py | DucAnhPhi/LinguisticAnalysis | 1 | 12773772 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon Jul 3 23:36:17 2017
Unit tests for utils.py
@author: duc
"""
import unittest
import utils as ut
from nltk.corpus import cmudict
def to_string(tokenized):
return " ".join(sum(tokenized, []))
class UtilTests(unittest.TestCase):
#------ test boo... | 3.359375 | 3 |
test/test_ex5.py | hemincong/MachineLearningExercise | 1 | 12773773 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import unittest
import numpy as np
import scipy.io
# Exercise 5 | Regularized Linear Regression and Bias-Variance
#
# Instructions
# ------------
#
# This file contains code that helps you get started on the
# exercise. You will need to complete the following funct... | 3.75 | 4 |
rgb.py | AlexandrShcherbakov/python_2019 | 2 | 12773774 | <gh_stars>1-10
Colors = {'snow': ('255', '250', '250'),
'ghostwhite': ('248', '248', '255'),
'GhostWhite': ('248', '248', '255'),
'whitesmoke': ('245', '245', '245'),
'WhiteSmoke': ('245', '245', '245'),
'gainsboro': ('220', '220', '220'),
'floralwhite': ('255', '250', '240'),
'FloralWhite': ('255', '250', '240'),
'old... | 1.171875 | 1 |
script/bitbucket-buildstatus-notifier.py | ydemetriades/codefresh-bitbucket-buildstatus | 0 | 12773775 | <gh_stars>0
#!/usr/bin/env python
import os
import requests
repo_owner = os.getenv('CF_REPO_OWNER')
repo_slug = os.getenv('CF_REPO_NAME')
repo_auth_user = os.getenv('BB_BSN_REPO_AUTH_USER')
repo_auth_password = os.getenv('BB_BSN_REPO_AUTH_PASSWORD')
if repo_auth_user is None:
print("Authentication User Environme... | 2.25 | 2 |
rubin_sim/maf/mafContrib/StarCounts/StarCounts/__init__.py | RileyWClarke/flarubin | 0 | 12773776 | <gh_stars>0
__all__ = ["abs_mag", "coords", "spec_type", "starcount", "starcount_bymass", "stellardensity"]
| 1.046875 | 1 |
advbench/lib/logging.py | constrainedlearning/advbench | 0 | 12773777 | from selectors import EpollSelector
from scipy import ma
import torch
from torch.cuda.amp import autocast
from advbench import attacks
from einops import repeat, rearrange
import torch.nn.functional as F
from tqdm import tqdm
from advbench.datasets import FFCV_AVAILABLE
class PerturbationEval():
def __init__(self... | 2.15625 | 2 |
bioindex/lib/index.py | massung/bioindex | 6 | 12773778 | <gh_stars>1-10
import concurrent.futures
import csv
import datetime
import functools
import logging
import orjson
import os
import os.path
import rich.progress
import sqlalchemy
import tempfile
import time
from .aws import invoke_lambda
from .s3 import list_objects, read_object, relative_key
from .schema import Schema... | 2.265625 | 2 |
activitysim/examples/example_marin/scripts/marin_fix.py | mxndrwgrdnr/activitysim | 85 | 12773779 | # remove some of the asim-style columns added by marin_work_tour_mode_choice.py
# so data input files look 'realistic' - and that work is done instaed by 'import_tours' annotation expression files
import os
import pandas as pd
import openmatrix as omx
input_dir = './data_3_marin'
output_dir = './data_3_marin/fix' # ... | 2.375 | 2 |
Python/Listas/Q1.py | Flavio-Varejao/Exercicios | 0 | 12773780 | '''
Faça um Programa que leia um vetor de 5 números inteiros e mostre-os.
'''
lista=[]
for numero in range(1,6):
lista.append(int(input("Digite um número: ")))
print(lista)
| 4 | 4 |
python3/forwardfinancing.py | ForwardFinancing/partner_api_client_samples | 0 | 12773781 | <filename>python3/forwardfinancing.py
import requests
import os
import json
import base64
# Get api_key from your environment variables
api_key = os.environ["FORWARD_FINANCING_API_KEY"]
# sample payload
body = {
"lead": {
"contacts_attributes": [
{
"first_name": "string",
"last_name": "str... | 2.296875 | 2 |
Raspberry-Pi/PWM colorful LED/PWM-colorful-LED.py | 5j54d93/NTOU-CS-Course-Works | 1 | 12773782 | import RPi.GPIO as GPIO
import time
import random
GPIO.setmode(GPIO.BOARD)
BTN_PIN = 11
BTN_PIN1 = 10
LED_PIN = 12
WAIT_TIME = 200
status = GPIO.LOW
GPIO.setup(BTN_PIN, GPIO.IN, pull_up_down = GPIO.PUD_UP)
# GPIO.setup(LED_PIN, GPIO.OUT, initial = status)
R_pin = 33 # R:33 號腳位(第 33 根 pin)
G_pin = ... | 3.140625 | 3 |
pyelong/api/hotel/__init__.py | DeanThompson/pyelong | 1 | 12773783 | # -*- coding: utf-8 -*-
from ..base import ApiBase
from .order import Order
from .data import Data
from .incr import Incr
__all__ = 'Hotel'
class Hotel(ApiBase):
_category = ''
def list(self, **kwargs):
"""酒店列表搜索,方法名:hotel.list
文档
~~~~
- http://open.elong.com/wiki/Hotel... | 2.59375 | 3 |
scripts/calibrate_dark_current.py | mjerrar/duo3d_ros | 5 | 12773784 | <filename>scripts/calibrate_dark_current.py
#!/usr/bin/python
# Copyright (c) 2016 AIT, ETH Zurich. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistributions of source code must re... | 1.257813 | 1 |
eyes_detect.py | kmranrg/FaceID | 2 | 12773785 | import cv2
eyeCascade = cv2.CascadeClassifier('haarcascade_eye.xml')
video_capture = cv2.VideoCapture(0)
while True:
ret,frame = video_capture.read()
gray = cv2.cvtColor(frame,cv2.COLOR_BGR2GRAY)
eyes = eyeCascade.detectMultiScale(gray,
scaleFactor=1.2,
minNeighbors=5,
minSize=(30,30))
for(x,y,w,h) in eyes... | 2.828125 | 3 |
ph5/utilities/validation.py | PIC-IRIS/PH5 | 21 | 12773786 | <reponame>PIC-IRIS/PH5
"""
common functions for validation
"""
import tables
import re
ERRORS = {'smodel': "Array_t_%(array)s:sensor_model=%(smodel)s",
'dmodel': "Array_t_%(array)s:das_model=%(dmodel)s",
'spr': "Array_t_%(array)s:sr=%(spr)s",
'sprm': "Array_t_%(array)s:srm=%(sprm)s",
... | 2.3125 | 2 |
tests/mlir/polybench/python/adi.py | chhzh123/heterocl | 0 | 12773787 | ###################################################################
# This implementation is based on the following papaer:
#
# <NAME> and <NAME>. Automatic data and computation
# decomposition on distributed# memory parallel computers.
# ACM Transactions on Programming Languages and Systems,
# 24(1):1–50, Jan. 2002... | 2.65625 | 3 |
Crawl/Code/com.vitan.test/maoyan_pool_csv.py | ivitan/LearnPython | 1 | 12773788 | <filename>Crawl/Code/com.vitan.test/maoyan_pool_csv.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 18-10-28 下午12:07
# @Author : Vitan
# @File : maoyan_pool_csv.py
import requests
import re
import pandas
from multiprocessing import Pool
from requests.exceptions import RequestException
def ... | 2.984375 | 3 |
Problem Set 0 - Student Version/college.py | MuhammeedAlaa/MI-Assignemnets | 0 | 12773789 | class Student:
def __init__(self, id: str, name: str) -> None:
self.id = id
self.name = name
class Course:
def __init__(self, id: str, name: str, hours: int, grades = None) -> None:
self.id = id
self.name = name
self.hours = hours
self.grades = grades or {}
... | 3.625 | 4 |
API/UtilsNGSIv1.py | IoTCrawler/PEP-Proxy | 0 | 12773790 | #
#Copyright Odin Solutions S.L. All Rights Reserved.
#
#SPDX-License-Identifier: Apache-2.0
#
import json
import uuid
#import os
from subprocess import Popen, PIPE
def processUri(uri):
try:
if(str(uri).upper().startswith("/v1".upper()) == False ):
uri = "/v1"+uri
return uri
e... | 2.5 | 2 |
football/teams.py | tbradshaw91/DS-OOP-Review | 0 | 12773791 | team_names = ['LA Chargers', 'LA Rams', 'NE Patriots', NY Giants', 'Chicago Bears']
| 1.242188 | 1 |
tests/scripts/script_test_gpu_1.py | mpelchat04/hypertrainer | 1 | 12773792 | import os
import time
vd = os.environ['CUDA_VISIBLE_DEVICES']
print(f'gpu_id={vd}')
num_gpus = len(vd.split(','))
if vd == '' or num_gpus != 1:
raise Exception('There must be one visible gpu.')
time.sleep(0.5)
| 2.921875 | 3 |
run.py | ShiChristineChen/CustomerClassification_RFM_python | 0 | 12773793 |
"""This program will focus on developing a program package for the application of RFM (Recency, Frequency, Monetary Value)
model and output the customer classification results into a new document.
Name: <NAME>
Date:28/05/2020
"""
from app.saver import Saver
if __name__ == '__main__':
saver = Saver()
saver.re... | 2.609375 | 3 |
src/eAsisitent_scraper/scraper.py | PingWasFun/eAsistent-scraper | 0 | 12773794 | <gh_stars>0
import bs4.element
import datetime
import re
import requests
import time
from bs4 import BeautifulSoup
def request_schedule(
school_id: str,
class_id=0,
professor=0,
classroom=0,
interest_activity=0,
school_week=0,
student_id=0,
soup=False,
... | 3.515625 | 4 |
src/test.py | myscience/ltts | 5 | 12773795 | <gh_stars>1-10
'''
This is the Learning Through Target Spikes (LTTS) repository for code associated to
the paper: <NAME>, <NAME>, <NAME> (2020)
"Target spike patterns enable efficient and biologically plausible learning for
complex temporal tasks*" (currently *under review*).
Please give credit to... | 2.703125 | 3 |
frappe-bench/env/lib/python2.7/site-packages/gocardless_pro/services/base_service.py | Semicheche/foa_frappe_docker | 0 | 12773796 | <filename>frappe-bench/env/lib/python2.7/site-packages/gocardless_pro/services/base_service.py
# WARNING: Do not edit by hand, this file was generated by Crank:
#
# https://github.com/gocardless/crank
#
import re
import time
from requests import Timeout, ConnectionError
from uuid import uuid4
from .. import list_re... | 1.882813 | 2 |
multienv/web_servers/web_server_definitions.py | sfelix-martins/laradock-up-env | 2 | 12773797 | <filename>multienv/web_servers/web_server_definitions.py
class WebServerDefinitions:
name = None
root = None
template = None
https = False
default_template = 'laravel'
def __init__(self, name, root, template=None, https=False):
self.name = name
self.root = root
self.http... | 1.945313 | 2 |
refinery/units/blockwise/pack.py | bronxc/refinery | 0 | 12773798 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import re
from typing import Iterable
from refinery.units.blockwise import Arg, BlockTransformationBase
from refinery.units.encoding.base import base as BaseUnit
from refinery.lib.argformats import number
from refinery.lib.patterns import formats
class pack(BlockTransfo... | 2.90625 | 3 |
dafipost/functional_test.py | UncleGoogle/dafipost | 0 | 12773799 | <filename>dafipost/functional_test.py
"""
User stories as a bunch of functional tests in a real webdriver.
"""
from selenium import webdriver
import pytest
@pytest.fixture
def browser():
browser = webdriver.Firefox()
yield browser
browser.quit()
@pytest.fixture
def host():
return 'http://localhost:... | 2.46875 | 2 |
file/delfiles.py | stormabq/python-examples | 1 | 12773800 | # Shows how to delete files
import glob
import os
from os import listdir
from os.path import isfile, join
def get_and_delete_symbol_files(path, symbol):
filenames = []
pattern = path + "/" + symbol + "-*.csv"
for name in glob.glob(pattern):
filenames.append(name)
for filename in filenames:
... | 3.15625 | 3 |
userbot/modules/multimemes.py | JoanLindo/BaianoBot-backup-sexo | 1 | 12773801 | # Copyright (C) 2020 MoveAngel and MinaProject
#
# Licensed under the Raphielscape Public License, Version 1.d (the "License");
# you may not use this file except in compliance with the License.
#
# Multifunction memes
#
# Based code + improve from AdekMaulana and aidilaryanto
import asyncio
import os
import random
im... | 1.789063 | 2 |
GraphRepr/GraphReprBase.py | olokshyn/Parallel-Regulations | 1 | 12773802 | <reponame>olokshyn/Parallel-Regulations
class GraphReprBase(object):
@staticmethod
def read_from_file(input_file):
raise NotImplemented()
| 1.796875 | 2 |
dpython/__init__.py | Ajoo/dpy | 0 | 12773803 | # -*- coding: utf-8 -*-
"""
Created on Sun Sep 4 17:31:30 2016
@author: Ajoo
"""
from .autodiff import *
from .dfloat import *
print('Initializing dpy...')
__all__ = autodiff.__all__ + dfloat.__all__
__version__ = '0.0.0'
__author__ = u'<NAME> <<EMAIL>>'
if __name__ == "__main__":
pass | 1.898438 | 2 |
terrascript/data/mailgun.py | amlodzianowski/python-terrascript | 0 | 12773804 | # terrascript/data/mailgun.py
import terrascript
__all__ = []
| 1 | 1 |
piecutter/engines/jinja.py | diecutter/piecutter | 2 | 12773805 | # -*- coding: utf-8 -*-
"""Jinja2 template engine."""
import os
import re
from jinja2 import Environment
from jinja2.exceptions import UndefinedError, TemplateSyntaxError
from piecutter.engines import Engine
from piecutter.exceptions import TemplateError
def path_join(*args, **kwargs):
"""Return ``args`` joined... | 2.640625 | 3 |
cognite/extractorutils/metrics.py | thomafred/python-extractor-utils | 0 | 12773806 | # Copyright 2020 Cognite AS
#
# 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 writ... | 2.140625 | 2 |
examples/dectree.py | tresoldi/multitiers | 0 | 12773807 | <gh_stars>0
from pathlib import Path
import multitiers
# Read data
source = Path(__file__).parent.parent / "resources" / "germanic.tsv"
data = multitiers.read_wordlist_data(source.as_posix(), comma=False)
# Build classifier
print("============ STUDY 1")
clf = multitiers.Classifier(data, models=["cv"], left=1, right=1... | 2.46875 | 2 |
setup.py | Parnassius/construct-typing | 16 | 12773808 | #!/usr/bin/env python
from setuptools import setup
version_string = "?.?.?"
exec(open("./construct_typed/version.py").read())
setup(
name="construct-typing",
version=version_string,
packages=["construct-stubs", "construct_typed"],
package_data={
"construct-stubs": ["*.pyi", "lib/*.pyi"],
... | 1.757813 | 2 |
src/skim/modeling/skim_attention/__init__.py | recitalAI/skim-attention | 4 | 12773809 | <reponame>recitalAI/skim-attention<filename>src/skim/modeling/skim_attention/__init__.py<gh_stars>1-10
from .configuration_skim import (
SkimformerConfig,
BertWithSkimEmbedConfig,
SkimmingMaskConfig,
)
from .configuration_longskim import (
LongSkimformerConfig
)
from .modeling_skim import (
Skimf... | 1.140625 | 1 |
tests/model_options/test_default_related_name.py | benjaoming/django | 2 | 12773810 | from django.test import TestCase
from .models.default_related_name import Author, Editor, Book
class DefaultRelatedNameTests(TestCase):
def setUp(self):
self.author = Author.objects.create(first_name="Dave", last_name="Loper")
self.editor = Editor.objects.create(name="Test Editions",
... | 2.6875 | 3 |
src/modularitydensity/metrics.py | ckmanalytix/modularity-density | 4 | 12773811 | # -*- coding: utf-8 -*-
# Copyright (c) CKM Analytix Corp. All rights reserved.
# Authors: <NAME> (<EMAIL>), <NAME> (<EMAIL>)
"""
Metrics for determining quality of community structure
"""
import numpy as np
from scipy.sparse import identity
__all__ = ['modularity_r', 'modularity_density', 'mula_modularity_density']... | 2.78125 | 3 |
EBOLA/Scripts/HMMSEIR_expanded.py | LorenzoRimella/Multinomial-Approximations-for-compartmental-models | 3 | 12773812 | import numpy as np
from scipy.stats import gamma as RVgamma
# the gamma distribution consider a varying shape parameter and a scale parameter equal to 1
class HMM_approxSEIR_expanded:
def __init__( self, N, beta, rho, gamma, q, eta_zero, q_r, t_star ):
self.N = N
self.beta = beta
... | 2.546875 | 3 |
fluent_pages/pagetypes/textfile/migrations/0002_add_translation_model.py | django-fluent/django-fluent-pages | 59 | 12773813 | from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [("textfile", "0001_initial")]
operations = [
migrations.CreateModel(
name="TextFileTranslation",
fields=[
(
"id",
models.Aut... | 1.984375 | 2 |
magnets/reduction/mod_reduction.py | meghnathomas/MAGNets | 2 | 12773814 | <gh_stars>1-10
import wntr
from magnets.reduction import build_g_matrix
from magnets.reduction import reinitialize
from magnets.utils.characteristics import *
from magnets.utils.call_on_functions import *
import warnings
def mod_reduction(wn, new_link_list, junc_dict, pipe_dict, unremovable_nodes, relations, nodes_to_... | 2.296875 | 2 |
molsysmt/element/molecule/get_molecule_index_from_atom.py | uibcdf/MolModMTs | 0 | 12773815 | <gh_stars>0
from molsysmt._private.exceptions import *
from molsysmt._private.digestion import *
import numpy as np
def get_molecule_index_from_atom(molecular_system, indices='all', check=True):
if check:
digest_single_molecular_system(molecular_system)
indices = digest_indices(indices)
from... | 2.421875 | 2 |
cookiedjango/twitter/models.py | shanenater/shanecookie | 0 | 12773816 | from django.db import models
from cookiedjango.core.models import TimeStampedModel
class TwitterPost(TimeStampedModel):
tag = models.CharField(max_length=140)
text = models.TextField()
| 2.3125 | 2 |
src/model/GCN.py | Zeyuzhao/DeepKidney | 1 | 12773817 | import torch
import torch.nn.functional as F
import torch.nn as nn
from torch.nn import BatchNorm1d
from torch_geometric.nn import GCNConv, GraphConv, GATConv, GatedGraphConv
from torch_geometric.utils import add_remaining_self_loops, add_self_loops
class BasicNet(torch.nn.Module):
def __init__(self):
s... | 2.71875 | 3 |
examples/gui/ReFlowClient.py | whitews/ReFlowRESTClient | 0 | 12773818 | <reponame>whitews/ReFlowRESTClient
import Tkinter
import ttk
import tkMessageBox
import tkFileDialog
import tkFont
from PIL import Image, ImageTk
import json
import re
import sys
import os
import calendar
from threading import Thread
from exceptions import TypeError
import reflowrestclient.utils as rest
import flowio
... | 2.21875 | 2 |
test-integration/test_integration/fixtures/complex-output-project/predict.py | dashstander/cog | 0 | 12773819 | <reponame>dashstander/cog
from pydantic import BaseModel
from cog import BasePredictor
class Output(BaseModel):
hello: str
goodbye: str
class Predictor(BasePredictor):
def predict(self, name: str) -> Output:
return Output(
hello="hello " + name,
goodbye="goodbye " + name... | 2.8125 | 3 |
api/kiln_share/__init__.py | jim8786453/kiln_share | 1 | 12773820 | <gh_stars>1-10
# -*- coding: utf-8 -*-
import json
import os
from copy import deepcopy
from eve import Eve
from eve.auth import TokenAuth
from eve_swagger import swagger, add_documentation
from flask import current_app as app, abort, request
from kiln_share import settings
from kiln_share.storage import GridFSImage... | 2.265625 | 2 |
contentcuration/contentcuration/migrations/0120_auto_20210128_1646.py | d0sadata/studio | 60 | 12773821 | # -*- coding: utf-8 -*-
# Generated by Django 1.11.29 on 2021-01-28 16:46
from __future__ import unicode_literals
import contentcuration.models
from django.db import migrations, models
import django.db.models.functions.text
class Migration(migrations.Migration):
dependencies = [
('contentcuration', '011... | 1.890625 | 2 |
examples/gto/00-input_mole.py | robert-anderson/pyscf | 2 | 12773822 | #!/usr/bin/env python
'''
Initialize a molecular system.
There are many methods to define/initialize a molecule. This example presents
three methods to create/initialize the molecular object. Mole object is a
Python object. You can initialize the Mole object using any methods supported
by Python.
See also
pyscf/... | 4.375 | 4 |
post.py | botarsiv/arsiv | 0 | 12773823 | import uuid
from aiogram.utils.callback_data import CallbackData
POSTS = {
str(uuid.uuid4()): {
'title': f'Grup Yönetimi\n',
'body': '\n@Combot \n@MissRose_bot \n@baymax_en_bot',
}
}
posts_cb = CallbackData('post','id', 'action')
| 2.15625 | 2 |
async_gsm_modem/quectel_ec25/constants.py | Sinusoidal36/async-gsm-modem | 4 | 12773824 |
STATUS_MAP = {
'RECEIVED_UNREAD': b'0',
'RECEIVED_READ': b'1',
'STORED_UNSENT': b'2',
'STORED_SENT': b'3',
'ALL': b'4'
}
STATUS_MAP_R = {
b'0': 'RECEIVED_UNREAD',
b'1': 'RECEIVED_READ',
b'2': 'STORED_UNSENT',
b'3': 'STORED_SENT',
b'4': 'ALL'
}
DELETE_FLAG = {
'ALL_READ': b... | 1.445313 | 1 |
responsibly/tests/test_we.py | staeiou/responsibly | 48 | 12773825 | <gh_stars>10-100
"""Unit test module for responsibly.we"""
# pylint: disable=redefined-outer-name,unused-variable,expression-not-assigned,singleton-comparison,protected-access
import copy
from math import isclose
import numpy as np
import pytest
from responsibly.consts import RANDOM_STATE
from responsibly.tests.data... | 2.5 | 2 |
pycopula/estimation.py | merz9b/pycopula | 71 | 12773826 | <gh_stars>10-100
import numpy as np
from scipy.optimize import minimize, minimize_scalar
def cmle(log_lh, theta_start=0, theta_bounds=None, optimize_method='Nelder-Mead', bounded_optimize_method='SLSQP', is_scalar=False):
"""
Computes the CMLE on a specified log-likelihood function.
Parameters
----------
log_l... | 2.921875 | 3 |
src/rbvfit/rb_setline.py | manoranjan-s/rbvfit | 2 | 12773827 | from __future__ import print_function, absolute_import, division, unicode_literals
import numpy as np
from astropy.io import ascii
from pkg_resources import resource_filename
'''
Function to read in atomic line information for a given rest frame wavelength.
Or
For the line matching the ... | 3.03125 | 3 |
alfworld/utils.py | zhaozj89/alfworld_meta_dqn | 42 | 12773828 | <reponame>zhaozj89/alfworld_meta_dqn
import os
def mkdirs(dirpath: str) -> str:
""" Create a directory and all its parents.
If the folder already exists, its path is returned without raising any exceptions.
Arguments:
dirpath: Path where a folder need to be created.
Returns:
Path to... | 3.625 | 4 |
src/shape_constraint_detectors/TargetNodeTargetDetector.py | IDLabResearch/lovstats | 1 | 12773829 | <reponame>IDLabResearch/lovstats
from utils.RestrictionTypeDetector import RestrictionTypeDetector
from utils.RestrictionTypeDetector import TYPE_INT
from utils.RestrictionTypeDetector import MEASURE_OCCURRENCE
class TargetNodeTargetDetector(RestrictionTypeDetector):
"""
This class serves as interface for all... | 2.640625 | 3 |
src/correr_modelo.py | osim-microgrid-tool/osim_islanded_microgrids_sizing | 2 | 12773830 | <reponame>osim-microgrid-tool/osim_islanded_microgrids_sizing
import gurobipy
import warnings
import pyomo.environ as pyo
from pyomo.opt import *
import sys
warnings.filterwarnings("ignore")
from time import time
import os
def correr_modelo(model=None, gap=None, time_limit=None, experimento=None):
"""Correr el mo... | 2.21875 | 2 |
scripts/plot_vorticity.py | rohitsupekar/active_matter_spheres | 1 | 12773831 | <gh_stars>1-10
print('starting')
import numpy as np
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
from mpl_toolkits.basemap import Basemap, shiftgrid
from matplotlib import cm, colors
import sphere as sph
import equations as eq
from mpi4py... | 2.28125 | 2 |
POP3Drop.py | andrewksimon/POP3Drop | 0 | 12773832 | <filename>POP3Drop.py
# This script had been written by <NAME>.
# This scrip was written on 09/06/2018
# The purpose of this script is to delete messages on a POP3 server (especially if they are in large quantities).
# Import statements
import poplib # POP3 Manipulation library
# Defines environment variables
user = ... | 3.09375 | 3 |
accounting_integrations/allauth/providers/fylein/views.py | fylein/fyle-accounting-integrations | 1 | 12773833 | from fylesdk import FyleSDK
from django.conf import settings
from allauth.socialaccount.providers.oauth2.views import (
OAuth2Adapter,
OAuth2CallbackView,
OAuth2LoginView,
)
from accounting_integrations.allauth.providers.fylein.provider import FyleProvider
class FyleOAuth2Adapter(OAuth2Adapter):
prov... | 1.96875 | 2 |
2017/round_1c/ample_syrup.py | laichunpongben/CodeJam | 0 | 12773834 | #!/usr/bin/env python
# Google Code Jam
# Google Code Jam 2017
# Round 1C 2017
# Problem A. <NAME>
# Solved small test set
from __future__ import print_function, division
import math
import itertools
def get_k_highest_pancakes(n_pancakes, k):
n_pancakes = sorted(n_pancakes, key=lambda x: -x[1])
return n_pa... | 3.375 | 3 |
utilities/file.py | IOTECH-Donegal/NMEA | 0 | 12773835 | <reponame>IOTECH-Donegal/NMEA
from datetime import datetime
import sys, csv
def path_name():
# Operating system dependent stuff
this_os = sys.platform
if this_os == 'win32':
return './logfiles/'
elif this_os == 'linux':
return '/home/pi/logfiles/'
else:
print(f'Unsupported ... | 2.734375 | 3 |
tests/hq_mock.py | SrihariThalla/seesaw-kit | 49 | 12773836 | '''Mocks Warrior HQ.'''
import tornado.web
class RegisterHandler(tornado.web.RequestHandler):
def initialize(self, **kwargs):
pass
def post(self):
self.write({
'warrior_id': 'test-warrior-id',
})
class UpdateHandler(tornado.web.RedirectHandler):
def initialize(self, ... | 2.359375 | 2 |
archive/archive/circular_buffer.py | walchko/the-collector | 0 | 12773837 | <reponame>walchko/the-collector
##############################################
# The MIT License (MIT)
# Copyright (c) 2017 <NAME>
# see LICENSE for full details
##############################################
#
# class CircularBuffer(object):
# def __init__(self, size, mmax=100.0, mmin=0.0):
# """initiali... | 2.875 | 3 |
iceworm/engine/connectors/base.py | wrmsr0/iceworm | 0 | 12773838 | <reponame>wrmsr0/iceworm
"""
TODO:
- virtual vs physical tables
- physical tables requiring refresh
- incremental vs total physical tables
- materialized vs unmaterialized virtuals
- ** dataclass interop ** - dc->tbl, query
- just return object refs? jsonize?
- support snowflake json garbage on objects
- piec... | 1.945313 | 2 |
tests/test_ops/test_correlation.py | BIGWangYuDong/mmcv | 1 | 12773839 | # Copyright (c) OpenMMLab. All rights reserved.
import pytest
import torch
from mmcv.ops import Correlation
_input1 = [[[[1., 2., 3.], [0., 1., 2.], [3., 5., 2.]]]]
_input2 = [[[[1., 2., 3.], [3., 1., 2.], [8., 5., 2.]]]]
gt_out_shape = (1, 1, 1, 3, 3)
_gt_out = [[[[[1., 4., 9.], [0., 1., 4.], [24., 25., 4.]]]]]
gt_... | 2.171875 | 2 |
Project/Final-Code/Graph Downloader.py | Connectomics-Classes/pseudocoelomates | 0 | 12773840 | import os
from urllib2 import urlopen, URLError, HTTPError
import lxml.html
from graphml2mat import graphml2mat
"""
Returns a list of all links at a given url string.
"""
def link_crawler(url):
connection = urlopen(url)
domain = lxml.html.fromstring(connection.read())
url_list = []
for link in ... | 3.421875 | 3 |
flask_maple/lazy.py | honmaple/flask-maple | 9 | 12773841 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# **************************************************************************
# Copyright © 2016 jianglin
# File Name: lazy.py
# Author: jianglin
# Email: <EMAIL>
# Created: 2016-11-08 23:02:24 (CST)
# Last Update: Wednesday 2018-09-26 10:52:51 (CST)
# By:
# Descrip... | 2.203125 | 2 |
api/serializers.py | themontem/EverPoll-api | 0 | 12773842 | import time
from datetime import datetime
from django.contrib.auth import authenticate
from django.contrib.auth.models import User
from django.utils import timezone
from django.utils.translation import ugettext_lazy as _
from rest_framework import serializers, exceptions
from .models import *
def time_ago_in_words(... | 2.765625 | 3 |
gbf_bot/battle_result.py | mythnc/gbf-bot | 4 | 12773843 | <reponame>mythnc/gbf-bot
import logging
from os.path import join
import random
import sys
import time
import pyautogui
from .constants import images_dir, battle_result_config as config
from .components import Button, AppWindow
logger = logging.getLogger(__name__)
result_ok = Button("ok1.png", config["result ok"])
to... | 2.203125 | 2 |
CODES/webserver.py | PacktPublishing/Raspberry-Pi-Essentials-Learn-More-in-Less-Time | 3 | 12773844 | from flask import Flask
#import json
import RPi.GPIO as GPIO
GPIO.setwarnings(False) # Ignore warning for now
GPIO.setmode(GPIO.BCM) # Use physical pin numbering
GPIO.setup(21, GPIO.OUT, initial=GPIO.LOW)
app = Flask(__name__)
@app.route("/")
def hello():
return "Lets Have a Party"
@app.route("/<key>")
def... | 3.046875 | 3 |
DVDR_Client-master/client/alcohol_sensor.py | unimelb-networkedsociety/ser-pi | 0 | 12773845 | import time
import grovepi
#grovepi.pinMode(heaterSelPin,"OUTPUT")
def read_sensor():
try:
analogInDatPin = 0
heaterSelPin = 15
sensorValue = 0
RS_air = 0
grovepi.digitalWrite(heaterSelPin, 0)
time.sleep(0.1)
#/*--- Get a average data by testing 1... | 3.140625 | 3 |
demo-led/led-gateway/repo/web_viewer/viewer.py | isandlaTech/cohorte-demos | 1 | 12773846 | <reponame>isandlaTech/cohorte-demos
#!/usr/bin/python
from pelix.ipopo.decorators import ComponentFactory, Provides, Requires, Property, \
BindField, UnbindField
import pelix.remote
import os
import json
import time
import uuid
import logging
_logger = logging.getLogger("viewer.viewer")
@ComponentFactor... | 2.015625 | 2 |
pydemic/models/model.py | GCES-Pydemic/pydemic | 0 | 12773847 | import datetime
import warnings
from copy import copy
from types import MappingProxyType
from typing import Sequence, Callable, Mapping, Union, TypeVar, TYPE_CHECKING
import numpy as np
import pandas as pd
import sidekick as sk
from .clinical_acessor import Clinical
from .metaclass import ModelMeta
from .. import fit... | 1.90625 | 2 |
DeepCode.py | nexfreak07/Mask-Detector | 1 | 12773848 | <reponame>nexfreak07/Mask-Detector
#Data Preprocessing
#--------------------- Importing the Libraries-----------------------------
from tensorflow.keras.preprocessing.image import ImageDataGenerator
from tensorflow.keras.applications import MobileNetV2
from tensorflow.keras.layers import AveragePooling2D
from... | 2.953125 | 3 |
stemdl/runtime.py | nlaanait/stemdl | 0 | 12773849 | <filename>stemdl/runtime.py<gh_stars>0
"""
Created on 10/9/17.
@author: <NAME>, <NAME>
email: <EMAIL>, <EMAIL>
"""
import time
from datetime import datetime
import os
import sys
import re
import numpy as np
import math
from itertools import chain
from multiprocessing import cpu_count
from copy import deepcopy
#TF
imp... | 1.945313 | 2 |
tests/factories.py | lisac-usds/dsnap_rules | 4 | 12773850 | <reponame>lisac-usds/dsnap_rules<gh_stars>1-10
import factory
from dsnap_rules import models
class DisasterFactory(factory.django.DjangoModelFactory):
class Meta:
model = 'dsnap_rules.Disaster'
disaster_request_no = factory.Faker('pystr')
title = factory.Faker('pystr')
state = factory.Iterat... | 2.09375 | 2 |