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 |
|---|---|---|---|---|---|---|
src/3D_plots.py | suryadheeshjith/episimmer | 0 | 12793651 | import sys
import ReadFile
import pickle
import World
import importlib.util
import os.path as osp
import policy_generator as pg
import matplotlib.pyplot as plt
from matplotlib import cm
from matplotlib.ticker import LinearLocator
import numpy as np
def module_from_file(module_name, file_path):
spec = importlib.ut... | 2.140625 | 2 |
odor_env/__init__.py | chinaheyu/pydog_training | 0 | 12793652 | from gym.envs.registration import register
register(
id='OdorEnvA-v0',
entry_point='odor_env.odor_env:OdorEnvA'
)
register(
id='OdorEnvB-v0',
entry_point='odor_env.odor_env:OdorEnvB'
)
| 1.507813 | 2 |
support_functions.py | DataCentric1/ponpare | 2 | 12793653 | #########################################################################################################
# Description: Collection of support functions that'll be used often
#
#########################################################################################################
import numpy as np
################... | 2.875 | 3 |
ARMODServers/Apps/ARExperiences/migrations/0005_auto_20210411_1029.py | Phantomxm2021/ARMOD-Dashboard | 1 | 12793654 | <reponame>Phantomxm2021/ARMOD-Dashboard
# Generated by Django 3.1.4 on 2021-04-11 02:29
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('ARExperiences', '0004_auto_20210411_1019'),
]
operations = [
migrations.RenameField(
model_name=... | 1.59375 | 2 |
pycgr/py_cgr_client.py | ewb4/HDTN | 6 | 12793655 | from py_cgr.py_cgr_lib.py_cgr_lib import *
import zmq
import time
import sys
import random
import json
import re
import getopt
argumentList = sys.argv[1:]
# Options
options = "hc"
try:
# Parsing argument
arguments, values = getopt.getopt(argumentList, options)
# checking each argument
for currentAr... | 2.484375 | 2 |
deployml/keras/load/base.py | deploy-ml/deploy-ml | 18 | 12793656 | <reponame>deploy-ml/deploy-ml
from keras.preprocessing.image import img_to_array
import numpy as np
import pickle
import keras
import sys
import cv2
class KerasLoader:
def __init__(self, file_path):
if file_path[-3:] == "sav":
package = pickle.load(open(file_path, "rb"))
else:
... | 2.625 | 3 |
ex075.py | erikamaylim/Python-CursoemVideo | 0 | 12793657 | <filename>ex075.py<gh_stars>0
"""Desenvolva um programa que leia quatro valores pelo teclado e guarde-os em uma tupla.
No final, mostre:
A) Quantas vezes apareceu o valor 9.
B) Em que posição foi digitado o primeiro valor 3.
C) Quais foram os números pares."""
tuplanum = (int(input('1º valor: ')),
int(inpu... | 3.71875 | 4 |
ja/code_snippets/results/result.api-tags-update.py | quotecenter/documentation-1 | 0 | 12793658 | {'host': 'hostname', 'tags': ['role:database','environment:test']}
| 1.148438 | 1 |
external/metadata/core.py | jtackaberry/stagehand | 8 | 12793659 | # -*- coding: iso-8859-1 -*-
# -----------------------------------------------------------------------------
# core.py
# -----------------------------------------------------------------------------
# $Id$
#
# -----------------------------------------------------------------------------
# kaa-Metadata - Media Metadata ... | 1.625 | 2 |
sacrerouge/tests/fixtures/data/simetrix/setup.py | danieldeutsch/decomposed-rouge | 81 | 12793660 | <reponame>danieldeutsch/decomposed-rouge<gh_stars>10-100
"""
This script parses the sample data and output from the SIMetrix package and
saves it for unit testing.
"""
import argparse
import sys
from glob import glob
sys.path.append('.')
from sacrerouge.io import JsonlWriter # noqa
def load_sample_documents(input_... | 2.5 | 2 |
atomtools/__init__.py | atomse/atomtools | 0 | 12793661 | <reponame>atomse/atomtools<filename>atomtools/__init__.py<gh_stars>0
"""
independent chemical symbols
"""
__version__ = '1.9.4'
def version():
return __version__
| 1.21875 | 1 |
src/python/pcmdi/misc.py | gleckler1/pcmdi_metrics | 0 | 12793662 | <gh_stars>0
import cdms2 as cdms
import string, os
import ESMP
#### MAKE DIRECTORY
def mkdir_fcn(path):
try:
os.mkdir(path)
except:
pass
return
#### GET INHOUSE DATA THAT HAS BEEN TRANSFORMED/INTERPOLATED
def get_our_model_clim(data_location,var):
pd = data_location
# if var in ['tos','sos','zos']: p... | 2.015625 | 2 |
AtCoder/ABC/150/A.500 Yen Coins.py | shinkeonkim/today-ps | 2 | 12793663 | K,X=map(int,input().split())
print("Yes" if K*500>=X else "No" ) | 3.109375 | 3 |
training.py | zhangsiyu1103/ESNAC | 0 | 12793664 | <reponame>zhangsiyu1103/ESNAC
import torch
import torch.nn as nn
import torch.optim as optim
import torch.nn.functional as F
import torch.backends.cudnn as cudnn
import options as opt
import os
import time
import sys
import numpy as np
def init_model(model):
for module in model.modules():
if isinstance(mod... | 2.5 | 2 |
tests/test_jsonutil.py | bhlarson/pymlutil | 0 | 12793665 | import sys
import os
import numpy as np
import cv2
import json
from collections import defaultdict
import unittest
import torch
sys.path.insert(0, os.path.abspath('')) # Test files from current path rather than installed module
from pymlutil.jsonutil import *
test_config = 'test.yaml'
class Test(unittest.TestCase):
... | 2.546875 | 3 |
tests/test_proxy_digest_auth.py | untitaker/requests-toolbelt | 0 | 12793666 | # -*- coding: utf-8 -*-
"""Test proxy digest authentication
"""
import unittest
import requests
import requests_toolbelt
class TestProxyDigestAuth(unittest.TestCase):
def setUp(self):
self.username = "username"
self.password = "password"
self.auth = requests_toolbelt.auth.HTTPProxyDigest... | 2.9375 | 3 |
monotemplate.py | abderrahmen-hadjadj-aoul/monotemplate | 1 | 12793667 | """
"""
import sys
import re
import shutil
import json
if len(sys.argv) < 3:
print('Not enough input arguments')
exit()
################################################################################
# Options
comment = {'begin':'<!--', 'end':'-->'}
#######################################################... | 2.859375 | 3 |
GameRoom/clienttest.py | gaogaotiantian/GameHost | 0 | 12793668 | <filename>GameRoom/clienttest.py
import socket
import time
if __name__ == "__main__":
sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
conn = '/tmp/GameRoomConn'
sock.connect(conn)
time.sleep(1)
sock.send('hello world')
sock.close()
| 1.875 | 2 |
app/utils.py | mirsazzathossain/SPMS-Project | 0 | 12793669 | from django.db import connection
import numpy as np
def getstudentcoursewisePLO(studentID, courseID):
with connection.cursor() as cursor:
cursor.execute('''
SELECT p.ploNum as plonum,100*(sum(e.obtainedMarks)/sum(a.totalMarks)) as plopercent
FROM app_registration_t r,
... | 2.28125 | 2 |
content_upload/get_marketo_email.py | tyron-pretorius/zapier | 0 | 12793670 |
#input variables to Zapier Step 12: Get Marketo Email ID
input={
'token': 'Token' #from Step 3: Get Marketo Access Token
'pid': 'Pid' #from Step 9: Clone Latest Marketo Program
'c_type': 'Content Type' #from Step 1: Get Submission from Google Form
}
import requests
import datetime
import re
if (input['c... | 2.59375 | 3 |
tests/test_logger.py | nimbinatus/python | 0 | 12793671 | <filename>tests/test_logger.py
import json
import unittest
from http.server import BaseHTTPRequestHandler
from logdna import LogDNAHandler
from .mock.server import get_port, start_server
from .mock.log import logger, info, LOGDNA_API_KEY
expectedLines = []
class SuccessfulRequestHandler(BaseHTTPRequestHandler):
... | 2.6875 | 3 |
backend/src/pox/ext/gini/samples/packet_loss.py | anrl/gini4 | 11 | 12793672 | <gh_stars>10-100
#!/usr/bin/python2
"""
packet_loss.py: Simulates packet loss by dropping all packets with a
probability of 25%.
"""
import random
from pox.core import core
import pox.openflow.libopenflow_01 as of
def packet_in(event):
if random.random() >= 0.25:
msg = of.ofp_packet_out(data = event.ofp... | 2.3125 | 2 |
ampa/cole/migrations/0023_entitat_codi_registre.py | jordiprats/django-ampa | 0 | 12793673 | <gh_stars>0
# Generated by Django 3.1.5 on 2021-03-06 17:29
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('cole', '0022_auto_20210306_1528'),
]
operations = [
migrations.AddField(
model_name='entitat',
name='codi... | 1.460938 | 1 |
apps/dashboard/migrations/0009_generalsettings_location.py | iamjdcollins/districtwebsite | 0 | 12793674 | # -*- coding: utf-8 -*-
# Generated by Django 1.11.6 on 2018-05-17 15:50
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('taxonomy', '0009_boardprecinct_precinct_map'),
('da... | 1.65625 | 2 |
unittests/constants.py | ga4gh/gsoc2018-ref-retrieval-api | 6 | 12793675 | GOOD_SERVER_URL = "http://0.0.0.0:8989/"
BAD_SERVER_URL = "http://0.0.0.0:8988/"
JSON_REPORT = "test_report.json"
WEB_FILE_PATH = "test_web"
DEFAULT_WEB_DIR = "web" | 1.289063 | 1 |
openerp/addons/base_report_designer/plugin/openerp_report_designer/bin/script/NewReport.py | ntiufalara/openerp7 | 3 | 12793676 | #########################################################################
#
# Copyright (c) 2003-2004 <NAME> <EMAIL>
# Copyright (C) 2004-2010 OpenERP SA (<http://openerp.com>).
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License ... | 1.40625 | 1 |
codes/pandas/pandas-1-loading-and-displaying-data.py | sandywadhwa/machine-learning-in-python | 0 | 12793677 | <filename>codes/pandas/pandas-1-loading-and-displaying-data.py<gh_stars>0
import pandas
import numpy
import matplotlib
# READ CSV FILE
df = pandas.read_csv("../../data/uci-pima-indian-diabetes-data-original.csv")
# Print Dimensions of Data (Rows, Cols)
print("Dimensions of Data", df.shape)
# Print First n Rows
n = ... | 3.875 | 4 |
csrf/luhack_csrf/site.py | nitros12/luhack-web-lab | 0 | 12793678 | <reponame>nitros12/luhack-web-lab<gh_stars>0
import os
from collections import defaultdict
from pathlib import Path
from starlette.exceptions import HTTPException
import aiohttp
from dotenv import load_dotenv
from furl import furl
from starlette.applications import Starlette
from starlette.endpoints import HTTPEndpoi... | 2.234375 | 2 |
pyaugmecon/__init__.py | vishalbelsare/pyaugmecon | 5 | 12793679 | from pyaugmecon.pyaugmecon import PyAugmecon
| 1.054688 | 1 |
feps/epitopeenergies.py | immunityproject/free-energy-post-substitution | 0 | 12793680 | <reponame>immunityproject/free-energy-post-substitution<gh_stars>0
"""
main.py - main functionality for feps tool
"""
from __future__ import print_function
import click
import csv
import sys
from collections import defaultdict
from feps.energy import load_db,combine_energy_mutations,codes,add_entropies
from feps.ent... | 2.640625 | 3 |
PWN/2018WangDing/2018WangDing-3/pwn3-note2/exp3.py | Cossack9989/SEC_LEARNING | 13 | 12793681 | <filename>PWN/2018WangDing/2018WangDing-3/pwn3-note2/exp3.py<gh_stars>10-100
# Pwned locally
# After two big chunks freed and combined, the first chunk's size will emerge a bug that its size equals the sum of the two chunks
# Use this bug to override and lead to UAF
# And this UAF lead to AnyMemWrite with the fake_fd
#... | 2 | 2 |
unittests/one_clock/gen.py | SubjeBilisim/anasymod | 20 | 12793682 | from pathlib import Path
from argparse import ArgumentParser
from msdsl import MixedSignalModel, VerilogGenerator
from msdsl.expr.extras import if_
def main():
print('Running model generator...')
# parse command line arguments
parser = ArgumentParser()
parser.add_argument('-o', '--output', type=str, d... | 2.4375 | 2 |
external/opensocdebug/software/src/bindings/python/examples/runelf.py | koenenwmn/optimsoc | 0 | 12793683 | <filename>external/opensocdebug/software/src/bindings/python/examples/runelf.py
import opensocdebug
import sys
from optparse import OptionParser
parser = OptionParser(usage="usage: %prog [options] <elffile>")
parser.add_option("--verify-memload",
action="store_true", dest="verify", default=False,
... | 2.375 | 2 |
backend/pints/utils.py | ebunt/pulse | 63 | 12793684 | <reponame>ebunt/pulse<gh_stars>10-100
import os
from cryptography.fernet import Fernet
FERNET_KEY = os.environ.get('PAPER_FERNET_KEY')
def encrypt(e):
f = Fernet(FERNET_KEY)
e = e.encode("utf-8")
return f.encrypt(e).decode()
def decrypt(d):
f = Fernet(FERNET_KEY)
d = f.decrypt(d.encode("utf-8"))
... | 2.46875 | 2 |
main.py | Mike-n-ike/deep-learning-for-pkd-patients | 0 | 12793685 | <gh_stars>0
# This is a sample Python script.
# Press ⌃R to execute it or replace it with your code.
# Press Double ⇧ to search everywhere for classes, files, tool windows, actions, and settings.
# importing important librarires
import itertools
import matplotlib.pyplot as plt
import numpy as np
import os
import pand... | 3 | 3 |
Data Structure/Sort/Quick Sort/main.py | InnoFang/oh-my-algorithms | 19 | 12793686 | import random
def partition(arr, left, right):
l, r, tmp = left, right, arr[left]
while l != r:
while l < r and arr[r] >= tmp: r -= 1
while l < r and arr[l] <= tmp: l += 1
arr[l], arr[r] = arr[r], arr[l]
arr[l], arr[left] = arr[left], arr[l]
return l
def quick_sort(arr, left, r... | 3.890625 | 4 |
nyaa_updater.py | mhaidarh/nyaaupdater | 7 | 12793687 | <filename>nyaa_updater.py
#!/usr/bin/env python
"""
Nyaa.eu Feed Auto Updater
<NAME> (faizilham.com) 2013
"""
from nyaa_parser import fetch, download
from nyaa_db import NyaaSQLiteDB
from threading import Thread
import os, stat
DBNAME = '/home/pi/db/nyaa.db'
DOWNLOAD_DIR = '/home/pi/download/update/'
NUM_UPDATER = 4... | 2.59375 | 3 |
data/data_split.py | SCUT-AILab/DTQ | 20 | 12793688 | <filename>data/data_split.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 2019/10/13 16:57
# @Author : xiezheng
# @Site :
# @File : data_split.py
import os
from scipy.io import loadmat
import shutil
def get_path_str(line):
line = str(line)
_, path, _ = line.split('\'')
# print('lin... | 2.796875 | 3 |
make_data.py | kazurayam/ks_LogViewerSlowsDownTests_HowToPrevent | 0 | 12793689 | print('ID')
for number in range(1000):
print("#" + format(number, '0>4'))
| 2.96875 | 3 |
scrap_phat.py | Astroua/LocalGroup-VLA | 1 | 12793690 |
# Scrap all the brick mosaics for PHAT
import os
from os.path import join as osjoin
output = "/home/ekoch/bigdata/ekoch/M31/PHAT/"
baseurl = "https://archive.stsci.edu/pub/hlsp/phat/"
# This is easier than webscraping right now.
brick_dict = {1: 12058,
2: 12073,
3: 12109,
... | 2.375 | 2 |
test_pipeline/utils/visualize.py | Garvit-32/LPRNet-Pytorch | 0 | 12793691 | #Color dict
import numpy as np
# import wandb
import cv2
import torch
import os
colors = {
'0':[(128, 64, 128), (244, 35, 232), (0, 0, 230), (220, 190, 40), (70, 70, 70), (70, 130, 180), (0, 0, 0)],
'1':[(128, 64, 128), (250, 170, 160), (244, 35, 232), (230, 150, 140), (220, 20, 60), (255, 0, 0), (0, 0, 230),... | 2.40625 | 2 |
Sketches/RJL/bittorrent/BitTorrent/BitTorrent/LaunchPath.py | sparkslabs/kamaelia_orig | 12 | 12793692 | <reponame>sparkslabs/kamaelia_orig
# The contents of this file are subject to the BitTorrent Open Source License
# Version 1.1 (the License). You may not copy or use this file, in either
# source code or executable form, except in compliance with the License. You
# may obtain a copy of the License at http://www.bitto... | 2.0625 | 2 |
python/mxnet/gluon/probability/transformation/domain_map.py | pioy/incubator-mxnet | 211 | 12793693 | <filename>python/mxnet/gluon/probability/transformation/domain_map.py
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you ... | 1.96875 | 2 |
chains/front/network.py | thirionjl/chains | 2 | 12793694 | <filename>chains/front/network.py
import abc
from ..core import node_factory as f, initializers as init
from ..core.graph import Node, Graph
from ..core.static_shape import Dim
from ..utils import validate
from ..utils.naming import NameGenerator
class Network(abc.ABC):
def __init__(self):
self.cost_gra... | 2.625 | 3 |
tests/browser/pages/external/events_registration.py | mayank-sfdc/directory-tests | 4 | 12793695 | <filename>tests/browser/pages/external/events_registration.py
# -*- coding: utf-8 -*-
"""Event Registration Page Object."""
from selenium.webdriver.remote.webdriver import WebDriver
from directory_tests_shared import URLs
from directory_tests_shared.enums import PageType, Service
from directory_tests_shared.utils impo... | 2.015625 | 2 |
server/empous/utils.py | Slruh/Empous-Control-The-World | 1 | 12793696 | <reponame>Slruh/Empous-Control-The-World
#Takes in a list of games
def dictify_games(games, empous_user):
game_list = dict()
for game in games:
game_stats = dict()
game_stats["id"] = game.id
if game.victor == empous_user:
game_stats['isVictor'] = "yes"
else:
game_stats['isVictor'] = "no"
if game.c... | 2.96875 | 3 |
lnxproc/netsnmp.py | eccles/lnxproc | 1 | 12793697 | '''
Contains the NetSnmp() class
Typical contents of file /proc/net/snmp::
Ip: Forwarding DefaultTTL InReceives InHdrErrors InAddrErrors ForwDatagrams
InUnknownProtos InDiscards InDelivers OutRequests OutDiscards OutNoRoutes
ReasmTimeout ReasmReqds ReasmOKs ReasmFails FragOKs FragFails FragCreates
Ip:... | 1.773438 | 2 |
models/cae.py | TimCJanke/ImplicitGenerativeCopulas | 0 | 12793698 | """
@author: <NAME>, Energy Information Networks & Systems @ TU Darmstadt
"""
import numpy as np
import tensorflow as tf
from models.igc import ImplicitGenerativeCopula, GMMNCopula
from models.utils import cdf_interpolator
import pyvinecopulib as pv
from models import mv_copulas
import matplotlib.pyplot as plt
class... | 2.34375 | 2 |
Examples/Actor.py | VincentsCode/Smart-Room-Projekt | 0 | 12793699 | import socket
import Constants
# Create a TCP/IP socket
socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
socket.bind(('', 1339))
socket.listen(1)
while True:
connection, client_address = socket.accept()
print('connection from', client_address)
while True:
# noinspection PyBroadException... | 2.96875 | 3 |
pytools/lib/readqc_report.py | virtualparadox/bbmap | 134 | 12793700 | #! /usr/bin/env python
# -*- coding: utf-8 -*-
"""
Readqc report: record stat key-value in readqc-stats.txt
### JGI_Analysis_Utility_Illumina::illumina_read_level_report
Created: Jul 24 2013
sulsj (<EMAIL>)
"""
import os
import sys
## custom libs in "../lib/"
srcDir = os.path.dirname(__file__)
sys.path.appe... | 1.96875 | 2 |
deathgod/directions.py | wmakley/deathgod | 0 | 12793701 | """Constants indicating compass directions used throughout deathgod."""
(NORTH, NORTHEAST, EAST, SOUTHEAST, SOUTH, SOUTHWEST, WEST, NORTHWEST) = list(range(8))
| 1.710938 | 2 |
twitter_crawler/got/manager/TweetGenerator.py | AlexHtZhang/A-billion-dollar-deal | 0 | 12793702 | import json,sys,cookielib
from pyquery import PyQuery
from .. import models
from . import TweetCriteria
from . import TweetHelper
class TweetGenerator(object):
def __init__(self, noTweets = sys.maxint, tweetCriteria = TweetCriteria()):
assert isinstance(tweetCriteria, dict)
self.noTweets = noTweets
... | 2.8125 | 3 |
controllers/default.py | orbnauticus/metabase | 0 | 12793703 | # -*- coding: utf-8 -*-
# this file is released under public domain and you can use without limitations
#########################################################################
## This is a sample controller
## - index is the default action of any application
## - user is required for authentication and authorization... | 2.359375 | 2 |
openstack_dashboard/dashboards/idm/organizations/tests.py | agaldemas/horizon | 0 | 12793704 | # Copyright (C) 2014 Universidad Politecnica de Madrid
#
# 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 la... | 1.742188 | 2 |
PythonDesafios/d049.py | adaatii/Python-Curso-em-Video- | 0 | 12793705 | <filename>PythonDesafios/d049.py
#Refaça o DESAFIO 9, mostrando a tabuada
# de um número que o usuário escolher,
# só que agora utilizando um laço for.
num = int(input('Digite o numero da tabuada que deseja ver: '))
for i in range(1, 11):
print('{} X {} = {}'.format(i, num, i*num)) | 4.0625 | 4 |
bookwyrm/tests/templatetags/test_notification_page_tags.py | mouse-reeve/fedireads | 270 | 12793706 | <gh_stars>100-1000
""" style fixes and lookups for templates """
from unittest.mock import patch
from django.test import TestCase
from bookwyrm import models
from bookwyrm.templatetags import notification_page_tags
@patch("bookwyrm.activitystreams.add_status_task.delay")
@patch("bookwyrm.activitystreams.remove_stat... | 2.234375 | 2 |
programming_ex/ex-11/POplanning/numbers.py | nnhjy/AI-python | 0 | 12793707 | <gh_stars>0
# State space problems with observability
#
# States
# applActions actions applicabable in the state
# succs successor states of the state w.r.t. action
# preds predecessor states of the state w.r.t. action
# compatible Is the state compatible with an observation?
# Actions
# ... | 3.375 | 3 |
boxm/update_downtown.py | mirestrepo/voxels-at-lems | 2 | 12793708 | <reponame>mirestrepo/voxels-at-lems
import boxm_batch;
import os;
import time;
boxm_batch.register_processes();
boxm_batch.register_datatypes();
#time.sleep(10);
class dbvalue:
def __init__(self, index, type):
self.id = index # unsigned integer
self.type = type # string
# Capitol
model_dir = "/Users/i... | 2.1875 | 2 |
sftpsync/command_line.py | marccarre/sftpsync | 1 | 12793709 | import sys
from sys import argv, exit
import os
from os import linesep
from getopt import getopt, GetoptError
import re
import socks
from getpass import getuser
ERROR_ILLEGAL_ARGUMENTS = 2
def usage(error_message=None):
if error_message:
sys.stderr.write('ERROR: ' + error_message + linesep)
sys.stdo... | 2.53125 | 3 |
test_flexipy/test_faktura.py | Vitexus/flexipy | 3 | 12793710 | # -*- coding: utf-8 -*-
from flexipy import Faktura
from flexipy import config
import requests
import json
class TestFaktura:
def setup(self):
self.conf = config.TestingConfig()
server_settings = self.conf.get_server_config()
self.username = str(server_settings['username'])
self.password = str(server_settin... | 2.609375 | 3 |
note-input/main.py | hyper-neutrino/hack-the-north-2017 | 0 | 12793711 | <filename>note-input/main.py
import subprocess
import sys
import re
import json
import os
import requests
requests.get("http://localhost:5000/recorder/set_killee_process?pid=%s" % os.getpid())
try:
port = int(sys.argv[-1])
except:
print("Usage:\npython3 main.py <port>")
sys.exit(-1)
process = subprocess.... | 2.46875 | 2 |
Chinchira19041.py | fujisaki-tamago/anime2021 | 2 | 12793712 | from anime2021.anime import *
chinchira_url = 'https://1.bp.blogspot.com/-OBrXImM0Sd4/X5OcFkxjEnI/AAAAAAABb40/HSDcWu_nYSUbAmRlWro9bHF6pkZJEyFngCNcBGAsYHQ/s789/animal_mawashi_guruma_chinchira.png'
class RollingChinchira(AImage):
def __init__(self, width=100, height=100, cx=None, cy=None, image=chinchira_url, scale=... | 2.890625 | 3 |
eland/tests/field_mappings/test_metric_source_fields_pytest.py | redNixon/eland | 0 | 12793713 | <reponame>redNixon/eland
# Copyright 2019 Elasticsearch BV
#
# 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
#
# Unl... | 2.125 | 2 |
runfiles/internal/codegen.bzl | fmeum/rules_runfiles | 7 | 12793714 | # Copyright 2021 <NAME>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, soft... | 2.109375 | 2 |
workplace_extractor/Nodes/__init__.py | denisduarte/workplace_extractor | 0 | 12793715 | <reponame>denisduarte/workplace_extractor
# from workplace_extractor.Nodes.Node import Node
# from workplace_extractor.Nodes.NodeCollection import NodeCollection, PostCollection
# from workplace_extractor.Nodes.Post import Post
# from workplace_extractor.Nodes.Group import Group
| 1.171875 | 1 |
src/debruijnextend/utils.py | Dreycey/DebruijnExtend | 0 | 12793716 | """
This module contains methods/objects that facilitate
basic operations.
"""
# std pkgs
import numpy as np
import random
from typing import Dict, List, Optional, Union
from pathlib import Path
import pickle
# non-std pkgs
import matplotlib.pyplot as plt
def hamming_dist(k1, k2):
val = 0
for ind, char in e... | 3.15625 | 3 |
ESP8266/WIFI/httpcc/WebControl.py | 1021256354/ELE-Clouds | 3 | 12793717 | <gh_stars>1-10
# -*- coding: UTF-8 -*-
u'''
******************************************************************************
* 文 件:WebControl.py
* 概 述:Web页面控制设备
* 版 本:V0.10
* 作 者:<NAME>
* 日 期:2018年5月8日
* 历 史: 日期 编辑 版本 记录
2018年5月8日 <NAME> V0.10 创建文件
**************... | 2.125 | 2 |
taiseia101/dehumidifier.py | slee124565/pytwseia | 3 | 12793718 | <reponame>slee124565/pytwseia
from taiseia101.core import *
logger = logging.getLogger(__name__)
class Dehumidifier(GeneralDevice):
dev_type = {'id': DeviceTypeCode.DEHUMIDIFIER, 'name': 'DEHUMIDIFIER'}
class ServiceCode(BaseObject):
POWER_RW = 0x00
OP_MODE_RW = 0x01
OP_TIMER_RW = 0x... | 2.09375 | 2 |
tcp_connectors/gmqtt_connector.py | evocount/connectors | 2 | 12793719 | import asyncio
import logging
import uuid
import ssl
from gmqtt import Client as MQTTClient
from .exceptions import ConnectionFailed, DestinationNotAvailable
from .base import BaseConnector
logger = logging.getLogger(__name__)
class GMQTTConnector(BaseConnector):
"""GMQTTConnector uses gmqtt library for conne... | 2.546875 | 3 |
server/tests/steps/__init__.py | JeremyJacquemont/weaverbird | 54 | 12793720 | <reponame>JeremyJacquemont/weaverbird
"""
This module contains unit tests for every supported pipeline step
"""
| 0.71875 | 1 |
docs/tutorials/scripts/pure_scattering_plot.py | christopherlovell/hyperion | 37 | 12793721 | import matplotlib.pyplot as plt
from hyperion.model import ModelOutput
from hyperion.util.constants import pc
mo = ModelOutput('pure_scattering.rtout')
image_fnu = mo.get_image(inclination=0, units='MJy/sr', distance=300. * pc)
image_pol = mo.get_image(inclination=0, stokes='linpol')
fig = plt.figure(figsize=(8, 8))... | 2.3125 | 2 |
hug_peewee/__init__.py | timothycrosley/hug_peewee | 7 | 12793722 | """Defines how the hug_peewee package exposes modules as well as exposes it's version number"""
from hug_peewee._version import current
from hug_peewee.connection import ENGINES
from hug_peewee import connection
__version__ = current
| 1.539063 | 2 |
aoc2021/day05-hydrotermal_venture/solution2021d05.py | carloscabello/AoC | 0 | 12793723 | """Day 4: Giant Squid"""
import sys, os, inspect
# necessary to import aoc2021/utils.py moudule
currentdir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))
parentdir = os.path.dirname(currentdir)
sys.path.insert(1, os.path.join(sys.path[0], '..'))
import utils
exampledata = ['0,9 -> 5,9'... | 3.234375 | 3 |
enabling_addons/enabling_addons_example_2.py | CGArtPython/bpy_building_blocks_examples | 0 | 12793724 | <gh_stars>0
import bpy
import addon_utils
def enable_addon(addon_module_name):
loaded_default, loaded_state = addon_utils.check(addon_module_name)
if not loaded_state:
addon_utils.enable(addon_module_name)
##########################################################
# _____ ... | 1.953125 | 2 |
src/15/15953.py | youngdaLee/Baekjoon | 11 | 12793725 | """
15953. 상금 헌터
작성자: xCrypt0r
언어: Python 3
사용 메모리: 29,380 KB
소요 시간: 160 ms
해결 날짜: 2020년 9월 25일
"""
def main():
for _ in range(int(input())):
a, b = map(int, input().split())
money = 0
if a == 1: money += 5000000
elif 2 <= a <= 3: money += 3000000
elif 4 <= a <= 6: money +... | 3.609375 | 4 |
srcs/sg/objects/abstract_object.py | pomponchik/computor_v2 | 0 | 12793726 | <reponame>pomponchik/computor_v2
from srcs.errors import RuntimeASTError
class AbstractObject:
def __init__(self):
raise NotImplementedError
@classmethod
def create_from_node(cls, node):
raise NotImplementedError('operation not defined')
def representation(self, context):
rai... | 2.5 | 2 |
utils/cal_normalize.py | qaz670756/LSNet | 3 | 12793727 | import numpy as np
import cv2
import os
from glob import glob
from tqdm import tqdm
img_h, img_w = 256, 256
means, stdevs = [], []
img_list = []
TRAIN_DATASET_PATH = 'data/Real/subset/train/B'
image_fns = glob(os.path.join(TRAIN_DATASET_PATH, '*.*'))
for single_img_path in tqdm(image_fns):
img = cv2.imread(sing... | 2.46875 | 2 |
iniciante/python/2493-jogo-do-operador.py | tfn10/beecrowd | 0 | 12793728 | <gh_stars>0
def jogo_do_operador():
while True:
expressoes = list()
resposta_dos_jogadores = list()
jogadores_que_erraram = list()
try:
quantidade_de_expressoes = int(input())
for expre in range(quantidade_de_expressoes):
expressoes.append(list... | 3.578125 | 4 |
a06_Seq2seqWithAttention/a1_seq2seq.py | sunshinenum/text_classification | 7,723 | 12793729 | # -*- coding: utf-8 -*-
import tensorflow as tf
# 【该方法测试的时候使用】返回一个方法。这个方法根据输入的值,得到对应的索引,再得到这个词的embedding.
def extract_argmax_and_embed(embedding, output_projection=None):
"""
Get a loop_function that extracts the previous symbol and embeds it. Used by decoder.
:param embedding: embedding tensor for symbol
... | 3.21875 | 3 |
kitsune/users/migrations/0025_auto_20200926_0638.py | The-smooth-operator/kitsune | 929 | 12793730 | # Generated by Django 2.2.14 on 2020-09-26 06:38
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('users', '0024_auto_20200914_0433'),
]
operations = [
migrations.AlterModelOptions(
name='profile',
options={'permissions': ... | 1.375 | 1 |
mysite/services/plot_bound_service.py | mscibxablach/PhotoApp2 | 0 | 12793731 | <gh_stars>0
from mysite.plot_bound_detector.PlotBoundCalculator import PlotBoundCalculator
class PlotBoundService:
def __init__(self, plot_bound_detector):
self.plot_bound_detector = plot_bound_detector
def get_plot_bound_ratio(self, image):
top_chunks, bottom_chunks = self.plot_bound_detecto... | 2.515625 | 3 |
main.py | csepy/csepy | 1 | 12793732 | <filename>main.py<gh_stars>1-10
#!/usr/bin/python3
import sys
from csepy.csepy import Start
if len(sys.argv) > 1:
Start(sysargs=sys.argv)
elif __name__ == '__main__':
Start()
| 1.875 | 2 |
handlers/other/clan.py | roomdie/KingsEmpiresBot | 0 | 12793733 | <gh_stars>0
import typing
import keyboards
import states
import re
import random
from loader import dp
from aiogram import types
from aiogram.dispatcher import filters
from aiogram import exceptions
from aiogram.dispatcher import FSMContext
from utils.misc.read_file import read_txt_file
from utils.db_api import tabl... | 2.171875 | 2 |
trojsten/settings/wiki.py | MvonK/web | 5 | 12793734 | from trojsten.settings.production import *
SITE_ID = 6
NAVBAR_SITES = [1, 3, 4, 5]
ROOT_URLCONF = "trojsten.urls.wiki"
| 1.265625 | 1 |
bubblegum/backend/mpl/contour.py | danielballan/xray-vision | 4 | 12793735 | # ######################################################################
# Copyright (c) 2014, Brookhaven Science Associates, Brookhaven #
# National Laboratory. All rights reserved. #
# #
# Redistribution and use in ... | 0.855469 | 1 |
utilities/GraphLoss.py | adik0861/RetinaNet | 0 | 12793736 | import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
from pathlib import Path
import re
import io
loss = Path.cwd().parent.joinpath('savefiles', 'checkpoints', 'loss.log').read_text()
loss = re.sub(r'[\]\[]', '', loss)
df = pd.read_csv(io.StringIO(loss), names=['epoch', 'iteration', 'cls_loss', 'box... | 2.671875 | 3 |
uam_simulator/agent.py | colineRamee/UAM_simulator_scitech2021 | 1 | 12793737 | import math
import numpy as np
from uam_simulator import my_utils
from uam_simulator import pathPlanning
from uam_simulator import orca
import gurobipy as grb
from gurobipy import GRB
import time as python_time
class Flightplan:
def __init__(self, t0, dt, positions, times=None):
self.start_time = t0
... | 2.796875 | 3 |
authentik/stages/user_delete/apps.py | BeryJu/passbook | 15 | 12793738 | <reponame>BeryJu/passbook
"""authentik delete stage app config"""
from django.apps import AppConfig
class AuthentikStageUserDeleteConfig(AppConfig):
"""authentik delete stage config"""
name = "authentik.stages.user_delete"
label = "authentik_stages_user_delete"
verbose_name = "authentik Stages.User D... | 1.5625 | 2 |
analyze.py | satamame/pscscrape | 0 | 12793739 | # %%
import os
import matplotlib.pyplot as plt
# %% 設定
datasets = ['hariko/scripts',]
# %% "「" を含む行数をカウントする関数
def count_kakko(f_path):
'''行数と "「" を含む行数を取得する
parameters
----------
f_path : str
調査するファイルのパス名
returns
-------
lines : int
ファイルの行数
lines_with_kakko
... | 2.40625 | 2 |
source/cognidron/interfaces/eeg/eegInterfaz.py | dregmli/cognidron | 1 | 12793740 | <gh_stars>1-10
# Para usar esta clase como una interfaz en POO se utiliza esta libreria
# mas info en: https://www.python-course.eu/python3_abstract_classes.php
from abc import ABC, abstractmethod
class EegInterfaz(ABC):
"""
Interfaz abstracta que debe implementarse para conectar el cognidron con el dis... | 3.328125 | 3 |
tpDcc/tools/unittests/core/toolset.py | tpDcc/tpDcc-tools-unittest | 0 | 12793741 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Toolset implementation for tpDcc-tools-unittests
"""
from __future__ import print_function, division, absolute_import
from tpDcc.libs.qt.widgets import toolset
class UnitTestsToolsetWidget(toolset.ToolsetWidget, object):
def __init__(self, *args, **kwargs):
... | 2.015625 | 2 |
examples/example_GenericSignal.py | ishine/acoular | 294 | 12793742 | # -*- coding: utf-8 -*-
"""
"""
from pylab import *
from acoular import *
# files
datafile = 'example_data.h5'
t1 = MaskedTimeSamples(name=datafile)
t1.start = 0 # first sample, default
t1.stop = 16000 # last valid sample = 15999
invalid = [1,7] # list of invalid channels (unwanted microphones etc... | 2.25 | 2 |
gcn/subsample.py | floregol/gcn | 1 | 12793743 | import random
import time
import numpy as np
import copy
from itertools import compress
random.seed(123)
#remove columns from adj matrix.
#TODO needs additional scaling?
#Be carefull too not modify the initial complete support matrix
def get_sub_sampled_support(complete_support, node_to_keep):
index_array = comp... | 2.28125 | 2 |
utils/add_entry.py | capitanu/DD2477-project | 0 | 12793744 | <gh_stars>0
#!/usr/bin/env python
from elasticsearch import Elasticsearch
es = Elasticsearch()
entry = {
"word" : "the",
"list": [
{
"docID" : "3",
"offsetlist" : ["3", "5", "14", "15"]
},
{
"docID" : "14",
"offsetlist" : ["2", "8", "27"... | 2.578125 | 3 |
features/steps/fizz_buzz_steps.py | lazaromer97/fizz-buzz-test | 1 | 12793745 | <gh_stars>1-10
from behave import given, when, then
def fizz_buzz(since: int, until: int) -> dict:
data = {}
for num in range(since, until+1):
if num % 15 == 0:
data[str(num)] = 'FizzBuzz'
elif num % 5 == 0:
data[str(num)] = 'Buzz'
elif num % 3 == 0:
... | 2.90625 | 3 |
openspeech/datasets/librispeech/preprocess/subword.py | CanYouImagine/openspeech | 207 | 12793746 | # MIT License
#
# Copyright (c) 2021 <NAME> and <NAME> and <NAME>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy... | 2.09375 | 2 |
appg/views/admin_list_examples.py | poxstone/appg | 0 | 12793747 | <filename>appg/views/admin_list_examples.py
# -*- coding: utf-8 -*-
from flask.views import View
from flask import flash, redirect, url_for, jsonify, render_template, request
import json
from google.appengine.api import users
from google.appengine.runtime.apiproxy_errors import CapabilityDisabledError
from forms imp... | 2.1875 | 2 |
tests/auth/test_auth_models.py | ethanaggor/twitter-clone | 0 | 12793748 | <reponame>ethanaggor/twitter-clone
"""Tests for `app.auth.models.User` class."""
import pytest
from werkzeug.exceptions import HTTPException
from app import db
from app.auth.models import User
from tests.conftest import CleanTestingMixin
class TestUserExistence(CleanTestingMixin):
"""Test the existence of our `... | 2.796875 | 3 |
openmdao/examples/subproblem_example.py | naylor-b/OpenMDAO1 | 17 | 12793749 |
import sys
from math import pi
from openmdao.api import Problem, Group, Component, IndepVarComp, ExecComp, \
ScipyOptimizer, SubProblem, CaseDriver
class MultiMinGroup(Group):
"""
In the range -pi <= x <= pi
function has 2 local minima, one is global
global min is: f(x) =... | 3.09375 | 3 |
modules/utils/br_feat_orc_creator.py | guilhermemg/trace-links-tc-br | 0 | 12793750 | # utilitary functions to create the expert and volunteers oracles from the taskruns dataset
import pandas as pd
from modules.utils import aux_functions
from modules.utils import firefox_dataset_p2 as fd
class Br_Feat_Oracle_Creator:
def __init__(self, bugreports, features):
self.bugreports = bugrepo... | 2.515625 | 3 |