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 |
|---|---|---|---|---|---|---|
quetz/migrations/versions/30241b33d849_add_task_pending_state.py | maresb/quetz | 108 | 28300 | <gh_stars>100-1000
"""add task pending state
Revision ID: 30241b33d849
Revises: cd<PASSWORD>
Create Date: 2021-01-07 14:39:43.251123
"""
import sqlalchemy as sa
from alembic import op
# revision identifiers, used by Alembic.
revision = '<KEY>'
down_revision = 'cd404ed93cc0'
branch_labels = None
depends_on = None
d... | 1.554688 | 2 |
tests/RL_cache.py | RasoulNik/Deep-Reinforcement-Learning-Algorithms-with-PyTorch | 0 | 28301 | import random
import matplotlib.pyplot as plt
import gym
# from agents.actor_critic_agents.A2C import A2C
# from agents.actor_critic_agents.A3C import A3C
# from agents.actor_critic_agents.SAC import SAC
from agents.actor_critic_agents.SAC_Discrete import SAC_Discrete
# from agents.DQN_agents.DQN_HER import DQN_HER
#... | 1.875 | 2 |
train_meta.py | Huadous/eecs545finalproject | 4 | 28302 | import os, argparse, torch, math, time, random
from os.path import join, isfile
import torch.nn.functional as F
from torch.optim import SGD
from torch.distributions import Beta
from tensorboardX import SummaryWriter
import torchvision
import modified_vgg
from dataloader import dataloader1
import dataloader
from utils ... | 1.875 | 2 |
Monitor/MonitorPlatform/webshell_detect/jsp_cnn_model.py | Leeyuxun/CNN-WebShell-Detect-Tool | 2 | 28303 | <reponame>Leeyuxun/CNN-WebShell-Detect-Tool
# coding=utf-8
import commands
import multiprocessing
import os
import re
import gensim
import numpy as np
import tensorflow as tf
import tflearn
from sklearn import metrics
from tflearn.data_utils import to_categorical
from tflearn.layers.conv import conv_1d, global_max_poo... | 2.484375 | 2 |
Task1/1.py | phumin1994/AiTasks | 0 | 28304 | import pandas as pd
df = pd.read_csv('data.csv') # read the data
print(df)
def median(list_vales):
n_num = list_vales
n = len(n_num)
n_num.sort()
if n % 2 == 0:
median1 = n_num[n // 2]
median2 = n_num[n // 2 - 1]
median = (median1 + median2) / 2
else:
median = n_n... | 3.625 | 4 |
RGBMatrixEmulator/graphics/__init__.py | WardBrian/RGBMatrixEmulator | 0 | 28305 | from skimage.draw import line as sk_line
from skimage.draw import circle_perimeter as sk_circle_perimeter
from RGBMatrixEmulator.graphics.color import Color
from RGBMatrixEmulator.graphics.font import Font
def DrawText(canvas, font, x, y, color, text):
# Early return for empty string prevents bugs in bdfparser l... | 2.90625 | 3 |
dorado/scheduling/scripts/skygrid.py | bwgref/dorado-scheduling | 6 | 28306 | #
# Copyright © 2021 United States Government as represented by the Administrator
# of the National Aeronautics and Space Administration. No copyright is claimed
# in the United States under Title 17, U.S. Code. All Other Rights Reserved.
#
# SPDX-License-Identifier: NASA-1.3
#
"""Generate a grid of pointings on the sk... | 2.453125 | 2 |
python/euler002/euler002.py | marvins/ProjectEuler | 0 | 28307 | <filename>python/euler002/euler002.py
#!/usr/bin/env python
#---------------------------------#
#- Fibonacci Lookup Table -#
#---------------------------------#
fib_table = {0:0, 1:1, 2:1, 3:2}
#---------------------------------#
#- Compute Fibonacci Value -#
#---------------------------------#
def Fibon... | 3.921875 | 4 |
aiidalab_sssp/steps.py | aiidalab/aiidalab-sssp | 0 | 28308 | <reponame>aiidalab/aiidalab-sssp<gh_stars>0
"""widget for pseudo inmport"""
import io
import os
import ipywidgets as ipw
import traitlets
from aiida import orm
from aiida.common import NotExistent
from aiida.engine import ProcessState, submit
from aiida.orm import Node, ProcessNode, load_code
from aiida.plugins import... | 2.203125 | 2 |
bin/vigilance-server.py | EricMountain/weather_risk_metrics | 0 | 28309 | <filename>bin/vigilance-server.py
#!/usr/bin/python3
from prometheus_client import start_http_server, Gauge
import urllib.request
import random
from datetime import datetime
import re
import time
test = False
risks = ["vent violent", "pluie-inondation", "orages", "inondation", "neige-verglas", "canicule", "grand-froi... | 2.65625 | 3 |
examples/tutorial/paging_exception_force.py | Wlgen/force-riscv | 0 | 28310 | <filename>examples/tutorial/paging_exception_force.py
#
# Copyright (C) [2020] Futurewei Technologies, Inc.
#
# FORCE-RISCV is 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.a... | 2.375 | 2 |
test.py | letri6tdn/PythonScript_URLshortener | 0 | 28311 | # main.py
#----------------------------------------------------------------------#
#
#
#
#----------------------------------------------------------------------#
from math import floor
from sqlite3 import OperationalError
import string, sqlite3
from urllib.parse import urlparse
import http.server
import socketserver
... | 2.8125 | 3 |
SimpleHTTPSAuthServer.py | oza6ut0ne/SimpleHTTPSAuthServer | 0 | 28312 | import base64
import os
import random
import re
import socket
import sys
import ssl
import string
if sys.version_info[0] == 2:
from BaseHTTPServer import HTTPServer as Server
from SimpleHTTPServer import SimpleHTTPRequestHandler as Handler
from SocketServer import ThreadingMixIn
from httplib import UNA... | 2.96875 | 3 |
image/__init__.py | navroz-lamba/Image-Classifier-using-VGG-19-CNN | 1 | 28313 | import flask
from flask import Flask, url_for
from tensorflow.keras.applications.imagenet_utils import preprocess_input, decode_predictions
from tensorflow.keras.models import load_model
from tensorflow.keras.preprocessing import image
import numpy as np
# instantiating a class object
app = Flask(__name__)
model_pat... | 2.90625 | 3 |
interface/tasks.py | cni-iisc/campus-rakshak-simulator-app | 1 | 28314 | <reponame>cni-iisc/campus-rakshak-simulator-app
from __future__ import absolute_import
from .helper import convert, run_aggregate_sims
from django.core.files import File
from celery import shared_task
from django.core.mail import EmailMultiAlternatives
from django.conf import settings
from anymail.exceptions import An... | 1.804688 | 2 |
lightweight_mmm/media_transforms_test.py | google/lightweight_mmm | 45 | 28315 | <reponame>google/lightweight_mmm<filename>lightweight_mmm/media_transforms_test.py<gh_stars>10-100
# Copyright 2022 Google LLC.
#
# 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://... | 2.0625 | 2 |
tests/plugins/inventory/test_simple_inventory.py | kyawmyomin/nornir | 0 | 28316 | <filename>tests/plugins/inventory/test_simple_inventory.py
import os
from nornir.plugins.inventory import SimpleInventory
dir_path = os.path.dirname(os.path.realpath(__file__))
class Test:
def test(self):
host_file = f"{dir_path}/data/hosts.yaml"
group_file = f"{dir_path}/data/groups.yaml"
... | 2.53125 | 3 |
main.py | shipwreckdev/cloudflare-reconciler | 0 | 28317 | <filename>main.py<gh_stars>0
import argparse
import json
import os
import requests
import lib.cf as cf
import lib.aws as aws
import lib.gh as gh
version = "v1.0"
api_base = 'https://api.cloudflare.com/client/v4/zones'
api_key = os.getenv("CLOUDFLARE_API_KEY")
content_type = 'application/json'
email = os.getenv("CLOUD... | 2.65625 | 3 |
app/helpers.py | QwertygidQ/phystech-backend | 0 | 28318 | from flask import request, jsonify
from functools import wraps
from schema import SchemaError
def json_required(func):
@wraps(func)
def wrapper(*args, **kwargs):
if not request.data or not request.json:
return jsonify({
'status': 'Error',
'reason': 'No JSON ... | 2.734375 | 3 |
tests/__init__.py | zhester/jdi | 0 | 28319 | <filename>tests/__init__.py
#=============================================================================
#
# JDI Unit Tests
#
#=============================================================================
"""
JDI Unit Tests
==============
Run all unit tests from project's root directory.
python -m unittest dis... | 2.03125 | 2 |
Part-03-Understanding-Software-Crafting-Your-Own-Tools/models/edx-platform/lms/djangoapps/grades/course_grade.py | osoco/better-ways-of-thinking-about-software | 3 | 28320 | <reponame>osoco/better-ways-of-thinking-about-software
"""
CourseGrade Class
"""
from abc import abstractmethod
from collections import OrderedDict, defaultdict
from ccx_keys.locator import CCXLocator
from django.conf import settings
from lazy import lazy
from openedx.core.lib.grade_utils import round_away_from_zer... | 2.84375 | 3 |
horoscope.py | Srol/Slack-Horoscope-Bot | 2 | 28321 | import os
import feedparser
import json
from flask import Flask, request
# Add your Slack token to the variable below.
SLACK_TOKEN = ""
url = ""
payload = {}
headers = {'content-type': 'application/json'}
app = Flask(__name__)
# this endpoint listens for incoming slash commands from Slack.
@app.route('/horos', metho... | 3 | 3 |
scripts/segmentation/PointNet/run_pointnet_segmentation.py | devskroy1/ForkedBrainSurfaceTK | 0 | 28322 | <reponame>devskroy1/ForkedBrainSurfaceTK<filename>scripts/segmentation/PointNet/run_pointnet_segmentation.py
import os.path as osp
PATH_TO_ROOT = osp.join(osp.dirname(osp.realpath(__file__)), '..', '..', '..')
import sys
sys.path.append(PATH_TO_ROOT)
import pickle
import time
import numpy as np
import torch
from torch.... | 1.789063 | 2 |
basic_auth/handler.py | andrei-shabanski/s3pypi | 249 | 28323 | import base64
import hashlib
import json
import logging
from dataclasses import dataclass
import boto3
log = logging.getLogger()
region = "us-east-1"
def handle(event: dict, context):
request = event["Records"][0]["cf"]["request"]
try:
authenticate(request["headers"])
except Exception as e:
... | 2.40625 | 2 |
misc/zip/Cura-master/plugins/CuraEngineBackend/ProcessSlicedLayersJob.py | criscola/G-Gen | 1 | 28324 | #Copyright (c) 2017 <NAME>.
#Cura is released under the terms of the LGPLv3 or higher.
import gc
from UM.Job import Job
from UM.Application import Application
from UM.Mesh.MeshData import MeshData
from UM.Preferences import Preferences
from UM.View.GL.OpenGLContext import OpenGLContext
from UM.Message import Message... | 2.140625 | 2 |
sts/metric.py | LostCow/KLUE | 18 | 28325 | <reponame>LostCow/KLUE
from datasets import load_metric
def compute_metrics(pred):
pearson = load_metric("pearsonr").compute
references = pred.label_ids
predictions = pred.predictions
metric = pearson(predictions=predictions, references=references)
return metric
| 1.976563 | 2 |
BITs/2014/Abdrahmanova_G_I/task_3_1.py | YukkaSarasti/pythonintask | 0 | 28326 | #Задача 3. Вариант 1.
#Напишите программу, которая выводит имя "<NAME>", и запрашивает его псевдоним. Программа должна сцеплять две эти строки и выводить полученную строку, разделяя имя и псевдоним с помощью тире.
name=input('Герой нашей сегодняшней программы - <NAME>. \nПод каким же именем мы знаем этого человека? ')
... | 3.96875 | 4 |
musiquepy/data/db.py | vitormoura/musiquepy | 0 | 28327 | <reponame>vitormoura/musiquepy
import io
import logging
import os
import pathlib
from datetime import datetime
from typing import List
from musiquepy.data.errors import MusiquepyExistingUserError
from musiquepy.data.media import get_profile_pictures_dir
from musiquepy.data.model import (
Album, AlbumPhoto, Artist,... | 2.375 | 2 |
main.py | Drejky/Genetic-ML | 0 | 28328 | <filename>main.py<gh_stars>0
import random
from copy import deepcopy, copy
import timeit
adrMask = 63 #mask to get our addr bits
cmdMask = 192 #mask to get our command bits
stepLim = 500 #Limited num of instructions
tourFlag = int(input("Input 1 for tournament, 0 for roulette"))
mixFlag = int(input("... | 2.859375 | 3 |
wordVerification.py | Androcks/SlideWord | 0 | 28329 | <reponame>Androcks/SlideWord
import enchant
##Use our custom word list
wordList = enchant.request_pwl_dict("truncListWords.txt")
##Takes our string from the stage and checks it
def checkForWord(playerString) :
return wordList.check(playerString)
| 2.453125 | 2 |
server/main/components/widgets_content.py | INRIM/forms-theme-italia | 0 | 28330 | from .widgets_base import WidgetsBase
class PageWidget(WidgetsBase):
def __init__(self, templates_engine, request, settings, schema={}, resource_ext=None, disabled=False, **kwargs):
super(PageWidget, self).__init__(templates_engine, request, **kwargs)
self.base_path = kwargs.get('base_path', "/")... | 2.140625 | 2 |
app/pages/forms.py | MicroprocessorX069/Todo-web-app | 0 | 28331 | from flask_wtf import FlaskForm
from wtforms import StringField, PasswordField, BooleanField, SubmitField, TextAreaField
from wtforms.validators import ValidationError, DataRequired, Email, EqualTo, Length
from app.models import User
from flask import request
class CreateChallengeForm(FlaskForm):
name = StringField('... | 2.765625 | 3 |
study/hfppnetwork/hfppnetwork/sms/logginghelper.py | NASA-Tournament-Lab/CoECI-CMS-Healthcare-Fraud-Prevention | 7 | 28332 | <reponame>NASA-Tournament-Lab/CoECI-CMS-Healthcare-Fraud-Prevention
# -*- coding: utf-8 -*-
"""
Copyright (C) 2013 TopCoder Inc., All Rights Reserved.
This is the module that defines logging helper methods
This module resides in Python source file logginghelper.py
Thread Safety:
It is thread safe because no module-lev... | 2.5625 | 3 |
hw8/next_permutation.py | alexander-paskal/ece143-hw | 1 | 28333 | """
Given a permutation of any length, generate the next permutation in lexicographic order.
For example, this are the permutations for [1,2,3] in lexicographic order.
# >>> list(it.permutations([1,2,3]))
[(1, 2, 3), (1, 3, 2), (2, 1, 3), (2, 3, 1), (3, 1, 2), (3, 2, 1)]
Then, your function next_permutation(t:tuple)... | 4.09375 | 4 |
8/8.10/great_magician.py | singi2016cn/python-scaffold | 0 | 28334 | <gh_stars>0
# 魔术师
def show_magicians(magicians):
for magician in magicians:
print('magician\'s name is ' + magician)
def make_great(magicians):
i = 0
for item in magicians:
magicians[i] = 'The Great ' + item
i = i + 1
magicians = ['singi', 'sunjun']
make_great(magicians)
show_... | 3.625 | 4 |
scratchpad/voids_paper/bin/tests/test_smartvis.py | arshadzahangirchowdhury/TomoEncoders | 0 | 28335 | <filename>scratchpad/voids_paper/bin/tests/test_smartvis.py<gh_stars>0
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
"""
import numpy as np
import matplotlib.pyplot as plt
import os
import h5py
import sys
import time
import seaborn as sns
import pandas as pd
sys.path.append('/home/atekawade/TomoEncoders/scra... | 1.875 | 2 |
src/Python/flask/app.py | mwaseem75/iris-python-template | 0 | 28336 | <reponame>mwaseem75/iris-python-template
from flask import Flask, jsonify, Response, request, make_response, render_template
from definitions.passenger import Passenger
import json,util,io,random
import iris
from matplotlib.backends.backend_agg import FigureCanvasAgg
from matplotlib.backends.backend_svg import FigureCa... | 2.4375 | 2 |
unihan_db/importer.py | linnaea/unihan-db | 0 | 28337 | from unihan_db.tables import (
UnhnLocation,
UnhnLocationkXHC1983,
UnhnReading,
kCantonese,
kCCCII,
kCheungBauer,
kCheungBauerIndex,
kCihaiT,
kDaeJaweon,
kDefinition,
kFenn,
kFennIndex,
kGSR,
kHanYu,
kHanyuPinlu,
kHanyuPinyin,
kHDZRadBreak,
kIICore... | 1.921875 | 2 |
sylwek/data_provider.py | fizykpl/Synerise2 | 0 | 28338 | <reponame>fizykpl/Synerise2
import time
import numpy as np
from matplotlib import pyplot as plt
from sylwek.similarity_measure import SimilarityMeasure
from utils import mnist_reader
class DataProvider:
images = {}
labels = {}
similarity_measure = None
next_id = -1 #TODO 2. Prosimy nadać każdemu obra... | 2.71875 | 3 |
mmtbx/regression/fix_cablam/tst_one_resid_rotation.py | hbrunie/cctbx_project | 2 | 28339 | from __future__ import absolute_import, division, print_function
import iotbx.pdb
import mmtbx.model
from mmtbx.building.cablam_idealization import cablam_idealization, master_phil
import sys
import libtbx.load_env
pdb_str = """\
ATOM 2327 N GLY A 318 169.195 115.930 63.690 1.00216.32 N
ATOM 23... | 1.507813 | 2 |
mindhome_alpha/erpnext/stock/doctype/batch/test_batch.py | Mindhome/field_service | 1 | 28340 | <reponame>Mindhome/field_service
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
from frappe.exceptions import ValidationError
import unittest
from erpnext.stock.doctype.batch.batch imp... | 1.96875 | 2 |
morphological_analysis_v4.py | rivernuthead/DoD_analysis | 0 | 28341 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed May 25 16:02:58 2022
@author: erri
"""
import os
import numpy as np
import math
from morph_quantities_func_v2 import morph_quantities
import matplotlib.pyplot as plt
# SINGLE RUN NAME
run = 'q07_1'
DoD_name = 'DoD_s1-s0_filt_nozero_rst.txt'
# Step betw... | 2.296875 | 2 |
SimulationLego/laptop.py | MajesticKhan/Reinforcement-Learning | 4 | 28342 | #--------------------------------------------------------Import libraries
import pickle
import socket
import struct
import cv2
from stable_baselines import PPO2
import numpy as np
import imageio
#--------------------------------------------------------Establiosh connection
s = socket.socket(socket.AF_INET,socket.SOCK_... | 2.4375 | 2 |
examples/py/async-generator-multiple-tickers.py | diwenshi61/ccxt | 24,910 | 28343 | <gh_stars>1000+
# -*- coding: utf-8 -*-
import asyncio
import ccxt.async_support as ccxt
async def poll(tickers):
i = 0
kraken = ccxt.kraken()
while True:
symbol = tickers[i % len(tickers)]
yield (symbol, await kraken.fetch_ticker(symbol))
i += 1
await asyncio.sleep(kraken... | 2.921875 | 3 |
sdk/keyvault/azure-keyvault-administration/azure/keyvault/administration/_generated/v7_2_preview/models/__init__.py | vbarbaresi/azure-sdk-for-python | 8 | 28344 | <filename>sdk/keyvault/azure-keyvault-administration/azure/keyvault/administration/_generated/v7_2_preview/models/__init__.py<gh_stars>1-10
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT Lic... | 1.390625 | 1 |
fitbox/consultas/views.py | ravellys/fitbox | 0 | 28345 | # from django.shortcuts import render
# Create your views here.
from django.urls import reverse_lazy
from django.views.generic import CreateView
from fitbox.consultas.forms import ConsultaForm
from fitbox.consultas.models import Consulta
class ConsultaCreateView(CreateView):
template_name = "consultas/cadastro_... | 1.96875 | 2 |
{{cookiecutter.repo_name}}/{{cookiecutter.repo_name}}/settings/base.py | drgarcia1986/cookiecutter-muffin | 3 | 28346 | import os
STATIC_FOLDERS = (
'{{cookiecutter.repo_name}}/common/static',
'{{cookiecutter.repo_name}}/users/static',
)
# Muffin Plugins
PLUGINS = (
'muffin_jinja2',
'muffin_peewee',
'muffin_session',
)
# Plugins configurations
SESSION_SECRET = 'SecretHere'
SESSION_LOGIN_URL = '/users/signin/'
JI... | 1.773438 | 2 |
rpyc/core/netref.py | fruch/rpyc | 0 | 28347 | <gh_stars>0
"""
NetRef - transparent network references implementation.
"""
import sys
import inspect
import types
import cPickle as pickle
from rpyc.core import consts
_local_netref_attrs = frozenset([
'____conn__', '____oid__', '__class__', '__cmp__', '__del__', '__delattr__',
'__dir__', '__doc__', '__geta... | 1.78125 | 2 |
hpc/config_manager.py | PRIDE-Toolsuite/trackhub-creator | 0 | 28348 | <filename>hpc/config_manager.py<gh_stars>0
#
# Author : <NAME>
# Project : trackhub-creator
# Timestamp : 11-09-2017 11:10
# ---
# © 2017 <NAME> <<EMAIL>>
# All rights reserved.
#
"""
Configuration Manager for this HPC Module
"""
if __name__ == '__main__':
print("ERROR: This script is part of a pipeline co... | 1.34375 | 1 |
exampleScripts/basicClusterHoehnerExampleData.py | StSchulze/pyGCluster | 7 | 28349 | <reponame>StSchulze/pyGCluster
#!/usr/bin/env python
"""
Testscript to demonstrate functionality of pyGCluster
This script imports the data of Hoehner et al. (2013) and executes pyGCluster
with 250,000 iterations of resampling. pyGCluster will evoke 4 threads
(if possible), which each require approx. 1.5GB RAM. Ple... | 2.46875 | 2 |
fpga_interchange/convert.py | gatecat/python-fpga-interchange | 27 | 28350 | <gh_stars>10-100
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Copyright (C) 2020 The SymbiFlow Authors.
#
# Use of this source code is governed by a ISC-style
# license that can be found in the LICENSE file or at
# https://opensource.org/licenses/ISC
#
# SPDX-License-Identifier: ISC
""" Utilities for converting ... | 2.203125 | 2 |
sharpy/plans/tactics/speed_mining.py | DuncanDHall/sharpy-sc2 | 0 | 28351 | from typing import List, Dict
from sc2.ids.ability_id import AbilityId
from sc2.position import Point2
from sc2.unit import Unit
from sc2.units import Units
from sharpy.interfaces import IZoneManager
from sharpy.managers.core.roles import UnitTask
from sharpy.plans.acts import ActBase
from sharpy.sc2math import get_in... | 2.34375 | 2 |
build_automation/content_management/migrations/0046_auto_20200228_1432.py | SolarSPELL-Main/DLMS | 0 | 28352 | # Generated by Django 2.1.3 on 2020-02-28 21:32
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('content_management', '0045_auto_20200228_1345'),
]
operations = [
migrations.RemoveField(
model... | 1.390625 | 1 |
pycudadecon/deconvolution.py | zbarry/pycudadecon | 46 | 28353 | import os
from fnmatch import fnmatch
from typing import Iterator, List, Optional, Sequence, Tuple, Union
import numpy as np
from typing_extensions import Literal
from . import lib
from .otf import TemporaryOTF
from .util import PathOrArray, _kwargs_for, imread
def rl_cleanup():
"""Release GPU buffer and cleanu... | 2.328125 | 2 |
deep_learning_with_tensorFlow/Chapter05/p11302.py | pearpai/TensorFlow-action | 3 | 28354 | # coding=utf-8
import tensorflow as tf
v = tf.Variable(0, dtype=tf.float32, name='v3')
# 在没有声明滑动平均模型时只有一个变量v,所以下面的语句只会输出v:0
for variables in tf.global_variables():
print(variables.name)
ema = tf.train.ExponentialMovingAverage(0.99)
# 加入命名空间中
maintain_averages_op = ema.apply(tf.global_variables())
# 在申明滑动平均模型之后,T... | 2.828125 | 3 |
build/lib/zorb/models/__init__.py | varunranga/zorb | 3 | 28355 | from .Sequential import Sequential
| 1.132813 | 1 |
oarepo_whitenoise/__init__.py | oarepo/oarepo-whitenoise | 0 | 28356 | <filename>oarepo_whitenoise/__init__.py
"""Nothing here, really."""
| 1.039063 | 1 |
assets/src/ba_data/python/bastd/mapdata/rampage.py | Benefit-Zebra/ballistica | 317 | 28357 | # Released under the MIT License. See LICENSE for details.
#
# This file was automatically generated from "rampage.ma"
# pylint: disable=all
points = {}
# noinspection PyDictCreation
boxes = {}
boxes['area_of_interest_bounds'] = (0.3544110667, 5.616383286,
-4.066055072) + (0.0, 0.0,... | 1.53125 | 2 |
PyFlow/UI/Widgets/GraphEditor_ui.py | dlario/PyFlow | 0 | 28358 | <filename>PyFlow/UI/Widgets/GraphEditor_ui.py
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'e:/GIT/PyFlow/PyFlow/UI/Widgets\GraphEditor_ui.ui',
# licensing of 'e:/GIT/PyFlow/PyFlow/UI/Widgets\GraphEditor_ui.ui' applies.
#
# Created: Sat May 4 12:25:24 2019
# by: pyside2-uic runni... | 1.445313 | 1 |
computer_wordle.py | AntonKueltz/computer-wordle-client | 0 | 28359 | <filename>computer_wordle.py
#!/usr/bin/env python3
import api
from urllib.parse import urljoin
GREEN = 'G'
YELLOW = 'Y'
GRAY = '.'
with open('wordlist.txt') as wordlist_file:
wordlist = tuple(line.strip() for line in wordlist_file)
class Game:
def __init__(self):
response = api.start_new_game()
... | 3.5625 | 4 |
src/validataclass/validators/date_validator.py | binary-butterfly/validataclass | 0 | 28360 | """
validataclass
Copyright (c) 2021, binary butterfly GmbH and contributors
Use of this source code is governed by an MIT-style license that can be found in the LICENSE file.
"""
from datetime import date
from typing import Any
from .string_validator import StringValidator
from validataclass.exceptions import Invali... | 3.703125 | 4 |
shimmer/apps/SimpleAccelGyro/simpleAccelGyroRecv.py | tinyos-io/tinyos-3.x-contrib | 1 | 28361 | #!/usr/bin/python
import sys, os, struct, array, time
try:
import tos
except ImportError:
import posix
sys.path = [os.path.join(posix.environ['TOSROOT'], 'support', 'sdk', 'python')] + sys.path
import tos
if len(sys.argv) < 2:
print "no device specified"
print "example:"
print " simpleAccelGyro... | 2.46875 | 2 |
astronat/core/__init__.py | nstarman/astronat | 1 | 28362 | <filename>astronat/core/__init__.py
# -*- coding: utf-8 -*-
# see LICENSE.rst
"""Basic Astronomy Functions.
.. todo::
change this to C / pyx. whatever astropy's preferred C thing is.
"""
__author__ = ""
# __copyright__ = "Copyright 2018, "
# __credits__ = [""]
# __license__ = ""
# __version__ = "0.0.0"
# __mai... | 1.34375 | 1 |
CHEBYSHEV/TVB_Method/cheb_class.py | mtmoncur/RootFinding | 0 | 28363 | <filename>CHEBYSHEV/TVB_Method/cheb_class.py
import numpy as np
import itertools
from numpy.polynomial import chebyshev as cheb
"""
Module for defining the class of Chebyshev polynomials, as well as various related
classes and methods, including:
Classes:
-------
Polynomial: Superclass for MultiPower ... | 3.40625 | 3 |
18-Make-and-build/42-Latex/run_45-Copy-latex-typo3-stuff.py | marble/Toolchain_RenderDocumentation | 0 | 28364 | #!/usr/bin/env python
# coding: utf-8
from __future__ import print_function
from __future__ import absolute_import
import os
import re
import shutil
import stat
import sys
import tct
from os.path import exists as ospe, join as ospj
from tct import deepget
params = tct.readjson(sys.argv[1])
binabspath = sys.argv[2]
... | 1.953125 | 2 |
src/tact/server/websocket.py | wabain/tact | 0 | 28365 | <gh_stars>0
"""Base definitions for the websocket interface"""
import json
from abc import ABC, abstractmethod
class WebsocketConnectionLost(Exception):
pass
class AbstractWSManager(ABC):
@abstractmethod
async def send(self, conn_id: str, msg: dict) -> None:
# This is implemented as a separate m... | 2.578125 | 3 |
wiimatch/match.py | mcara/wiimatch | 2 | 28366 | <filename>wiimatch/match.py
"""
A module that provides main API for optimal (LSQ) "matching" of weighted
N-dimensional image intensity data using (multivariate) polynomials.
:Author: <NAME> (contact: <EMAIL>)
:License: :doc:`../LICENSE`
"""
import numpy as np
from .lsq_optimizer import build_lsq_eqs, pinv_solve, rl... | 2.6875 | 3 |
tests/test_utils.py | plus3it/WatchMaker | 39 | 28367 | <gh_stars>10-100
# -*- coding: utf-8 -*-
# pylint: disable=redefined-outer-name,protected-access
"""Salt worker main test module."""
from __future__ import (absolute_import, division, print_function,
unicode_literals, with_statement)
import watchmaker.utils
try:
from unittest.mock import p... | 1.90625 | 2 |
shop/src/transaction_logic.py | gryan12/anonymous_ecommerce | 0 | 28368 | import logging
import random
import time
import src.support.outbound_routing as ob
from src.support.creds import build_cred, build_proof_request, build_schema, build_credential_proposal, build_proof_proposal
import src.support.settings as config
# This file containst the functions that perform transaction-specific
# ... | 2.125 | 2 |
pymath/renders.py | Lafrite/pyMath | 0 | 28369 | #!/usr/bin/env python
# encoding: utf-8
from .render import Render
from .fraction import Fraction
from .generic import first_elem, last_elem
__all__ = ['post2in_fix', 'tex_render', 'txt_render']
# ------------------------
# A infix to postfix list convertor
p2i_infix = {"+": "+", "-": "-", "*": "*", "/" : "/", ":":... | 2.765625 | 3 |
examples/wide_and_deep_example.py | meta-soul/MetaSpore | 32 | 28370 | #
# To run locally, execute:
#
# spark-submit --master local[2] wide_and_deep_example.py
#
S3_ROOT_DIR = 's3://{YOUR_S3_BUCKET}/{YOUR_S3_PATH}/'
batch_size = 100
worker_count = 1
server_count = 1
import metaspore as ms
spark = ms.spark.get_session(batch_size=batch_size,
worker_count=wo... | 1.976563 | 2 |
O3/_10_bias_variance_tradeoff/bias_variance_tradeoff.py | ShAlireza/ML-Tries | 0 | 28371 | <reponame>ShAlireza/ML-Tries<gh_stars>0
"""The bias-variance tradeoff
Often, researchers use the terms "bias" and "variance" or "bias-
variance tradeoff" to describe the performance of a model—that
is, you may stumble upon talks, books, or articles where people
say that a model has a "high variance" or... | 2.8125 | 3 |
pytronlinks/__init__.py | wahyubram82/PytronAI | 2 | 28372 | <reponame>wahyubram82/PytronAI<filename>pytronlinks/__init__.py
# -*- coding: UTF-8 -*-
"""
Pytron - Links Mark II Interface
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Links for Python
:copyright: (c) 2016 by <NAME> / aka: traBpUkciP.
:license: BSD, see LICENSE for more details.
"""
from .client import ... | 1.148438 | 1 |
tests/test_nestedprops.py | atviriduomenys/spinta | 2 | 28373 | <gh_stars>1-10
import pytest
@pytest.mark.models(
'backends/mongo/report',
'backends/postgres/report',
)
def test_update_object(model, app):
app.authmodel(model, ['insert', 'patch', 'getone'])
resp = app.post(f'/{model}', json={
'status': 'ok',
'sync': {
'sync_revision': '... | 2.234375 | 2 |
dockerpty/__init__.py | tedivm/dockerpty | 129 | 28374 | # dockerpty.
#
# Copyright 2014 <NAME> <<EMAIL>>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | 2.515625 | 3 |
django_documents_tools/utils.py | pik-software/django-documents-tools | 1 | 28375 | <reponame>pik-software/django-documents-tools<gh_stars>1-10
import os
from collections import Counter
from django.core.exceptions import ValidationError
from django.utils import timezone
from django.utils.deconstruct import deconstructible
from django_documents_tools.exceptions import (
BusinessEntityCreationIsNo... | 1.9375 | 2 |
database/models.py | zdresearch/Nettacker | 884 | 28376 | <reponame>zdresearch/Nettacker
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy import (Column,
Integer,
Text,
DateTime)
Base = declarative_base()
class Report(Base):
"""... | 2.609375 | 3 |
umigame/plotting.py | penguinwang96825/Umigame | 0 | 28377 | <gh_stars>0
import matplotlib
import matplotlib.pyplot as plt
import seaborn as sns
import pandas as pd
import numpy as np
import empyrical as ep
from matplotlib.ticker import FuncFormatter
def plot_returns(returns,
live_start_date=None,
ax=None):
"""
Plots raw returns over t... | 2.890625 | 3 |
anuvaad-etl/anuvaad-extractor/document-processor/block-segmenter/src/routes/__init__.py | srihari-nagaraj/anuvaad | 0 | 28378 | <reponame>srihari-nagaraj/anuvaad<filename>anuvaad-etl/anuvaad-extractor/document-processor/block-segmenter/src/routes/__init__.py
from .routes import Bolck_Segmenter_BLUEPRINT
from .routes import Bolck_Segmenter_BLUEPRINT_WF
#from .documentstructure import DOCUMENTSTRUCTURE_BLUEPRINT | 1.078125 | 1 |
spectools_ir/slab_fitter/helpers.py | erichegonzales/eriche-thesis | 4 | 28379 | import numpy as np
from astroquery.hitran import Hitran
from astropy import units as un
from astropy.constants import c, k_B, h, u
def calc_solid_angle(radius,distance):
'''
Convenience function to calculate solid angle from radius and distance, assuming a disk shape.
Parameters
----------
radius ... | 2.9375 | 3 |
tests/test_models.py | hramezani/django-voting | 0 | 28380 | # coding: utf-8
from __future__ import unicode_literals
from django.contrib.auth.models import User
from django.test import TestCase
from voting.models import Vote
from test_app.models import Item
# Basic voting ###############################################################
class BasicVotingTests(TestCase):
... | 2.65625 | 3 |
CodeIA/venv/Lib/site-packages/absl/testing/_parameterized_async.py | Finasty-lab/IA-Python | 38,667 | 28381 | <reponame>Finasty-lab/IA-Python
# Lint as: python3
# Copyright 2020 The Abseil Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#... | 1.742188 | 2 |
app/ImagePreprocessing.py | sadpotatoes/G6capstone-AI_Education | 0 | 28382 | <reponame>sadpotatoes/G6capstone-AI_Education<filename>app/ImagePreprocessing.py
# -*- coding: utf-8 -*-
"""
Created on Sat Feb 8 11:20:09 2020
@author: Donovan
"""
class ImagePreprocessing:
"""@package ImagePreprocessing
This class extracts a number of features from the images and saves them in a CSV
... | 2.828125 | 3 |
www.geofabrik.de/__poly2geojson.py | 0xC70FF3/maps-playground | 0 | 28383 | <reponame>0xC70FF3/maps-playground
import json
import os
def main():
features = {
"type": "FeatureCollection",
"features": []
}
directory = "poly/"
for file in os.listdir(directory):
if file.endswith(".poly"):
name = os.path.basename(file).split(".")[0]
... | 2.875 | 3 |
kafka/optstest.py | peterhogan/python | 0 | 28384 | from optparse import OptionParser
kafkabroker = ""
kafkatopic = ""
rssfile = ""
helpstring = """Usage: newsreader.py [OPTIONS]... -f <RSS_FILE> <KAFKA_BROKER> <KAFKA_TOPIC>
Read news articles from XML rss feeds specified in <RSS_FILE>
Feeds must be separated by newlines
Feeds to be ignored can be prefixed with #
Ma... | 3.203125 | 3 |
Shuffle an Array.py | HalShaw/Leetcode | 1 | 28385 | from random import shuffle#自带洗牌方法
from copy import deepcopy
class Solution(object):
def __init__(self, nums):
"""
:type nums: List[int]
:type size: int
"""
self.nums=nums
def reset(self):
"""
Resets the array to its original configurati... | 3.984375 | 4 |
ml3/mbrl_utils.py | neha191091/LearningToLearn | 76 | 28386 | # Copyright (c) Facebook, Inc. and its affiliates.
import numpy as np
from termcolor import colored
import logging
import torch.nn as nn
import torch.utils.data
log = logging.getLogger(__name__)
import torch
import numpy as np
import math
class Dataset(torch.utils.data.Dataset):
def __init__(self, x, y):
... | 2.46875 | 2 |
src/write.py | toodom02/img-to-css | 0 | 28387 | from . import config
def write_to_css(css):
f = open(
f"output/{'b' if config.bmethod else 'p'}/{config.filename}.css", "w")
f.write(css)
f.close()
def write_to_HTML(html):
f = open(
f"output/{'b' if config.bmethod else 'p'}/{config.filename}.html", "w")
f.write(html)
f.close... | 2.984375 | 3 |
test/tests/marshal_test.py | jvkersch/pyston | 0 | 28388 | <gh_stars>0
import marshal
o = [-1, 1.23456789, complex(1.2, 3.4)]
o += [True, False, None]
o += ["Hello World!", u"Hello World!"]
o += [{ "Key" : "Value" }, set(["Set"]), frozenset(["FrozenSet"]), (1, 2, 3), [1, 2, 3]]
for i in o:
s = marshal.dumps(i)
r = marshal.loads(s)
print "Dumping:", i, "Loaded", r
| 2.296875 | 2 |
tests/test_reader.py | goiosunsw/audacity.py | 1 | 28389 | import unittest
import os
import sys
import argparse
import numpy as np
import audacity as aud
print('Module file:')
print(aud.__file__)
SCRIPT_DIR = os.path.split(os.path.realpath(__file__))[0]
PACKAGE_DIR = os.path.realpath(os.path.join(SCRIPT_DIR,'..'))
DATA_DIR = os.path.join(PACKAGE_DIR, 'data')
TEST_FILE_1 = ... | 2.796875 | 3 |
src/models/predict_model.py | Chrypapado/Garbage_Classification | 0 | 28390 | <filename>src/models/predict_model.py
import argparse
import sys
from pathlib import Path
import matplotlib.pyplot as plt
import torch
import torchvision.transforms as transforms
from model import ResNet
from PIL import Image
if __name__ == '__main__':
# Arguments
parser = argparse.ArgumentParser(description=... | 2.390625 | 2 |
tests/test_lightcurve.py | moemyself3/lightcurator | 2 | 28391 | <gh_stars>1-10
import unittest
from lightcurator import lightcurve as lc
class TestLightcuratorMethods(unittest.TestCase):
def test_matchcat(self):
cc = lc.matchcat(23)
self.assertEqual(cc, 1)
if __name__ == '__main__':
unittest.main()
| 2.046875 | 2 |
baselines/deepq/assembly/data/plot_result.py | DengYuelin/baselines-assembly | 1 | 28392 | # -*- coding: utf-8 -*-
"""
# @Time : 24/10/18 2:40 PM
# @Author : <NAME>
# @FileName: plot_result.py
# @Software: PyCharm
# @Github : https://github.com/hzm2016
"""
import collections
import matplotlib.pyplot as plt
import numpy as np
import pickle
import copy as cp
from baselines.deepq.assembly.src.value_funct... | 2.21875 | 2 |
repacolors/palette/__init__.py | dyuri/repacolors | 1 | 28393 | from repacolors import ColorScale
from .colorbrewer import PALETTES as CBPALETTES
PALETTES = {
"ryb": ["#fe2713", "#fd5307", "#fb9900", "#fabc00", "#fefe34", "#d1e92c", "#66b032", "#0492ce", "#0347fe", "#3e01a4", "#8600af", "#a7194b"],
"rybw3": ["#FE2712", "#FC600A", "#FB9902", "#FCCC1A", "#FEFE33", "#B2D732"... | 2.859375 | 3 |
src/util.py | sgtpepperpt/cowrie-qemu | 1 | 28394 | # Copyright (c) 2019 <NAME> <<EMAIL>>
# See the COPYRIGHT file for more information
import subprocess
import time
def ping(guest_ip):
out = subprocess.run(['ping', '-c 1', guest_ip], capture_output=True)
return out.returncode == 0
def nmap_ssh(guest_ip):
out = subprocess.run(['nmap', guest_ip, '-PN', ... | 2.59375 | 3 |
library/load_partial.py | binaryburn/pan-fca | 26 | 28395 | <filename>library/load_partial.py
# -*- coding: utf-8 -*-
## Developed by <NAME>
from PyQt5.QtWidgets import QMainWindow, QApplication, QFileDialog, QMessageBox, QSizePolicy, QDialog
from PyQt5.QtGui import QColor, QPalette
from PyQt5 import QtCore
from qt_iron_skillet_ui import Ui_Dialog as IRONSKILLET
from qt_config_... | 1.945313 | 2 |
lab_2/find_lcs_length_optimized_test.py | alenashuvar/2020-2-level-labs | 3 | 28396 | <gh_stars>1-10
"""
Tests find_lcs_optimized function
"""
import timeit
import unittest
from memory_profiler import memory_usage
from lab_2.main import find_lcs_length_optimized, tokenize_big_file
class FindLcsOptimizedTest(unittest.TestCase):
"""
Checks for find_lcs_optimized function
"""
def test_f... | 2.6875 | 3 |
second/app.py | angelsoffury/microservices-basic | 1 | 28397 | <filename>second/app.py
from flask import Flask, jsonify, render_template
import requests
app = Flask(__name__)
@app.route('/')
def intro():
url = "http://backend-service:6002/"
response = requests.get(url)
info = response.json()["info"]
return render_template('index.html', data=info, title='Hello!')... | 2.640625 | 3 |
autokernel/autokernel.py | oddlama/autokernel | 49 | 28398 | <reponame>oddlama/autokernel<gh_stars>10-100
import autokernel.kconfig
import autokernel.config
import autokernel.lkddb
import autokernel.node_detector
import autokernel.symbol_tracking
from autokernel import __version__
from autokernel import log
from autokernel import util
from autokernel.symbol_tracking import set_v... | 2.328125 | 2 |
game.py | henryboisdequin/Tower-Defense-Game | 0 | 28399 | <filename>game.py
from Enemy.bosses import *
from Enemy.desert_enemies import *
from Enemy.field_enemies import *
from Enemy.graveyard_enemies import *
from Enemy.magic_enemies import *
from Enemy.moon_enemies import *
from Enemy.winter_enemies import *
from Enemy.fire_enemies import *
from menu import VerticalMenu
fro... | 2.640625 | 3 |