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 |
|---|---|---|---|---|---|---|
kats/tests/models/test_harmonic_regression.py | ottertune/ottertune-kats | 0 | 12787551 | # Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import os
import unittest
from unittest import TestCase
import pkgutil
import io
import numpy as np
import pandas as pd
from kats.consts import... | 2.546875 | 3 |
erdospy/test/__init__.py | NiMlr/erdospy | 0 | 12787552 | <gh_stars>0
from .tests import testall
| 1.015625 | 1 |
src/mlspace/scripts/__init__.py | abhishekkrthakur/mlspace | 283 | 12787553 | from .base import script as base_script
from .install_docker import script as install_docker
from .install_nvidia_docker import script as install_nvidia_docker
from .install_nvidia_drivers import script as install_nvidia_drivers
| 1.007813 | 1 |
scripts/optimize_latent/optimize_cifar10.py | bg459/gan-ensembling-loader | 86 | 12787554 | import argparse
import torch
import numpy as np
import os
import data
from networks import domain_generator, domain_classifier
from utils import util
def optimize(opt):
dataset_name = 'cifar10'
generator_name = 'stylegan2-cc' # class conditional stylegan
transform = data.get_transform(dataset_name, 'imv... | 2.296875 | 2 |
ramda/zip_with_test.py | Rafi993/pyramda | 56 | 12787555 | from .zip_with import zip_with
from ramda.private.asserts import assert_iterables_equal
def add(a, b):
return a + b
def uniq_nocurry_test():
assert_iterables_equal(zip_with(add, [1, 1, 1], [1, 2, 3]), [2, 3, 4])
def take_curry_test():
assert_iterables_equal(zip_with(add)([1, 1, 1], [1, 2, 3]), [2, 3, ... | 2.578125 | 3 |
regMRAToMRI.py | KitwareMedical/TubeTK-pypbm | 6 | 12787556 | <filename>regMRAToMRI.py
"""regMRAToMRI.py
"""
__license__ = "Apache License, Version 2.0"
__author__ = "<NAME>, Kitware Inc., 2013"
__email__ = "E-Mail: <EMAIL>"
__status__ = "Development"
import os
import sys
import subprocess
from optparse import OptionParser
from core import regtools
import pickle
def us... | 2.453125 | 2 |
anprx/plot.py | ppintosilva/anprx | 6 | 12787557 | ################################################################################
# Module: plot.py
# Description: Plot functions
# License: Apache v2.0
# Author: <NAME>
# Web: https://github.com/pedroswits/anprx
################################################################################
import math
import adjustT... | 2.25 | 2 |
1.py | gewplay/e5 | 9 | 12787558 | <filename>1.py
# -*- coding: UTF-8 -*-
from os import lseek
import requests as req
import json,sys,time
#先注册azure应用,确保应用有以下权限:
#files: Files.Read.All、Files.ReadWrite.All、Sites.Read.All、Sites.ReadWrite.All
#user: User.Read.All、User.ReadWrite.All、Directory.Read.All、Directory.ReadWrite.All
#mail: Mail.Read、Mail.ReadWrite... | 2.40625 | 2 |
pytrol/control/Ananke.py | mothguib/pytrol | 0 | 12787559 | <filename>pytrol/control/Ananke.py<gh_stars>0
# -*- coding: utf-8 -*-
import pickle
import networkx as nx
import numpy as np
import pytrol.util.misc as misc
from pytrol.control.Communicating import Communicating
from pytrol.control.agent.Agent import Agent
from pytrol.control.agent.MAPTrainerModelAgent import MAPTra... | 2.71875 | 3 |
tests/test_urls.py | adriangrepo/mathsonmars | 0 | 12787560 | #! ../env/bin/python
# -*- coding: utf-8 -*-
import sys
print("TestURLs sys.path: {0}".format(sys.path))
import unittest
from mathsonmars.models import db, User, Role
from mathsonmars import create_app
from mathsonmars.constants.modelconstants import RoleTypes, DefaultUserName
import logging
logging.basicConfig(level... | 2.328125 | 2 |
Pacote Dowload/Pyhton3/Maiores de Idade.py | JoaoVictorDeCastro/Python3 | 0 | 12787561 | from datetime import date
maior = 0
menor = 0
for c in range(1, 8):
ano = int(input('Digite o ano de nascimento: '))
if date.today().year - ano >= 18:
maior += 1
else:
menor += 1
print('Das sete pessoas digitadas {} são MAIORES DE IDADE.' .format(maior))
print('As outras {} pessoas são MENOR... | 4 | 4 |
resources.py | ostash-group/GeneticPlotter | 3 | 12787562 | # -*- coding: utf-8 -*-
# Resource object code
#
# Created by: The Resource Compiler for PyQt5 (Qt v5.9.1)
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore
qt_resource_data = b"\
\x00\x00\xe5\x76\
\x47\
\x49\x46\x38\x39\x61\xb3\x00\xa2\x00\xd5\x22\x00\xf4\xf4\xf4\xf3\
\xf3\xf3\xc3\xc... | 0.980469 | 1 |
server/tests/test_leds.py | jeffeb3/sandypi | 0 | 12787563 | <reponame>jeffeb3/sandypi
from server.hw_controller.leds.leds_driver import LedsDriver
def test_led_driver_error():
try:
ld = LedsDriver()
except:
assert(True)
def test_led_driver():
try:
ld = LedsDriver((30,20))
assert(True)
except:
assert(False)
| 2.203125 | 2 |
Warm Up: Machine Learning with a Heart/Python approach (Random Forest).py | RenXie/Drivendata | 0 | 12787564 | <gh_stars>0
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns #for plotting
from sklearn.ensemble import RandomForestClassifier #for the model
from sklearn.tree import DecisionTreeClassifier
from sklearn.tree import export_graphviz #plot tree
from sklearn.metrics import... | 2.484375 | 2 |
couchbase_mapping/tests/design.py | hdmessaging/couchbase-mapping-python | 1 | 12787565 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2008 <NAME>
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution.
import doctest
import unittest
from couchbase_mapping import design
from couchbase_mapping.tests import testutil
... | 2.171875 | 2 |
src/algorithms/main/sorts/heap_sort.py | JoelGRod/Algorithms-py | 0 | 12787566 | <filename>src/algorithms/main/sorts/heap_sort.py<gh_stars>0
"""
Heapsort
A comparison-based sorting algorithm. Heapsort can be thought
of as an improved selection sort: like that algorithm, it divides its
input into a sorted and an unsorted region, and it iteratively shrinks
the unsorted region by extracting the l... | 3.484375 | 3 |
tkinter/tk-stopwatch.pyw | rsmith-nl/python-examples | 0 | 12787567 | <filename>tkinter/tk-stopwatch.pyw
#!/usr/bin/env python3
# file: tk-stopwatch.pyw
# vim:fileencoding=utf-8:fdm=marker:ft=python
#
# Copyright © 2020 <NAME> <<EMAIL>>.
# SPDX-License-Identifier: MIT
# Created: 2020-04-16T22:14:50+0200
# Last modified: 2022-02-04T16:37:22+0100
"""Example tkinter script showing use of th... | 3.75 | 4 |
absynthe/cfg/graph.py | chaturv3di/absynthe | 6 | 12787568 | <filename>absynthe/cfg/graph.py
from __future__ import print_function
from sys import stderr
from typing import TextIO, List, Tuple
from .node import Node
from random import randint
class Graph(object):
"""
The Graph class. Can have multiple root nodes; and it suffices
for objects of this class to only k... | 3.859375 | 4 |
tests/examples/test_nwchem_pymatgen.py | nkeilbart/aiida-nwchem | 1 | 12787569 | #!/usr/bin/env runaiida
# -*- coding: utf-8 -*-
###########################################################################
# Copyright (c), The AiiDA team. All rights reserved. #
# This file is part of the AiiDA code. #
# ... | 1.726563 | 2 |
bot_group_only.py | PushDotGame/telegram-forward-bot | 1 | 12787570 | <reponame>PushDotGame/telegram-forward-bot<gh_stars>1-10
from libs import shell
from libs import config_bot as config
from libs.MQBot import MQBot
from libs.group import handlers
from telegram.ext import Updater
def main():
# bot
bot = MQBot(token=config.BOT_TOKEN)
# updater
updater = Upd... | 2.453125 | 2 |
realsense_examples/launch/template.launch.py | getsomatic/ros2_intel_realsense | 0 | 12787571 | <reponame>getsomatic/ros2_intel_realsense<filename>realsense_examples/launch/template.launch.py
import os
from ament_index_python.packages import get_package_share_directory
from launch import LaunchDescription
from launch.actions import DeclareLaunchArgument
from launch_ros.actions import Node
from launch.substitutio... | 2.078125 | 2 |
chatbot_nlu/extractors/bert_bilstm_crf_entity_extractor.py | charlesXu86/Chatbot_NLU | 6 | 12787572 | # -*- coding: utf-8 -*-
'''
@Author : Xu
@Software: PyCharm
@File : bert_bilstm_crf_entity_extractor.py
@Time : 2019-09-26 11:09
@Desc :
'''
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
... | 1.882813 | 2 |
lib/pipefunc.py | kei-iketani/plex | 153 | 12787573 | <reponame>kei-iketani/plex<gh_stars>100-1000
#*********************************************************************
# content = common functions
# version = 0.1.0
# date = 2019-12-01
#
# license = MIT <https://github.com/alexanderrichtertd>
# author = <NAME> <<EMAIL>>
#************************************... | 2.40625 | 2 |
torchimagefilter/filter.py | pmeier/torchimagefilter | 0 | 12787574 | <gh_stars>0
from typing import Optional, Tuple, List
from copy import copy
import numpy as np
import torch
from torch import nn
from torch.nn.functional import conv2d, pad
from .kernel import *
class ImageFilter(nn.Module):
def __init__(
self,
kernel: torch.Tensor,
output_shape: str = "sam... | 2.453125 | 2 |
SigProfilerExtractor/version.py | david-a-parry/SigProfilerExtractor | 1 | 12787575 | <reponame>david-a-parry/SigProfilerExtractor
# THIS FILE IS GENERATED FROM SIGPROFILEREXTRACTOR SETUP.PY
short_version = '1.1.4'
version = '1.1.4'
Update = 'Heirarchy option deleted, clustering deleted and signatures orders by the mutation burden'
| 0.695313 | 1 |
tests/services/conftest.py | javi-cortes/gigaupload | 0 | 12787576 | <gh_stars>0
import pathlib
import uuid
import pytest
from app.schemas import FileQuery
from app.services.file import FileService
@pytest.fixture()
def file_service(db):
return FileService(db)
@pytest.fixture(scope="session")
def file():
return open("tests/files_stub/test_file", "wb")
@pytest.fixture(sco... | 2.09375 | 2 |
umb/admin/forms.py | LuckyWirasakti/umb | 0 | 12787577 | <reponame>LuckyWirasakti/umb
from umb.admin.models import Master, Weight
from django import forms
class WeightForm(forms.ModelForm):
class Meta:
model = Weight
fields = '__all__'
class MasterForm(forms.ModelForm):
class Meta:
model = Master
fields = '__all__'
def __init__... | 1.914063 | 2 |
fast/FAST/FAST.py | yagweb/pyfast | 0 | 12787578 | <filename>fast/FAST/FAST.py
# -*- coding: utf-8 -*-
"""
Created on Mon Dec 01 20:49:10 2014
@author: YangWenguang
Issues contact with: <EMAIL>
os.popen: 返回值是一个开放的文件对象连接到管道,可读写模式是根据是否为'r'(预设)或'w'。
"""
import os
import numpy as np
import matplotlib.pylab as plt
import scipy.io as spio
import scipy.signal as spsignal
fro... | 1.914063 | 2 |
model.py | GuanLab/sepsis | 7 | 12787579 | <filename>model.py
import lightgbm as lgb
import numpy as np
def lightgbm_train(train_data, train_label):
"""
params:
train_data: Numpy array
train_label: Numpy array
yields:
gbm
"""
lgb_train = lgb.Dataset(np.asarray(train_data), np.asarray(train_label))
params = {
... | 2.859375 | 3 |
pacote-download/Python/modulo01/python01ex/ex049.py | fabiosabariego/curso-python | 0 | 12787580 | <reponame>fabiosabariego/curso-python
"""
Refaça o desafio 9, mostrando a tabuada do numero que o usuário escolher, só que faça com for
"""
res = 0
num = int(input('Digite um numero: '))
print('=' * 20)
print('A Tabuada do {} é:'.format(num))
print('=' * 20)
for c in range(1, 11):
res = num * c
print('{} x {} =... | 4.03125 | 4 |
flexlab/drivers/primary_chiller.py | rongxinyin/HIL-Sim | 0 | 12787581 | <gh_stars>0
from driver import Driver, pd, np, datetime
import logging
from flexlab.drivers.modbus_driver import Modbus_Driver
class Primary_Chiller(Driver):
def __init__(self, config_file="read_data_config.yaml"):
logging.basicConfig(format='%(asctime)s %(levelname)s:%(message)s', level=logging.INFO)
... | 2.375 | 2 |
ssi.py | NingAnMe/extraterrestrial-solar-radiation | 0 | 12787582 | <gh_stars>0
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 2020-04-01 15:10
# @Author : NingAnMe <<EMAIL>>
from dateutil.relativedelta import relativedelta
import numpy as np
G0_Correct = 0.75 # 使用G0订正Itol的系数
ER_TXT = 'er.txt'
EP_TXT = 'ep.txt'
def cos(x):
return np.cos(np.radians(x))
def sin(x... | 2.84375 | 3 |
tests/broken_pickle.py | Kyle-Kyle/angr | 6,132 | 12787583 | <reponame>Kyle-Kyle/angr<gh_stars>1000+
import pickle
import angr
import nose
def test_pickle_state():
b = angr.Project("/home/angr/angr/angr/tests/blob/x86_64/fauxware")
p = b.path_generator.entry_point()
p.state.inspect.make_breakpoint('mem_write')
nose.tools.assert_true('inspector' in p.state.plugin... | 2.09375 | 2 |
Baselines/OLTR/Codes/algorithms/basiconlineranker.py | nju-websoft/TRAVERS | 55 | 12787584 | <gh_stars>10-100
# -*- coding: utf-8 -*-
import sys
import os
sys.path.append(os.path.join(os.path.dirname(__file__), '..'))
import numpy as np
import utils.rankings as rnk
class BasicOnlineRanker(object):
def __init__(self, n_results, n_features):
self.n_features = n_features
self.n_results = n_results
... | 2.28125 | 2 |
Dataset/Leetcode/train/98/408.py | kkcookies99/UAST | 0 | 12787585 | <filename>Dataset/Leetcode/train/98/408.py
class Solution:
def XXX(self, root: TreeNode, min_=float("-inf"), max_=float("inf")) -> bool:
return (not root) or ((min_ < root.val < max_) and self.XXX(root.left, min_, root.val) and self.XXX(root.right, root.val, max_))
| 3.203125 | 3 |
panrep/encoders.py | amazon-research/panrep | 10 | 12787586 | from classifiers import BaseRGCN
from dgl.nn.pytorch import RelGraphConv
from functools import partial
import torch
import torch.nn.functional as F
import torch.nn as nn
from dgl.nn import RelGraphConv
from layers import RelGraphConvHetero, EmbeddingLayer, RelGraphAttentionHetero,MiniBatchRelGraphEmbed
class Encoder... | 2.5625 | 3 |
hseling_api_autotutor/app/recommendation_logic/get_new_knowledge_db.py | NatalieIsupova/hseling-repo-autotutor | 0 | 12787587 | <gh_stars>0
from gensim.models.keyedvectors import FastTextKeyedVectors
#fasttext = FastTextKeyedVectors.load("D:/fasttext_word2vec/araneum_none_fasttextcbow_300_5_2018/araneum_none_fasttextcbow_300_5_2018.model")
#fasttext = FastTextKeyedVectors.load("/Users/nigula/input/araneum_none_fasttextcbow_300_5_2018/araneum_no... | 2.203125 | 2 |
textmyself.py | ryanrobertson21/Morning-Surf-Report | 0 | 12787588 | #!/usr/bin/env python
#textMyself.py - Defines the textmyself() function that texts a message passed to it as a string
from twilio.rest import TwilioRestClient
# Read in account information
with open('/Users/RyanRobertson21/PycharmProjects/CoolProjects/twilioAccountInfo') as f:
info=f.read().splitlines()
# Prese... | 3.15625 | 3 |
proc/model.py | nisarkhanatwork/rocksample_deeprl | 0 | 12787589 | <filename>proc/model.py
import keras
from keras import backend as K
from keras.layers import Dense
from keras.models import Sequential
from support import *
import keras.losses
INPUT_SIZE = 56
def get_model(data_type):
# Model parameters and other things based upon the type of data
op_dims = 4
op_activ = ... | 2.5625 | 3 |
examples/kiva/service/kiva.py | aashish24/tangelo | 1 | 12787590 | <reponame>aashish24/tangelo
import bson.json_util
import datetime
import pymongo
import json
import cherrypy
import tangelo
def run(servername, dbname, type, datatype, querydata = None,
collection = None, by = None, datemin = None, datemax = None, count = 100):
# Check if we have valid count value if not def... | 2.703125 | 3 |
materials/migrations/0024_auto_20180321_1512.py | mgovoni-devel/MatD3 | 7 | 12787591 | <filename>materials/migrations/0024_auto_20180321_1512.py
# Generated by Django 2.0.1 on 2018-03-21 15:12
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('materials', '0023_merge_20180320_1842'),
]
operations = [
migrations.AddField(
... | 1.539063 | 2 |
Complexity 01/00002_list_filtering.py | alexudovichenko/python-solutions | 0 | 12787592 | from random import randint
class Solution:
'''
TASK DESCRIPTION
Преобразуйте список целых чисел: оставьте только кратные пяти.
Примечание, ввод производится в синтаксисе списка
EXAMPLES:
Sample Input:
[4, 5, 7, 237895, 32, 432, 45, 0]
Sample Output:
5 237895 45 0
'''
... | 3.71875 | 4 |
instagram_get_fans/model/instagram_user.py | comtong/instagram_graw_fans | 1 | 12787593 | <reponame>comtong/instagram_graw_fans
class InstagramUser(object):
def __init__(self,user_id, username,timestamp):
self.user_id = user_id
self.username = username
self.timestamp = timestamp
| 2.25 | 2 |
atomate/lammps/firetasks/__init__.py | dongsenfo/atomate | 1 | 12787594 | from __future__ import unicode_literals
# from .write_inputs import *
# from .run_calc import *
# from .parse_outputs import *
# from .glue_tasks import *
| 1.023438 | 1 |
under construction/tictactoe/client.py | LucasEmmes/pythonScripts | 0 | 12787595 | <filename>under construction/tictactoe/client.py
import socket
import os
import threading
import random
import time
PORT = 5050
FORMAT = "utf-8"
DISCONNECT_MESSAGE = "!DISCONNECT"
# SERVER = input("Please enter server IP: ")
SERVER = "10.18.0.2"
ADDR = (SERVER, PORT)
client = socket.socket(socket.AF_INET, socket.SOC... | 3.453125 | 3 |
src/ToolChainSCDG/procedures/linux/custom_package/getsockname.py | AnonymousSEMA/SEMA-ToolChain | 0 | 12787596 | <reponame>AnonymousSEMA/SEMA-ToolChain<filename>src/ToolChainSCDG/procedures/linux/custom_package/getsockname.py<gh_stars>0
import angr
class getsockname(angr.SimProcedure):
# pylint:disable=arguments-differ
def run(self, sock_fd, addr, length): # pylint:disable=unused-argument
len_addr = self.state... | 2.15625 | 2 |
paper_rock_scissors/_base.py | yehuihe/paper-rock-scissors | 1 | 12787597 | """Base classes for paper rock scissors game
"""
# Author: <NAME> <<EMAIL>>
from abc import ABCMeta, abstractmethod
from enum import Enum, auto
import time
import warnings
class MoveChoice(Enum):
ROCK = auto()
PAPER = auto()
SCISSORS = auto()
class Outcome(Enum):
WIN = auto()
LOSE = auto()
... | 3.5625 | 4 |
app/user/urls.py | opeerator/5G-Testbed-Backend | 0 | 12787598 | <filename>app/user/urls.py
from django.urls import path
from user import views
app_name = 'user'
urlpatterns = [
path('createuser/', views.CreateUserView.as_view(), name='createuser'),
path('createsuperuser/', views.CreateSuperUserView.as_view(), name='createsuperuser'),
path('token/', views.CreateToken... | 1.984375 | 2 |
yamlapi/demo/tool/read_write_yaml.py | Ironkubi/yamlapi | 19 | 12787599 | <gh_stars>10-100
from ruamel import yaml
from setting.project_config import *
def read_yaml(yaml_absolute_path):
"""
读取yaml文件
:param yaml_absolute_path: 参数为需要读取的yaml文件的绝对路径
:return:
"""
with open(yaml_absolute_path, "r", encoding="utf-8") as f:
data_list = yaml.load(f, Loader=yaml.Lo... | 2.546875 | 3 |
app/utils/ResponseUtil.py | hustcc/TODO | 7 | 12787600 | <gh_stars>1-10
#!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
Created on 2016年2月19日
@author: hzwangzhiwei
'''
from app.utils.JsonUtil import object_2_json
def standard_response(success, data):
'''
接口的标准json返回值,统一使用同一个方法,便于统一修改
'''
rst = {}
rst['success'] = success
rst['data'] = data
re... | 1.929688 | 2 |
python/language/utilities/unpacking/intro_1.py | futureseadev/hgwxx7 | 6 | 12787601 | <reponame>futureseadev/hgwxx7
# arguments unpacking simplified!!
# *
a, b = range(2)
a
0
b
1
a, b, *rest = range(5)
a
0
b
1
rest
[2,3,4]
# first and last lines
with open('file.name') as f:
first, *_, last = f.readlines()
# Refactor functions
def f(a, b, *args):
print(a, b, *args)
# instead -> *args... | 2.640625 | 3 |
URI/1-Beginner/1041.py | vicenteneto/online-judge-solutions | 0 | 12787602 | <filename>URI/1-Beginner/1041.py
# -*- coding: utf-8 -*-
x, y = [float(x) for x in raw_input().split()]
if x == 0 and y == 0:
print 'Origem'
elif x == 0:
print 'Eixo Y'
elif y == 0:
print 'Eixo X'
elif x > 0:
if y > 0:
print 'Q1'
else:
print 'Q4'
elif x < 0:
if y > 0:
p... | 3.59375 | 4 |
ML/learn/algorithm/activation_functions.py | qrsforever/workspace | 2 | 12787603 | <filename>ML/learn/algorithm/activation_functions.py
#!/usr/bin/python3
# -*- coding: utf-8 -*-
# @file activation_functions.py
# @brief
# @author QRS
# @blog qrsforever.github.io
# @version 1.0
# @date 2019-05-29 18:24:39
################################ jupyter-vim #######################################
# https:/... | 1.765625 | 2 |
examples/paper_benchmarks/GPU/cot_gpu_m12/run_sliced.py | XanaduAI/jet | 29 | 12787604 | import time
import sys
import quimb.tensor as qtn
import cotengra as ctg
import tqdm
from opt_einsum import contract, contract_expression, contract_path, helpers
from opt_einsum.paths import linear_to_ssa, ssa_to_linear
def load_circuit(
n=53,
depth=10,
seed=0 ,
elided=0,
sequence='ABCDCDAB',
... | 1.929688 | 2 |
Leetcode/1000-2000/1858. Longest Word With All Prefixes/1858.py | Next-Gen-UI/Code-Dynamics | 0 | 12787605 | <filename>Leetcode/1000-2000/1858. Longest Word With All Prefixes/1858.py<gh_stars>0
class Solution:
def __init__(self):
self.root = {}
def longestWord(self, words: List[str]) -> str:
ans = ''
for word in words:
self.insert(word)
for word in words:
if not self.allPrefixed(word):
... | 3.71875 | 4 |
guestbook.py | tgirotto/bigdata-test | 0 | 12787606 | import os
import urllib
import csv
from google.appengine.api import users
from google.appengine.ext import ndb
import jinja2
import webapp2
JINJA_ENVIRONMENT = jinja2.Environment(
loader=jinja2.FileSystemLoader(os.path.dirname(__file__)),
extensions=['jinja2.ext.autoescape'],
autoescape=True)
DEFAULT_GU... | 2.859375 | 3 |
src/reference/API.py | Limespy/interp-compression | 0 | 12787607 | <reponame>Limespy/interp-compression
import sys
import pathlib
import numpy as np
from collections import namedtuple
from scipy import interpolate
import math
path_package = pathlib.Path(__file__).parent.absolute()
sys.path.insert(1,str(path_package.parent))
import API as compression
#%%═════════════════════════════... | 2.28125 | 2 |
tests/test_context.py | d-wysocki/flask-resty | 86 | 12787608 | <reponame>d-wysocki/flask-resty<gh_stars>10-100
import pytest
from flask_resty import context
# -----------------------------------------------------------------------------
def test_view_default(app):
with app.test_request_context():
view_1 = object()
view_2 = object()
assert context.g... | 2.3125 | 2 |
platypush/message/event/music/snapcast.py | RichardChiang/platypush | 228 | 12787609 | from platypush.message.event import Event
class SnapcastEvent(Event):
""" Base class for Snapcast events """
def __init__(self, host='localhost', *args, **kwargs):
super().__init__(host=host, *args, **kwargs)
class ClientConnectedEvent(SnapcastEvent):
"""
Event fired upon client connection
... | 2.4375 | 2 |
class_day02.py | yunjung-lee/class_python_data | 0 | 12787610 | <gh_stars>0
# ## 통계 기반 데이터 분석 (부제: 영상 처리를 통한 데이터 분석 및 통계 처리) ##
#
#
#
#
# 복습퀴즈1. 800x800 화면에서 거북이가 다음 정보를 소유하도록 한다.
#
# [거북이개체, (시작x,y), (끝x,y), (r,g,b), 크기]
#
# 20마리를 생성해서 리스트에 저장한 후에, 각각 이동하도록 한다.
#
#
#
#
# 복습퀴즈2. 구구단을 처리하되, 각 결과의 앞자리~뒷자리까지 합계로 출력한다.
#
# 예) 2x1=3 (값2를 02로 취급해서 0부터 2까지의 합계 : 0+1+2 = 3)
#
#... | 2.546875 | 3 |
nwb_conversion_tools/utils/createextractors.py | miketrumpis/nwb-conversion-tools | 0 | 12787611 | <filename>nwb_conversion_tools/utils/createextractors.py
from distutils.version import StrictVersion
import numpy as np
try:
from spikeinterface.core.testing_tools import generate_recording, generate_sorting
import spikeinterface as si
if StrictVersion(si.__version__[:4]) >= StrictVersion("0.90"):
... | 1.851563 | 2 |
brahe/access/access_geometry.py | duncaneddy/brahe | 14 | 12787612 | '''Provide fundamental geometry calculations used by the scheduling.
'''
import math
import numpy as np
import brahe.data_models as bdm
from brahe.utils import fcross
from brahe.constants import RAD2DEG
from brahe.coordinates import sECEFtoENZ, sENZtoAZEL, sECEFtoGEOD, sGEODtoECEF
from brahe.relative_coordinates impo... | 2.515625 | 3 |
Network Simulations/Assignment 3/CSMA/logger.py | neeladripal/bcse-lab | 0 | 12787613 | # function to log the analytics of communication
def storeLogs(senderName, receiverName, effectiveFrames, totalFrames, totalTime, collision, rttStore:list):
# frame size (IEEE 802.3 Ethernet Frame Format)
FRAME_SIZE=72*8
# define bandwidth (in bps)
BANDWIDTH = 1000
logs = "Sender: "+senderName+" --... | 2.9375 | 3 |
src/scripts/descriptions/__init__.py | anku94/themis_tritonsort | 11 | 12787614 | from validateDescription import DescriptionValidator
from validateDescription import ValidationFailedError
from descriptionutils import Description
__all__ = ["validateDescription.DescriptionValidator",
"validateDescription.ValidationFailedError",
"descriptionutils.Description"]
| 1.375 | 1 |
tinyq/utils.py | mozillazg/tinyq | 14 | 12787615 | # -*- coding: utf-8 -*-
import importlib
def gen_task_name_via_func(func):
"""生成函数对象对应的 task name"""
return '{name}'.format(name=func.__name__)
def import_object_from_path(path, default_obj_name='app'):
"""从定义的字符串信息中导入对象
:param path: ``task.app``
"""
module_name, obj_name = path.rsplit('.',... | 2.53125 | 3 |
graph/tests/bfs_test.py | RobMcZag/python-algorithms3 | 1 | 12787616 | import unittest
import graph
class BreadthFirstSearchTest(unittest.TestCase):
__runSlowTests = False
def testTinyGraph(self):
g = graph.Graph.from_file('tinyG.txt')
bfs = graph.BreadthFirstSearch(g, 0)
self.assertEqual(7, bfs.count())
self.assertFalse(bfs.connected(7))
... | 3.3125 | 3 |
app/threads.py | candicecz/conp-portal | 0 | 12787617 | <filename>app/threads.py
# -*- coding: utf-8 -*-
"""Threading Module
Module that contains the threaded pipeline searching functions
"""
from boutiques.searcher import Searcher
from boutiques.puller import Puller
import threading
import json
import os
import logging
class UpdatePipelineData(threading.Thread):
"""... | 2.609375 | 3 |
src/autonmt/configs.py | mehdidou99/autONMT | 0 | 12787618 | import logging
import sys
import yaml
def load_config(filename):
with open(filename, 'r') as stream:
try:
return yaml.safe_load(stream)
except yaml.YAMLError as exc:
print('Invalid configuration')
print(exc)
sys.exit(1)
class LoadAndPreprocessConfig... | 2.40625 | 2 |
utils/lost2.py | xixigaga/GolemQ | 0 | 12787619 | <filename>utils/lost2.py
print(u'分析和展示计算结果...')
ret_codelist = featurs_printable_formatter(ret_codelist)
codelist_saltedfish, ret_codelist_saltedfish, ret_codelist = find_fratcal_saltfish(ret_codelist)
codelist_combo, ret_codelist_combo, ret_codelist = find_fratcal_bootstrap_combo(ret_codelist)
codelist_action, ret_cod... | 2.546875 | 3 |
build/lib/automata_toolkit/nfa_to_dfa.py | b30wulffz/automata-toolkit | 8 | 12787620 | <gh_stars>1-10
from .regex_to_nfa import regex_to_nfa
from .visual_utils import draw_dfa
from .consts import Consts
import itertools
from collections import Counter
def find_permutation(state_list, current_state):
for state in state_list:
if Counter(current_state) == Counter(state):
return stat... | 2.75 | 3 |
serieswatcher/sqlobject/tests/test_transactions.py | lightcode/SeriesWatcher | 303 | 12787621 | from sqlobject import *
from sqlobject.tests.dbtest import *
########################################
## Transaction test
########################################
class TestSOTrans(SQLObject):
#_cacheValues = False
class sqlmeta:
defaultOrder = 'name'
name = StringCol(length=10, alternateID=True, ... | 2.421875 | 2 |
dlrnapi_client/apis/__init__.py | ssbarnea/dlrnapi_client | 1 | 12787622 | <gh_stars>1-10
from __future__ import absolute_import
# import apis into api package
# from dlrnapi_client.apis.default_api import DefaultApi
| 1.125 | 1 |
analyze/core.py | autocorr/almaimf_nestfit | 0 | 12787623 | <reponame>autocorr/almaimf_nestfit
#!/usr/bin/env python3
"""
====
Core
====
Apply NestFit to test ALMA-IMF N2H+ J=1-0 datasets. This script may be called
from the command line for batch queue processing. Edit the ``__main__`` block.
Post-processing must be parallelized over different sources, so is not
currently effec... | 2.09375 | 2 |
2018/d02.py | m1el/advent-of-code | 0 | 12787624 | from collections import Counter
from itertools import product
with open('02.txt') as fd:
inp = [l.strip() for l in fd.readlines()]
twos = 0
thre = 0
for row in inp:
c = Counter(row)
if 2 in c.values():
twos += 1
if 3 in c.values():
thre += 1
print(twos*thre)
def diff(sa,sb):
c = ... | 3.265625 | 3 |
t2t/util.py | wasade/tax2tree | 0 | 12787625 | <reponame>wasade/tax2tree<gh_stars>0
#!/usr/bin/env python
from skbio import parse_fasta
__author__ = "<NAME>"
__copyright__ = "Copyright 2011, The tax2tree project"
__credits__ = ["<NAME>"]
__license__ = "BSD"
__version__ = "1.0"
__maintainer__ = "<NAME>"
__email__ = "<EMAIL>"
__status__ = "Development"
def combin... | 2.3125 | 2 |
openff/bespokefit/executor/services/coordinator/stages.py | openforcefield/openff-bespokefit | 7 | 12787626 | <reponame>openforcefield/openff-bespokefit<filename>openff/bespokefit/executor/services/coordinator/stages.py
import abc
import json
from collections import defaultdict
from typing import TYPE_CHECKING, Dict, List, Optional, Tuple, Union
import httpx
from openff.fragmenter.fragment import Fragment, FragmentationResult... | 1.25 | 1 |
docker-register.py | poporisil/docker-register | 0 | 12787627 | <gh_stars>0
#!/usr/bin/env python
import os
import sys
import argparse
import threading
import subprocess
import time
from urlparse import urlparse
import docker
import etcd
import json
import logging
import logging.handlers
parser = argparse.ArgumentParser(description='Docker Register')
parser.add_argument('-e','--... | 2.28125 | 2 |
worker/Twitter/service1/coordinatesExtractor.py | LamriAli/remote-extraction-proxy-and-worker | 0 | 12787628 |
class CoordinateExtractor:
@staticmethod
def crawlCoordinates(self,api,fullStructure,uid,graph,userQueue,coordinatesQueue,placeQueue,urlQueue,mediaQueue,tweetQueue):
pass
| 1.78125 | 2 |
src/tools/python/csv_transpose.py | Justintime50/easypost-tools | 1 | 12787629 | <reponame>Justintime50/easypost-tools
import argparse
import csv
# Transpose rows into columns and vice versa for a CSV
# Attribution: [jontsai](https://github.com/jontsai)
# Usage: venv/bin/python csv_transpose.py -f my_file.csv -o output.csv
class CSVTranspose:
def __init__(self):
parser = argparse.Arg... | 3.734375 | 4 |
lidar_convenience.py | mrtpk/lidar-buster | 17 | 12787630 | import numpy as np
class LidarTools(object):
'''
Collection of helpers for processing LiDAR point cloud.
'''
def get_bev(self, points, resolution=0.1, pixel_values=None, generate_img=None):
'''
Returns bird's eye view of a LiDAR point cloud for a given resolution.
Optional pixe... | 2.765625 | 3 |
practice/bitwise_operations/ex9.py | recursivelycurious/wordnik-repl | 0 | 12787631 | a = 0b10111011
mask = 0b100
desired = a | mask
print bin(desired)
| 2.4375 | 2 |
py/ClientProject/.idea/log/logger.py | Justyer/Secret | 0 | 12787632 | <gh_stars>0
import logging
from logging.handlers import TimedRotatingFileHandler
import sys, os
parent_path = os.path.dirname(os.getcwd())
sys.path.append(parent_path)
#自定义引用
from log.message import *
logpath=os.path.split(os.path.realpath(__file__))[0].split(':')[0] + ':\\gxd\\log'
if not os.path.exists(lo... | 2.1875 | 2 |
kattis/solutions/quickbrownfox.py | yifeng-pan/competitive_programming | 0 | 12787633 | <reponame>yifeng-pan/competitive_programming<gh_stars>0
# https://open.kattis.com/problems/quickbrownfox
cases = int(input())
for i in range(cases):
text = input()
missing = ""
for i in range(26):
c = chr(ord('a') + i)
C = chr(ord('A') + i)
if text.find(c) == -1 & text.find(C) == -... | 3.59375 | 4 |
examples/fast_api.py | alex-oleshkevich/aerie | 6 | 12787634 | """
This example requires uvicorn and fastapi.
pip install fastapi uvicorn
Run:
uvicorn examples.fast_api:app
then open http://localhost:8000
Access http://localhost:8000 to list all users.
Access http://localhost:8000/create to create a new user.
"""
import os
import sqlalchemy as sa
import typing as t
from fa... | 3.015625 | 3 |
tools/test_dota.py | qinr/MRDet | 8 | 12787635 | import argparse
import os
import os.path as osp
import pickle
import shutil
import tempfile
import mmcv
import torch
import torch.distributed as dist
from mmcv.parallel import MMDataParallel, MMDistributedDataParallel
from mmcv.runner import get_dist_info, load_checkpoint
from mmdet.apis import init_dist... | 1.8125 | 2 |
CybORG/CybORG/Agents/Branching_Agents/utils.py | tranhoangkhuongvn/cage-challenge-1 | 0 | 12787636 | import numpy as np
import gym
import torch
import random
from argparse import ArgumentParser
import os
import pandas as pd
import matplotlib.pyplot as plt
plt.style.use('ggplot')
from scipy.ndimage.filters import gaussian_filter1d
class Stats():
def __init__(self, num_episodes=20000, num_states = 6, log_dir... | 2.46875 | 2 |
C-101/test.py | shabd07/C-101 | 0 | 12787637 | a = input("write your name")
print(a) | 2.84375 | 3 |
machine-learning-box/sales-prediction/py_scripts/data.py | akito19/treasure-boxes | 0 | 12787638 | import os
import pandas as pd
os.system(f"{sys.executable} -m pip install -U pytd==0.8.0 td-client")
import pytd
from tdclient.errors import NotFoundError
def database_exists(database, client):
try:
client.api_client.database(database)
return True
except NotFoundError:
pass
re... | 2.59375 | 3 |
magic_8_ball.py | kruschk/automate-the-boring-stuff | 0 | 12787639 | <gh_stars>0
#!/usr/bin/python3
import random
def get_answer(answer_number):
if answer_number == 1:
return "It is certain"
elif answer_number == 2:
return "It is decidedly so"
elif answer_number == 3:
return "Yes"
elif answer_number == 4:
return "Reply lazy try again"
... | 3.96875 | 4 |
Python/Django/assert/task_1.py | Mikhail-Kushnerev/YA_Study | 0 | 12787640 | <filename>Python/Django/assert/task_1.py
def series_sum(incoming):
# Конкатенирует все элементы списка, приводя их к строкам."
result = ''
for i in incoming:
result += str(i)
return result
# Первое тестирование: проверьте, корректно ли сработает функция series_sum(),
# если ей на вход передать ... | 3.03125 | 3 |
prob/dice.py | ccorbell/gametheory | 0 | 12787641 | <gh_stars>0
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Jan 18 23:51:10 2022
@author: <NAME>
"""
import random
class Dice:
D6 = [n for n in range(1, 7)]
D20 = [n for n in range(1, 21)]
def d6():
return random.choice(Dice.D6)
def d20():
return random.choi... | 3.703125 | 4 |
project/backend/migrations/0005_alter_item_category.py | ryan-lam/hackathonx2021 | 1 | 12787642 | # Generated by Django 3.2 on 2021-06-26 00:30
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('backend', '0004_alter_item_description'),
]
operations = [
migrations.AlterField(
model_name='item',
name='category',
... | 1.570313 | 2 |
shot.py | RanlyX/web_screenshot | 0 | 12787643 | <reponame>RanlyX/web_screenshot
# !usr/bin/python
# -*- coding:utf-8 -*-
import re
import sys
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
# Text color define
T_LIGHT_RED = "\033[1;31m"
NORMAL = "\033[m"
# Some phish url will be report "hxxp" or "hxxps"
def refin... | 2.703125 | 3 |
pypi_librarian/class_user.py | jayvdb/pypi_librarian | 3 | 12787644 | # coding=utf-8
"""
Data and actions for user
"""
from typing import List
import pypi_xmlrpc
from pypi_librarian.class_package import Package
class User(object):
"""
Properties and methods
"""
def __init__(self, name: str) -> None:
"""
Initialize values
:param name:
"... | 2.8125 | 3 |
lib/tests/python/old/test_bug.py | re-Isearch/re-Isearch | 2 | 12787645 | #!/opt/BSN/bin/python
#-------------------------------------------------
#ident "%Z%%Y%%M% %I% %G% %U% BSN"
import sys
import string
from IB import *
#############################################################################
##
##
#############################################################################
qu... | 2.3125 | 2 |
omtdrspub/elastic/exe_elastic_resourcelist.py | openminted/omtd-rspub-elastic | 0 | 12787646 | <filename>omtdrspub/elastic/exe_elastic_resourcelist.py
import os
from os.path import basename
from urllib.parse import urljoin
import logging
from resync import Resource
from resync import ResourceList
from resync.list_base_with_index import ListBaseWithIndex
from rspub.core.executors import Executor, SitemapData, Ex... | 1.859375 | 2 |
jobs/types/job_run_result.py | soham4abc/oppia | 0 | 12787647 | <gh_stars>0
# coding: utf-8
#
# Copyright 2021 The Oppia Authors. 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.265625 | 2 |
Script update background test/Script_normal_update_win_zip.py | dacicas/Update_script | 0 | 12787648 | <filename>Script update background test/Script_normal_update_win_zip.py<gh_stars>0
#!/usr/bin/env python3
import os, fnmatch
import subprocess
import time
import gspread
from oauth2client.service_account import ServiceAccountCredentials
from pprint import pprint
import time
import random
import wget
import shutil
impor... | 2.28125 | 2 |
experiments/archived/20210119/bag_model/__init__.py | fxnnxc/text_summarization | 5 | 12787649 | from . import text_summarization_annealing # noqa
from .models import model, hub_interface # noqa
from .criterions import kld_loss
from .modules import pgn
#from .modules import # noqa | 0.949219 | 1 |
preprocess.py | akoksal/Turkish-Word2Vec | 175 | 12787650 | <filename>preprocess.py
from __future__ import print_function
import os.path
import sys
from gensim.corpora import WikiCorpus
import xml.etree.ElementTree as etree
import warnings
import logging
import string
from gensim import utils
def tokenize_tr(content,token_min_len=2,token_max_len=50,lower=True):
i... | 2.484375 | 2 |