max_stars_repo_path stringlengths 3 269 | max_stars_repo_name stringlengths 4 119 | max_stars_count int64 0 191k | id stringlengths 1 7 | content stringlengths 6 1.05M | score float64 0.23 5.13 | int_score int64 0 5 |
|---|---|---|---|---|---|---|
src/shapiro/language.py | roskakori/shapiro | 2 | 24600 | <gh_stars>1-10
"""
Language specific settings
"""
from typing import Dict, Set
from shapiro.common import Rating, ranged_rating
from shapiro.tools import log, signum
from spacy.tokens import Token
_log = log
class LanguageSentiment:
def __init__(self, language_code: str):
assert language_code is not Non... | 2.59375 | 3 |
sources/zmp_feedforwad_control.py | ekorudiawan/ZMP_Preview_Control_WPG | 8 | 24601 | <reponame>ekorudiawan/ZMP_Preview_Control_WPG
# ZMP preview control simulation with Python
# By : <NAME>
# Email : <EMAIL>
# This is an implementation of ZMP preview control with feedforward method
# This Python program will calculating CoM trajectory based on ZMP trajectory input
# The Gain parameter Gi, Gx, and Gd is... | 2.859375 | 3 |
algorithms/sorting/counting_sort.py | abhishektyagi2912/python-dsa | 1 | 24602 | def counting_sort(arr):
# Find min and max values
min_value = min(arr)
max_value = max(arr)
counting_arr = [0]*(max_value-min_value+1)
for num in arr:
counting_arr[num-min_value] += 1
index = 0
for i, count in enumerate(counting_arr):
for _ in range(count):
... | 3.734375 | 4 |
Python/8 kyu/Grasshopper - Terminal Game Move Function/solution.py | Hsins/CodeWars | 1 | 24603 | <reponame>Hsins/CodeWars
# [8 kyu] Grasshopper - Terminal Game Move Function
#
# Author: Hsins
# Date: 2019/12/20
def move(position, roll):
return position + 2 * roll
| 2.203125 | 2 |
server/app/__init__.py | trungkienbkhn/nmt-wizard | 0 | 24604 | <filename>server/app/__init__.py
import os
import logging.config
import redis
from flask import Flask
from nmtwizard import common
from nmtwizard import configuration as config
from utils.database_utils import DatabaseUtils
from flask_session import Session
VERSION = "1.12.0"
app = Flask(__name__)
app.request_id = 1
... | 2.109375 | 2 |
Neural_Networks/Multilayer/Neural_Multi_pybrain.py | jeffreire/Deep_Learning | 0 | 24605 | <reponame>jeffreire/Deep_Learning
# from pybrain.datasets import SupervisedDataSet
# from pybrain.supervised.trainers import BackpropTrainer
# from pybrain.structure.modules import SoftmaxLayer
# from pybrain.structure.modules import SigmoidLayer
# from pybrain.tools.s import buildNetwork
# (x,y,z) = x é a quant... | 3.1875 | 3 |
aries_cloudagent/protocols/present_proof/dif/tests/test_pres_request.py | kuraakhilesh8230/aries-cloudagent-python | 4 | 24606 | <filename>aries_cloudagent/protocols/present_proof/dif/tests/test_pres_request.py
from unittest import TestCase
from ..pres_request_schema import DIFProofRequestSchema
class TestPresRequestSchema(TestCase):
"""DIF Presentation Request Test"""
def test_limit_disclosure(self):
test_pd_a = {
... | 2.375 | 2 |
datadog/api/screenboards.py | gust/datadogpy | 0 | 24607 | <gh_stars>0
from datadog.api.resources import GetableAPIResource, CreateableAPIResource, \
UpdatableAPIResource, DeletableAPIResource, ActionAPIResource, ListableAPIResource
class Screenboard(GetableAPIResource, CreateableAPIResource,
UpdatableAPIResource, DeletableAPIResource,
... | 2.53125 | 3 |
models/TCNet.py | sjenni/LCI | 13 | 24608 | from .alexnet import alexnet_V2
import tensorflow.compat.v1 as tf
import tensorflow.contrib.slim as slim
from utils import montage_tf
from .lci_nets import patch_inpainter, patch_discriminator
import tensorflow.contrib as contrib
# Average pooling params for imagenet linear classifier experiments
AVG_POOL_PARAMS = {'... | 2.125 | 2 |
dbs/dal/Whiteport.py | xinghejd/opencanary_web | 633 | 24609 | #!/usr/bin/env python
# -*- coding:utf-8 -*-
"""
Author: pirogue
Purpose: 白名单端口表操作
Site: http://pirogue.org
Created: 2018-08-03 17:32:54
"""
from dbs.initdb import DBSession
from dbs.models.Whiteport import Whiteport
from sqlalchemy import desc,asc
from sqlalchemy.exc import InvalidRequestError
# import s... | 2.453125 | 2 |
anyconfig/singleton.py | edyan/python-anyconfig | 0 | 24610 | #
# Copyright (C) 2018 <NAME> <<EMAIL>>
# License: MIT
#
r"""Singleton class
.. versionadded:: 0.9.8
- Add to make a kind of manager instancne later to manage plugins.
"""
from __future__ import absolute_import
import threading
class Singleton(object):
"""Singleton utilizes __new__ special method.
.. no... | 2.5 | 2 |
geophires_simulation/main.py | tuw-eeg/GEOPHIRES-simulation | 0 | 24611 | <reponame>tuw-eeg/GEOPHIRES-simulation<gh_stars>0
# -*- coding: utf-8 -*-
"""
Created on Tue Sep 9 10:37:24 2020
@author: fallahnejad
Important Note: all the costs provided in EUR should be multiplied by EUR2USD factor before providing to the GEOPHIRES
"""
import os
import re
import shutil
import pandas as pd
from ... | 2.421875 | 2 |
mydb/test_postgres.py | dappsunilabs/DB4SCI | 7 | 24612 | <filename>mydb/test_postgres.py
#!/usr/bin/python
import time
import psycopg2
import argparse
import postgres_util
import container_util
import admin_db
import volumes
from send_mail import send_mail
from config import Config
def full_test(params):
admin_db.init_db()
con_name = params['dbname']
dbtype = ... | 2.265625 | 2 |
perfectextractor/tests/test_extractor.py | UUDigitalHumanitieslab/time-in-translation | 3 | 24613 | <filename>perfectextractor/tests/test_extractor.py
# -*- coding: utf-8 -*-
import unittest
from lxml import etree
from perfectextractor.apps.extractor.models import Perfect
from perfectextractor.corpora.opus.perfect import OPUSPerfectExtractor
class TestPerfectExtractor(unittest.TestCase):
def test_is_lexicall... | 2.546875 | 3 |
python/tvm/tensor_graph/core/auto_schedule/utils.py | QinHan-Erin/AMOS | 22 | 24614 | import tvm
from functools import reduce
from ..utils import to_int, to_int_or_None
def get_need_tile(need_tile):
return [True if x.value == 1 else False for x in need_tile]
def get_factors(split_factor_entities):
return [[x.value for x in factors.factors] for factors in split_factor_entities]
def tile_axis(st... | 2.34375 | 2 |
SCALA_library/Lower_level_tools/pyCorner260.py | snfactory/scala | 0 | 24615 | ###########################################################
# LOWER LEVEL LIBRARY THAT TALKS TO THE MONOCHROMATON #
###########################################################
import subprocess
import time
# -- See pyserial
import serial
class CornerStone260:
"""This class controlls the Cornerstone 26... | 3.234375 | 3 |
resources/mgltools_x86_64Linux2_1.5.6/MGLToolsPckgs/AutoDockTools/autoflex4Commands.py | J-E-J-S/aaRS-Pipeline | 8 | 24616 | <filename>resources/mgltools_x86_64Linux2_1.5.6/MGLToolsPckgs/AutoDockTools/autoflex4Commands.py
#############################################################################
#
# Author: <NAME>, <NAME>
#
# Copyright: <NAME> TSRI 2008
#
#############################################################################
# $He... | 1.773438 | 2 |
cohesity_management_sdk/models/net_app_volume_information.py | sachinthakare-cohesity/management-sdk-python | 0 | 24617 | # -*- coding: utf-8 -*-
# Copyright 2019 Cohesity Inc.
import cohesity_management_sdk.models.cifs_share_information
import cohesity_management_sdk.models.volume_security_information
class NetAppVolumeInformation(object):
"""Implementation of the 'NetApp Volume Information.' model.
Specifies information abou... | 2.1875 | 2 |
src/matlab2cpp/node/__init__.py | neilferg/matlab2cpp | 0 | 24618 | <gh_stars>0
"""
The module contains the following submodules.
"""
from .frontend import Node
__all__ = ["Node"]
if __name__ == "__main__":
import doctest
doctest.testmod()
| 1.257813 | 1 |
ipsc/2016/f.py | csferng/competitive-programming | 0 | 24619 | import collections
import itertools
import re
import sys
read_str = lambda : sys.stdin.readline().strip()
read_str_list = lambda : sys.stdin.readline().strip().split()
read_int = lambda : int(read_str())
read_int_list = lambda : map(int, read_str_list())
read_float = lambda : float(read_str())
read_float_list = lambda... | 3.203125 | 3 |
mcpython/common/data/gen/TextureDataGen.py | mcpython4-coding/core | 2 | 24620 | """
mcpython - a minecraft clone written in python licenced under the MIT-licence
(https://github.com/mcpython4-coding/core)
Contributors: uuk, xkcdjerry (inactive)
Based on the game of fogleman (https://github.com/fogleman/Minecraft), licenced under the MIT-licence
Original game "minecraft" by Mojang Studios (www.m... | 3.046875 | 3 |
qinling/tests/unit/api/controllers/v1/test_webhook.py | goldyfruit/qinling | 0 | 24621 | <filename>qinling/tests/unit/api/controllers/v1/test_webhook.py
# Copyright 2018 Catalyst IT Limited
#
# 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/... | 2.34375 | 2 |
setup.py | elcolumbio/goofy | 1 | 24622 | from setuptools import setup
setup(name='goofy',
version='0.1',
description='A goofy ebay bot.',
url='github.com/elcolumbio/goofy',
author='<NAME>',
author_email='<EMAIL>',
license='Apache License, Version 2.0 (the "License")',
packages=['goofy'])
| 1.0625 | 1 |
nxt/main.py | TeamGalileoRobotics/qLearning | 4 | 24623 | <filename>nxt/main.py<gh_stars>1-10
import random
import os
import traceback
import json
from environment import Environment
from environment import Action
# 0 <= GAMMA < 1
# GAMMA = 0 -> only consider immediate rewards
# GAMMA = 1 -> consider future rewards
GAMMA = 0.8
confidence = 0
# initialize "brain"
brain = o... | 2.53125 | 3 |
final_project/machinetranslation/tests.py | eduardomecchia/xzceb-flask_eng_fr | 0 | 24624 | import unittest
import translator
class TestEnglishToFrench(unittest.TestCase):
def test_love(self):
self.assertEqual(translator.english_to_french('Love'), 'Amour')
def test_sun(self):
self.assertEqual(translator.english_to_french('Sun'), 'Soleil')
def test_null(self):
self.as... | 3.234375 | 3 |
dataRT/http.py | thedeltaflyer/dataRT | 2 | 24625 | from flask import (Flask, jsonify)
from gevent import (pywsgi, sleep)
from geventwebsocket.handler import WebSocketHandler
from . import __version__
from .logs import logger
class FlaskApp(object):
def __init__(self, host='', port=8080):
self.app = Flask(__name__)
self._register_routes()
... | 2.46875 | 2 |
order/views.py | abhijitdalavi/matrix | 0 | 24626 | from django.views.generic import ListView, CreateView, UpdateView
from django.utils.decorators import method_decorator
from django.contrib.admin.views.decorators import staff_member_required
from django.shortcuts import get_object_or_404, redirect, reverse
from django.urls import reverse_lazy
from django.contrib import... | 1.976563 | 2 |
example/testify_pytorch_to_caffe_example.py | templeblock/nn_tools | 0 | 24627 | import caffe
import torch
import numpy as np
import argparse
from collections import OrderedDict
from torch.autograd import Variable
import torch.nn as nn
def arg_parse():
parser = argparse.ArgumentParser()
parser.add_argument('--model', '-m', default='alexnet')
parser.add_argument('--decimal', '-d', defa... | 2.40625 | 2 |
gregsprograms/ohshots.py | gjhartwell/cth-python | 0 | 24628 | <reponame>gjhartwell/cth-python
# -*- coding: utf-8 -*-
"""
Created on Tue May 26 15:53:33 2020
@author: hartwgj
"""
# --------------------------------------
# OHShots.py
#
# MDSplus Python project
# for CTH data access
#
# OHShots.py --- gets the shots within a given date range that use OH
#
# Parameters:
# start... | 2.546875 | 3 |
app.py | plotly/radon-transform-visualisation | 0 | 24629 | <filename>app.py
#!/usr/bin/env python3
import argparse
import dash
import dash_core_components as dcc
import dash_html_components as html
from dash.dependencies import Input, Output
import numpy as np
import cv2
import matplotlib.pyplot as plt
from skimage.transform import radon, rescale, rotate
import plotly.grap... | 2.625 | 3 |
code/chapter_04/listing_04_13.py | guinslym/python_earth_science_book | 80 | 24630 | <reponame>guinslym/python_earth_science_book
# Go to new line using \n
print('-------------------------------------------------------')
print("My name is\n<NAME>")
# Inserting characters using octal values
print('-------------------------------------------------------')
print("\100 \136 \137 \077 \176")
# Inserting c... | 3.75 | 4 |
azure/durable_functions/models/RetryOptions.py | gled4er/azure-functions-durable-python | 9 | 24631 | <reponame>gled4er/azure-functions-durable-python
class RetryOptions:
def __init__(self, firstRetry: int, maxNumber: int):
self.backoffCoefficient: int
self.maxRetryIntervalInMilliseconds: int
self.retryTimeoutInMilliseconds: int
self.firstRetryIntervalInMilliseconds: int = firstRetr... | 2.59375 | 3 |
modules/kachelmann_bot.py | WhereIsTheExit/HeinzBot | 6 | 24632 | <gh_stars>1-10
import datetime
import urllib
from urllib.request import urlopen
import time
import logging
import bs4
import telegram
from telegram import Update
from telegram.ext import CommandHandler, CallbackContext
from modules.abstract_module import AbstractModule
from utils.decorators import register_module, r... | 2.046875 | 2 |
carpyncho.py | DrDub/carpyncho-py | 0 | 24633 | <filename>carpyncho.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2020, <NAME>
# License: BSD-3-Clause
# Full Text: https://github.com/carpyncho/carpyncho-py/blob/master/LICENSE
# =============================================================================
# DOCS
# =============================... | 1.898438 | 2 |
visual_data/app/utils.py | SaidLopez/django_start | 0 | 24634 | <reponame>SaidLopez/django_start
import matplotlib.pyplot as plt
import base64
from io import BytesIO
def get_graph():
buffer = BytesIO()
plt.savefig(buffer, format='png')
buffer.seek(0)
image_png = buffer.getvalue()
graph = base64.b64encode(image_png)
graph = graph.decode('utf-8')
buffer.c... | 2.375 | 2 |
qradar_utilities.py | intel471/titan_qradar_sync | 1 | 24635 | <gh_stars>1-10
#!/usr/bin/env python3.8
import time
from typing import List, Dict
import json
import requests
from requests.exceptions import HTTPError
from urllib3.exceptions import InsecureRequestWarning
from json_utilities import json_get
from titan_qradar_sync_config import TitanQRadarSyncConfig
class QRadarUti... | 2.359375 | 2 |
src/polls/polls/project/migrations/0002_shoppingitem_shoppinglist.py | Valeriu92/Shopping_list | 0 | 24636 | <filename>src/polls/polls/project/migrations/0002_shoppingitem_shoppinglist.py<gh_stars>0
# Generated by Django 3.0.5 on 2020-06-21 14:52
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('project', '0001_initial'),
]
... | 1.796875 | 2 |
utils.py | cswzhang/RESD | 1 | 24637 | # coding=utf-8
import logging
import numpy as np
import pandas as pd
from sklearn import metrics
from sklearn.linear_model import LogisticRegression
from sklearn.multiclass import OneVsRestClassifier
from sklearn.preprocessing import LabelBinarizer
from sklearn.utils import shuffle
logging.basicConfig(format='%(level... | 2.546875 | 3 |
misc/make_struct.py | kwrobert/nanowire | 0 | 24638 | import os
import glob
import argparse as ap
import shutil as sh
import re
def main():
parser = ap.ArgumentParser(description="""Uses minimum basis term file to extract the data for a
simulation that used the minimum number of basis terms for each frequency""")
parser.add_argument('min_file',type=str,help="... | 3.3125 | 3 |
rurina5/test2.py | TeaCondemns/rurina | 0 | 24639 | <reponame>TeaCondemns/rurina
from input import flip
from utilities.surface import *
import utilities.time as time
from nodes import Control, init
from shape import draw
import pygame
import pygame.key as key
from event import get, typename2
from input import map
screen = pygame.display.set_mode((800, 800), pygame.RES... | 2.875 | 3 |
Lab3/turingmachine.py | PedroDeSanti/PCS3616 | 0 | 24640 | # turingmachine.py - implementation of the Turing machine model
#
# Copyright 2014 <NAME>.
#
# This file is part of turingmachine.
#
# turingmachine is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
# Free Software Foundation, either versi... | 2.421875 | 2 |
stdlib2-src/dist-packages/quodlibet/formats/xiph.py | ch1huizong/Scode | 0 | 24641 | <filename>stdlib2-src/dist-packages/quodlibet/formats/xiph.py
# Copyright 2004-2005 <NAME>, <NAME>
# 2009-2014 <NAME>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation
import... | 2.125 | 2 |
test find weather.py | jacblo/tests-and-early-projects | 0 | 24642 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sun Jul 5 23:04:10 2020
@author: y3
749e8aa818a63c61c31acd7ee948d6d8
"""
import requests
api_address = "https://api.openweathermap.org/data/2.5/weather?q="
api_key_url = "&APPID=749e8aa818a63c61c31acd7ee948d6d8"
city_name = "Bet shemesh,IL"
weather_data... | 3.09375 | 3 |
customer_match/cli.py | Esquire-Digital/customer-match-translator | 0 | 24643 | #!/usr/bin/python3
import os
import click
import sys
import csv
import time
import pandas as pd
import country_converter as coco
import hashlib
import phonenumbers
from tqdm import tqdm
from uszipcode import SearchEngine
HEADER_TRANSLATIONS = {
"email1": "Email",
"phone1": "Phone",
"person_country": "Count... | 2.359375 | 2 |
pwndbg/color/__init__.py | R2S4X/pwndbg | 287 | 24644 | <reponame>R2S4X/pwndbg
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import re
import pwndbg.memoize
NORMAL = "\x1b[0m"
BLACK = "\x1b[30m"
RED ... | 2.34375 | 2 |
private_inference/app/commons.py | xiyueyiwan/private-ml-for-health | 28 | 24645 | import io
from PIL import Image
from torchvision import models
import torch
import torchvision.transforms as transforms
import torch.nn as nn
import torch.nn.functional as F
import urllib
import os
def get_model_from_global_agent():
global_model = models.squeezenet1_1(pretrained=True)
global_model.classifier[1... | 2.578125 | 3 |
eg-retracepoly.py | Cocodidou/projetFusee | 0 | 24646 | <filename>eg-retracepoly.py
# line drawing as shape, where drawing doesn't "lift pen from paper"
# coords are given as a list from (0,0), and sublists can be used to
# branch off then return to a particular point
#
# drawing the outline of a polygon, then retracing the steps backwards,
# renders the polygon outline as ... | 3.3125 | 3 |
migrations/versions/25276717e6b8_.py | myfreeweb/crawllog | 3 | 24647 | <reponame>myfreeweb/crawllog
"""Initial schema
Revision ID: 25276717e6b8
Revises: None
Create Date: 2016-03-25 17:58:19.963883
"""
# revision identifiers, used by Alembic.
revision = '2<PASSWORD>'
down_revision = None
from alembic import op
import sqlalchemy as sa
def downgrade():
op.drop_table('server_log')
... | 1.890625 | 2 |
Day 15/FLOW016.py | arpit1920/Python-Codechef-Problems | 0 | 24648 | """
This Code is Contributed by <NAME>
Codechef-@<EMAIL>
Github - @arpit1920
Kaggle - arpit3043
Mail - <EMAIL>
Two integers A and B are the inputs. Write a program to find GCD and LCM of A and B.
Input
The first line contains an integer T, total number of testcases.
Then follow T lines, each line contains an... | 3.703125 | 4 |
recupero/migrations/0001_initial.py | cluster311/ggg | 6 | 24649 | <filename>recupero/migrations/0001_initial.py
# Generated by Django 2.2.4 on 2019-10-22 00:36
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
class Migration(migrations.Migration):
initial = True
dependencies = [
('cie10_django', '0001_initial'... | 1.601563 | 2 |
main(terminal).py | fcondo/GUI-sudoku-solver | 0 | 24650 | """
main(terminal).py
Author: <NAME>
"""
from solver import print_grid, solve
def main():
sudoku_grid = [ [0,8,0, 0,0,0, 2,0,0],
[0,0,0, 0,8,4, 0,9,0],
[0,0,6, 3,2,0, 0,1,0],
[0,9,7, 0,0,0, 0,8,0],
... | 3.515625 | 4 |
win/ass_commander.py | janakhpon/PersonalAssistant | 0 | 24651 | import subprocess
import os
import requests
import pyttsx3
from bs4 import BeautifulSoup
class Commander:
def __init__(self):
self.confirm = ["yes", "ok", "go on", "sure", "do it", "yeah", "yaa", "Imm", "confirm", "of course"]
self.cancel = ["nope", "no", "noo", "not yet", "don't", "do not", "stop... | 3.171875 | 3 |
circular.py | beninato8/pokemon-go | 0 | 24652 | <reponame>beninato8/pokemon-go
def rotations(l):
out = []
for i in range(len(l)):
a = shift(l, i)
out += [a]
return out
def shift(l, n):
return l[n:] + l[:n]
if __name__ == '__main__':
l = [0,1,2,3,4]
for x in rotations(l):
print(x) | 3.421875 | 3 |
GetDataFrame.py | Adhmir/mcdm | 0 | 24653 | <reponame>Adhmir/mcdm
# -*- coding: utf-8 -*-
"""
Created on Tue Dec 28 17:41:18 2021
@author: <NAME>
"""
import pandas as pd
import MCDM_V_001 as mcdm
def pegar_dados():
file_path = mcdm.label_file["text"]
excel_filename = r"{}".format(file_path)
if excel_filename[-4:] == ".csv":
df ... | 2.515625 | 3 |
Individual task.py | IsSveshuD/lab_2_11 | 0 | 24654 | #!/usr/bin/env python3
# _*_ coding: utf-8 -*-
# Используя замыкания функций, объявите внутреннюю функцию,
# которая принимает в качестве аргумента коллекцию (список
# или кортеж) и возвращает или минимальное значение, или
# максимальное, в зависимости от значения параметра type внешней
# функции. Если type равен «max»... | 4.0625 | 4 |
cmsplugin_remote_form/migrations/0005_auto_20200429_1442.py | georgmzimmer/cmsplugin-remote-form | 0 | 24655 | # Generated by Django 2.2.12 on 2020-04-29 18:42
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('cmsplugin_remote_form', '0004_remoteform_notification_emails'),
]
operations = [
migrations.AlterField(
model_name='extrafield'... | 1.726563 | 2 |
model.py | bfMendonca/CarND-Behavioral-Cloning-P3 | 0 | 24656 | import csv
import cv2
import numpy as np
import pandas as pd
import sys
from datetime import datetime
from numpy.random import RandomState
import keras
import tensorflow as tf
from keras.models import Sequential
from keras.callbacks import ModelCheckpoint
from keras.layers import Flatten, Dense, Lambda, Cropping2D, C... | 2.453125 | 2 |
tools/debug_discovery.py | s1rd4v3/homebridge-tuya-web-es6-js | 172 | 24657 | <reponame>s1rd4v3/homebridge-tuya-web-es6-js<filename>tools/debug_discovery.py
# The script is intended to get a list of all devices available via Tuya Home Assistant API endpoint.
import requests
import pprint
# CHANGE THIS - BEGINNING
USERNAME = ""
PASSWORD = ""
REGION = "eu" # cn, eu, us
COUNTRY_CODE = "1" # Your a... | 2.875 | 3 |
yamtbx/dataproc/adxv.py | 7l2icj/kamo_clone | 16 | 24658 | """
(c) RIKEN 2015. All rights reserved.
Author: <NAME>
This software is released under the new BSD License; see LICENSE.
"""
import socket
import subprocess
import time
import os
import getpass
import tempfile
class Adxv:
def __init__(self, adxv_bin=None, no_adxv_beam_center=True):
self.adxv_bin = adxv_... | 1.929688 | 2 |
model/net.py | JiazeWang/Luna16 | 47 | 24659 | import torch
from torch import nn
from configs import ANCHOR_SIZES
class PostRes(nn.Module):
def __init__(self, n_in, n_out, stride=1):
super(PostRes, self).__init__()
self.conv1 = nn.Conv3d(n_in, n_out, kernel_size=3, stride=stride, padding=1)
self.bn1 = nn.BatchNorm3d(n_out)
self... | 2.328125 | 2 |
multiWindowTest.py | LukasHegenbarth/lableImg | 2 | 24660 | <reponame>LukasHegenbarth/lableImg
import codecs
import distutils.spawn
import os.path
import platform
import re
import subprocess
import sys
from collections import defaultdict
from functools import partial
try:
from PyQt5.QtCore import *
from PyQt5.QtGui import *
from PyQt5.QtWidgets import *
from Py... | 2.078125 | 2 |
api/accounts/urls.py | paurushofficial/InvitationApi | 0 | 24661 | from django.urls import path
from rest_framework_simplejwt.views import (
TokenObtainPairView,
TokenRefreshView,
TokenVerifyView,
)
from . views import *
urlpatterns = [
path('register/', UserRegisterView.as_view()),
path('logout/', LogoutView.as_view()),
path('token/', TokenObtainPairView.as_... | 1.882813 | 2 |
PhyTestOnline/PhyTestOnline.py | JerryLife/PhyTestOnline | 1 | 24662 | <gh_stars>1-10
# -*- coding: utf-8 -*-
# Copyright (C) 2016 <NAME>
import urllib
import urllib2
import re
import xlwt
START_PAGE = 0 # start page
ALL_PAGE = 82 # number of all pages
class PhyTestOnline(object):
"""
This class is specially for a HUST Physics Test Online providing a crawler... | 3.296875 | 3 |
examples/pytorch/DROCC/main_tabular.py | KimSangYeon-DGU/EdgeML | 0 | 24663 | from __future__ import print_function
import os
import argparse
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
from torch.utils.data import DataLoader, Dataset
from collections import OrderedDict
import numpy as np
from edgeml_pytorch.trainer.drocc_trainer import DROCCTra... | 2.75 | 3 |
funcs.py | amsynist/gmail_counter_deleter | 0 | 24664 | <filename>funcs.py
import re
import imaplib
def checkinbox(user,passw,imapserver):
imap = imaplib.IMAP4_SSL(imapserver)
try:
imap.login(user,passw)
print("Connecting and Fetching required info,Please Wait..")
select_folder = input("Enter the folder : ")
imap.select(select_folder)
... | 3.203125 | 3 |
plugin-python/proto/pyvcloudprovider_pb2_grpc.py | srinarayanant/terraform-provider-vcloud-director-1 | 0 | 24665 | <gh_stars>0
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
import grpc
from proto import catalog_item_pb2 as proto_dot_catalog__item__pb2
from proto import pyvcloudprovider_pb2 as proto_dot_pyvcloudprovider__pb2
from proto import vapp_pb2 as proto_dot_vapp__pb2
class PyVcloudProviderStub(objec... | 1.539063 | 2 |
bot/triggers/commands/math.py | elihschiff/Rubber-Duck-Python | 7 | 24666 | <reponame>elihschiff/Rubber-Duck-Python
from . import Command
from .. import utils
import wolframalpha
class Math(Command):
names = ["math", "calc", "calculate", "solve"]
description = "Solves a math problem"
usage = "!math [expression]"
examples = "!math d/dx sin(x)^2"
show_in_help = True
as... | 2.625 | 3 |
home/forms.py | Legaeldan/siobhan-mcgowan-photography | 0 | 24667 | from django import forms
class ContactForm(forms.Form):
user_name = forms.CharField(max_length=60, label='', required=True, widget=forms.TextInput(attrs={'placeholder': '<NAME>'}))
user_email = forms.EmailField(label='', required=True)
message = forms.CharField(label='', required=True, widget=forms.Texta... | 2.390625 | 2 |
lasttester/components/configs/ftp.py | gitdachong/lasttester | 0 | 24668 | #coding:utf-8
import ftplib
import os
from ...core import constants
from . import base
class Configurer(base.Configurer):
def __init__(self,config):
self._config = config
self._key = constants.KEY_CONFIGURER_INSTANCES
self._results = {}
self.instance = ftplib.FTP()
self.inst... | 2.359375 | 2 |
util/load.py | juvalen/mb-checker | 12 | 24669 | # Name: load.py
# Date: June 2019
# Function: goes trough a bookmark file checking the status of each URL
# Input: bookmark file in json format
# Output: new text and json files including those URLs according with their status
import os
import ast
try:
import requests
except:
sys.stderr.write("%s: Please inst... | 3.046875 | 3 |
dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numba/cuda/errors.py | jeikabu/lumberyard | 8 | 24670 | from __future__ import print_function, absolute_import
import numbers
class KernelRuntimeError(RuntimeError):
def __init__(self, msg, tid=None, ctaid=None):
self.tid = tid
self.ctaid = ctaid
self.msg = msg
t = ("An exception was raised in thread=%s block=%s\n"
"\t%s")... | 2.890625 | 3 |
gitrack/exceptions.py | AuHau/giTrack | 5 | 24671 | <gh_stars>1-10
class GitrackException(Exception):
"""
General giTrack's exception
"""
pass
class ConfigException(GitrackException):
"""
Exception related to Config functionality.
"""
pass
class InitializedRepoException(GitrackException):
"""
Raised when user tries to initial... | 2.765625 | 3 |
Protheus_WebApp/Modules/SIGAPLS/PLSA809TESTCASE.py | 98llm/tir-script-samples | 17 | 24672 | from tir import Webapp
import unittest
from tir.technologies.apw_internal import ApwInternal
import datetime
import time
DateSystem = datetime.datetime.today().strftime('%d/%m/%Y')
DateVal = datetime.datetime(2120, 5, 17)
"""-------------------------------------------------------------------
/*/{Protheus.doc} PLSA809T... | 2.109375 | 2 |
P13pt/mascril/modules/lockin2gates.py | green-mercury/P13pt | 3 | 24673 | from __future__ import print_function
from P13pt.mascril.measurement import MeasurementBase
from P13pt.mascril.parameter import Sweep, String, Folder, Boolean
from P13pt.drivers.bilt import Bilt, BiltVoltageSource, BiltVoltMeter
from P13pt.drivers.zilockin import ZILockin
import time
import numpy as np
import os
clas... | 2.1875 | 2 |
scripts/parse_coredump_bin.py | lucasdietrich/AVRTOS | 3 | 24674 | <reponame>lucasdietrich/AVRTOS<filename>scripts/parse_coredump_bin.py
import re
import struct
from typing import List
class Core:
def __init__(self):
self.registers = []
def SP(self) -> int:
return self.registers[0]
def PC(self) -> int:
return self.registers[1]
def SREG(sel... | 2.875 | 3 |
src/utils/time_helpers.py | pdkary/black-scholes-plus | 2 | 24675 | <gh_stars>1-10
from datetime import datetime,timedelta
import re
def get_time_to_expiry(maturity):
if maturity ==0:
return 0
# Today's date
day_0 = datetime.today()
# Maturity date
date_format = "%Y-%m-%d"
day_exp = datetime.strptime(maturity, date_format)
# Delta date: i.e. 1 day, ... | 2.875 | 3 |
scripts/publish_source.py | apguerrera/DreamFrames | 2 | 24676 | <reponame>apguerrera/DreamFrames<filename>scripts/publish_source.py
from brownie import *
from .contract_addresses import *
import time
def publish():
if network.show_active() == "development":
return False
else:
return True
def main():
publish_Goober_nft()
def publish_Goober_nft():
... | 2.25 | 2 |
examples/demo_classic.py | ria02/InquirerPy | 120 | 24677 | # NOTE: Following example requires boto3 package.
import boto3
from InquirerPy import prompt
from InquirerPy.exceptions import InvalidArgument
from InquirerPy.validator import PathValidator
client = boto3.client("s3")
def get_bucket(_):
return [bucket["Name"] for bucket in client.list_buckets()["Buckets"]]
de... | 2.484375 | 2 |
python/level1_single_api/9_amct/amct_pytorch/tensor_decompose/src/common/model.py | Ascend/samples | 25 | 24678 | <reponame>Ascend/samples<gh_stars>10-100
"""
# Copyright 2021 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
#... | 2.203125 | 2 |
layers/poky/scripts/lib/argparse_oe.py | dtischler/px30-test | 53 | 24679 | <reponame>dtischler/px30-test
import sys
import argparse
from collections import defaultdict, OrderedDict
class ArgumentUsageError(Exception):
"""Exception class you can raise (and catch) in order to show the help"""
def __init__(self, message, subcommand=None):
self.message = message
self.subc... | 2.671875 | 3 |
datahub/omis/invoice/migrations/0006_invoice_contact_email.py | Staberinde/data-hub-api | 6 | 24680 | <reponame>Staberinde/data-hub-api
# Generated by Django 2.0.1 on 2018-01-03 15:50
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('omis_invoice', '0005_populate_billing_fields'),
]
operations = [
migrations.AddField(
model_na... | 1.65625 | 2 |
src/waldur_openstack/openstack/__init__.py | geant-multicloud/MCMS-mastermind | 26 | 24681 | <filename>src/waldur_openstack/openstack/__init__.py
default_app_config = 'waldur_openstack.openstack.apps.OpenStackConfig'
| 1.007813 | 1 |
bin/system-setup.py | filipecosta90/readies | 9 | 24682 | #!/bin/sh
''''[ ! -z $VIRTUAL_ENV ] && exec python -u -- "$0" ${1+"$@"}; command -v python3 > /dev/null && exec python3 -u -- "$0" ${1+"$@"}; exec python2 -u -- "$0" ${1+"$@"} # '''
import sys
import os
import argparse
HERE = os.path.dirname(__file__)
ROOT = os.path.abspath(os.path.join(HERE, ".."))
sys.path.insert(0... | 2.25 | 2 |
server/block-pyhook.py | Strangemother/python-websocket-server | 0 | 24683 | import pyHook
from threading import Timer
import win32gui
import logging
class blockInput():
def OnKeyboardEvent(self,event):
return False
def OnMouseEvent(self,event):
return False
def unblock(self):
logging.info(" -- Unblock!")
if self.t.is_alive():
... | 2.515625 | 3 |
algorithms/implementation/cut_the_sticks.py | avenet/hackerrank | 0 | 24684 | def make_cut(l):
smallest = min(l)
return [
x - smallest
for x
in l
if x - smallest > 0
]
length = int(input())
current = list(
map(
int,
input().split()
)
)
while current:
print(len(current))
current = make_cut(current)
| 3.265625 | 3 |
datasets.py | RAMitchell/GLM-Benchmarks | 1 | 24685 | <gh_stars>1-10
import gzip
import numpy as np
import os
import pandas as pd
import shutil
import sys
import tarfile
import urllib
import zipfile
from scipy.sparse import vstack
from sklearn import datasets
from sklearn.externals.joblib import Memory
if sys.version_info[0] >= 3:
from urllib.request import urlretrie... | 2.375 | 2 |
lv_set/Main.py | Ramesh-X/Level-Set | 122 | 24686 | """
This python code demonstrates an edge-based active contour model as an application of the
Distance Regularized Level Set Evolution (DRLSE) formulation in the following paper:
<NAME>, <NAME>, <NAME>, <NAME>, "Distance Regularized Level Set Evolution and Its Application to Image Segmentation",
IEEE Trans. Ima... | 2.921875 | 3 |
object_detection/handlers.py | pavelbystrov1/detection_bot | 0 | 24687 | <gh_stars>0
""" bot handlers """
import os
from pymongo import MongoClient
from utils import main_keyboard
import settings
from db import get_or_create_user, save_detected_defects, save_car_counts
from db import defects_stat, cars_stat
from processing import process_picture
from cars_counting import detect_all_autos
fr... | 2.25 | 2 |
src/utils.py | Martins6/stats-img-processing | 0 | 24688 | <reponame>Martins6/stats-img-processing
import os
import matplotlib.pyplot as plt
def biplot(score,coeff,pcax_index,pcay_index,labels=None):
pcax=pcax_index
pcay=pcay_index
pca1=pcax-1
pca2=pcay-1
xs = score[:,pca1]
ys = score[:,pca2]
n=score.shape[1]
scalex = 1.0/(xs.max()- xs.min())
... | 2.71875 | 3 |
minigame/button.py | AndrewCarterUK/MiniGame | 0 | 24689 | <reponame>AndrewCarterUK/MiniGame
import abc
class Button(abc.ABC):
@abc.abstractmethod
def register_callback(self, callabck):
pass
@abc.abstractmethod
def pressed(self):
pass
| 2.90625 | 3 |
Polynomial_vec.py | chapman-phys227-2016s/hw-7-malfa100 | 0 | 24690 | <filename>Polynomial_vec.py
"""
File: Polynomial_vec.py
Copyright (c) 2016 <NAME>
License: MIT
Exercise 7.27
Description: Use vectorized expressions in the Polynomial class.
"""
import numpy as np
import unittest as ut
class Polynomial:
def __init__(self, coefficients):
if isinstance(coefficients, np.ndar... | 3.78125 | 4 |
OOP/Shop_OOP.py | Deego88/MPP_Assignment | 0 | 24691 | <gh_stars>0
# Student:<NAME>
# Student NUmber: G00387896
# Import libraries
import os
import csv
#****** CREATE DATA CLASS******#
# Create a data class for Product
class Product:
def __init__(self, name, price=0):
self.name = name
self.price = price
def __repr__(self):
... | 4.21875 | 4 |
7/assembly.py | Keilan/advent-of-code-2018 | 0 | 24692 | <gh_stars>0
import sys
import copy
def find_available(graph, steps):
return [s for s in steps if s not in graph]
def trim_graph(graph, item):
removed_keys = []
for step, items in graph.items():
if item in items:
items.remove(item)
if len(items) == 0:
remov... | 2.671875 | 3 |
server.py | andersonsso/vogon | 98 | 24693 | #!/usr/bin/python
# vim: set fileencoding=utf-8 :
# Copyright 2019 Google 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/LIC... | 1.898438 | 2 |
3/konks_lab_3.py | exucutional/study_comp_math | 0 | 24694 | #!/usr/bin/env python
# coding: utf-8
# # Lab 02
#
# ## Solving a system of nonlinear equations
#
# ### <NAME>, Б01-818
#
# IV.12.7.д
# $$\begin{cases} x^7 - 5x^2y^4 + 1510 = 0 \\ y^3 - 3x^4y - 105 = 0 \end{cases}$$
# $$\begin{cases} x_{n+1} = \sqrt{\frac{x_n^7 + 1510}{5y_n^4}} \\ y_{n+1} = \sqrt[3]{3x_{n}^4y_{n}... | 3.015625 | 3 |
tictactoe.py | pauloue/tictactoe-turtle | 1 | 24695 | <filename>tictactoe.py
#!/usr/bin/env python3
"""A tic tac toe game with an unbeatable AI that uses the Python turtle
module. The AI player chooses it's move using the minimax algorithm.
"""
from ttt_util import TicTacToeUI, HumanPlayer, BotPlayer
from random import shuffle
class TicTacToe:
def __init__(self, p... | 4 | 4 |
cjktools/tests/resources/test_tatoeba.py | pganssle/cjktools | 17 | 24696 | <gh_stars>10-100
# -*- coding: utf-8 -*-
#
# test_tatoeba.py
# cjktools
#
from __future__ import unicode_literals
import os
from .._common import to_unicode_stream, to_string_stream
import unittest
from six import text_type
from functools import partial
from datetime import datetime
from cjktools.resources impor... | 2.046875 | 2 |
sql/__init__.py | realDragonium/small-flask-project | 0 | 24697 | from .sql_models import SQLQuiz, SQLQuestion, SQLAnswerOption
| 1.109375 | 1 |
setup.py | fabaff/penin | 4 | 24698 | #!/usr/bin/env python3
"""PenIn setup script."""
from setuptools import setup, find_packages
from penin.core.version import get_version
VERSION = get_version()
readme_file = open("README.md", "r")
LONG_DESCRIPTION = readme_file.read()
readme_file.close()
setup(
name="penin",
version=VERSION,
description=... | 1.539063 | 2 |
tyled/tileset/orthogonal/__init__.py | kfields/tyled | 1 | 24699 | <reponame>kfields/tyled<gh_stars>1-10
from tyled.tileset.orthogonal.orthogonal import OrthogonalTileset | 1.226563 | 1 |