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
bfassist/standalone/monitoring/realtimecheckpoint.py
SanHime/bfassist
1
30500
############################################################################# # # # Module of BFA that manages server statistics in realtime # # ############################################################################# """ This module implements the real-time logging of in-game statistics specifically for one curre...
2.265625
2
core/views.py
koshasrepus/app_my_place
0
30501
from django.shortcuts import render from django.http import JsonResponse from django.views import View from core.handlers.dispatcher import process_telegram_event from app_my_places.settings import TELEGRAM_TOKEN import json # Create your views here. def index(request): return JsonResponse({"error": "forbidden"})...
1.945313
2
tests/cases/infer.py
div72/py2many
345
30502
<filename>tests/cases/infer.py #!/usr/bin/env python3 def foo(): a = 10 # infer that b is an int b = a assert b == 10 print(b) if __name__ == "__main__": foo()
2.515625
3
src/ascat/math.py
lweydemann/ascat
0
30503
# Copyright (c) 2020, TU Wien, Department of Geodesy and Geoinformation # All rights reserved. # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # * Redistributions of source code must retain the above copyright notice,...
1.546875
2
project/tests/fixtures/fixture_data.py
hlystovea/resource_planner
0
30504
import pytest import tempfile @pytest.fixture def post(user): from posts.models import Post image = tempfile.NamedTemporaryFile(suffix=".jpg").name return Post.objects.create(text='Тестовый пост 1', author=user, image=image) @pytest.fixture def group(): from posts.models import Group return Grou...
2.078125
2
orm_skills/views.py
bluebamus/django_miscellaneous_book
0
30505
from django.shortcuts import render # Create your views here. def index(): pass
1.148438
1
Sketches/RJL/bittorrent/BitTorrent/bittorrent-curses.py
sparkslabs/kamaelia_orig
12
30506
<reponame>sparkslabs/kamaelia_orig<gh_stars>10-100 #!/usr/bin/env python # 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 ...
1.851563
2
event_log/models/entry.py
darkismus/kompassi
13
30507
from django.conf import settings from django.contrib.postgres.fields import JSONField from django.db import models from django.db.models import Q from django.template.loader import render_to_string from django.utils.translation import ugettext_lazy as _ TARGET_FKEY_ATTRS = dict( null=True, blank=True, on_...
1.9375
2
tests/logging_test.py
lykme516/pykka
1
30508
<filename>tests/logging_test.py<gh_stars>1-10 import logging import threading import unittest from pykka import ActorRegistry, ThreadingActor from tests import TestLogHandler from tests.actor_test import ( EarlyFailingActor, FailingOnFailureActor, LateFailingActor) class LoggingNullHandlerTest(unittest.TestCase...
2.359375
2
ldaptor/apps/webui/i18n.py
tv42/ldaptor
1
30509
<reponame>tv42/ldaptor from nevow.inevow import ILanguages from nevow.i18n import I18NConfig from nevow import i18n _ = i18n.Translator(domain='ldaptor-webui') def render(): return i18n.render(translator=_)
1.835938
2
surface_integrator/photonmap.py
neodyme60/raypy
1
30510
<gh_stars>1-10 import math from scipy.spatial.ckdtree import cKDTree from core.camera import Camera from core.intersection import Intersection from core.ray import Ray from core.renderer import Renderer from core.sample import Sample from core.sampler import Sampler from core.scene import Scene from core.spect...
2.015625
2
bspump/declarative/expression/datastructs/itemexpr.py
chinese-soup/BitSwanPump
1
30511
<filename>bspump/declarative/expression/datastructs/itemexpr.py<gh_stars>1-10 from ...abc import Expression, evaluate from ..value.eventexpr import EVENT from ..value.eventexpr import KWARGS from ..value.eventexpr import ARG from ..value.valueexpr import VALUE from ..utility.context import CONTEXT class ITEM(Express...
2.65625
3
aula10/ex2.py
Vanderluizsj/AulasPython
0
30512
""" Faça um programa que pergunte a hora aousuário e, baseando-se na hora descrita, exiba a saudação apropriada. """ x=1 while x!=0: #Entra no try caso seja digitado um numero inteiro try: horas=int(input('Que horas são? ')) if horas>=0 and horas<=11: print('Bom dia!') x...
4.21875
4
lab07/app.py
mocurin/ITIS
0
30513
import aiohttp_jinja2 import jinja2 import secrets import random from aiohttp import web from aiohttp.client import MultiDict from source import fit_model, vectorize, model_predict routes = web.RouteTableDef() PORT = 8080 base_url = f"http://localhost:{PORT}" IMGS, X, Y = 3, 5, 7 THRESH = 0.1 networks = {} @rout...
2.25
2
ex6.py
EiPoPoAung/python_exercises
0
30514
x="There are %d types of people."%10 binary="binary" do_not="don't" y="Those who know %s and those who %s."%(binary,do_not) print(x) print(y) print("I said: '%s'."%y) hilarious=False joke_evaluation="Isn't that joke so funny?! %r" print (joke_evaluation % hilarious) w="This is the left side of ..." e="a string with a r...
3.671875
4
logic/config.py
ssichynskyi/lotti-karotti-calc
0
30515
<gh_stars>0 # -*- coding: utf-8 -*- import sys from pathlib import Path import yaml class Config: """ Extracts the data from the configuration file given """ def __init__(self, path): with open(path, 'r') as f: contents = f.read() self.options = yaml.safe_load(contents)...
2.84375
3
hs_modflow_modelinstance/admin.py
ResearchSoftwareInstitute/MyHPOM
1
30516
<reponame>ResearchSoftwareInstitute/MyHPOM from mezzanine.pages.admin import PageAdmin from django.contrib import admin from hs_modflow_modelinstance.models import MODFLOWModelInstanceResource admin.site.register(MODFLOWModelInstanceResource, PageAdmin)
1.257813
1
TAO/Firewall/EXPLOITS/ELBO/eligiblebombshell_1.2.0.1.py
dendisuhubdy/grokmachine
46
30517
<reponame>dendisuhubdy/grokmachine #!/usr/bin/python import shellcode import optparse import httplib import logging import random import socket import sys import re from struct import pack, unpack from time import sleep ######################## # Global configuration # ######################## DEFAULT_ETAG_FILE = "EL...
1.875
2
edu_visitor/visitor_logs/routes.py
covrebo/edu_visitor
0
30518
from flask import Blueprint, render_template, url_for, session, flash, redirect, request from edu_visitor import db from edu_visitor.visitor_logs.forms import StudentSignInForm, StudentSignOutForm, VisitorSignInForm, VisitorSignOutForm, StudentUpdateForm, VisitorUpdateForm from edu_visitor.models import StudentLog, Vi...
2.546875
3
abstract_model.py
mandt-lab/adversarial-negative-sampling
15
30519
<gh_stars>10-100 import sys import abc import tensorflow as tf import numpy as np import optimizer class AbstractModel(abc.ABC): '''Abstract base class for knowledge graph embedding models. You won't usually want to derive directly from this class. In most cases, you'll want to derive from either `Abst...
2.875
3
fnss/traffic/__init__.py
brucespang/fnss
114
30520
"""Tools for creating and manipulating event schedules and traffic matrices""" from fnss.traffic.eventscheduling import * from fnss.traffic.trafficmatrices import *
1.125
1
sphinxviewer/main.py
badisa/sphinx-viewer
0
30521
import os import sys from argparse import ArgumentParser from sphinxviewer.sphinx import build_html from sphinxviewer.server import serve_server def main(): parser = ArgumentParser(description="Live editing sphinx doc server") # parser.add_argument("-p", "--port", default=8888, help="Port to run server on")...
2.671875
3
djng/forms/widgets.py
ParikhKadam/django-angular
941
30522
import mimetypes from django.contrib.staticfiles.storage import staticfiles_storage from django.core import signing from django.forms import widgets from django.forms.utils import flatatt from django.utils.safestring import mark_safe from django.utils.html import format_html from django.utils.translation import ugette...
2.046875
2
chapter2/wok/develop/examples/multiport/sum.py
chris-zen/phd-thesis
1
30523
<reponame>chris-zen/phd-thesis<filename>chapter2/wok/develop/examples/multiport/sum.py<gh_stars>1-10 from wok.task import task @task.main() def main(): values, count_port, sum_port = task.ports("x", "count", "sum") count = 0 sum = 0 for v in values: task.logger.info("value = {0}".format(v)) count += 1 sum ...
2.921875
3
climateapp/climateapp/routes.py
mpasricha1/sqlalchemy-challenge
0
30524
from flask import jsonify, render_template import sqlalchemy from sqlalchemy.ext.automap import automap_base from sqlalchemy.orm import Session from sqlalchemy import create_engine, func import datetime as dt from climateapp import app engine = create_engine('sqlite:///../Resources/hawaii.sqlite') Base = automap_base...
2.796875
3
parse_jira_logged_time/gui.py
gil9red/SimplePyScripts
117
30525
<gh_stars>100-1000 #!/usr/bin/env python3 # -*- coding: utf-8 -*- __author__ = 'ipetrash' import json import io import sys import traceback import webbrowser from contextlib import redirect_stdout from datetime import datetime from PyQt5.Qt import ( QApplication, QMessageBox, QThread, pyqtSignal, QMainWindow, ...
1.984375
2
fasterRCNN.py
TangZhenchaoTZC/Keras-mask-detection
3
30526
"""fasterRCNN对象创建""" import numpy as np import colorsys import os from keras import backend as K from keras.applications.imagenet_utils import preprocess_input from PIL import Image, ImageFont, ImageDraw import copy import math from net import fasterrcnn as frcnn from net import netconfig as netconfig from net import ...
2.625
3
applications/popart/faster-rcnn/nanodata/dataset/xml_dataset_for_rcnn.py
payoto/graphcore_examples
260
30527
<reponame>payoto/graphcore_examples # Copyright (c) 2021 Graphcore Ltd. All rights reserved. # Copyright 2021 RangiLyu. # # 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.apac...
2.421875
2
application/briefkasten/commands.py
tomster/briefkasten
1
30528
import click from os import path, listdir, rename, remove from datetime import datetime from sys import exit from multiprocessing import Pool from signal import signal, SIGINT from watchdog.observers import Observer from watchdog.events import FileSystemEventHandler from threading import Condition from .dropbox import...
2.078125
2
tests/test_plat_win.py
juliangilbey/send2trash
0
30529
# coding: utf-8 import os import shutil import sys import unittest from os import path as op from tempfile import gettempdir from send2trash import send2trash as s2t # import the two versions as well as the "automatic" version from send2trash.plat_win_modern import send2trash as s2t_modern from send2trash.plat_win_le...
2.609375
3
examples/closest_unit_norm_column_approximation.py
paulroujansky/pymanopt
0
30530
<filename>examples/closest_unit_norm_column_approximation.py import numpy as np import theano.tensor as T from numpy import linalg as la, random as rnd import pymanopt from pymanopt.manifolds import Oblique from pymanopt.solvers import ConjugateGradient def closest_unit_norm_column_approximation(A): """ Retu...
3.203125
3
adafruit_dash_display.py
adafruit/Adafruit_CircuitPython_Dash_Display
2
30531
<gh_stars>1-10 # SPDX-FileCopyrightText: Copyright (c) 2021 <NAME> for Adafruit Industries # # SPDX-License-Identifier: MIT """ `adafruit_dash_display` ================================================================================ CircuitPython library for creating Adafruit IO dashboards. * Author(s): <NAME> Imple...
2.109375
2
fygen_test.py
vanish125/DS1054_BodePlotter
0
30532
<reponame>vanish125/DS1054_BodePlotter """Unit tests for fygen module.""" import unittest import six import fygen import fygen_help from wavedef import SUPPORTED_DEVICES # pylint: disable=too-many-public-methods # pylint: disable=invalid-name # pylint: disable=too-many-lines class FakeSerial(object): ...
2.421875
2
setup.py
hainegroup/Polar-overturning-circulation-model
3
30533
from setuptools import find_packages, setup setup( name='src', packages=find_packages(), version='0.1.0', description='POC model for publication', author='<NAME>', license='MIT', )
0.945313
1
danceschool/stats/cms_apps.py
benjwrdill/django-danceschool
1
30534
from cms.app_base import CMSApp from cms.apphook_pool import apphook_pool from django.utils.translation import ugettext_lazy as _ class StatsApphook(CMSApp): name = _("Stats Apphook") def get_urls(self, page=None, language=None, **kwargs): return ["danceschool.stats.urls"] # replace th...
1.710938
2
archinstall-variants.py
phisch/archinstall-variants
3
30535
import logging import archinstall __version__ = 0.1 class Plugin: VARIANTS_DICT_KEY = "variants" VARIANT_KEY = "variant" def __init__(self): if self.has_variants() and self.variants_is_dict(): variant_key = self.get_selected_variant_key() variant = archinstall.arguments[...
2.4375
2
declaraciones/declaracion/urls/admin.py
gob-cdmx/declaraciones
2
30536
<gh_stars>1-10 from django.urls import path from declaracion.views import (BusquedaDeclarantesFormView, InfoDeclarantesFormView, InfoDeclaracionFormView, BusquedaDeclaracionesFormView, BusquedaUsuariosFormView, NuevoUsuariosFormView, EliminarUsuarioFormView...
1.96875
2
rpbp/translation_prediction/merge_replicate_orf_profiles.py
HeyLifeHD/rp-bp
6
30537
<reponame>HeyLifeHD/rp-bp #! /usr/bin/env python3 import argparse import logging import scipy.io import pbio.misc.logging_utils as logging_utils import pbio.misc.math_utils as math_utils logger = logging.getLogger(__name__) def main(): parser = argparse.ArgumentParser(formatter_class=argparse.ArgumentDefaultsH...
2.390625
2
examples/basicServer.py
lwahlmeier/python-litesockets
1
30538
from litesockets import SocketExecuter, TcpServer import time #This starts a SocketExecuter with default of 5 threads SE = SocketExecuter() #creates a tcpServer listening on localhost port 11882 (socket is not open yet) server = TcpServer("localhost", 11882) #This is ran once the far side is connected def newConnect...
3.15625
3
datasets.py
jackwang0108/AlexNet
1
30539
# Standard Library import pickle from typing import * from pathlib import Path # Third-party Party import numpy as np import PIL.Image as Image from colorama import Fore, init # Torch Library import torch import torch.utils.data as data import torchvision.transforms as T # My Library from helper import visualize_np...
2.484375
2
spyder_terminal/widgets/style/themes.py
mrclary/spyder-terminal
169
30540
<filename>spyder_terminal/widgets/style/themes.py # -*- coding: utf-8 -*- # ----------------------------------------------------------------------------- # Copyright (c) Spyder Project Contributors # # Licensed under the terms of the MIT License # (see LICENSE.txt for details) # ----------------------------------------...
1.46875
1
research/cv/U-GAT-IT/src/models/UGATIT.py
mindspore-ai/models
77
30541
# Copyright 2022 Huawei Technologies Co., Ltd # # 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...
1.710938
2
bot/cogs/music.py
Nemika-Haj/Guess-The-Song
1
30542
<reponame>Nemika-Haj/Guess-The-Song import discord, youtube_dl, asyncio, json, random, os from youtube_search import YoutubeSearch from core import checks, embeds, files, database from discord.ext import tasks from difflib import SequenceMatcher commands = discord.ext.commands ytdl_format_options = { 'format'...
2.4375
2
tests/argparse/special/modules/defaults/__init__.py
da-h/miniflask
5
30543
<reponame>da-h/miniflask def printVal(state, name): val = state[name] print("%s:" % state.fuzzy_names[name], val) def print_all(state): printVal(state, "var_default") printVal(state, "var_default_override") printVal(state, "var_default_override_twice") printVal(state, "var_default_override_tw...
2.234375
2
Resene naloge/euler35.py
CadezDavid/ProjectEuler
0
30544
import itertools stevke = ['1', '3', '7', '9'] def je_prastevilo(n): if n < 2 or n % 2 == 0: return n == 2 i = 3 while i * i <= n: if n % i == 0 or n % 2 == 0: return False i += 2 return True def zasukej(nabor): stevilo = list(nabor) seznam = [] while l...
3.625
4
utils/update_ontario_huron_stocking.py
AdamCottrill/fsdivz
0
30545
""" ~/utils/update_ontario_stocking.py Created: 23 Jan 2019 15:29:22 DESCRIPTION: This script updates the ontario data in the lake wide cwt database. Updates include tag type, and sequence number for sequential cwts, cwt manufacturer (where it should have been Micro Mark (MM)) Updates are preformed on both stocking...
2.046875
2
mathplotlib/calculate_polygon_area.py
ronistiawan/python-scripts
0
30546
<reponame>ronistiawan/python-scripts<filename>mathplotlib/calculate_polygon_area.py from PIL import Image import numpy as np from matplotlib.path import Path import matplotlib.pyplot as plt import matplotlib.patches as patches image = Image.open('samp3.png', 'r') #read image image = image.convert('L') ...
3.71875
4
digital_ocean.py
Nahid5/digitalOceanHelper
0
30547
<reponame>Nahid5/digitalOceanHelper #!/usr/bin/env python3 import requests import json #Enter DO token DOTOKEN = "" HEADERS = {"Authorization": "Bearer " + DOTOKEN, "Content-Type": "application/json"} ################################################################################## # Dr...
3.0625
3
models.py
andywar65/dxf2vr
3
30548
import os from math import radians, sin, cos, asin, degrees, pi, sqrt, pow, fabs, atan2 from django import forms from django.db import models from django.conf import settings from modelcluster.fields import ParentalKey from wagtail.wagtailcore.models import Page, Orderable from wagtail.wagtailadmin.edit_handlers impo...
1.90625
2
scenarios/activity-update-and-delete/bots/activity_update_and_delete_bot.py
Shiftersky/botbuilder-python
1
30549
<filename>scenarios/activity-update-and-delete/bots/activity_update_and_delete_bot.py # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. from botbuilder.core import MessageFactory, TurnContext, ActivityHandler class ActivitiyUpdateAndDeleteBot(ActivityHandler): def __in...
2.28125
2
deliravision/torch/models/gans/deep_convolutional/__init__.py
delira-dev/vision_torch
4
30550
from deliravision.models.gans.deep_convolutional.dc_gan import \ DeepConvolutionalGAN
1.085938
1
nobos_commons/utils/bounding_box_helper.py
noboevbo/nobos_commons
2
30551
<gh_stars>1-10 import random import sys from nobos_commons.data_structures.bounding_box import BoundingBox from nobos_commons.data_structures.bounding_box_3D import BoundingBox3D from nobos_commons.data_structures.dimension import Coord2D, Coord3D from nobos_commons.data_structures.skeletons.joint_2d import Joint2D fr...
1.976563
2
homeassistant/components/metoffice/weather.py
tbarbette/core
6
30552
"""Support for UK Met Office weather service.""" from homeassistant.components.weather import WeatherEntity from homeassistant.const import LENGTH_KILOMETERS, TEMP_CELSIUS from homeassistant.core import callback from homeassistant.helpers.typing import ConfigType, HomeAssistantType from .const import ( ATTRIBUTION...
2.609375
3
erniekit/common/rule.py
PaddlePaddle/LARK
1,552
30553
<filename>erniekit/common/rule.py # -*- coding: utf-8 -* """ some rule """ class MaxTruncation(object): """MaxTruncation:超长截断规则 """ KEEP_HEAD = 0 # 从头开始到最大长度截断 KEEP_TAIL = 1 # 从头开始到max_len-1的位置截断,末尾补上最后一个id(词或字) KEEP_BOTH_HEAD_TAIL = 2 # 保留头和尾两个位置,然后按keep_head方式截断 class EmbeddingType(object):...
2.390625
2
bbscrape/__main__.py
luciancooper/bbcmd
2
30554
<reponame>luciancooper/bbcmd import sys,argparse from cmdprogress.bar import ProgBar def parse_years(arg): years = set() for a in arg.split(','): if '-' in a: y0,y1 = map(int,a.split('-')) years |= set(range(y0,y1+1)) else: years |= {int(a)} years = list(...
2.703125
3
src/reducer/bohm_debug.py
fritzo/pomagma
10
30555
#!/usr/bin/env python import os os.environ['POMAGMA_LOG_LEVEL'] = '3' from pomagma.compiler.util import temp_memoize # isort:skip from pomagma.reducer import bohm # isort:skip print('Example 1.') with temp_memoize(): bohm.sexpr_simplify('(ABS (ABS (1 0 (1 0))) (ABS (ABS (1 (0 0)))))') print('Example 2.') w...
2.046875
2
scaper_concept/venv/lib/python3.9/site-packages/celery/utils/debug.py
edudbot/web-scraper
3
30556
"""Utilities for debugging memory usage, blocking calls, etc.""" import os import sys import traceback from contextlib import contextmanager from functools import partial from pprint import pprint from celery.platforms import signals from celery.utils.text import WhateverIO try: from psutil import Process except ...
2.421875
2
scripts/selenium/test.py
Mlrobinson1993/trustroots
377
30557
#!/usr/bin/env python from browsers import browsers from selenium import webdriver from selenium.webdriver.common.keys import Keys from selenium.webdriver.common.desired_capabilities import DesiredCapabilities from selenium.webdriver.support.wait import WebDriverWait from selenium.common.exceptions import TimeoutExc...
2.34375
2
lib/dcsotiesplunk/filtering.py
satta/TIE-Splunk-TA
2
30558
<reponame>satta/TIE-Splunk-TA<gh_stars>1-10 # Copyright (c) 2017, 2020, DCSO GmbH import json import sys import os # we change the path so that this app can run within the Splunk environment sys.path.insert(0, os.path.join(os.path.dirname(__file__), "..", "lib")) from dcsotie.errors import TIEError from dcsotiesplun...
2.046875
2
tests/mapping_wind02.py
pnarvor/nephelae_mapping
0
30559
#! /usr/bin/python3 import sys sys.path.append('../../') import numpy as np import numpy.fft as npfft import matplotlib.pyplot as plt from matplotlib import animation import time from netCDF4 import MFDataset from nephelae_simulation.mesonh_interface import MesoNHVariable from nephelae_base.types import Position fr...
2.296875
2
interaction.py
BAFurtado/TLD
0
30560
# coding: utf-8 # Originally from # https://github.com/PPartisan/THE_LONG_DARK # Simply adapted to LINUX by <NAME> import threading import time import psutil from pylab import rcParams from pynput.keyboard import Key, Controller import mapping rcParams['figure.figsize'] = 12, 9.5 def is_tld_running(): retur...
2.4375
2
multiply_ui/server/resources/workflows/multiply_workflow.py
RaT0M/multiply-ui
0
30561
<reponame>RaT0M/multiply-ui<filename>multiply_ui/server/resources/workflows/multiply_workflow.py import logging import os import signal import sys from pmonitor import PMonitor logging.getLogger().setLevel(logging.INFO) class MultiplyMonitor(PMonitor): def __init__(self, parameters, types): PMonitor.__i...
2.1875
2
demo/utils/genderdetect.py
TommyZihao/MMGEN-FaceStylor
122
30562
<reponame>TommyZihao/MMGEN-FaceStylor<gh_stars>100-1000 import random import cv2 padding = 20 MODEL_MEAN_VALUES = (78.4263377603, 87.7689143744, 114.895847746) genderList = ['Male', 'Female'] class GenderDetection(): def __init__(self): faceProto = 'data/opencv_face_detector.pbtxt' faceModel = '...
2.515625
3
main.py
Knysliux001/pocker
0
30563
# import random # # deck = list() # for suit in ["♦", "♥", "♠", "♣"]: # for value in ["A", "K", "Q", "J", "10", "9", "8", "7", "6", "5", "4", "3", "2"]: # deck.append((value, suit)) # r_sample = random.sample(deck, 7) # print(r_sample) from enum import Enum, auto, unique class Suit(Enum): ...
3.3125
3
networkapi/api_task/classes.py
vinicius-marinho/GloboNetworkAPI
73
30564
<reponame>vinicius-marinho/GloboNetworkAPI # -*- coding: utf-8 -*- from networkapi import celery_app from networkapi.queue_tools.rabbitmq import QueueManager from networkapi.usuario.models import Usuario class BaseTask(celery_app.Task): def after_return(self, status, retval, task_id, args, kwargs, einfo): ...
2.03125
2
tests/thalesians/filtering/algs/test_kalman.py
thalesians/bayestsa
18
30565
import datetime import unittest class KalmanFilterTest(unittest.TestCase): def test_kalman_filter_with_prior_predict(self): t0 = datetime.datetime(2014, 2, 12, 16, 18, 25, 204000) print(t0) self.assertEqual(1., 1.) def test_kalman_filter_without_prior_predict(self...
2.828125
3
fclib/tests/test_dcnn.py
barrosm/forecasting
2,276
30566
<gh_stars>1000+ # Copyright (c) Microsoft Corporation. # Licensed under the MIT License. from fclib.models.dilated_cnn import create_dcnn_model def test_create_dcnn_model(): mod0 = create_dcnn_model(seq_len=1) # default args assert mod0 is not None mod1 = create_dcnn_model( seq_len=1, n_dyn_fea...
2.390625
2
threads/thread_pool_example.py
CoolerVoid/Python_survival_tricks
4
30567
<reponame>CoolerVoid/Python_survival_tricks # threadpool example import sys from threading import Thread import queue import time class Worker(Thread): def __init__(self,queue): super(Worker, self).__init__() self._q = queue self.daemon = True self.start() def run(self): while True:...
3.625
4
src/CollidingNode.py
kingjin94/enhanced_simulation
0
30568
<filename>src/CollidingNode.py #!/usr/bin/python import rospy from gazebo_msgs.msg import ContactsState from enhanced_sim.msg import CollisionState """ Spec: Look at all /panda/bumper* topics, get which are colliding and publish a boolean variable (per link) saying whether in collision """ class CollidingNode(object...
2.625
3
flatlib/protocols/behavior.py
UtkuGlsvn/flatlib
0
30569
<reponame>UtkuGlsvn/flatlib """ This file is part of flatlib - (C) FlatAngle Author: <NAME> (<EMAIL>) This module implements the Behavior Traditional Protocol. """ from flatlib import const from flatlib import aspects from flatlib.dignities import essential def _merge(listA, listB): "...
2.0625
2
fetch_embed/__init__.py
ffreemt/fetch-embed
0
30570
<gh_stars>0 __version__ = "0.1.6" from .fetch_embed import fetch_embed from .embed_text import embed_text __all__ = ( "fetch_embed", "embed_text", )
1.125
1
NeodymiumDotNet.Benchmark.Numpy/SimpleCalculationBenchmark.py
aka-nd1220/NeodymiumDotNet
0
30571
#!/usr/bin/env python3 import numpy as np import numpy.random as npr import pytest A1 = npr.rand( 1, 1) B1 = npr.rand( 1, 1) C1 = npr.rand( 1, 1) A3 = npr.rand( 3, 3) B3 = npr.rand( 3, 3) C3 = npr.rand( 3, 3) A10 = npr.rand( 10, 10) B10 = npr.rand( 10, 10) C10...
2.1875
2
backstaff/plotting.py
lars-frogner/bifrost-rust
0
30572
<reponame>lars-frogner/bifrost-rust import copy import numpy as np import matplotlib as mpl # mpl.use('agg') import matplotlib.pyplot as plt import matplotlib.patches as mpl_patches import matplotlib.colors as mpl_colors import matplotlib.cm as mpl_cm import matplotlib.animation as animation import matplotlib.patheffe...
2.3125
2
cms/management/commands/create_initial_data.py
dcreekp/pythondotorg
1
30573
<gh_stars>1-10 import importlib import inspect import pprint from django.apps import apps from django.core.management import BaseCommand, call_command class Command(BaseCommand): help = 'Create initial data by using factories.' def add_arguments(self, parser): parser.add_argument( '--ap...
2.21875
2
oslo_cache/backends/dictionary.py
mail2nsrajesh/oslo.cache
29
30574
# Copyright 2015 Mirantis Inc # # 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...
2.359375
2
preprocessdata.py
zoepie/HTML-Project
0
30575
import numpy as np from bs4 import BeautifulSoup from tqdm import tqdm import json def read_file(filename): with open(filename, 'r', encoding='utf-8') as f: contents = f.read() soup = BeautifulSoup(contents, "html.parser") return soup if __name__ == '__main__': with open('name2idx.js...
2.796875
3
tests/test_surrogates.py
scott-trinkle/braingraphgeo
0
30576
<gh_stars>0 import numpy as np from numpy.testing import assert_array_equal, assert_array_almost_equal from context import braingraphgeo as bgg def test_geomsurr(sample_W_1, sample_D): W = sample_W_1.values d = sample_D.values Wgeo = bgg.surrogates.geomsurr(W, d, rs=2021) result = np.array([[0., 0.00...
2.09375
2
census-us/custom-recipes/address-batch-geocoder-us-census-geo/recipe.py
RedaAffane/dataiku-contrib
0
30577
# -*- coding: utf-8 -*- import dataiku import pandas as pd, numpy as np from dataiku import pandasutils as pdu import requests #import time from dataiku.customrecipe import * import sys import re import geocoder_utils import common import os logging.info('1/6 Creating base folder...' ) path_datadir_tmp = dataiku.get...
2.171875
2
workers/macos/worker.py
joweeba/mrtaskman
0
30578
#!/usr/bin/python # 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, software # di...
2.21875
2
pystrafe/tests/test_basic.py
Matherunner/pystrafe
2
30579
<filename>pystrafe/tests/test_basic.py from pytest import approx, warns, raises from pystrafe import basic def test_collide(): v = [-1000, 123, 456] basic.collide(v, [1, 0, 0]) assert v == [0, 123, 456] def test_collide_out_of_plane(): v = [100, 100, 100] with warns(RuntimeWarning): basic....
2.15625
2
MWE/SDHM/sdhm_dpp_exact_sc.py
volpatto/porousdrake
1
30580
from firedrake import * import numpy as np from firedrake.petsc import PETSc from firedrake import COMM_WORLD try: import matplotlib.pyplot as plt plt.rcParams["contour.corner_mask"] = False plt.close("all") except: warning("Matplotlib not imported") nx, ny = 4, 4 Lx, Ly = 1.0, 1.0 quadrilateral = Fa...
2.09375
2
data_sets/config.py
davidp94/data-sets
0
30581
<reponame>davidp94/data-sets<gh_stars>0 """Definition and configuration of data sets""" import functools from data_sets import data_set @functools.lru_cache(maxsize=None) def data_sets() -> ['data_set.DataSet']: """All available data sets""" return [] def charts_color() -> str: """The color (rgb hex c...
2.203125
2
photospicker/exception/abstract_exception.py
l-vo/photos-picker
0
30582
<gh_stars>0 class AbstractException(Exception): """Abstract exception for project""" def __init__(self, code, message): """ Constructor :param int code: error code :param str message: error message """ self._code = code self._message = message @prop...
2.859375
3
kafka/test/consume.py
nicovillanueva/docker-kafka
0
30583
from kafka import KafkaConsumer consumer = KafkaConsumer('test-topic', bootstrap_servers='localhost:9092') print("listening") for msg in consumer: print(msg)
2.1875
2
recognition/train_utils.py
Queuer/queue-vision
0
30584
import random import numpy as np import tensorflow as tf from recognition.utils import train_utils, googlenet_load try: from tensorflow.models.rnn import rnn_cell except ImportError: rnn_cell = tf.nn.rnn_cell from tensorflow.python.framework import ops from tensorflow.python.ops import array_ops random.seed...
2.546875
3
gtbook/linear.py
dellaert/nbdev_test
5
30585
# AUTOGENERATED! DO NOT EDIT! File to edit: linear.ipynb (unless otherwise specified). __all__ = ['vv', 'denoising_MRF'] # Cell import numpy as np import gtsam from gtsam import noiseModel from .display import show from typing import Dict # Cell def vv(keys_vectors: Dict[int, np.ndarray]): """Create a VectorVal...
2.34375
2
_0697_div3/D_Cleaning_the_Phone.py
mingweihe/codeforces
0
30586
<filename>_0697_div3/D_Cleaning_the_Phone.py def solve(n, m, A, B): ans = 0 ones, twos = [], [] for i in xrange(n): if B[i] == 1: ones += A[i], else: twos += A[i], ones.sort() twos.sort() i, j = len(ones)-1, len(twos)-1 while m > 0 and (i >= 0 or j >= 0): if i >= 0 an...
3.046875
3
xpcs/calc_scattering.py
aryabhatt/xpcs-baseline
0
30587
<reponame>aryabhatt/xpcs-baseline #! /usr/bin/env python import mdscatter import numpy as np import h5py import time import os from loader import list_lammps_txt_files, load_lammps_txt from detector import Lambda750k if __name__ == '__main__': wavelen = 0.1127 energy = 1.23984 / wavelen sdd = 4. ...
1.78125
2
sphinxcontrib/collections/drivers/copy_file.py
useblocks/sphinx-collections
4
30588
import os from shutil import copyfile from sphinxcontrib.collections.drivers import Driver class CopyFileDriver(Driver): def run(self): self.info('Copy file...') if not os.path.exists(self.config['source']): self.error('Source {} does not exist'.format(self.config['source'])) ...
2.640625
3
venv/lib/python3.6/site-packages/ansible_collections/ansible/utils/plugins/action/update_fact.py
usegalaxy-no/usegalaxy
1
30589
# -*- coding: utf-8 -*- # Copyright 2020 Red Hat # GNU General Public License v3.0+ # (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type import ast import re from ansible.plugins.action import ActionBase from ansible.module...
1.882813
2
PackageGen.py
Qudix/Buffout4
0
30590
import os import zipfile import zlib def make_rel_archive(a_parent, a_name): archive = zipfile.ZipFile("release/" + a_name + ".zip", "w", zipfile.ZIP_DEFLATED) def do_write(a_relative): archive.write(a_parent + a_relative, a_relative) do_write("F4SE/Plugins/" + a_name + ".dll") do_write("F4SE/Plugins/" + a_name...
2.375
2
scripts/extract-traj.py
KeithLabPitt/scripts
0
30591
<filename>scripts/extract-traj.py #!/usr/bin/env python3 # MIT License # # Copyright (c) 2020, <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 witho...
1.625
2
examples/M4_competition/evaluate_prophet.py
LeoTafti/darts
1
30592
"""Evaluating Prophet model on M4 timeseries """ from darts.models import Prophet from darts.utils.statistics import check_seasonality from darts.utils import _build_tqdm_iterator import numpy as np import pandas as pd import pickle as pkl from M4_metrics import owa_m4, mase_m4, smape_m4 if __name__ == "__main__"...
2.28125
2
preprocess/step4/count.py
moore3930/dependency-based-w2v
11
30593
<filename>preprocess/step4/count.py<gh_stars>10-100 import codecs import sys import argparse parser = argparse.ArgumentParser(description='manual to this script') parser.add_argument('--file', type=str, default = None) parser.add_argument('--quantity', type=int, default=5785) args = parser.parse_args() output = codecs...
2.515625
3
pyannote/audio/applications/pyannote_audio.py
kan-cloud/pyannote-audio
1
30594
<filename>pyannote/audio/applications/pyannote_audio.py #!/usr/bin/env python # encoding: utf-8 # The MIT License (MIT) # Copyright (c) 2019-2020 CNRS # 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 th...
1.234375
1
convert_data_to_tfrecords.py
richiesui/Deep-Association-Learning
70
30595
from __future__ import absolute_import from __future__ import division from __future__ import print_function import tensorflow as tf import os from datasets import convert_data FLAGS = tf.app.flags.FLAGS tf.app.flags.DEFINE_string('data_type', None, 'The type of the dataset to convert, ne...
2.625
3
vispy/geometry/tests/test_generation.py
chongxi/vispy
3
30596
# -*- coding: utf-8 -*- # Copyright (c) 2015, Vispy Development Team. # Distributed under the (new) BSD License. See LICENSE.txt for more info. import numpy as np from numpy.testing import assert_array_equal, assert_allclose from vispy.testing import run_tests_if_main from vispy.geometry import (create_box, create_cub...
2.796875
3
bico/utils/BICONode.py
gallmerci/bico
39
30597
import logging import numpy as np from bico.geometry.point import Point from bico.nearest_neighbor.base import NearestNeighbor from bico.utils.ClusteringFeature import ClusteringFeature from datetime import datetime from typing import Callable, TextIO, List logger = logging.getLogger(__name__) class BICONode: de...
2.421875
2
pythonScript.py
qinenergy/QinBox
0
30598
<gh_stars>0 """ Lite install NLTK resource """ import nltk dler = nltk.downloader.Downloader() dler._update_index() dler._status_cache['panlex_lite'] = 'installed' # Trick the index to treat panlex_lite as it's already installed. dler.download('all')
2.15625
2
py2450/misc.py
sveinrou/py2450
0
30599
<gh_stars>0 import pyvisa def find_instruments(): rm = pyvisa.ResourceManager() instruments = rm.list_resources() return {'usb':[i for i in instruments if 'USB' in i], 'gpib':[i for i in instruments if 'GPIB' in i], 'serial':[i for i in instruments if 'ASRL' in i]} def play_star_war...
2.578125
3