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 |
|---|---|---|---|---|---|---|
bin/gpio-syslog-daemon.py | Ricapar/ta-splunk-perimeter-security | 0 | 12779651 | <gh_stars>0
#!/usr/bin/env python
import os
import sys
import time
import datetime
import logging
import RPi.GPIO as GPIO
from daemon import Daemon
from socket import gethostname
rpiPins = [
[ 4, 17, 21, 22, 18, 23, 24, 25 ],
[ 4, 17, 27, 22, 18, 23, 24, 25 ],
[ 4, 17, 27, 22, 5, 6, 13, 19, 26, 18, 23, 24, 25, 12,... | 2.71875 | 3 |
python/comparatist/utils/jl.py | tkf/comparatist | 0 | 12779652 | <filename>python/comparatist/utils/jl.py
import os
import numpy
import julia
jlbase = os.path.join(os.path.dirname(os.path.abspath(__file__)),
os.path.pardir, os.path.pardir, os.path.pardir,
'julia')
os.environ['JULIA_LOAD_PATH'] = jlbase + (
':' + os.environ['JULIA_LO... | 2.359375 | 2 |
model_trainer/basic_trainer.py | NeverendingNotification/nnlibs | 0 | 12779653 | <reponame>NeverendingNotification/nnlibs
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sun Sep 30 11:25:37 2018
@author: nn
"""
class BaseTrainer:
def __init__(self, trainer_setting):
self.setting = trainer_setting
def make_model(self, loader, is_train=True):
raise NotImplementedE... | 2.46875 | 2 |
pipeline_tools/tests/test_http_requests_manager.py | HumanCellAtlas/pipeline-tools | 5 | 12779654 | import os
from pipeline_tools.shared import http_requests
from pipeline_tools.tests.http_requests_manager import HttpRequestsManager
class TestHttpRequestsManager(object):
def test_enter_creates_directory(self):
with HttpRequestsManager() as temp_dir:
assert os.path.isdir(temp_dir) is True
... | 2.234375 | 2 |
algorithm/enigma_smarter_crack_turing.py | alphaPhantm/Privacy-and-security-SRP | 1 | 12779655 | <filename>algorithm/enigma_smarter_crack_turing.py
from collections import deque
from random import random
def str2num(zeichenkette):
return [ord(c) - 65 for c in zeichenkette]
walzen_r = ['EKMFLGDQVZNTOWYHXUSPAIBRCJ', # I
'AJDKSIRUXBLHWTMCQGZNPYFVOE', # II
'BDFHJLCPRTXVZNYEIWGAKMUSQO'... | 2.765625 | 3 |
tools/clang/scripts/generate_compdb.py | zipated/src | 2,151 | 12779656 | #!/usr/bin/env python
# Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Helper for generating compile DBs for clang tooling. On non-Windows platforms,
this is pretty straightforward. On Windows, the tool... | 2.0625 | 2 |
rev1/scripts/bom_csv_multi.py | bzzzm/commodity-hw | 0 | 12779657 | <filename>rev1/scripts/bom_csv_multi.py
"""
@package
A simple way to generate separate CSV BOM files for multiple suppliers in Kicad.
Heavily inspired from https://github.com/wokwi/kicad-jlcpcb-bom-plugin .
This can be made much more efficient than it is, but I didn't really bothered with the performa... | 2.140625 | 2 |
exercicios/ex030.py | thiago5171/python. | 1 | 12779658 | """
Faça um programa que mostre na tela uma contagem regressiva para o estouro de fogos de
artifício, indo de 10 até 0, com uma pausa de 1 segundo entre eles.
"""
#importar a bliblioteca para esperar
from time import sleep
print("contagem regressiva para os fogos!!!!")
for a in range(10,0,-1):
print(a)
sleep... | 3.359375 | 3 |
mc_launcher_core/web/install.py | tfff1OFFICIAL/mc_launcher_core | 2 | 12779659 | <gh_stars>1-10
"""
All the web requests related to installing a version of Minecraft
"""
import os.path
import logging
import platform
import shutil
import unpack200
from urllib.error import URLError, HTTPError
from mc_launcher_core.exceptions import HashMatchError
from mc_launcher_core.util import extract_file_to_dire... | 2.671875 | 3 |
src/main/models.py | HammudElHammud/DjangoProject | 0 | 12779660 | from __future__ import unicode_literals
from django import forms
from django.contrib.auth.models import User
from django.db import models
from ckeditor_uploader.fields import RichTextUploadingField
# Create your models here.
from django.utils.safestring import mark_safe
class Main(models.Model):
STATUS = (
... | 2.109375 | 2 |
Exercises/Conditions/Aumento_salarial.py | LuisAdolfoAlves/Learning-Python | 0 | 12779661 | ('-=-' * 20)
print('ANALISADOR DE TRIANGULOS')
('-=-' * 20)
p = float(input('Primeiro segmento: '))
s = float(input('Segundo segmento: '))
t = float(input('Terceiro segmento: '))
triangulo1 = p < s + t
triangulo1 = p > s - t or p > t - s
if triangulo1 == true:
print('Os segmentos acima PODEM formar um triângulo... | 4 | 4 |
TPC Gateway.py | dangerousbeak/tpc | 0 | 12779662 | <filename>TPC Gateway.py<gh_stars>0
#!/usr/bin/python
from game import Game, State
from racing import Racing
from quiet import QuietAttract
from songs import Songs
game = Game({
"quiet": QuietAttract,
"racing": Racing,
"songs": Songs,
})
try:
if game.buttons.back:
game.play("racing")
else:... | 2.421875 | 2 |
PatchMatch.py | WArushrush/An-Application-of-Image-Inpainting-and-Completion | 3 | 12779663 | import numpy as np
from PIL import Image
import time
import cv2
global img
global point1, point2
global min_x, min_y, width, height, max_x, max_y
def on_mouse(event, x, y, flags, param):
global img, point1, point2, min_x, min_y, width, height, max_x, max_y
img2 = img.copy()
if event == cv2.EVENT_LBUTTOND... | 2.734375 | 3 |
generativepy/tween.py | LloydTao/generativepy | 58 | 12779664 | # Author: <NAME>
# Created: 2019-01-25
# Copyright (C) 2018, <NAME>
# License: MIT
import math
class Tween():
'''
Tweening class for scalar values
Initial value is set on construction.
wait() maintains the current value for the requested number of frames
pad() similar to wait, but pads until ... | 3.953125 | 4 |
mod_ngarn/connection.py | hotkit/mod-ngarn | 3 | 12779665 | import json
import os
import asyncpg
async def get_connection():
PGDBNAME = os.getenv("PGDBNAME")
PGHOST = os.getenv("PGHOST")
PGPASSWORD = <PASSWORD>("PGPASSWORD")
PGUSER = os.getenv("PGUSER")
cnx = await asyncpg.connect(
user=PGUSER, password=<PASSWORD>, database=PGDBNAME, host=PGHOST
... | 2.546875 | 3 |
data_admin_examples/example1/urls.py | love1900905/frepple-data-admin | 7 | 12779666 | from django.conf.urls import url
from . import views
from . import serializers
# Automatically add these URLs when the application is installed
autodiscover = True
urlpatterns = [
# Grid views
url(
r"^data/example1/location/$",
views.LocationList.as_view(),
name="example1_location_cha... | 2.1875 | 2 |
src/utils/money_api.py | Bemesko/Dolar-Canadense-Bipolar | 3 | 12779667 | import requests
class MoneyAPI():
def __init__(self):
self.API_URL = "https://economia.awesomeapi.com.br/json/all/CAD"
self.SUCESS_STATUS_CODE = 200
def request_money(self):
resp = requests.get(self.API_URL)
if resp.status_code != self.SUCESS_STATUS_CODE:
raise Exc... | 3.265625 | 3 |
project/server/main/tasks.py | dataesr/harvest-theses | 0 | 12779668 | <filename>project/server/main/tasks.py
import time
import datetime
import os
import requests
from project.server.main.feed import harvest_and_insert
from project.server.main.logger import get_logger
logger = get_logger(__name__)
def create_task_harvest(arg):
collection_name = arg.get('collection_name')
if co... | 2.140625 | 2 |
tests/test_bitvector.py | devjsc/ledger-api-py | 0 | 12779669 | <gh_stars>0
import unittest
from fetchai.ledger.bitvector import BitVector
class BitVectorSerialisationTests(unittest.TestCase):
def test_empty(self):
bits = BitVector()
self.assertEqual(len(bits), 0)
self.assertEqual(bits.byte_length, 0)
def test_sets(self):
bits = BitVecto... | 2.53125 | 3 |
buddy/groupme_util.py | gc-13/studybuddy | 0 | 12779670 | <filename>buddy/groupme_util.py
from django.conf import settings
import requests, json
from .models import User, Course, StudyGroup, StudyRequest
# GROUPME_ACCESS_TOKEN = settings.GROUPME_ACCESS_TOKEN
def creategroupme(title):
groupme_name = "Study Group for - {}".format(title)
groupme_params = '{"name": "'+... | 2.28125 | 2 |
MySQL/insert_data_to_table.py | arjunjanamatti/pymongo_practise | 0 | 12779671 | <filename>MySQL/insert_data_to_table.py
import mysql.connector
from mysql.connector.errors import Error
databse_name = 'practise_db'
user_name = 'aj'
password = '<PASSWORD>'
host_address = 'localhost'
try:
### CONNECT TO THE DATABASE
mydb = mysql.connector.connect(
host = 'localhost',
user = us... | 3.296875 | 3 |
tests/test_data.py | deep-voice/soundbay | 7 | 12779672 | from hydra.experimental import compose, initialize
from random import randint
from random import seed
from soundbay.data import ClassifierDataset
import numpy as np
def test_dataloader() -> None:
seed(1)
with initialize(config_path="../soundbay/conf"):
# config is relative to a module
cfg = co... | 2.109375 | 2 |
delivery_bot.py | zaleksandrne/delivery_bot | 0 | 12779673 | # -*- coding: utf-8 -*-
import json, os, requests
from dotenv import load_dotenv
from telegram import Bot, InlineKeyboardButton, InlineKeyboardMarkup, Update
from telegram.ext import (CallbackContext, CallbackQueryHandler,
CommandHandler, Filters, MessageHandler, Updater)
load_dotenv()
TEL... | 2.296875 | 2 |
src/megapy/pin.py | aakash-sahai/megapy | 0 | 12779674 | <filename>src/megapy/pin.py
from arduino import ArduinoConnection, ArduinoObject
class DigitalPin(ArduinoObject):
def __init__(self, conn, pin, mode='input'):
ArduinoObject.__init__(self, conn, 'dp' + str(pin), 'pin digital')
self._pin = pin
self._mode = mode
super(DigitalPin, sel... | 3.28125 | 3 |
pysuru/tests/conftest.py | rcmachado/pysuru | 0 | 12779675 | # coding: utf-8
from pytest import fixture
@fixture
def tsuru_apps_list():
return """[
{
"name": "app1-dev",
"cname": ["app1-dev.cname.example.com"],
"ip": "app1-dev.example.com"
},
{
"name": "app1-prod",
"cname": [],
"ip": "app1-prod.example.com"
... | 2.015625 | 2 |
dev_Hand.py | lpeletan/Poker_Monte-Carlo | 0 | 12779676 | <filename>dev_Hand.py
import poker as p
d = p.Deck.standard_52_card_deck()
print(d)
for c in d:
print(repr(c), c)
h = p.Hand([d['2c']])
print(h._strength)
print(h.strength)
# h = p.Hand.best_from_cards(d.cards)
# print(h)
| 2.5625 | 3 |
pycmp/ast/relational.py | aeroshev/CMP | 0 | 12779677 | from .lhs_rhs_node import LhsRhsNode
from .node import Node
class GreaterRelationalNode(LhsRhsNode):
"""Greater relational object node"""
__slots__ = ("lhs", "rhs")
def __init__(self, lhs: Node, rhs: Node) -> None:
super().__init__(lhs, rhs)
class GreaterEqualRelationalNode(LhsRhsNode):
"""... | 3.109375 | 3 |
03 Programming Contest/shoffee.py | thinkofmia/Team-MIA-Shopee-Code-League-2021 | 0 | 12779678 | <gh_stars>0
#!/bin/python3
import math
import os
import random
import re
import sys
from itertools import combinations
#
# Complete the 'maxSubstring' function below.
#
# The function is expected to return a STRING.
# The function accepts STRING s as parameter.
#
def findShoffee(coffeeBeanAndExpectat... | 3.578125 | 4 |
leetcode/python/Q0054_Spiral_Matrix.py | lisuizhe/algorithm | 2 | 12779679 | class Solution(object):
def spiralOrder(self, matrix):
"""
:type matrix: List[List[int]]
:rtype: List[int]
"""
ans = []
if not matrix:
return ans
r1, r2 = 0, len(matrix) - 1
c1, c2 = 0, len(matrix[0]) - 1
while c1 <= c2 and r1 <= r2... | 3.25 | 3 |
scripts/batch-reverse-complement.py | cherrytrees-kpu/kpu-agc-project-scripts | 0 | 12779680 | <gh_stars>0
from Bio import Seq, SeqIO
import argparse
import pathlib
def parse_args():
parser = argparse.ArgumentParser(description="Script to quickly generate reverse complement fastas")
parser.add_argument(
'seq_path',
type=pathlib.Path,
action='store',
help='Path to sequenc... | 2.921875 | 3 |
packages/attitude.pkg/providers.py | GrahamCobb/maemo-mud-builder | 0 | 12779681 | <filename>packages/attitude.pkg/providers.py
#
# Provider information sources for `Attitude' - a false horizon display using
# accelerometer information. (c) <NAME> 2009
# Released under the Artistic Licence
import os.path
from math import sin, cos, pi
class Du... | 3.21875 | 3 |
_lib/wordpress_office_processor.py | himedlooff/cfgov-refresh | 0 | 12779682 | import sys
import json
import os.path
import requests
def posts_at_url(url):
current_page = 1
max_page = sys.maxint
while current_page <= max_page:
url = os.path.expandvars(url)
resp = requests.get(url, params={'page':current_page, 'count': '-1'})
results = json.loads(resp.co... | 2.671875 | 3 |
zombie.py | mohaninit/bigga | 0 | 12779683 | import os
CMD = 'docker ps'
os.system(CMD)
ls = os.popen(CMD).read().split('\n')[1:-1]
zombies = []
for line in ls:
container, image = line.split()[:2]
if 'bigga' not in image and ':' not in image:
print(container, image)
zombies.append(container)
print("Zombies: ", " ".join(zombies))
# docke... | 3 | 3 |
mastermind_api/game/tests/test_models.py | manuelmamut/mastermind | 0 | 12779684 | from django.test import TestCase
from ..models import Game
class TestGame(TestCase):
"""This is the test for the Game model"""
def setUp(self):
Game.objects.create(codemaker="User 1",
codebreaker="User 2",
peg_1="R",
... | 2.859375 | 3 |
plant_vs_zoomie_game_normal03.py | ChengzhuLi/plantwarzombie | 4 | 12779685 | <gh_stars>1-10
import pygame
import os
from Peashooter import Peashooter
from SunFlower import SunFlower
from WallNut import WallNut
from Sun import Sun
from Zombie import Zombie
pygame.init()
backgd_size = (1200, 600)
screen = pygame.display.set_mode(backgd_size)
pygame.display.set_caption('plant_vs_zoomie')
bg_img... | 2.640625 | 3 |
multinet/api/apps.py | multinet-app/multinet-api | 0 | 12779686 | from django.apps import AppConfig
class ApiConfig(AppConfig):
name = 'multinet.api'
verbose_name = 'Multinet: Api'
| 1.1875 | 1 |
togglcmder/toggl/caching.py | yatesjr/toggl-cmder | 3 | 12779687 | import sqlite3
from sqlite3 import IntegrityError
import logging
from typing import List
from datetime import datetime
from togglcmder.toggl.types.workspace import Workspace
from togglcmder.toggl.builders.workspace_builder import WorkspaceBuilder
from togglcmder.toggl.types.time_entry import TimeEntry
from togglcmder... | 2.25 | 2 |
baudelaire/log.py | juliendoutre/baudelaire | 0 | 12779688 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import logging
def init_logger() -> None:
logging.basicConfig(
level=logging.INFO,
format="%(asctime)s - %(name)s - %(levelname)s - %(message)s",
)
| 2.125 | 2 |
data_exploration/england_wales_risk_plots.py | riskyviz/webapp | 0 | 12779689 | <filename>data_exploration/england_wales_risk_plots.py
import csv
from visigoth.utils.geojson import GeojsonReader
from visigoth import Diagram
from visigoth.map_layers import KDE, Hexbin, Geoimport, Cartogram
from visigoth.utils.colour import ContinuousPalette
from visigoth.containers import Map, Sequence
from visigo... | 2.484375 | 2 |
tests/test_distancefunctions.py | jplalor/flowpm | 0 | 12779690 | <gh_stars>0
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Dec 2 18:24:41 2020
@author: Denise
"""
import numpy as np
from flowpm.tfbackground import dchioverda, rad_comoving_distance,a_of_chi as a_of_chi_tf, transverse_comoving_distance as trans_comoving_distance,angular_diameter_distance as ang_... | 2.15625 | 2 |
listaMetodit.py | anolsa/listenandrepeat-praat | 0 | 12779691 | <gh_stars>0
def f1Lista(formanttiLista):
lista = [int(i.split(",")[0]) for i in formanttiLista]
return lista
def f2Lista(formanttiLista):
lista = [int(i.split(",")[1]) for i in formanttiLista]
return lista
def laskeSuhteet(formanttiLista, f1min, f2min, f1range, f2range):
lista2 = f1Lis... | 2.890625 | 3 |
fixGanExperment/model.py | okingjerryo/modelExperiment | 0 | 12779692 | <reponame>okingjerryo/modelExperiment<filename>fixGanExperment/model.py
'''
sunkejia
GAN network
'''
import tensorflow as tf
import tensorflow.contrib.slim as slim
def inst_norm(inputs, epsilon=1e-3, suffix=''):
"""
Assuming TxHxWxC dimensions on the tensor, will normalize over
the H,W dimensions. Use thi... | 2.484375 | 2 |
src/components/kankeiforms/coloring_types.py | BigJerBD/Kankei-Backend | 0 | 12779693 | from components.kankeiforms.shown_properties import DEFAULT_SHOWN_PROPERTIES
DEFAULT_COLORING_TYPES = [name for name, scope in DEFAULT_SHOWN_PROPERTIES["nodes"]]
| 1.289063 | 1 |
tests/graphics/RETAINED_INDEXED.py | qbektrix/pyglet | 1 | 12779694 | <reponame>qbektrix/pyglet<gh_stars>1-10
#!/usr/bin/env python
"""Tests vertex list drawing using indexed data.
"""
import unittest
import pyglet
from graphics_common import GraphicsIndexedGenericTestCase, get_feedback, GL_TRIANGLES
__noninteractive = True
class GraphicsIndexedVertexListTestCase(GraphicsIndexedGene... | 2.25 | 2 |
sky/migrations/0007_auto_20180224_1120.py | eethan1/IMnight2018_Backend | 0 | 12779695 | <filename>sky/migrations/0007_auto_20180224_1120.py
# Generated by Django 2.0 on 2018-02-24 11:20
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('sky', '0006_auto_20180224_1118'),
]
operations = [
migrations.AlterField(
mode... | 1.5 | 2 |
DR_Warnings/server/web_server/warning_web_server/static/program/client.py | TseSteven/SureSide | 0 | 12779696 | <reponame>TseSteven/SureSide
# Example of embedding CEF Python browser using wxPython library.
# This example has a top menu and a browser widget without navigation bar.
# Tested configurations:
# - wxPython 4.0 on Windows/Mac/Linux
# - wxPython 3.0 on Windows/Mac
# - wxPython 2.8 on Linux
# - CEF Python v66.... | 2.25 | 2 |
src/shotgun_io.py | shotgunsoftware/shotgun_io | 2 | 12779697 | #!/usr/bin/env python
# ---------------------------------------------------------------------------------------------
# Copyright (c) 2009-2016, Shotgun Software Inc
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# ... | 1.210938 | 1 |
src/feature/commands/Export.py | junhg0211/Condictbot | 0 | 12779698 | <filename>src/feature/commands/Export.py
from os import mkdir
from os.path import exists
from discord import Message, File
from feature.commands.Command import Command
from util.constants import COMMAND_IDENTIFIER, WORK_END_EMOJI
from util.util import is_dm_channel, get_language, pickle_to_json
class Export(Command... | 2.265625 | 2 |
verboselib/__init__.py | oblalex/verboselib | 3 | 12779699 | <gh_stars>1-10
from .core import *
from .helpers import *
from .translations import *
| 1.054688 | 1 |
main.py | TotoAfreeca/Neural-Network | 1 | 12779700 | <gh_stars>1-10
import sys
from PyQt5.QtWidgets import QDialog, QTabWidget, QHBoxLayout, QSpinBox, QLabel, QDoubleSpinBox, QTextEdit, QRadioButton, \
QFileDialog, QErrorMessage, \
QApplication, QPushButton, QVBoxLayout, QLineEdit, QFormLayout, QWidget, QPlainTextEdit
from matplotlib.backends.backend_qt5agg impor... | 1.984375 | 2 |
modules/photons_transport/comms/base.py | Djelibeybi/photons | 51 | 12779701 | <reponame>Djelibeybi/photons
from photons_transport.errors import FailedToFindDevice, StopPacketStream
from photons_transport.comms.receiver import Receiver
from photons_transport.comms.writer import Writer
from photons_app.errors import TimedOut, FoundNoDevices, RunErrors, BadRunWithResults
from photons_app import he... | 2.140625 | 2 |
homeassistant/components/solax/const.py | PiotrMachowski/core | 3 | 12779702 | """Constants for the solax integration."""
DOMAIN = "solax"
| 1.007813 | 1 |
scripts/WIPS2015/incidentCases_RtEstimation_dataExport.py | eclee25/flu-SDI-exploratory-age | 3 | 12779703 | <reponame>eclee25/flu-SDI-exploratory-age
#!/usr/bin/python
##############################################
###Python template
###Author: <NAME>
###Date: 2/3/15
###Function: Export incident ILI cases by week for total population in all service places
###Import data: SQL_export/OR_allweeks.csv, SQL_export/totalpop.csv
... | 2.28125 | 2 |
utility_scripts/configureCMK.py | jjk-dev/aws-qnabot | 197 | 12779704 | <reponame>jjk-dev/aws-qnabot
import boto3
from botocore.config import Config
import argparse
import json
import base64
import sys
parser = argparse.ArgumentParser(description='Uses a specified CMK to encrypt QnABot Lambdas and Parameter Store settings')
parser.add_argument("region", help="AWS Region")
parser.add_argu... | 2.15625 | 2 |
boto3_exceptions/discovery.py | siteshen/boto3_exceptions | 2 | 12779705 | import boto3
exceptions = boto3.client('discovery').exceptions
AuthorizationErrorException = exceptions.AuthorizationErrorException
ConflictErrorException = exceptions.ConflictErrorException
InvalidParameterException = exceptions.InvalidParameterException
InvalidParameterValueException = exceptions.InvalidParameterVa... | 1.851563 | 2 |
rewx/core.py | akrk1986/re-wx | 0 | 12779706 | <reponame>akrk1986/re-wx
"""
https://medium.com/@sweetpalma/gooact-react-in-160-lines-of-javascript-44e0742ad60f
"""
import functools
import wx
from inspect import isclass
from rewx.dispatch import mount, update
from rewx.widgets import mount as _mount
from rewx.widgets import update as _update
mount.merge_registries... | 2.09375 | 2 |
apps/projetos/apps/sentinela/migrations/0006_auto_20210220_1547.py | mequetrefe-do-subtroco/web_constel | 1 | 12779707 | <reponame>mequetrefe-do-subtroco/web_constel<filename>apps/projetos/apps/sentinela/migrations/0006_auto_20210220_1547.py
# Generated by Django 3.0.7 on 2021-02-20 15:47
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('sentinela', '0005_sentinelacontratos... | 1.257813 | 1 |
vmware_nsx/plugins/nsx_p/availability_zones.py | yebinama/vmware-nsx | 0 | 12779708 | <filename>vmware_nsx/plugins/nsx_p/availability_zones.py
# Copyright 2017 VMware, 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.ap... | 1.859375 | 2 |
inbox/constants.py | future-haus/django-inbox | 0 | 12779709 | <reponame>future-haus/django-inbox
from functools import lru_cache
from django_enumfield import enum
class MessageMedium(enum.Enum):
APP_PUSH = 1
EMAIL = 2
SMS = 3
WEB_PUSH = 4
__labels__ = {
APP_PUSH: 'App Push',
EMAIL: 'Email',
SMS: 'SMS',
WEB_PUSH: 'Web Push'
... | 2.015625 | 2 |
scripts/pre-commit.py | rcy1314/RSSerpent | 0 | 12779710 | #!/usr/bin/env python
import os
import subprocess
import sys
from pathlib import Path
basedir = Path(__file__).parent.parent
os.chdir(basedir)
deps = {
"flake8": [
"darglint",
"flake8-bugbear",
"flake8-builtins",
"flake8-comprehensions",
"flake8-datetimez",
"flake... | 1.945313 | 2 |
ufss/HLG/base_class.py | peterarose/UFSS | 8 | 12779711 | import yaml
import os
import numpy as np
class DataOrganizer:
def __init__(self,parameter_file_path):
self.base_path = parameter_file_path
self.load_params()
def load_params(self):
params_file = os.path.join(self.base_path,'params.yaml')
with open(params_file) as yamlstream:
... | 2.859375 | 3 |
flask_pancake/views.py | arthurio/flask-pancake | 4 | 12779712 | from flask import Blueprint, abort, current_app, render_template, request
from flask.json import jsonify
from jinja2 import TemplateNotFound
from .constants import EXTENSION_NAME
from .extension import FlaskPancake
bp = Blueprint("pancake", __name__, template_folder="templates")
def aggregate_data(ext: FlaskPancake... | 2.21875 | 2 |
models/__init__.py | Jay2020-01/TextureGAN--Flask | 5 | 12779713 | import torch
import torch.nn as nn
from torch.autograd import Variable
import numpy as np
import os
import os.path as osp
def save_network(model, network_label, epoch, iteration, args):
dataset = args.data_path.split(os.sep)[-1]
save_filename = "{0}_net_{1}_{2}_{3}.pth".format(network_label, args.model, epoch... | 2.4375 | 2 |
climate/denv-2w.py | williamcaicedo/morbidityPrediction | 0 | 12779714 | <filename>climate/denv-2w.py
import numpy as np
from sklearn.preprocessing import StandardScaler
from sklearn.kernel_ridge import KernelRidge
from sklearn.model_selection import GridSearchCV
from sklearn.model_selection import KFold
import sklearn.metrics as metrics
import matplotlib.pyplot as plt
def show_prediction_... | 2.859375 | 3 |
src/clustering_hyperparameters/dataset/suite.py | mishra-sid/clustering_hyperparameters | 2 | 12779715 | from .loaders.loader import DatasetLoader
from omegaconf import OmegaConf
class DatasetSuite:
def __init__(self, name, cache_dir, datasets):
self.name = name
self.cache_dir = cache_dir
self.datasets = datasets
def fetch_and_cache_dataset(self, dataset_index):
loader_type = sel... | 2.28125 | 2 |
fiber/__init__.py | leukeleu/django-fiber-multilingual | 0 | 12779716 | <gh_stars>0
__version__ = '1.2-multilingual'
| 1.039063 | 1 |
hand.py | shin-sforzando/PAC2020-RPS | 0 | 12779717 | from enum import Enum
class Hand(Enum):
G = "グー"
C = "チョキ"
P = "パー"
| 2.671875 | 3 |
app/grandchallenge/cases/image_builders/__init__.py | Tommos0/grand-challenge.org | 0 | 12779718 | from collections import namedtuple
ImageBuilderResult = namedtuple(
"ImageBuilderResult",
("consumed_files", "file_errors_map", "new_images", "new_image_files"),
)
| 1.710938 | 2 |
setup.py | Christoph-Raab/log-parser | 0 | 12779719 | <reponame>Christoph-Raab/log-parser<filename>setup.py
from setuptools import setup
setup(
name='ams-recruiting-4',
version='0.1.0',
packages=['app', 'app.tests'],
author='<NAME>',
description='Log Parser to parse a log and find top 10 hosts and http status code stats for first 7 days of july'
)
| 1.273438 | 1 |
src/create_train_valid_dataset.py | HuyVu0508/psychgenerator | 0 | 12779720 | <reponame>HuyVu0508/psychgenerator
import pandas as pd
from tqdm import tqdm
import numpy as np
import argparse
import random
# main function
def main():
### input arguments
print("Reading arguments.")
parser = argparse.ArgumentParser()
# important arguments
parser.add_argument("--messages_cs... | 2.90625 | 3 |
delete_organism.py | diogo1790team/inphinity_DM | 1 | 12779721 | <gh_stars>1-10
# -*- coding: utf-8 -*-
"""
Created on Tue Apr 24 08:57:47 2018
@author: Diogo
"""
# NOTE: this script does not take in consideration the data for the datasets
from objects_new.Couples_new import *
from objects_new.Proteins_new import *
from objects_new.Gene_new import *
from objects_new.Protein_dom_... | 2.578125 | 3 |
runme.py | ipendlet/SD2_DRP_ML | 6 | 12779722 | """ESCALATE Capture
Main point of entry for for EscalateCAPTURE
"""
import os
import sys
import ast
import xlrd
import logging
import argparse as ap
from log import init
from capture import specify
from capture import devconfig
from utils import globals, data_handling
def escalatecapture(rxndict, vardict):
"""... | 2.75 | 3 |
ditto/tickets/api/views.py | Kvoti/ditto | 0 | 12779723 | <reponame>Kvoti/ditto<gh_stars>0
from django.shortcuts import get_object_or_404
from rest_framework import generics, response
from rest_framework.decorators import api_view
from .. import models
from . import serializers
class TicketList(generics.ListAPIView):
serializer_class = serializers.ViewTicketSerializer
... | 2.015625 | 2 |
cse_helpers.py | Steve-Hawk/nrpytutorial | 0 | 12779724 | """ CSE Partial Factorization and Post-Processing
The following script will perform partial factorization on SymPy expressions,
which should occur before common subexpression elimination (CSE) to prevent the
identification of undesirable patterns, and perform post-processing on the
the resulting replaced/reduced expre... | 2.984375 | 3 |
baiduocr.py | wangtonghe/hq-answer-assist | 119 | 12779725 | # coding=utf-8
from aip import AipOcr
import re
opt_aux_word = ['《', '》']
def get_file_content(file):
with open(file, 'rb') as fp:
return fp.read()
def image_to_str(name, client):
image = get_file_content(name)
text_result = client.basicGeneral(image)
print(text_result)
result = get_que... | 2.734375 | 3 |
Document Summarization/engine.py | ShivamRajSharma/PyTorch | 5 | 12779726 | <reponame>ShivamRajSharma/PyTorch<filename>Document Summarization/engine.py
import torch
import torch.nn as nn
from tqdm import tqdm
def loss_fn(predicted, target, pad_idx):
return nn.CrossEntropyLoss(ignore_index=pad_idx)(predicted, target)
def train_fn(model, dataloader, optimizer, scheduler, device, pad_idx):... | 2.296875 | 2 |
basicsr/demo.py | ACALJJ32/BasicSR_ACALJJ32 | 2 | 12779727 | import torch, os
from os import path as osp
from math import ceil
import sys
from yaml import load
from basicsr.data import build_dataloader, build_dataset
from basicsr.utils.options import parse_options
import torch.nn as nn
import torch.nn.functional as F
import torch
from torch.autograd import Variable
import cv2
fr... | 2.078125 | 2 |
python/aether/src/tests/scratch_tests.py | MoysheBenRabi/setp | 1 | 12779728 | <gh_stars>1-10
t = bytearray([65]*3)
print(t[0:2]) | 1.632813 | 2 |
commerce/__init__.py | PragmaticMates/django-commerce | 4 | 12779729 | <gh_stars>1-10
default_app_config = 'commerce.apps.Config'
| 1.1875 | 1 |
tasks/EPAM/pytasks/task04-03.py | AleksNeStu/projects | 2 | 12779730 | <reponame>AleksNeStu/projects<gh_stars>1-10
#!/usr/bin/python
# -*- coding: utf-8 -*-
__author__ = 'AleksNeStu'
# Task04-03 (not mandatory):
# Create **very** simple [ORM] using data descriptors like in `Subtask 1` and [SQLite]3 python module to store fields in Data Base.
# After creating instances of model all field... | 3.84375 | 4 |
baduk/command/remove_dead_stones.py | sarcoma/Baduk | 3 | 12779731 | <filename>baduk/command/remove_dead_stones.py
from baduk.command.command_types import UndoableCommand
class RemoveDeadStones(UndoableCommand):
def __init__(self, groups: set, dead_stone_groups: list):
self.groups = groups
self.group = None
self.dead_stone_groups = dead_stone_groups
d... | 2.640625 | 3 |
bindings/pydeck-carto/tests/test_credentials.py | ehtick/deck.gl | 0 | 12779732 | from pydeck_carto import load_carto_credentials
def test_load_carto_credentials(requests_mock):
requests_mock.post(
"https://auth.carto.com/oauth/token", text='{"access_token":"asdf1234"}'
)
creds = load_carto_credentials("tests/fixtures/mock_credentials.json")
assert creds == {
"apiVe... | 2.421875 | 2 |
fewshot/data/samplers/fewshot_sampler.py | sebamenabar/oc-fewshot-public | 18 | 12779733 | """Regular few-shot episode sampler.
Author: <NAME> (<EMAIL>)
"""
from __future__ import (absolute_import, division, print_function,
unicode_literals)
from fewshot.data.registry import RegisterSampler
from fewshot.data.samplers.incremental_sampler import IncrementalSampler
@RegisterSampler(... | 2.171875 | 2 |
sirepo/pkcli/rcscon.py | mkeilman/sirepo | 49 | 12779734 | # -*- coding: utf-8 -*-
"""Wrapper to run RCSCON from the command line.
:copyright: Copyright (c) 2019 RadiaSoft LLC. All Rights Reserved.
:license: http://www.apache.org/licenses/LICENSE-2.0.html
"""
from __future__ import absolute_import, division, print_function
from pykern.pkcollections import PKDict
from pykern.... | 1.867188 | 2 |
src/gat.py | simoneazeglio/DeepInf | 258 | 12779735 | <reponame>simoneazeglio/DeepInf
#!/usr/bin/env python
# encoding: utf-8
# File Name: gat.py
# Author: <NAME>
# Create Time: 2017/12/18 21:40
# TODO:
from __future__ import absolute_import
from __future__ import unicode_literals
from __future__ import division
from __future__ import print_function
import torch
import ... | 2.0625 | 2 |
homeassistant/components/philips_js/__init__.py | elyobelyob/core | 0 | 12779736 | <gh_stars>0
"""The Philips TV integration."""
import asyncio
from datetime import timedelta
import logging
from typing import Any, Callable, Dict, Optional
from haphilipsjs import ConnectionFailure, PhilipsTV
from homeassistant.components.automation import AutomationActionType
from homeassistant.config_entries import... | 2.078125 | 2 |
src/pyorc/predicates.py | anilreddypuresoftware/pyorc | 0 | 12779737 | <reponame>anilreddypuresoftware/pyorc
import enum
from typing import Any, Optional
from .enums import TypeKind
class Operator(enum.IntEnum):
NOT = 0
OR = 1
AND = 2
EQ = 3
LT = 4
LE = 5
class Predicate:
def __init__(self, operator: Operator, left, right) -> None:
self.values = (o... | 2.859375 | 3 |
scripts/robot_position.py | DharminB/moving_obstacle_gazebo | 0 | 12779738 | <reponame>DharminB/moving_obstacle_gazebo<filename>scripts/robot_position.py
#! /usr/bin/env python
import rospy
from geometry_msgs.msg import PoseStamped
from gazebo_msgs.msg import ModelStates
class RobotPosition(object):
"""get the position of robot from /gazebo/model_states and re publish it with /robot_posi... | 2.46875 | 2 |
main.py | realtechsupport/c-plus-r | 2 | 12779739 | <reponame>realtechsupport/c-plus-r
#!/usr/bin/env python3
# main.py
# Catch & Release
# Flask interface for linux computers
# experiments in knowledge documentation; with an application to AI for ethnobotany
# spring 2020
# tested on ubuntu 18 LTS, kernel 5.3.0; Mac OS Catalina
#----------------------------------------... | 1.835938 | 2 |
netbox/dcim/migrations/0093_auto_20200205_0157.py | sharknasuhorse/netbox | 0 | 12779740 | # Generated by Django 2.2.10 on 2020-02-05 01:57
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('dcim', '0092_fix_rack_outer_unit'),
]
operations = [
migrations.AddField(
model_name='device',
name='cpus',
... | 1.703125 | 2 |
tensorflow/lite/micro/examples/magic_wand_flourish/train/LRF/lr_finder.py | nancibles/tensorflow | 0 | 12779741 | <gh_stars>0
from tensorflow.keras.callbacks import Callback
import tensorflow.keras.backend as K
import numpy as np
import matplotlib.pyplot as plt
class LRFinder(Callback):
"""
Up-to date version: https://github.com/WittmannF/LRFinder
Example of usage:
from keras.models import Sequential
... | 2.765625 | 3 |
cpmpy/solvers/gurobi.py | vishalbelsare/cpmpy | 0 | 12779742 | <gh_stars>0
#!/usr/bin/env python
"""
Interface to the python 'gurobi' package
Requires that the 'gurobipy' python package is installed:
$ pip install gurobipy
as well as the Gurobi bundled binary packages, downloadable from:
https://www.gurobi.com/
In contrast to other solvers i... | 1.84375 | 2 |
3.py | inwk6312fall2018/model-open-book-quiz-rohit391 | 0 | 12779743 | <gh_stars>0
def deal_cards(self, number: int):
for _ in range(0, number):
for player in self.players:
card = self.deck.draw()
player.hand.append(card)
print("Dealt {} to player {}".format(card, player))
deal_cards()
| 2.96875 | 3 |
tests/test_sdpb.py | alepiazza/pycftboot | 0 | 12779744 | <gh_stars>0
import unittest
import shutil
import os
import subprocess
import filecmp
from symengine.lib.symengine_wrapper import RealMPFR
from pycftboot import SdpbDocker, SdpbBinary, SdpbSingularity
from pycftboot.constants import prec
DIR = 'test_output'
def have_binary(bin_name):
bin_in_path = shutil.which(... | 2.328125 | 2 |
src/Services/errorHandlers.py | CarolineYao/SentimentAnalysisProject | 2 | 12779745 | <filename>src/Services/errorHandlers.py
from flask import json, request, jsonify, make_response
import werkzeug
exception_to_error_code = {
"BadRequest": 400
}
def _get_exception_error_code(e):
exception_type = type(e).__name__
return exception_to_error_code[exception_type]
def _compute_error_json(e):
... | 2.75 | 3 |
tracker/forms.py | amin-da71/Benbb96 | 0 | 12779746 | from django import forms
from django.core.exceptions import ValidationError
from django_select2.forms import Select2MultipleWidget
from tracker.models import Track, Tracker
class TrackerForm(forms.ModelForm):
class Meta:
model = Tracker
fields = ('nom', 'icone', 'color')
widgets = {
... | 2.375 | 2 |
app.py | annewieggers/sqlalchemy-challenge | 0 | 12779747 | import datetime as dt
from datetime import datetime
import numpy as np
import pandas as pd
import sqlalchemy
from sqlalchemy.ext.automap import automap_base
from sqlalchemy.orm import Session
from sqlalchemy import create_engine, func
from sqlalchemy import inspect
from dateutil.relativedelta import relativedelta
fro... | 3.03125 | 3 |
lib/improver/tests/argparser/test_ArgParser.py | TomekTrzeciak/improver | 0 | 12779748 | <filename>lib/improver/tests/argparser/test_ArgParser.py
# -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
# (C) British Crown Copyright 2017-2019 Met Office.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modificatio... | 1.710938 | 2 |
RL_based_ATSC/single-intersection/SALT/rl/agents/__init__.py | sue04206/traffic-signal-optimization | 6 | 12779749 | from __future__ import absolute_import
from .dqn import Learner, get_state_1d, get_state_2d
| 1.109375 | 1 |
hub_app/views/auth.py | passiopeia/passiopeia-hub | 0 | 12779750 | <filename>hub_app/views/auth.py
"""
Views for authentication
"""
from django.conf import settings
from django.contrib import messages
from django.contrib.auth import logout, authenticate, login
from django.http import HttpRequest, HttpResponse
from django.shortcuts import redirect, render
from django.utils.translation ... | 2.375 | 2 |