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 |
|---|---|---|---|---|---|---|
xcube_hub/models/cubegen_config_code_config_file_set.py | bcdev/xcube-hub | 3 | 53200 | # coding: utf-8
from __future__ import absolute_import
from datetime import date, datetime # noqa: F401
from typing import List, Dict # noqa: F401
from xcube_hub.models.base_model_ import Model
from xcube_hub import util
class CubegenConfigCodeConfigFileSet(Model):
"""NOTE: This class is auto generated by Op... | 2.265625 | 2 |
hostmanager/migrations/0002_auto_20170929_2313.py | kingsdigitallab/devops-django | 1 | 53201 | # -*- coding: utf-8 -*-
# Generated by Django 1.11.5 on 2017-09-29 22:13
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('hostmanager', '0001_initial'),
]
operations = [
migrations.AlterField(
... | 1.71875 | 2 |
wagtail/search/migrations/0005_create_indexentry.py | stevedya/wagtail | 1 | 53202 | # Generated by Django 3.2.4 on 2021-06-28 14:12
import django.db.models.deletion # noqa
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("contenttypes", "0002_remove_content_type_name"),
("wagtailsearch", "0004_querydailyhits_verbose_name_plural... | 1.757813 | 2 |
apsuite/commisslib/ts_disp_meas.py | carneirofc/apsuite | 1 | 53203 | <reponame>carneirofc/apsuite<filename>apsuite/commisslib/ts_disp_meas.py
"""."""
import time as _time
import numpy as _np
import matplotlib.pyplot as _mplt
import matplotlib.gridspec as _mgs
import pyaccel
from siriuspy.devices import SOFB as _SOFB, RFGen as _RFGen, EVG as _EVG
from siriuspy.search import BPMSearch ... | 1.898438 | 2 |
wrappers.py | raymundosaraiva/moviestar_bot | 0 | 53204 | <gh_stars>0
from telegram import ChatAction
from functools import wraps
def send_typing_action(func):
"""Sends typing action while processing func command."""
@wraps(func)
def command_func(update, context, *args, **kwargs):
context.bot.send_chat_action(chat_id=update.effective_message.chat_id, a... | 2.59375 | 3 |
external/glbinding-1.1.0/codegeneration/scripts/binding.py | matparsa/Fahim | 2 | 53205 | <gh_stars>1-10
import os, sys
templatedir = "templates/"
tab = " "
tab2 = tab + tab
execdir = os.path.dirname(os.path.abspath(sys.argv[0])) + "/"
def versionBID(feature, core = False, ext = False):
if feature is None:
return ""
version = str(feature.major) + str(feature.minor... | 2.359375 | 2 |
maskrcnn_benchmark/modeling/arpn/arpn.py | Shualite/UBNet | 2 | 53206 | # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
import torch
import torch.nn.functional as F
from torch import nn
from maskrcnn_benchmark.modeling import registry
from maskrcnn_benchmark.modeling.rbox_coder import RBoxCoder
from maskrcnn_benchmark.layers import Mish
from .loss import make_rpn_l... | 2.265625 | 2 |
ui/ui_designer/ui_file/uic_initDialog.py | Tanyiqu/AnimeArtifactPro | 50 | 53207 | <reponame>Tanyiqu/AnimeArtifactPro
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'initDialog.ui'
#
# Created by: PyQt5 UI code generator 5.14.1
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_initDialog(object):
def set... | 1.570313 | 2 |
IoT/presentation/plots/step_plot.py | Mohitsharma44/CUSP-GX-6004-C | 5 | 53208 | import matplotlib.pyplot as plt
import numpy as np
plt.style.use('seaborn-darkgrid')
x = range(8)
y = np.linspace(1.1, 5.0, 8)
ylabel = map(lambda num: bin(num)[2:], x)
xlabel = map(lambda num: "{0:.2f}".format(num), y)
plt.step(x, y)
plt.yticks(y, ylabel)
plt.xticks(x, xlabel, rotation=45)
plt.ylabel("Binary Output... | 3.15625 | 3 |
__init__.py | Wired-Square/homeassistant-twc-director | 0 | 53209 | """The Tesla Wall Charger Director integration."""
import asyncio
from twcdirector.listener import TWCListener
from twcdirector.device import TWCPeripheral
from homeassistant.config_entries import ConfigEntry
from homeassistant.core import HomeAssistant
from homeassistant.const import (EVENT_HOMEASSISTANT_STOP)
from... | 2.1875 | 2 |
ilp.py | kaustav-basu/IdentifyingCodes | 0 | 53210 | <filename>ilp.py
__author__ = "<NAME>"
'''
Please read the papers under Research, to better grasp the concept of Identifying Codes.
This program computes the Minimum Identifying Code Set for a given graph.
I utilize the Gurobi Optimization package to obtain the optimal solution.
'''
# Packages required in this prog... | 3.203125 | 3 |
math/0x00-linear_algebra/10-ill_use_my_scale.py | sebaslherrera/holbertonschool-machine_learning | 0 | 53211 | #!/usr/bin/env python3
"""I’ll Use My Scale module"""
def np_shape(matrix):
"""calculates the shape of a numpy.ndarray"""
return matrix.shape
| 2.515625 | 3 |
Machine Learning Explainability/02.Permutation_Importance.py | BEPb/Python-100-days | 16 | 53212 | <reponame>BEPb/Python-100-days
# Permutation Importance
# Загрузите данные
# Разделите данные на обучение и проверку
# Создайте модель, предсказывающую стоимость такси.
# Распечатайте несколько строк для просмотра
# Loading data, dividing, modeling and EDA below
import pandas as pd
from sklearn.ensemble import RandomF... | 2.765625 | 3 |
scripts/softArm.py | XiaojiaoChen/origarm_ros | 1 | 53213 | <reponame>XiaojiaoChen/origarm_ros
# -*- coding: utf-8 -*-
from math import sin, cos, pi, atan2, sqrt, asin, atan
import numpy
class softArm(object):
def __init__(self, c1 =6 * 400 * 0.09 / 2.3e-3 / 2, lengthD=0.403,length=0.055
,length0=0.055,alphaD=.0,betaD=.0,alpha=.0,beta=.0,actuator_type='s... | 2.5625 | 3 |
instance/models.py | Kuebler-IT/WebVirtNG | 0 | 53214 | <reponame>Kuebler-IT/WebVirtNG<filename>instance/models.py<gh_stars>0
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models
from servers.models import Compute
class Instance(models.Model):
compute = models.ForeignKey(Compute)
name = models.CharField(max_length=20)
uu... | 1.867188 | 2 |
translate_web.py | kestel/dndmonstertrans | 1 | 53215 | <reponame>kestel/dndmonstertrans
#!/usr/bin/env python3.6
#-*- coding:utf-8 -*-
import sys
from os import environ
# подцепляем словарь из внешнего файла
import dicts.dicts as d
import dicts.spells as s
from translate import replacer
import bottle
bottle.debug(True)
@bottle.route('/dict')
def print_dict():
html ... | 2.203125 | 2 |
agents/actor_critic_agents/TD3.py | kadhirumasankar/Deep-Reinforcement-Learning-Algorithms-with-PyTorch | 0 | 53216 | <filename>agents/actor_critic_agents/TD3.py
import torch
import torch.nn.functional as functional
from torch import optim
from agents.Base_Agent import Base_Agent
from .DDPG import DDPG
from exploration_strategies.Gaussian_Exploration import Gaussian_Exploration
class TD3(DDPG):
"""A TD3 Agent from the paper Addr... | 2.421875 | 2 |
Dataset/Leetcode/train/70/119.py | kkcookies99/UAST | 0 | 53217 | <filename>Dataset/Leetcode/train/70/119.py
class Solution(object):
def XXX(self, n):
g5=5**0.5
b=(((1+g5)/2)**(n+1)-((1-g5)/2)**(n+1))/g5
return int(round(b))
| 2.875 | 3 |
scrapper.py | muhammedramshin/ktu-notification-bot | 0 | 53218 | <gh_stars>0
import time
import hashlib
import requests
import psycopg2
import os
import json
import telegram
import urllib.parse
from bs4 import BeautifulSoup, Comment
from telegram import InlineKeyboardButton, InlineKeyboardMarkup
# ___________ CONFIG AREA ________________
# This will prevent sending messages to chan... | 2.3125 | 2 |
outbreak_z.py | jonesmat/outbreak_z | 1 | 53219 | import pygame
from pygame.locals import QUIT, KEYDOWN, K_q, K_ESCAPE, K_BACKQUOTE, MOUSEBUTTONDOWN
from resources.resourcemgr import ResourceMgr
from scenes.game_scene import GameScene
def main():
pygame.init()
SCREEN_SIZE = (1280, 800)
surface = pygame.display.set_mode(SCREEN_SIZE, 0, 32)
clock = py... | 3.078125 | 3 |
events/migrations/0014_tournament.py | RyanRMurray/warwick_gg | 5 | 53220 | <filename>events/migrations/0014_tournament.py
# Generated by Django 2.0.2 on 2018-06-07 13:25
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [
('events', '0013_eventsignup_unsigned_up_at'),
... | 2.125 | 2 |
__main__.py | Susan1110/MisCancionesApp-1 | 0 | 53221 | from src.modelo.cancion import Cancion
from src.modelo.interprete import Interprete
from src.modelo.album import Album, Medio
from src.modelo.declarative_base import Session, engine, Base
from src.logica.coleccion import Coleccion
def anadir_album (titulo , anio , descripcion , medio) :
# Crea la BD
Base.metada... | 2.65625 | 3 |
farecalculator.py | bliksemlabs/Glassbox | 1 | 53222 | <gh_stars>1-10
"""
The MIT License (MIT)
Copyright (c) 2014 <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, modif... | 2.671875 | 3 |
v1.0/main.py | casithepython/AoPSCoin | 2 | 53223 | <reponame>casithepython/AoPSCoin
import json
import random
import sqlite3
import string
import requests
from flask import Flask, jsonify, make_response, request, render_template
import emaildata
app = Flask(__name__)
@app.route("/")
def home():
return render_template("index.html")
def connect():
... | 2.90625 | 3 |
contrib/monitoring/alert-kvm.py | MailOnline/alerta | 0 | 53224 | <gh_stars>0
#!/usr/bin/env python
import os
import subprocess
import re
"""
Id Name State
----------------------------------------------------
6 instance-00000654 running
7 instance-00000655 running
9 instance-00000657 running
10 ... | 2.296875 | 2 |
storey/aggregations.py | katyakats/storey | 0 | 53225 | <reponame>katyakats/storey<filename>storey/aggregations.py<gh_stars>0
import asyncio
import copy
from datetime import datetime
import re
from typing import Optional, Union, Callable, List, Dict
from .aggregation_utils import is_raw_aggregate, get_virtual_aggregation_func, get_implied_aggregates, get_all_raw_aggregates... | 2.296875 | 2 |
trasto/model/service_sensor.py | pablocm83/jpardobl-trastobrain | 15 | 53226 | from trasto.model.entities import EstadoHumorRepositoryInterface
from trasto.model.value_entities import ResultadoAccion
from trasto.model.events import EventRepositoryInterface
class SensorInterface:
def listen_to_task_result(self, evento_repo: EventRepositoryInterface) -> None:
pass
def update_hu... | 1.695313 | 2 |
searching/search_by_google.py | dimishpatriot/image_parser | 2 | 53227 | <reponame>dimishpatriot/image_parser
# -*- coding: utf-8 -*-
# search_by_google.py
# github.com/dimishpatriot/img_pars
from searching import search_main
class GoogleSearch(search_main.Search):
search_types = {}
size_types = {}
gamma_types = {}
orient_types = {}
type_types = {}
maximum_pics = ... | 1.960938 | 2 |
circular_cylinder/Train/Extra/ridge_regression_sci.py | J-Massey/postproc | 0 | 53228 | <reponame>J-Massey/postproc
# we import necessary libraries and functions
import matplotlib.pyplot as plt
from sklearn.linear_model import LinearRegression
from sklearn.linear_model import Ridge
from sklearn.linear_model import Lasso
from sklearn.model_selection import train_test_split
import numpy as np
data = np.loa... | 3.25 | 3 |
gratipay/models/account_elsewhere.py | webmaven/gratipay.com | 0 | 53229 | from __future__ import absolute_import, division, print_function, unicode_literals
import json
from postgres.orm import Model
from psycopg2 import IntegrityError
from urlparse import urlsplit, urlunsplit
import xml.etree.ElementTree as ET
import xmltodict
from aspen import Response
from gratipay.exceptions import Pro... | 2.34375 | 2 |
pdfs/ExtractDoi.py | tmearnest/sbd | 0 | 53230 | <gh_stars>0
import re
import os
from .Exceptions import AbortException
from .Prompt import promptOptions, promptString
from .TermOutput import msg
from .BaseWork import Work
from .AnsiBib import printBibliography, printWork
from .ReadPdf import getPdfTxt
_doiRegexStr= re.compile(r'10[.][0-9]{4,}[^\s"/<>]*/[^\s"<>]+')
... | 2.359375 | 2 |
models/mcnn.py | junprog/cc-base | 0 | 53231 | import torch
import torch.nn as nn
import torch.nn.functional as F
class Conv2d(nn.Module):
def __init__(self, in_channels, out_channels, kernel_size, stride=1, NL='relu', same_padding=False, bn=False, dilation=1):
super(Conv2d, self).__init__()
padding = int((kernel_size - 1) // 2) if same_padding... | 2.734375 | 3 |
benchmark/datasets/synthetic/data_generator.py | FederalLab/benchmark-lightly | 0 | 53232 | <filename>benchmark/datasets/synthetic/data_generator.py
# @Author : FederalLab
# @Date : 2021-09-26 00:25:30
# @Last Modified by : <NAME>
# @Last Modified time: 2021-09-26 00:25:30
# Copyright (c) FederalLab. All rights reserved.
# type: ignore
import numpy as np
from scipy.special import soft... | 2.3125 | 2 |
board/field.py | dwaffe/connect4deepLearning | 0 | 53233 | from .piece import Piece
from typing import Optional
from colorama import init
from termcolor import colored
init()
class Field:
def __init__(self, piece: Optional[Piece] = None) -> None:
self._piece = piece
def get_piece(self) -> Optional[Piece]:
return self._piece
def put_piece(self,... | 3.046875 | 3 |
src/losses.py | webersab/joint_biased_embeddings | 5 | 53234 | <gh_stars>1-10
from torch import nn
import torch as t
from .utils import get_correct_and_incorrect_scores, get_device
DEVICE = get_device()
class SoftMaxLoss(nn.modules.loss._Loss):
'''
This loss implements NLL of softmax for a batch where each item
contains one positive, and neg_ratio number of negative ... | 2.53125 | 3 |
desafio046.py | romstk/pythonExercicios | 0 | 53235 | from time import sleep
import emoji
print('AGUARDE A CONTAGEM PARA OS FOGOS')
for c in range(10, 0, -1):
print(c)
sleep(1)
print(emoji.emojize("Detonação dos fogos :sunny: ", use_aliases=True))
print('FIM') | 3.109375 | 3 |
placerg/testboot.py | mcmorre/placerg | 3 | 53236 | #funcsboot.py
from placerg.funcs import *
from placerg.funcsrg import *
from placerg.funcsall import *
from placerg.objects import *
from scipy.optimize import curve_fit
def bootfunc(a, env):
rate=[]
coeff=[]
eigspec=[]
var=[]
psil=[]
actmom=[]
autocorr=[]
tau=[]
... | 1.859375 | 2 |
Python/Exercícios_Python/036_analisando_triângulo.py | vdonoladev/aprendendo-programacao | 0 | 53237 | # -*- coding: utf-8 -*-
"""036 - Analisando Triângulo
Automatically generated by Colaboratory.
Original file is located at
https://colab.research.google.com/drive/1oQmCX-HLeaqxWxaz9zsjj-5Na35XtNXM
"""
print('*' * 54)
print('------- Condição de existência de um triângulo -------'.upper())
print('*' * 54)
r1 = fl... | 3.78125 | 4 |
nuage_neutron/plugins/nuage_ml2/nuage_ml2_wrapper.py | krissterckx/nuage-openstack-neutron | 0 | 53238 | <reponame>krissterckx/nuage-openstack-neutron
# Copyright 2017 Nokia
#
# 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... | 1.5 | 2 |
HW/hw01/hw01.py | IZUMI-Zu/CS61A | 0 | 53239 | <reponame>IZUMI-Zu/CS61A
from operator import add, sub
def a_plus_abs_b(a, b):
"""Return a+abs(b), but without calling abs.
>>> a_plus_abs_b(2, 3)
5
>>> a_plus_abs_b(2, -3)
5
"""
if b < 0:
b = -b
f = add
else:
f = add
return f(a, b)
def a_plus_abs_b_syn... | 4.125 | 4 |
alfpy/ncd.py | hasibaasma/alfpy | 19 | 53240 | <gh_stars>10-100
"""Normalized compression distance (NCD)
The NCD is a family of distances parametrized with the compressor Z.
The better Z is, the closer the NCD approaches the NID, and the better
the results are.
As described in:
1. <NAME>
IEEE Transactions on Information Theory 1998. 44(4):1407-1423
doi: 10.... | 2.6875 | 3 |
runtests.py | beezz/django-admin2 | 1 | 53241 | <filename>runtests.py
#!/usr/bin/env python
import os
import sys
os.environ['DJANGO_SETTINGS_MODULE'] = 'example.settings'
exampleproject_dir = os.path.join(os.path.dirname(__file__), 'example')
sys.path.insert(0, exampleproject_dir)
from django.test.utils import get_runner
from django.conf import settings
def runt... | 2.3125 | 2 |
workload_auto/rest.py | CiscoDevNet/dcnm-workload-automation | 0 | 53242 | <reponame>CiscoDevNet/dcnm-workload-automation
# Copyright 2020 Cisco Systems, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/L... | 1.992188 | 2 |
aapi/__init__.py | wpk-/aapi | 0 | 53243 | """
aapi.
Een typed interface voor de data API van de Gemeente Amsterdam.
"""
__version__ = '0.2.2'
__author__ = '<NAME>'
__credits__ = 'Gemeente Amsterdam'
from aapi.api import API
| 0.984375 | 1 |
poker_remnants.py | HaowenLee/PokerRemnants- | 1 | 53244 | # -*- coding: UTF-8 -*-
# 该算法比较慢
import operator
# 牌型枚举
class ComeType:
PASS, SINGLE, PAIR, TRIPLE, TRIPLE_ONE, TRIPLE_TWO, FOURTH_TWO_ONES, FOURTH_TWO_PAIRS, STRAIGHT, EVEN_PAIR, BOMB = \
range(11)
# 3-14 分别代表 3-10, J, Q, K, A
# 16, 18, 19 分别代表 2, little_joker, big_joker
# 将 2 与其他牌分开是为了方便计算顺子
# 定义 HAN... | 2.71875 | 3 |
scripts/display.py | priyablue/ros-face-recognition | 19 | 53245 | #!/usr/bin/env python
import cv2
import dlib
import rospy
from sensor_msgs.msg import Image
from cv_bridge import CvBridge, CvBridgeError
from ros_face_recognition.srv import Face
import config
import face_api
_service = "/{}/faces".format(config.topic_name)
class ImageReader:
def __init__(self):
self.... | 2.671875 | 3 |
Others/jsc/jsc2021/c/main.py | KATO-Hiro/AtCoder | 2 | 53246 | # -*- coding: utf-8 -*-
def main():
from math import ceil
import sys
input = sys.stdin.readline
a, b = map(int, input().split())
ans = 1
for i in range(1, b):
z = ceil(a / i)
if i * (z + 1) <= b:
ans = max(ans, i)
print(ans)
if __name__ == "__main__":
... | 3.015625 | 3 |
Algorithms/moran_number.py | StokicDusan/Python-misc | 0 | 53247 | <filename>Algorithms/moran_number.py<gh_stars>0
from math import sqrt
def is_prime(pp) -> bool:
"""
Returns True if pp is prime
otherwise, returns False
"""
if pp == 2 or pp == 3:
return True
elif pp < 2 or not pp % 2:
return False
odd_n = range(3, int(sqrt(pp) + 1), 2)
... | 4.09375 | 4 |
get_symmetrized_cifs.py | jzj701/GBB | 0 | 53248 | <reponame>jzj701/GBB
# this program gets symmetrized CIF files using pymatgen
import data_handler
from tqdm import tqdm
# read API key
import os
from dotenv import load_dotenv
# pymatgen
from pymatgen.ext.matproj import MPRester
from pymatgen.symmetry.analyzer import SpacegroupAnalyzer
from pymatgen.io.cif import CifW... | 2.546875 | 3 |
waymo_kitti_converter/tools/list_generator.py | anhvth/Pseudo_Lidar_V2 | 0 | 53249 | """
This script generates number list text files
Number list contains stem of filenames
Number list specifies the files used for a certain data split
Prefix:
- training: 0 (training/)
- validation: 1 (training/)
- testing: 2 (testing/)
- domain adaptation training labell... | 3.234375 | 3 |
__scraping__/routing.openstreetmap.de/main.py | furas/python-code | 2 | 53250 | # author: Bartlomiej "furas" Burek (https://blog.furas.pl)
# date: 2022.03.07
# [javascript - export gpx file with python? - Stack Overflow](https://stackoverflow.com/questions/71375579/export-gpx-file-with-python/71375874#71375874)
import requests
start_lon = -0.0898 # can be also as text
start_lat = 51.514739 #... | 3.375 | 3 |
pulumi/aws/vpc/__main__.py | resurfaceio/kic-reference-architectures | 72 | 53251 | import pulumi
from pulumi_aws import ec2, get_availability_zones
stack_name = pulumi.get_stack()
project_name = pulumi.get_project()
config = pulumi.Config('vpc')
vpc = ec2.Vpc(resource_name=f"eks-{project_name}-{stack_name}",
cidr_block="10.100.0.0/16",
enable_dns_support=True,
... | 2.78125 | 3 |
examples/default/app.py | lucuma/authcode | 11 | 53252 | # coding=utf-8
from flask import Flask
from mailshake import ToConsoleMailer, SMTPMailer
from sqlalchemy_wrapper import SQLAlchemy
import settings
app = Flask(__name__)
app.config.from_object(settings)
db = SQLAlchemy(settings.SQLALCHEMY_URI, app)
if settings.DEBUG:
mailer = ToConsoleMailer()
else:
mailer ... | 2 | 2 |
VTiger_KPI_Dashboard/docs/models.py | roovyshapiro/VTiger_Sales_Dashboard | 0 | 53253 | <reponame>roovyshapiro/VTiger_Sales_Dashboard
from django.db import close_old_connections, models
from django.utils import timezone
class Docs(models.Model):
'''
DOC Example
{
"archivedAt": null,
"collaboratorIds": [
"12345-1234-1234-1234-123456789",
"12345asdf-1234-... | 2.078125 | 2 |
examples/test_grf2ps.py | gjsun/starterlite | 0 | 53254 | import numpy as np
import os
from scipy.interpolate import interp1d
import matplotlib.pyplot as plt
import starterlite
grf = starterlite.simulation.GaussianRandomField()
grf_input = np.load(os.getenv('STARTERLITE')+'/output/grf/grf_samples_x180y1z30_N1.npz', allow_pickle=True)
f_in = grf_input['grf']
f_in = f_in.sq... | 2.140625 | 2 |
athanor_channels/commands/character.py | volundmush/athanor_channels | 0 | 53255 | <gh_stars>0
from athanor_channels.commands.base import AbstractChannelAdminCommand, AbstractChannelCommand, AbstractChannelUseCommand
class CharacterChannelCommand(AbstractChannelCommand):
system_key = 'character'
help_category = "Character Channel Aliases"
user_controller = 'character'
class CmdCharact... | 2.453125 | 2 |
asyncexec/examples/simple_http/simple_processing.py | arshadansari27/async-exec-core | 4 | 53256 | <filename>asyncexec/examples/simple_http/simple_processing.py
import sys
sys.path.insert(0, '../../../')
from asyncexec.exec import AsyncExecutor
async_executor = AsyncExecutor({
"http": {
"port": 8080
}
})
@async_executor.handler('rabbitmq', 'req_queue1', 'res_queue1')
def test_method1(data):
... | 2.734375 | 3 |
keras/datasets/sin.py | Dlyma/keras-plus | 1 | 53257 | <filename>keras/datasets/sin.py
# -*- coding: utf-8 -*-
import cPickle
import sys, os
import numpy as np
# written by zhaowuxia @ 2015/5/30
# used for generate linear datasets
def generate_data(sz, T, diff_start, diff_T):
data = []
for i in range(sz):
start = 0
if diff_start:
start ... | 2.796875 | 3 |
py/write.py | copvict/LoginRFID | 0 | 53258 | import RPi.GPIO as GPIO
import sys
import os
from datetime import datetime
from time import sleep
import socket
try:
from mfrc522 import SimpleMFRC522
from getmac import get_mac_address
import hashlib
except:
os.system("pip3 install mfrc522")
os.system("pip3 install getmac")
os.system("pip3 ins... | 2.765625 | 3 |
artbot/feed/__init__.py | skielred/ArtCompanion | 1 | 53259 | from .cog import FeedCog
def init(bot):
bot.add_cog(FeedCog(bot))
from . import pixiv, twitter
| 1.484375 | 1 |
src/py_dss_interface/models/Bus/BusF.py | davilamds/py_dss_interface | 8 | 53260 | <reponame>davilamds/py_dss_interface
# -*- encoding: utf-8 -*-
"""
Created by eniocc at 11/10/2020
"""
import ctypes
from py_dss_interface.models.Base import Base
class BusF(Base):
"""
This interface can be used to read/write certain properties of the active DSS object.
The structure of the interface i... | 2.984375 | 3 |
handlers/simple/index.py | therightstuff/aws-cdk-python-dev-guide | 1 | 53261 | import json
import os
import uuid
def main(event, context):
return_object = {
"success": True,
"response_id": str(uuid.uuid4()),
"querystring": event.get("queryStringParameters"),
"environment_variables": os.environ['GREETING']
}
return {
"statusCode": 200,
"... | 2.25 | 2 |
4_review_to_tag.py | carpedm20/movietag | 7 | 53262 | #!/usr/bin/python
import requests
import json
import sys
from os import listdir
from config import *
from random import shuffle
from func import *
debug = True
f = open('movie_review.json', 'r')
j = json.loads(f.read())
f.close()
movie_dict = {}
movie_dict['data'] = []
count = 0
for i in j['data']:
print coun... | 2.65625 | 3 |
stocktools/tmp.py | oleg-gunchenko/stock-analysis-py | 1 | 53263 | # -*- coding: utf-8 -*-
import plotly.graph_objects as go
import pandas as pd
import dash
import dash_core_components as dcc
import dash_html_components as html
def plot_ohlc(co_df: pd.DataFrame, title: str = ""):
colors = {
'background': '#11001A', # onyx
'text': '#7FDBFF'
}
hovertext... | 2.453125 | 2 |
tulipnb/__init__.py | anlambert/tulip_python_jupyter | 0 | 53264 | <reponame>anlambert/tulip_python_jupyter<gh_stars>0
# Python module to use when working with the tulip module in a Jupyter / IPython notebook
# It enables to inline Tulip WebGL graph visualizations in the notebook
# That code is freely inspired from the great mpld3 project
# (see https://github.com/mpld3/mpld3/tree/ma... | 2.71875 | 3 |
sme/test/test_membrane.py | henryiii/spatial-model-editor | 4 | 53265 | import unittest
import sme
class TestMembrane(unittest.TestCase):
def test_membrane(self):
m = sme.open_example_model()
self.assertEqual(len(m.membranes), 2)
self.assertRaises(sme.InvalidArgument, lambda: m.membranes["X"])
mem = m.membranes["Outside <-> Cell"]
self.assertEq... | 2.875 | 3 |
test/test_delete_contact_from_group.py | Dessummiis/python_training | 0 | 53266 | <reponame>Dessummiis/python_training<gh_stars>0
from model.contact import Contact
from model.group import Group
import random
def test_add_contact(app, orm):
# проверки на группы и контакты
if len(orm.get_group_list()) == 0:
app.group.create(Group(name="test"))
if len(orm.get_contact_list()) == 0:... | 2.765625 | 3 |
houdini_engine_for_maya/asset_store.py | sonictk/HoudiniEngineForMaya | 86 | 53267 | import json
import os
import re
import sys
import maya.cmds as cmds
import maya.mel as mel
current_user = None
asset_size = 100
child_entries_margin = 5
child_assets_column = 3
asset_store_window = "houdiniEngineAssetStoreWindow"
change_user_menu_item = "houdiniEngineAssetStoreChangeUserMenuItem"
asset_entries_scro... | 2.171875 | 2 |
conflicting_package_test/pkg/foo.py | bmintz/python-snippets | 2 | 53268 | <filename>conflicting_package_test/pkg/foo.py<gh_stars>1-10
from . import MyImportantClass
| 1.273438 | 1 |
tecinterp.py | aldebaran1/gpstec | 0 | 53269 | <reponame>aldebaran1/gpstec
# -*- coding: utf-8 -*-
"""
Created on Sat Mar 28 20:25:26 2020
@author: <EMAIL>
"""
from gpstec import gpstec
from datetime import datetime
import numpy as np
from typing import Union
from scipy.interpolate import griddata
from scipy.spatial import Delaunay
import matplotlib.pyplot as plt... | 2.109375 | 2 |
back-end/main.py | Guilhermeslucas/SPaaS | 2 | 53270 | from flask import Flask, request, Response
import json
import pymongo
from flask_cors import CORS
from bson.json_util import dumps, loads
import os
from azure.storage.blob import BlockBlobService, PublicAccess
from celery import Celery
import subprocess
import uuid
app = Flask(__name__)
CORS(app)
db_cli... | 1.914063 | 2 |
malib/utils/typing.py | zbzhu99/malib | 0 | 53271 | import enum
import time
from collections import namedtuple
from dataclasses import dataclass, field
from typing import List, Dict, Any, Union, Tuple, Sequence, Callable, Optional
import gym
import numpy as np
from malib.utils.notations import deprecated
""" Rename and definition of basic data types which are corresp... | 2.265625 | 2 |
ussd/airtime_api.py | dirkcuys/save4life | 0 | 53272 | <reponame>dirkcuys/save4life
from django.conf import settings
from zeep import Client
import time
import logging
logger = logging.getLogger(__name__)
class InsufficientBalance(Exception):
pass
class AirtimeApiError(Exception):
pass
def pinless_recharge(transaction):
amount = transaction.amount
msi... | 2.203125 | 2 |
python/word_break.py | soumasish/leetcode | 10 | 53273 | """Created by sgoswami on 7/18/17."""
"""Given a non-empty string s and a dictionary wordDict containing a list of non-empty words, determine if s can be
segmented into a space-separated sequence of one or more dictionary words. You may assume the dictionary does not
contain duplicate words.
For example, given
s = ... | 3.8125 | 4 |
migrations/0017_auto_20210419_1810.py | andywar65/buildings | 2 | 53274 | <gh_stars>1-10
# Generated by Django 3.1.2 on 2021-04-19 16:10
import django.contrib.gis.db.models.fields
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('buildings', '0016_auto_20210414_2325'),
]
operations = [
... | 1.5625 | 2 |
tests/ut/modules/test_ctera_portal_syslog.py | ctera/ctera-ansible-collection | 0 | 53275 | # pylint: disable=protected-access
# This code is part of Ansible, but is an independent component.
# This particular file snippet, and this file snippet only, is licensed under the Apache License 2.0.
# Modules you write using this snippet, which is embedded dynamically by Ansible
# still belong to the author of the ... | 1.609375 | 2 |
URI/1-Beginner/1012.py | vicenteneto/online-judge-solutions | 0 | 53276 | <reponame>vicenteneto/online-judge-solutions<filename>URI/1-Beginner/1012.py
# -*- coding: utf-8 -*-
a, b, c = [float(x) for x in raw_input().split()]
print 'TRIANGULO: %.3f' % (a * c / 2)
print 'CIRCULO: %.3f' % (3.14159 * c * c)
print 'TRAPEZIO: %.3f' % ((a + b) * c / 2)
print 'QUADRADO: %.3f' % (b * b)
print 'RETAN... | 3.46875 | 3 |
tests/test_resources/concept_ids/municipality.py | JobtechSwe/sokannonser-api | 14 | 53277 | from tests.test_resources.helper import select_random_from_list
def get_muncipalities_with_hits():
with_hits = []
for m in municipalities:
if m['hits'] > 0:
with_hits.append(m)
return with_hits
def get_ten_random_municipalities_with_hits():
return select_random_from_list(full_lis... | 2.6875 | 3 |
include/syms.py | Newer-Team/NewerSMBU | 7 | 53278 | <filename>include/syms.py
names = []
addr = 0x148 + 0x4E4
while addr <= 0x148 + 0x7FC:
names.append('\t' + Name(Dword(addr)) + ' = ')
addr += 8
with open('names.txt', 'w') as f:
f.write('\n'.join(names))
| 2.328125 | 2 |
utility/image.py | milesgray/ImageFunctions | 0 | 53279 | import math
from typing import Union, Dict
import numpy as np
import torch
import torchvision.transforms as transforms
from torchvision.transforms import InterpolationMode
import utility as utils
import utility.color as color
class Resolution:
def __init__(self, width, height):
self.width = width
... | 3 | 3 |
main.py | andrewmsilva/Topic-Modeling-with-news | 1 | 53280 | from pandas import read_sql_query
from sqlite3 import connect
from pickle import load, dump
from time import time
from gensim.utils import simple_preprocess
from gensim.models import Phrases
from gensim.models.phrases import Phraser
from gensim.parsing.preprocessing import STOPWORDS
from gensim.corpora import Dictiona... | 2.5 | 2 |
cacp_examples/experiment.py | sylwekczmil/cacp | 1 | 53281 | from sklearn.neighbors import KNeighborsClassifier
from skmultiflow.lazy import KNNClassifier
from skmultiflow.meta import LearnPPNSEClassifier
from cacp import all_datasets, run_experiment, ClassificationDataset
from cacp_examples.classifiers import CLASSIFIERS
from cacp_examples.example_custom_classifiers.xgboost im... | 2.859375 | 3 |
timestamp.py | pujithas/python | 0 | 53282 | import os,sys
from os import walk
path='C:\\Users\\PUJITHA\\AppData\\Local\\Programs\\Python\\Python36\\Timestamps'
dirs=os.listdir(path)
print("list of all the contetnts in the TimeStamps Library ")
print(dirs)
# Adding the directory contents in list data structure
f = []
for (filenames) in walk(path):
... | 3 | 3 |
equivalence/correction/node.py | Shurik412/equivalence_rastr_win3 | 0 | 53283 | # -*- coding: utf-8 -*-
from equivalence.tables.Tables import Node, Vetv
def removing_nodes_without_branches(rastr_win: object):
# ************************************************************
# Назначение: Удаление узлов без связи с ветвями
# Входные параметры: Nothing
# Возврат: Nothing
# *... | 2.40625 | 2 |
src/form_builder/views.py | danny8000/collab-form-builder | 4 | 53284 | import csv
import datetime
import re
import json
import unicodedata
from django.shortcuts import render_to_response, get_object_or_404
from django.template import RequestContext
from django.http import HttpResponseRedirect, HttpResponse
from django.core.urlresolvers import reverse
from django.contrib.auth.decorators i... | 1.9375 | 2 |
Exercicios/ex_058.py | antoniosereno95/Python_Curso_em_Video | 0 | 53285 | <filename>Exercicios/ex_058.py
import random
r = random.randint(0,10)
count = 1
n = input('numero de 0 a 10: ')
while int(n) != int(r):
print('tente novamente: ')
count += 1
n = input()
print('parabens voce acretou em ',count,' chances.')
| 3.96875 | 4 |
faceModel.py | cagrigungor/Multiple-Face-Recognition-with-Keras | 1 | 53286 | <gh_stars>1-10
from __future__ import print_function
import keras
from tensorflow.keras.preprocessing.image import ImageDataGenerator
from tensorflow.keras.models import Sequential
from tensorflow.keras.layers import Dense, Dropout, Activation, Flatten
from tensorflow.keras.layers import Conv2D, MaxPooling2D
import os
... | 2.609375 | 3 |
setup.py | simonblouin/montreal-py-wd | 3 | 53287 | <filename>setup.py
from setuptools import setup, find_packages
setup(name='NaBlaUtils',
version='0.1',
description="Utilitaires Python pour l'analyse et la visualisation de données relatives aux étoiles naines blanches",
url='https://github.com/simonblouin/NaBlaMTL-utilitaires',
package_data={'... | 1.546875 | 2 |
tests/data.py | dydyamotya/python-xkbcommon | 12 | 53288 | <filename>tests/data.py
# Defines sample_keymap_string and sample_keymap_bytes
# Python 2 type Python 3 type
# sample_keymap_string unicode str
# sample_keymap_bytes str bytes
# This sample keymap is the output of xkbcomp :0 [filename] on my
# system - it was... | 2.015625 | 2 |
nrgmap/hybri_sc.py | GiggleLiu/nrg_mapping | 5 | 53289 | '''
Get the hybridization function of a conventional superconductor bath.
wide-band approximation(get_hybri_wideband) version and finite-band width(get_hybri) version are available.
'''
from numpy import *
from .utils import sx,sz
__all__=['get_hybri','get_hybri_wideband','get_hybri_skew']
def get_hybri(Gap,Gamma,D... | 2.84375 | 3 |
INF101/TD/1.2.6.py | Marshellson/UGA_IMF | 1 | 53290 | <reponame>Marshellson/UGA_IMF
prenom = input("Votre prenom svp ")
langue = input("Votre langue: ") # Langue devait etre "francais" ou "anglais"
if langue == "francais":
print("Bonjour %s" % prenom)
elif langue == "anglais":
print("Hello %s" % prenom)
else:
print("ERREUR")
| 3.546875 | 4 |
solvers/day1.py | MaphsterB/advent2017 | 0 | 53291 | """
Day 1 Solutions
"""
def part1(input_lines):
"""
The captcha requires you to review a sequence of digits (your puzzle input) and find
the sum of all digits that match the next digit in the list. The list is circular,
so the digit after the last digit is the first digit in the list.
For example... | 4.125 | 4 |
deployer/__init__.py | LSmith-Zenoscave/deployer | 3 | 53292 | <filename>deployer/__init__.py
"""Top-level package for deployer-fsm."""
__author__ = """<NAME>"""
__email__ = '<EMAIL>'
__version__ = '0.1.5'
| 1.078125 | 1 |
mibs/pycopia/mibs/SNMP_PROXY_MIB.py | kdart/pycopia | 89 | 53293 | <reponame>kdart/pycopia
# python
# This file is generated by a program (mib2py). Any edits will be lost.
from pycopia.aid import Enum
import pycopia.SMI.Basetypes
Range = pycopia.SMI.Basetypes.Range
Ranges = pycopia.SMI.Basetypes.Ranges
from pycopia.SMI.Objects import ColumnObject, MacroObject, NotificationObject, Ro... | 1.875 | 2 |
ssl_context_builder/Tests/dry_run_examples.py | mbjahnoon/ssl_context_builder | 1 | 53294 | import asyncio
from aiohttp import ClientSession
from ssl_context_builder.builder.builder import SslContextBuilder
from ssl_context_builder.http_impl.requests_wrapper.secure_session import RequestsSecureSession
def create_strong_crypto_ctx():
builder = SslContextBuilder()
ssl_ctx = builder.use_tls_1_2_and_a... | 2.21875 | 2 |
number_punch/number_punch.py | abcdHero/battlegame | 1 | 53295 | import sys
import random
import pygame
# Define Window Size
SCREEN_WIDTH, SCREEN_HEIGHT = 800, 600
# Define Frames Per Second
FRAMES_PER_SEC = 25
# Function: Draw a text to the screen
def blit_text(screen_object, font, msg_text, color_tuple, center_tuple, antialiased=True):
# Define a message in Main Menu with Co... | 3.578125 | 4 |
metropolis-hastings/doc/presentation/plot_norm.py | nicholasmalaya/paleologos | 1 | 53296 | <reponame>nicholasmalaya/paleologos
import matplotlib.pyplot as plt
import numpy as np
import matplotlib.mlab as mlab
import math
mean = 0
variance = 1
sigma = math.sqrt(variance)
x = np.linspace(-3,3,100)
plt.plot(x,mlab.normpdf(x,mean,sigma))
# first point (reject)
x1=[-2.2]
y1=[0.25]
plt.plot(x1,y1,color='r', ms=1... | 2.96875 | 3 |
objectstorage/commit_differ.py | syncwerk/syncwerk-server-python-object-storage | 0 | 53297 | <gh_stars>0
# coding: UTF-8
from objectstorage import fs_mgr
import os
ZERO_OBJ_ID = '0000000000000000000000000000000000000000'
class DiffEntry(object):
def __init__(self, path, obj_id, size=-1, new_path=None):
self.path = path
self.new_path = new_path
self.obj_id = obj_id
self.s... | 2.3125 | 2 |
AnomalyPlugin/train_model_dialog.py | IMMS-Ilmenau/AnoPCB | 2 | 53298 | <reponame>IMMS-Ilmenau/AnoPCB<filename>AnomalyPlugin/train_model_dialog.py
"""Contains the TrainModelDialog used by the TrackGUI"""
import re
import time
import wx
import wx.aui
import pcbnew
import json
from AnomalyPlugin.training_results_dialog import ResultDialog
class TrainModelDialog(wx.Frame):
"""The dialog... | 2.265625 | 2 |
BinarySearchProbs/MedianofSortedMatrix.py | Saicharan67/Interview-Coding-Questions | 12 | 53299 | <reponame>Saicharan67/Interview-Coding-Questions<filename>BinarySearchProbs/MedianofSortedMatrix.py
class Solution:
# @param A : list of list of integers
# @return an integer
def cnt(self, A, mid):
l = 0
r = len(A)-1
while l <= r:
m = (l+r)//2
if A[m] <= mid:... | 3.5 | 4 |