repo_name
stringlengths
6
97
path
stringlengths
3
341
text
stringlengths
8
1.02M
bit-bots/karma
karma/karma/admin.py
from django.contrib import admin from .models import KarmaPoints, Project, Category admin.site.register(KarmaPoints) admin.site.register(Category) admin.site.register(Project)
bit-bots/karma
karma/karma/migrations/0003_project_karma_rules.py
# -*- coding: utf-8 -*- # Generated by Django 1.11 on 2017-11-05 10:19 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('karma', '0002_auto_20170307_1645'), ] operations = [ migrations.AddField( ...
philipempl/mail_watch
black_list_all.py
import imaplib, base64, os, email, re, configparser import tkinter as tk from tkinter import messagebox from datetime import datetime from email import generator from dateutil.parser import parse def init(): mail = imaplib.IMAP4_SSL(config['SERVER']['Host'],config['SERVER']['Port']) pwd = str(input("PWD: ")) ...
philipempl/mail_watch
mail_watcher.py
<gh_stars>0 import imaplib, base64, os, email, re, configparser import tkinter as tk from tkinter import messagebox from datetime import datetime from email import generator from dateutil.parser import parse def init(): mail = imaplib.IMAP4_SSL(config['SERVER']['Host'],config['SERVER']['Port']) pwd = str(input(...
ethansimpson285/HEPDash
src/hepdash/histograms/design.py
# Design config import mplhep as hep experiment_labels = { "ATLAS" : hep.atlas, "CMS" : hep.cms, "LHCb2" : hep.lhcb, "ALICE" : hep.alice } HEP_histogram_design_parameters = { "experiment" : "ATLAS", "HEP label text" : "Internal" } HEP_histogram_design_parameters["HEP experim...
ethansimpson285/HEPDash
src/hepdash/funcs/make_premade_comparison_app.py
<filename>src/hepdash/funcs/make_premade_comparison_app.py ''' HEP-Dash <NAME> December 10th 2021 Notes: - Require that the primary function for creating the web-app must be called main() - How to re-factor this into something more user freindly? - Just now, the only thing the user is required to do is edit the input ...
ethansimpson285/HEPDash
src/hepdash/funcs/make_general_comparison_app.py
''' HEP-Dash <NAME> December 10th 2021 Notes: - Require that the primary function for creating the web-app must be called main() - How to re-factor this into something more user freindly? - Just now, the only thing the user is required to do is edit the input dic - this could come from a config file - Or it could come...
ethansimpson285/HEPDash
src/hepdash/apps/Histogram_Apps.py
<gh_stars>0 # Histogram Apps ''' Histogram apps could have General or Specific varieties Pull histograms from ROOT file Compile into app ''' import streamlit as st import uproot import matplotlib.pyplot as plt import mplhep as hep import sys from streamlit import cli as stcli from hepdash.layouts.BiColumn import imp...
ethansimpson285/HEPDash
src/hepdash/histograms/Histogram_Classes.py
import matplotlib.pyplot as plt import mplhep as hep import hist import numpy as np from hist.intervals import ratio_uncertainty import boost_histogram as bh import uproot import functools import operator import math class PyHist_Object: ''' A basic wrapper for storing a boost-histogram and associated bin...
ethansimpson285/HEPDash
src/hepdash/histograms/Plotting_Histograms.py
import matplotlib.pyplot as plt import mplhep as hep import hist import numpy as np from hist.intervals import ratio_uncertainty import boost_histogram as bh import uproot from matplotlib.lines import Line2D from hepdash.histograms.Histogram_Classes import Histogram_Wrapper, PyHist_Object from streamlit import cli ...
ethansimpson285/HEPDash
src/hepdash/layouts/BiColumn.py
<filename>src/hepdash/layouts/BiColumn.py<gh_stars>0 """ HEP Dashboard 1 <NAME> For plotting single histograms in a streamlit web-app, with controls for binning and histogram range. Run either through python3 or streamlit commands: ```python3 PlotHist.py <file_name> <tree_name> <branch_name>``` or ```streamli...
ethansimpson285/HEPDash
src/hepdash/apps/Tree_Apps.py
<reponame>ethansimpson285/HEPDash from dataclasses import dataclass import itertools import yaml import os import matplotlib.pyplot as plt import streamlit as st from hepdash.layouts.BiColumn import import_ROOT_file, PhysOb_Page_TwoColumn, MultiPage default_colours = plt.rcParams['axes.prop_cycle'].by_key()['color']...
ethansimpson285/HEPDash
src/hepdash/histograms/Plotters.py
<reponame>ethansimpson285/HEPDash # Various plotters import mplhep as hep from hist.intervals import ratio_uncertainty import matplotlib.pyplot as plt from matplotlib.lines import Line2D from hepdash.histograms.Histogram_Classes import PyHist_Object, Histogram_Wrapper from hepdash.histograms.design import HEP_histogr...
ethansimpson285/HEPDash
src/hepdash/funcs/make_tree.py
<filename>src/hepdash/funcs/make_tree.py<gh_stars>0 ''' HEP-Dash <NAME> December 10th 2021 Notes: - Require that the primary function for creating the web-app must be called main() - How to re-factor this into something more user freindly? - Just now, the only thing the user is required to do is edit the input dic - t...
luckyzflQ/py4fix
python36/dxa/sn_random_numbers.py
import numpy as np def sn_random_numbers(shape, antithetic=True, moment_matching=True, fixed_seed=False): ''' Returns an array of shape shape with (pseudo)random numbers that are standard normally distributed. Parameters ========== shape : tuple (o, n, m) generati...
luckyzflQ/py4fix
python36/dxa/valuation_class.py
# # DX Library Valuation # valuation_class.py # class valuation_class(object): ''' Basic class for single-factor valuation. Attributes ========== name : string name of the object underlying : instance of simulation class mar_env : instance of market_environment market env...
luckyzflQ/py4fix
python36/volservice/vol_pricing_service.py
# # Valuation of European volatility options # in Gruenbichler-Longstaff (1996) model # square-root diffusion framework # -- parameter dictionary & web service function # from vol_pricing_formula import calculate_option_value # model parameters # http://127.0.0.1:4000/?V0=0.2&kappa=2.0&theta=0.21&sigma=0.02&zeta=0.0&...
luckyzflQ/py4fix
python36/dxa/derivatives_position.py
# # DX Library Portfolio # derivatives_position.py # class derivatives_position(object): ''' Class to model a derivatives position. Attributes ========== name : string name of the object quantity : float number of assets/derivatives making up the position underlying : string ...
kaist-jisungpark/ros_node_pattern
demo/scripts/sender.py
#!/usr/bin/env python import rospy #from dbw_mkz_msgs.msg import SteeringCmd from std_msgs.msg import String def CommandSender(): pub = rospy.Publisher('subscriber', String, queue_size=10) rospy.init_node('Commands', anonymous=True) rate = rospy.Rate(10) # 10hz while not rospy.is_shutdown(): he...
Dhruva-Ananth/IS1_Telemetry_Decoding
Inspire_Telemetry_Decoder_v6.py
import csv import os from tkinter import filedialog from tkinter import * from tkinter import ttk from satnogs.satnogs import Satnogs import cubeds import argparse LARGE_FONT= ("Verdana", 12) NORM_FONT= ("Verdana", 10) SMALL_FONT= ("Verdana", 8) def restart_program(): """Restarts the current program. Note: t...
jamesrr39/public-ip-logger
log-ip.py
#!/usr/bin/python import subprocess __author__ = 'james' import urllib2 from BeautifulSoup import BeautifulSoup from gi.repository import Notify import time from datetime import datetime import os def get_ip(): req = urllib2.Request("http://checkip.dyndns.org/") webpage = urllib2.urlopen(req).read() webp...
chucknthem/Data-structures-algorithms
algorithms/edit_dist.py
# The edit distance or Levenshteien distance between two strings is the # minimum number of insertion, deletion, and substitution operations it takes # to transfer one string into another. # http://en.wikipedia.org/wiki/Levenshtein_distance # This algorithm uses a bottom up dynamic programming approach to calculate #...
andrewguy9/safeoutput
safeoutput/__init__.py
<gh_stars>1-10 import argparse import logging import sys from builtins import object from os import rename from os.path import abspath, dirname from tempfile import NamedTemporaryFile LOG = logging.getLogger(__name__) def open(dst=None, mode="w"): if dst: fd = NamedTemporaryFile(dir=dirname(abspath(dst))...
andrewguy9/safeoutput
tests/test_safeoutput.py
<filename>tests/test_safeoutput.py import inspect from os import remove from os.path import isfile import pytest import safeoutput def _filename(): return u"testfile_" + inspect.stack()[1][3] def ensure_file_absent(path): try: remove(path) except OSError: pass def expected_file(path, ...
andrewguy9/safeoutput
setup.py
from setuptools import setup tests_require = ['tox', 'pytest'] setup( name='safeoutput', version='2.0', description='Tempfile wrapper to ensure output files are either complete, or empty. Also handles stdout, which gives no truncation guarantees.', long_description='Tool to facilitate console script o...
iamavx/AI_Sudoku_Solver
main.py
print('This is a opencv project created by <NAME> ') import os os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3' # To avoid the warning and log message from utlis import * import sudukoSolver pathImage = "Resources/1.jpeg" # path of image heightImg = 450 widthImg = 450 model = intializePredectionModel() # LOAD THE ...
yasuit21/EarthScienceExperiment
winpy.py
<reponame>yasuit21/EarthScienceExperiment ## winpy.py - Manipulate WIN files ## Sample code to outout csv files of WIN data ## Apr 05, 2021 <NAME> import sys import os from pathlib import Path import argparse from collections import defaultdict import numpy as np import matplotlib.pyplot as plt import obspy as ob ...
decopificador/OpenHAB
configurations/scripts/jsr223_demo.py
class TestRule(Rule): def __init__(self): self.logger = oh.getLogger("TestRule") def getEventTrigger(self): return [ StartupTrigger(), ChangedEventTrigger("Heating_FF_Child", None, None), TimerTrigger("0/50 * * * * ?") ] def execute(self, event):...
alankan886/SuperMemo2
supermemo2/__init__.py
from .sm_two import *
alankan886/SuperMemo2
supermemo2/sm_two.py
<reponame>alankan886/SuperMemo2 from math import ceil from datetime import date, datetime, timedelta from typing import Optional, Union, Dict import attr year_mon_day = "%Y-%m-%d" mon_day_year = "%m-%d-%Y" day_mon_year = "%d-%m-%Y" @attr.s class SMTwo: easiness = attr.ib(validator=attr.validators.instance_of(f...
alankan886/SuperMemo2
tests/test_sm_two.py
from datetime import date, timedelta import pytest from supermemo2 import SMTwo, year_mon_day, mon_day_year, day_mon_year @pytest.mark.parametrize( "quality, expected_easiness, expected_interval, expected_repetitions, expected_review_date", [ (0, 1.7000000000000002, 1, 0, date.today() + timedelta(da...
marcosorive/reddit-ns-wiki-scrapper
src/Utils/scrapper.py
<reponame>marcosorive/reddit-ns-wiki-scrapper import bs4 import re from Model.Game import Game from Utils import request_maker def get_name_link(element): anchor = element.find("a") if anchor: name = element.find("a").text link = element.find("a").attrs["href"] else: name = element....
marcosorive/reddit-ns-wiki-scrapper
src/main.py
<reponame>marcosorive/reddit-ns-wiki-scrapper import bs4 from Utils.request_maker import get_test_file from Utils.scrapper import iterate_table html = get_test_file() #response = get_text_body_from_url("https://www.reddit.com/r/NintendoSwitch/wiki/games") soup = bs4.BeautifulSoup(html, 'html.parser', from_encoding="ut...
marcosorive/reddit-ns-wiki-scrapper
src/Utils/request_maker.py
import os import requests from fake_useragent import UserAgent NINTENDO_SWITCH_WIKI_URL = "https://reddit.com/r/nintendoswitch/wiki/games" TEST_DATA_DIR = "./test_data" TEST_DATA_FILE = TEST_DATA_DIR+"/test_data.html" def get_text_body_from_url(url): ua = UserAgent() headers = { 'User-Agent': ua.ran...
marcosorive/reddit-ns-wiki-scrapper
src/Model/Game.py
<reponame>marcosorive/reddit-ns-wiki-scrapper class Game: def __init__(self, name = None): self.name = "" self.link = "" self.dev = "" self.publisher = "" self.dates = dict() self.trailer_link = "" def __str__(self): return ( "Name: " + self....
kunz07/fyp2017
Ubidots-RoomIOT.py
<reponame>kunz07/fyp2017 # FYP2017 # Program to send room temperature and humidity to ThingSpeak # Author: <NAME> # License: Public Domain import time import serial import sys from ubidots import ApiClient f = open('Ubidots_APIkey.txt', 'r') apikey = f.readline().strip() f.close() api = ApiClient(token = apikey) try...
kunz07/fyp2017
BatteryIOT.py
# FYP2017 # Program to send battery status to ThingSpeak channel # Author: <NAME> # License: Public Domain import time import sys import urllib.request import urllib.parse # Import SPI library (for hardware SPI) and MCP3008 library. import Adafruit_GPIO.SPI as SPI import Adafruit_MCP3008 # Hardware SPI configuration...
kunz07/fyp2017
Fuzzy.py
<reponame>kunz07/fyp2017 # FYP2017 # Program to determine economy level of system using fuzzy logic # Author: <NAME> # License: Public Domain import numpy as np import skfuzzy as fuzz from skfuzzy import control as ctrl import Weather import Battery # New Antecedent/Consequent objects hold universe variables and memb...
kunz07/fyp2017
GUI/system_rc.py
# -*- coding: utf-8 -*- # Resource object code # # Created by: The Resource Compiler for PyQt5 (Qt v5.8.0) # # WARNING! All changes made in this file will be lost! from PyQt5 import QtCore qt_resource_data = b"\ \x00\x00\x02\xec\ \x89\ \x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x48\x44\x52\x00\ \x00\x00\x20\x0...
kunz07/fyp2017
Ubidots-Forecast.py
<filename>Ubidots-Forecast.py # FYP2017 # Program to send average forecastof temperature and cloud cover to ThingSpeak # Author: <NAME> # License: Public Domain from forecastiopy import * import datetime import sys from ubidots import ApiClient import time hour = 3600 f = open('Ubidots_APIkey.txt', 'r') apikey = f....
kunz07/fyp2017
Fuzzytest.py
<filename>Fuzzytest.py # FYP2017 # Program to determine economy level of system using fuzzy logic (TESTING) # Author: <NAME> # License: Public Domain import matplotlib matplotlib.use('TkAgg') import numpy as np import skfuzzy as fuzz from skfuzzy import control as ctrl # New Antecedent/Consequent objects hold univers...
kunz07/fyp2017
test.py
<reponame>kunz07/fyp2017 from pyqtgraph.Qt import QtCore, QtGui import numpy as np import pyqtgraph as pg data = np.array([ [0.0, 0.5, 0.0], [0.5, 1.0, 0.5], [0.0, 0.5, 0.0] ]) pg.plot(data)
kunz07/fyp2017
WeatherIOT.py
<gh_stars>1-10 # FYP2017 # Program to send average forecastof temperature and cloud cover to ThingSpeak # Author: <NAME> # License: Public Domain from forecastiopy import * import datetime import sys import urllib.request import urllib.parse import time hour = 3600 def sendForecast(): f = open('DS_APIkey.txt','...
kunz07/fyp2017
ZigBee.py
# FYP2017 # Program to establish ZigBee communication between raspberry Pi and arduino # Complete control of HVAC elements based on commands sent from the Pi # Author: <NAME> # License: Public Domain import time import serial hour = 3600 PORT = '/dev/ttyUSB1' BAUD_RATE = 9600 # Open serial port ser = serial.Serial(...
kunz07/fyp2017
Battery.py
<filename>Battery.py # FYP2017 # Program to read battery voltage and display it on OLED # Author: <NAME> # License: Public Domain import time # OLED modules import Adafruit_SSD1306 from PIL import Image from PIL import ImageDraw from PIL import ImageFont # Raspberry Pi pin configuration: RST = 32 # 128x32 display w...
kunz07/fyp2017
GUI/lockscreen_rc.py
<reponame>kunz07/fyp2017 # -*- coding: utf-8 -*- # Resource object code # # Created by: The Resource Compiler for PyQt5 (Qt v5.8.0) # # WARNING! All changes made in this file will be lost! from PyQt5 import QtCore qt_resource_data = b"\ \x00\x00\x04\x31\ \x89\ \x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x48\x44...
kunz07/fyp2017
GUI/FinalLock.py
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'howmanylocks.ui' # # Created by: PyQt5 UI code generator 5.8.1 # # WARNING! All changes made in this file will be lost! from PyQt5 import QtCore, QtGui, QtWidgets class Ui_UserText(object): def setupUi(self, UserText): UserText...
kunz07/fyp2017
Weather.py
<reponame>kunz07/fyp2017 # FYP2017 # Program to get average forecast of temperature and cloud cover for 2 days # Author: <NAME> # License: Public Domain from forecastiopy import * import datetime f = open('DS_APIkey.txt','r') apikey = f.read() f.close() Bangalore = [12.9716, 77.5946] fio = ForecastIO.ForecastIO(api...
kunz07/fyp2017
ZigBeetest.py
# FYP2017 # Program to establish ZigBee communication between raspberry Pi and arduino # Complete control of HVAC elements based on commands sent from the Pi (TESTING) # Author: <NAME> # License: Public Domain import time import serial #import fuzzy hour = 3600 PORT = '/dev/ttyUSB0' BAUD_RATE = 9600 # Open serial p...
kunz07/fyp2017
GUI/final.py
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'final.ui' # # Created by: PyQt5 UI code generator 5.8.1 # # WARNING! All changes made in this file will be lost! from PyQt5 import QtCore, QtGui, QtWidgets from PyQt5.QtCore import * from PyQt5.QtGui import * from PyQt5.QtWidgets import * ...
kunz07/fyp2017
Ubidots-Finaltest.py
<filename>Ubidots-Finaltest.py # FYP2017 # Program to establish ZigBee communication between raspberry Pi and arduino # Complete control of HVAC elements based on commands sent from the Pi # Author: <NAME> # License: Public Domain import time import serial from ubidots import ApiClient one = 1 zero = 0 f = open('Ubi...
kunz07/fyp2017
Ubidots-Battery.py
# FYP2017 # Program to send battery status to ThingSpeak channel # Author: <NAME> # License: Public Domain import time import sys from ubidots import ApiClient f = open('Ubidots_APIkey.txt', 'r') apikey = f.readline().strip() f.close() api = ApiClient(token = apikey) try: variable1 = api.get_variable("58d763aa76...
kunz07/fyp2017
RoomIOT.py
<reponame>kunz07/fyp2017 # FYP2017 # Program to send room temperature and humidity to ThingSpeak # Author: <NAME> # License: Public Domain import time import serial import sys import urllib.request import urllib.parse PORT = '/dev/ttyUSB0' BAUD_RATE = 9600 # Open serial port ser = serial.Serial(PORT, BAUD_RATE) d...
mbarnaba/numerical-analysis-2021-2022
main.py
import numpy as np from matplotlib import pyplot as plt ''' Implement a function that given the domain interval, the forcing function, the number of discretization points, the boundary conditions, returns the matrix and the the right hand side b. ''' def finDif(omega, f, n, bc): span = omega[ -1 ] - omega[ 0 ]...
jmtroll/my-resume2
manage.py
from flask_script import Manager from myResume2 import app, db, Professor, Course manager = Manager(app) # reset the database and create some initial data @manager.command def deploy(): db.drop_all() db.create_all() p1 = Professor(name='Hartono', department='MIS') p2 = Professor(name='Harry', departm...
ahelmy/weather2tts-raspi
temp.py
#!/usr/bin/env python import logging.handlers import os import json API_KEY = '' LONG_LAT = '26.2172,50.1971' PATH = "temp.log" handler = logging.handlers.WatchedFileHandler( os.environ.get("LOGFILE", PATH)) formatter = logging.Formatter(logging.BASIC_FORMAT) handler.setFormatter(formatter) root = logging.getLogg...
datablane/QuantEcon.py
quantecon/distributions.py
<gh_stars>0 """ Probability distributions useful in economics. References ---------- http://en.wikipedia.org/wiki/Beta-binomial_distribution """ from math import sqrt import numpy as np from scipy.special import binom, beta class BetaBinomial: """ The Beta-Binomial distribution Parameters ------...
Lagg/steam-swissapiknife
steamswissapiknife/main.py
#!/usr/bin/env python """steam-swissapiknife see README.md""" # Python 2 <-> 3 glue try: from urllib.request import urlopen except ImportError: from urllib2 import urlopen import json, sys import argparse def parse_args(args): """Parse command line arguments""" cmdline = argparse.ArgumentParser(descr...
Lagg/steam-swissapiknife
setup.py
#!/usr/bin/env python # -*- coding: utf-8 -*- from setuptools import setup setup(name='steam-swissapiknife', version='0.1', description='A tool to explore the Steam API.', url='https://github.com/Lagg/steam-swissapiknife', author='Lagg', author_email='<EMAIL>', license='ISC', packages=['ste...
Lagg/steam-swissapiknife
steamswissapiknife/tests/test_all.py
#!/usr/bin/env python """steam-swissapiknife test suite""" from steamswissapiknife import main import unittest import os from contextlib import contextmanager import sys if sys.version_info[0] < 3: from StringIO import StringIO else: from io import StringIO key = os.environ['STEAM_API_KEY'] @contextmanager d...
nairraghav/tkinter-example
app.py
import tkinter as tk # create window root = tk.Tk() # creates a frame within our window top_frame = tk.Frame(root) top_frame.pack() bottom_frame = tk.Frame(root) bottom_frame.pack(side=tk.BOTTOM) first_buttom = tk.Button(top_frame, text='Login', fg='red') second_buttom = tk.Button(top_frame, text='Forgot Username',...
AspirinCode/Compound_Protein_Interaction_Prediction
code/preprocess_data.py
<filename>code/preprocess_data.py<gh_stars>0 from collections import defaultdict import os import pickle import sys import numpy as np from rdkit import Chem def create_atoms(mol): atoms = [atom_dict[a.GetSymbol()] for a in mol.GetAtoms()] return np.array(atoms) def create_adjacency(mol): adjacency = ...
AspirinCode/Compound_Protein_Interaction_Prediction
code/run_training.py
from collections import defaultdict import pickle import sys import timeit import numpy as np import torch import torch.nn as nn import torch.nn.functional as F import torch.optim as optim from sklearn.metrics import roc_auc_score, precision_score, recall_score class CompoundProteinInteractionPrediction(nn.Module)...
dmcomm/dmcomm-python
lib/dmcomm/hardware/barcode.py
<gh_stars>1-10 # This file is part of the DMComm project by BladeSabre. License: MIT. import array import pulseio from dmcomm import CommandError from dmcomm.protocol.barcode import ean13_lengths class BarcodeCommunicator: def __init__(self, ir_output): self._pin_output = ir_output.pin_output self._output_pulse...
dmcomm/dmcomm-python
utils/pio_asm_src.py
# This file is part of the DMComm project by BladeSabre. License: MIT. # Source code for the RP2 PIO programs, to be pre-assembled using desktop Python. # Main writes to ../lib/dmcomm/hardware/pio_programs.py . import os import adafruit_pioasm # Output to pronged devices. # Run with 1MHz clock, 2 set pins, initial_s...
dmcomm/dmcomm-python
lib/dmcomm/hardware/ic_encoding.py
START_SEQUENCE = [0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xFF,0x13,0x70,0x70] def redundancy_bits(x): "Calculates the 16 redundancy bits for 16 bits of data." result = 0x79B4 mask = 0x19D8 for i in range(16): if x & 1: result ^= mask x >>= 1 mask <<= 1 if mask >= 0x10000: mask ^= 0x10811 ...
dmcomm/dmcomm-python
lib/dmcomm/protocol/__init__.py
# This file is part of the DMComm project by BladeSabre. License: MIT. """ `dmcomm.protocol` ================= ... Note: This API is still under development and may change at any time. """ from dmcomm import CommandError def parse_command(text): parts = text.strip().upper().split("-") if len(parts[0]) >= 2: o...
dmcomm/dmcomm-python
lib/dmcomm/hardware/control.py
# This file is part of the DMComm project by BladeSabre. License: MIT. from dmcomm import CommandError from . import WAIT_REPLY from . import pins class Controller: """Main class which controls the communication. The constructor takes no parameters. """ def __init__(self): self._digirom = None self._communic...
dmcomm/dmcomm-python
lib/dmcomm/hardware/pio_programs.py
# This file is part of the DMComm project by BladeSabre. License: MIT. # Auto-generated from pio_asm_src.py - do not edit. from array import array prong_TX = array('H', [32928, 40999, 68, 10, 70, 13, 72, 16, 72, 0, 57344, 57475, 0, 57345, 57475, 0, 57472]) iC_TX = array('H', [32928, 41199, 57345, 59392, 24577, 59392...
dmcomm/dmcomm-python
lib/dmcomm/hardware/modulated.py
# This file is part of the DMComm project by BladeSabre. License: MIT. import array import pulseio from dmcomm import CommandError, ReceiveError from . import WAIT_REPLY from . import misc class ModulatedCommunicator: def __init__(self, ir_output, ir_input_modulated): self._pin_output = ir_output.pin_output sel...
dmcomm/dmcomm-python
lib/dmcomm/protocol/core16.py
<reponame>dmcomm/dmcomm-python # This file is part of the DMComm project by BladeSabre. License: MIT. """ `dmcomm.protocol.core16` ======================== Handling of 16-bit low-level protocols. Note: This API is still under development and may change at any time. """ from dmcomm import CommandError from dmcomm.pr...
dmcomm/dmcomm-python
lib/dmcomm/protocol/core_digits.py
# This file is part of the DMComm project by BladeSabre. License: MIT. """ `dmcomm.protocol.core_digits` ============================= Handling of digit sequence low-level protocols. Note: This API is still under development and may change at any time. """ from dmcomm import CommandError from dmcomm.protocol import...
dmcomm/dmcomm-python
lib/dmcomm/hardware/ic.py
# This file is part of the DMComm project by BladeSabre. License: MIT. import array import pulseio import time import rp2pio from dmcomm import ReceiveError from . import WAIT_REPLY from . import ic_encoding from . import misc from . import pio_programs class iC_Communicator: def __init__(self, ir_output, ir_input_...
dmcomm/dmcomm-python
lib/dmcomm/hardware/prongs.py
<filename>lib/dmcomm/hardware/prongs.py # This file is part of the DMComm project by BladeSabre. License: MIT. import array import digitalio import pulseio import rp2pio from dmcomm import ReceiveError from . import WAIT_REPLY from . import misc from . import pio_programs class ProngCommunicator: def __init__(self,...
dmcomm/dmcomm-python
lib/dmcomm/hardware/__init__.py
<reponame>dmcomm/dmcomm-python # This file is part of the DMComm project by BladeSabre. License: MIT. """ `dmcomm.hardware` ================= Communication with pronged and infrared Digimon toys, for CircuitPython 7 on RP2040. Note: This API is still under development and may change at any time. """ #: Value to pass...
dmcomm/dmcomm-python
lib/dmcomm/protocol/core_bytes.py
# This file is part of the DMComm project by BladeSabre. License: MIT. """ `dmcomm.protocol.core_bytes` ============================ Handling of byte-sequence low-level protocols. Note: This API is still under development and may change at any time. """ from dmcomm import CommandError from dmcomm.protocol import Ba...
dmcomm/dmcomm-python
docs/conf.py
# Configuration file for the Sphinx documentation builder. # # This file only contains a selection of the most common options. For a full # list see the documentation: # https://www.sphinx-doc.org/en/master/usage/configuration.html # -- Path setup -------------------------------------------------------------- # If e...
dmcomm/dmcomm-python
lib/dmcomm/__init__.py
<reponame>dmcomm/dmcomm-python # This file is part of the DMComm project by BladeSabre. License: MIT. """ `dmcomm` ======== Communication with Digimon toys. Note: This API is still under development and may change at any time. """ class CommandError(ValueError): """Exception raised when an incorrect command is prov...
dmcomm/dmcomm-python
code.py
# This file is part of the DMComm project by BladeSabre. License: MIT. import board import digitalio import time import usb_cdc from dmcomm import CommandError, ReceiveError import dmcomm.hardware as hw import dmcomm.protocol pins_extra_power = [board.GP11, board.GP13, board.GP18] outputs_extra_power = [] for pin in...
dmcomm/dmcomm-python
lib/dmcomm/hardware/misc.py
<reponame>dmcomm/dmcomm-python<gh_stars>1-10 # This file is part of the DMComm project by BladeSabre. License: MIT. import supervisor from . import WAIT_FOREVER # Example from https://circuitpython.readthedocs.io/en/latest/shared-bindings/supervisor/index.html _TICKS_PERIOD = 1 << 29 _TICKS_MAX = _TICKS_PERIOD - 1 _...
dmcomm/dmcomm-python
lib/dmcomm/hardware/pins.py
<reponame>dmcomm/dmcomm-python<filename>lib/dmcomm/hardware/pins.py # This file is part of the DMComm project by BladeSabre. License: MIT. class ProngOutput: """Description of the outputs for the RP2040 prong circuit. :param pin_drive_signal: The first pin to use for signal output. Note that `pin_drive_low=pin_dr...
dmcomm/dmcomm-python
lib/dmcomm/protocol/barcode.py
# This file is part of the DMComm project by BladeSabre. License: MIT. """ `dmcomm.protocol.barcode` ========================= Functions for generating EAN-13 patterns. """ # https://en.wikipedia.org/wiki/International_Article_Number _START_END = "101" _CENTRE = "01010" _CODES = { "L": ["0001101", "0011001", "00100...
ctrotz/seashell-generation
seashell.py
import math import numpy as np import matplotlib.pyplot as plt from typing import Callable from mpl_toolkits.mplot3d import Axes3D class Seashell(object): def __init__(self, r0: float, z0: float, growth: float, d_theta: float): self.__base_radius = r0 self.__base_z = z0 self.__growth_rat...
tomoki171923/selenium-ci
src/common/const.py
class _const(object): class ConstError(TypeError): pass def __setattr__(self, name, value): if name in self.__dict__: raise self.ConstError() self.__dict__[name] = value import sys sys.modules[__name__] = _const()
tomoki171923/selenium-ci
case1_sample.py
# How to execute this file # Executing the follow command. # python3 ./SchoolQuotation_case3_reservation.py -v from selenium import webdriver from selenium.webdriver.support import expected_conditions as ExpectedConditions from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.common.action_ch...
tomoki171923/selenium-ci
src/scenario/scenario.py
from selenium import webdriver from selenium.webdriver.support import expected_conditions as ExpectedConditions from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.chrome.options import Options from selenium.webdriver.support.select import Select from selenium.webdriver.common.by import By ...
tomoki171923/selenium-ci
src/common/myconst.py
<reponame>tomoki171923/selenium-ci from src.common import const as cst import platform class Myconst: #----------------------------------------------# # CHROME DRIVER #----------------------------------------------# # DRIVER PATH if 'macOS' in platform.platform(): cst.CHROME_DRIVER_PATH = '...
tomoki171923/selenium-ci
src/common/selenium.py
<reponame>tomoki171923/selenium-ci from selenium import webdriver from selenium.webdriver.support import expected_conditions as ExpectedConditions from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.chrome.options import Options from selenium.webdriver.support.select import Select from sele...
gryf/weechat-replacer
replacer.py
<filename>replacer.py # -*- coding: utf-8 -*- """ Simple replacer for substitution one keyword with some text using completion mechanism from weechat. add: add new replacement to table del: remove key from table Without any argument list of defined substitution will be displayed. Script will replace any defined keyw...
gryf/weechat-replacer
test_replacer.py
#!/usr/bin/env python # -*- coding: utf-8 -*- import sys import os import unittest from unittest import mock import tempfile class Weechat(object): """Mock weechat interface""" ACTION = '*' ERROR = '=!=' NETWORK = '--' JOIN = '-->' QUIT = '<--' WEECHAT_RC_OK = 0 WEECHAT_LIST_POS_SORT ...
SBTMLab/AIM_2021
main/sensing.py
<reponame>SBTMLab/AIM_2021 import RPi.GPIO as GPIO import spidev import time import numpy as np # 형광분석법, 마스크먼지 측정 class sensing(): def __init__(self, ultraviolet_pin:int, visible_pin:int, light_channel=0): self.ultraviolet_pin = ultraviolet_pin self.visible_pin = visible_pin self.light_chan...
SBTMLab/AIM_2021
main/main.py
from bs4 import BeautifulSoup as bs import requests import numpy as np import matplotlib.pyplot as plt import matplotlib.cm as cm import pandas as pd import cv2 from classification_model import classification_model background_color = (211, 200, 86) font_color = (255, 255, 255) model = classification_model() light_ma...
SBTMLab/AIM_2021
main/classification_model.py
from bs4 import BeautifulSoup as bs import requests import numpy as np import matplotlib.pyplot as plt import matplotlib.cm as cm import pandas as pd # dust info, KNN, visualize class classification_model(): def __init__(self): self.data = None self.reference = None self.weight = None ...
anuar12/relational_pose
lib/models/pose_resnet.py
<reponame>anuar12/relational_pose # ------------------------------------------------------------------------------ # Copyright (c) Microsoft # Licensed under the MIT License. # Written by <NAME> (<EMAIL>) # ------------------------------------------------------------------------------ from __future__ import absolute_i...
mclt0568/Discord.py-bot-system
bot_Main.py
<reponame>mclt0568/Discord.py-bot-system # Copyright (c) 2018 mclt0568 (For more information see LICENCE) import bot_config as cfg import bot_log as log import bot_check as check #Init config = cfg.init(r"C:\Users\USER\Desktop\Python Project\DISCORDBOTS2") config.initdirs() INITCFG = config.initconfig() INI...
mclt0568/Discord.py-bot-system
bot_check.py
<reponame>mclt0568/Discord.py-bot-system # Copyright (c) 2018 mclt0568 (For more information see LICENCE)
mclt0568/Discord.py-bot-system
bot_log.py
# Copyright (c) 2018 mclt0568 (For more information see LICENCE) import sys import bot_config as cfg from time import gmtime, strftime from datetime import datetime class log_option: def __init__ (self,_path): global INITCFG config = cfg.init(_path) INITCFG = config.initconfig() self.path = _path ...
hamzaalalach/casting-cap-api
src/app.py
import os import sys from flask import Flask, request, abort, jsonify from flask_sqlalchemy import SQLAlchemy from flask_cors import CORS # To be able to recognize relative imports sys.path.append(os.path.dirname(os.path.realpath(__file__))) from models import setup_db, create_all, Actor, Movie from auth import AuthE...
hamzaalalach/casting-cap-api
src/test_app.py
<reponame>hamzaalalach/casting-cap-api<filename>src/test_app.py<gh_stars>0 import unittest import json import os from flask_sqlalchemy import SQLAlchemy from app import create_app from models import setup_db, Movie, Actor def get_last_element_id(element): elements = element.query.order_by('id').all() return...
anbclausen/hacktoberfest
WebsiteBlocker.py
import time from datetime import datetime as dt hosts_path = r"C:\Windows\System32\drivers\etc\hosts" hosts_temp = "hosts" redirect = "127.0.0.1" web_sites_list = ["www.google.com", "google.com"] #here add any website for block while True: if dt(dt.now().year, dt.now().month, dt.now().day, 9) < dt.now() < dt(dt.n...