repo_name
stringlengths
6
97
path
stringlengths
3
341
text
stringlengths
8
1.02M
malina-molodchina/letoproject
nobelevka.py
import pandas as pd import numpy as np import matplotlib.pyplot as plt import streamlit as st import time import seaborn as sns import squarify import pycountry import geopandas import plotly.graph_objects as go from PIL import Image from wordcloud import WordCloud, STOPWORDS,ImageColorGenerator st.title("Nobelevo4k...
malina-molodchina/letoproject
a.py
from operator import itemgetter import datetime import plotly.graph_objects as go import plotly.express as px from plotly.offline import download_plotlyjs, init_notebook_mode, plot, iplot init_notebook_mode(connected=False) def main(): df = pd.read_csv('./country_vaccinations.csv') datum = df.groupby('dat...
ojuba-org/ojuba-virtual-cd
setup.py
#! /usr/bin/python import sys, os, os.path from distutils.core import setup from glob import glob # to install type: # python setup.py install --root=/ def no_empty(l): return filter(lambda (i,j): j, l) def recusive_data_dir(to, src, l=None): D=glob(os.path.join(src,'*')) files=filter( lambda i: os.path...
ojuba-org/ojuba-virtual-cd
OjubaVirtualCD.py
<gh_stars>0 # -*- coding: UTF-8 -*- # -*- Mode: Python; py-indent-offset: 4 -*- """ Ojuba Virtual CD Copyright © 2011, <NAME> <<EMAIL>> PyGtk+ front-end for fuseiso Released under terms of Waqf Public License. This program is free software; you can redistribute it and/or modify it under the te...
mbarkhau/pylev
tests.py
<gh_stars>0 import itertools import unittest import pylev test_data = [ ('classic', "kitten", "sitting", 3), ('same', "kitten", "kitten", 0), ('empty', "", "", 0), ('a', "meilenstein", "levenshtein", 4), ('b', "levenshtein", "frankenstein", 6), ('c', "confide", "deceit", 6), ('d', "CUNsperr...
mbarkhau/pylev
pylev.py
<reponame>mbarkhau/pylev<gh_stars>1-10 """ pylev ===== A pure Python Levenshtein implementation that's not freaking GPL'd. Based off the Wikipedia code samples at http://en.wikipedia.org/wiki/Levenshtein_distance. Usage ----- Usage is fairly straightforward.:: import pylev distance = pylev.levenshtein('kit...
mbarkhau/pylev
setup.py
import os try: from setuptools import setup except ImportError: from distutils.core import setup setup( name='pylev', version='1.3.0', description="A pure Python Levenshtein implementation that's not freaking GPL'd.", author='<NAME>', author_email='<EMAIL>', long_description=open(os.pa...
dvsu/image-manipulation
main.py
#!/usr/bin/python3 import os from PIL import Image class ImageManipulation: def __init__(self, source_dir: str, output_dir: str, target_extension: str): self.__source_dir = source_dir self.__output_dir = output_dir self.__target_extension = target_extension self.__recognized_exte...
yokoyama-minami/toggl-to-kosu_sheet
toggleToKosu.py
import pandas as pd import datetime as dt # Toggl-report.csv 読み込み df = pd.read_csv('Toggl-report.csv', sep=',') # 必要なデータの変数定義 date = (df['Start date']) time = (df['Duration']) description = (df['Description']) division = (df['Tags']) replace_date = date.str.replace('-', '/') split_time = time.str.split(':') hr = [] m...
Detry322/map-creator
app/models/best_dcgan.py
from keras.models import Sequential, load_model from keras.layers import Dense, Reshape, Flatten, Conv2D, Conv2DTranspose, BatchNormalization, Activation from keras.layers.advanced_activations import LeakyReLU from keras.optimizers import Adam, SGD from keras.backend import clear_session import numpy as np import os i...
Detry322/map-creator
app/data.py
import os, glob import numpy as np import random from scipy import misc from app import OUTPUT_TILES_FOLDER class ZoomLoader(object): def __init__(self, zoom): self.files = glob.glob(os.path.join(OUTPUT_TILES_FOLDER, str(zoom), '*', '*.png')) self.i = -1 def __iter__(self): return self def __len__...
Detry322/map-creator
app/download.py
import os, requests, subprocess, tempfile, math, glob from PIL import Image from app import CITIES, INPUT_TILES_FOLDER, TILE_DOWNLOADER MAX_TILES_PER_CITY = 5000 TILE_SERVER = "OpenCycleMap" MAP_API_BASE = 'http://maps.googleapis.com/maps/api/geocode/json' XML_BASE = """<?xml version="1.0" encoding="UTF-8"?> <!DOC...
Detry322/map-creator
app/generate.py
<filename>app/generate.py from app.models import all_models from app.utils import mkdir_p from app import GENERATED_TILES_FOLDER from scipy import misc import os import time def generate_tiles(model_type, model_file): ModelClass = all_models[model_type] model = ModelClass(None, None, model_file=model_file) fo...
Detry322/map-creator
app/__main__.py
import argparse import logging logging.basicConfig(level=logging.INFO) import numpy as np np.random.seed(234421) from app.data import ZoomLoader from app.download import download_tiles, prune_tiles from app.preprocess import preprocess_tiles from app.train import train_model from app.generate import generate_tiles fr...
Detry322/map-creator
app/models/autoencoder.py
from keras.models import Sequential from keras.callbacks import ModelCheckpoint from keras.layers import Dense, Reshape, Flatten from keras.layers.advanced_activations import LeakyReLU from keras.layers.normalization import BatchNormalization from keras.layers.convolutional import UpSampling2D, Convolution2D, MaxPoolin...
Detry322/map-creator
app/models/basic_dcgan.py
from keras.models import Sequential, load_model from keras.layers import Dense, Reshape, Flatten from keras.layers.advanced_activations import LeakyReLU from keras.layers.normalization import BatchNormalization from keras.layers.convolutional import UpSampling2D, Convolution2D, MaxPooling2D from keras.layers.core impor...
Detry322/map-creator
app/models/base.py
class BaseModel(object): def __init__(self, image_size, image_loader, model_file=None): self.model = None self.image_size = image_size self.image_loader = image_loader if model_file is not None: self._construct_from_file(model_file) else: self._construct_model() def _construct_from...
Detry322/map-creator
app/preprocess.py
import os, glob import numpy as np from scipy import misc from app import INPUT_TILES_FOLDER, OUTPUT_TILES_FOLDER from app.utils import mkdir_p def greyscale(img, *args): return img.mean(axis=2) def resize(img, *args): p = float(args[0]) if len(args) > 0 else .5 return misc.imresize(img, p, interp='lanczos') ...
Detry322/map-creator
app/train.py
from app.data import ZoomLoader from app.models import all_models def train_model(model_type, zoom_level, model_file=None): ModelClass = all_models[model_type] loader = ZoomLoader(zoom_level) image_size = loader.random().shape model = ModelClass(image_size, loader, model_file=model_file) model.train()
Detry322/map-creator
app/backprop.py
from app.models import all_models from app.utils import mkdir_p from app import GENERATED_TILES_FOLDER from scipy import misc import glob import numpy as np import os from keras.models import load_model, Model from keras.optimizers import Adam, SGD, Adagrad from keras.layers import LocallyConnected1D, Input, Reshape ...
Detry322/map-creator
app/random.py
from app.models import all_models from app.utils import mkdir_p from app import GENERATED_TILES_FOLDER, RANDOM_FOLDER, BACKPROPS_FOLDER from scipy import misc import glob import numpy as np import os from keras.models import load_model, Model from keras.optimizers import Adam, SGD, Adagrad from keras.layers import Lo...
Detry322/map-creator
app/__init__.py
<reponame>Detry322/map-creator import os BASE_FOLDER = os.path.abspath(os.path.join(os.path.dirname(__file__), os.pardir)) INPUT_TILES_FOLDER = os.path.join(BASE_FOLDER, 'input_tiles') OUTPUT_TILES_FOLDER = os.path.join(BASE_FOLDER, 'output_tiles') BACKPROPS_FOLDER = os.path.join(BASE_FOLDER, 'backprops') FORWARDPROPS...
Detry322/map-creator
app/models/__init__.py
from app.models.basic_dcgan import BasicDCGAN from app.models.better_dcgan import BetterDCGAN from app.models.best_dcgan import BestDCGAN from app.models.autoencoder import Autoencoder all_models = { 'BasicDCGAN': BasicDCGAN, 'Autoencoder': Autoencoder, 'BetterDCGAN': BetterDCGAN, 'BestDCGAN': BestDCGAN }
Detry322/map-creator
app/forwardprop.py
from app.models import all_models from app.utils import mkdir_p from app import GENERATED_TILES_FOLDER from scipy import misc import glob import numpy as np import os from keras.models import load_model, Model from keras.optimizers import Adam, SGD, Adagrad from keras.layers import LocallyConnected1D, Input, Reshape ...
sanzoghenzo/poetry2conda
poetry2conda/convert.py
import argparse import contextlib import pathlib import sys from datetime import datetime from typing import Mapping, TextIO, Tuple, Iterable, Optional import semver import toml from poetry2conda import __version__ def convert( file: TextIO, include_dev: bool = False, extras: Optional[Iterable[str]] = None ) ->...
sanzoghenzo/poetry2conda
tests/test_example.py
<filename>tests/test_example.py import io import yaml from poetry2conda.convert import main # foo, bar, baz, qux, quux, quuz, corge, grault, garply, waldo, fred, plugh, xyzzy, and thud; SAMPLE_TOML = """\ [tool.poetry] name = "bibimbap" version = "1.2.3" description = "Delicious korean food" authors = ["<NAME> <<EM...
sanzoghenzo/poetry2conda
poetry2conda/__init__.py
# Note the version managed by bump2version. # Do not change it manually here, use bump2version to change it. __version__ = "0.3.0"
Shopzilla-Ops/gitlab-jenkins-connector
gitlabjenkinsweb/gitlabjenkinsweb.py
<filename>gitlabjenkinsweb/gitlabjenkinsweb.py #!/usr/bin/env python # * Copyright 2014 Shopzilla.com # * # * 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/li...
Shopzilla-Ops/gitlab-jenkins-connector
gitlabjenkins/szgitlab.py
# * Copyright 2014 Shopzilla.com # * # * Licensed under the Apache License, Version 2.0 (the "License"); # * you may not use this file except in compliance with the License. # * You may obtain a copy of the License at # * # * http://www.apache.org/licenses/LICENSE-2.0 # * # * Unless required by applicable law or agreed...
Shopzilla-Ops/gitlab-jenkins-connector
gitlabjenkins/jenkins.py
# * Copyright 2014 Shopzilla.com # * # * Licensed under the Apache License, Version 2.0 (the "License"); # * you may not use this file except in compliance with the License. # * You may obtain a copy of the License at # * # * http://www.apache.org/licenses/LICENSE-2.0 # * # * Unless required by applicable law or agreed...
Shopzilla-Ops/gitlab-jenkins-connector
gitlabjenkins/basehandler.py
<reponame>Shopzilla-Ops/gitlab-jenkins-connector # * Copyright 2014 Shopzilla.com # * # * 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 # ...
ArtellaPipe/artellapipe-tools-bugtracker
tests/test_general.py
#! /usr/bin/env python # -*- coding: utf-8 -*- """ Module that contains tests for artellapipe-tools-bugtracker """ import pytest from artellapipe.tools.bugtracker import __version__ def test_version(): assert __version__.get_version()
ArtellaPipe/artellapipe-tools-bugtracker
artellapipe/tools/bugtracker/core/bugtracker.py
<gh_stars>0 #!/usr/bin/env python # -*- coding: utf-8 -*- """ Tool to handle bugs and requests for the different tools of the pipeline """ from __future__ import print_function, division, absolute_import __author__ = "<NAME>" __license__ = "MIT" __maintainer__ = "<NAME>" __email__ = "<EMAIL>" from artellapipe.core ...
ArtellaPipe/artellapipe-tools-bugtracker
artellapipe/tools/bugtracker/widgets/bugtracker.py
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Tool that allows to detect errors and trace calls and easily them to TDs """ from __future__ import print_function, division, absolute_import __author__ = "<NAME>" __license__ = "MIT" __maintainer__ = "<NAME>" __email__ = "<EMAIL>" import os import sys import getpas...
gregoiredervaux/face_recognition
apps/train_new_face.py
<filename>apps/train_new_face.py<gh_stars>0 import cv2 import numpy as np from models import face_track_server, face_describer_server, nn, camera_server, dataloader from configs import configs import os import sys ''' The demo app utilize all servers in model folder with simple business scenario/logics: I have a camer...
gregoiredervaux/face_recognition
apps/train_init.py
import numpy as np from models import face_describer_server, nn, dataloader, face_track_server from configs import configs ''' the module is used to build the initial model and to save the initial ''' if __name__ == '__main__': face_describer = face_describer_server.FDServer( model_fp=configs.face_descr...
gregoiredervaux/face_recognition
configs/configs.py
<reponame>gregoiredervaux/face_recognition import os BASE_PATH = '/'.join(os.getcwd().split('/')[:-1]) # Using ubuntu machine may require removing this -1 face_describer_input_tensor_names = ['img_inputs:0', 'dropout_rate:0'] face_describer_output_tensor_names = ['resnet_v1_50/E_BN2/Identity:0'] face_describer_device ...
gregoiredervaux/face_recognition
models/nn.py
<filename>models/nn.py ''' A dummy db storaing faces in memory Feel free to make it fancier like hooking with postgres or whatever This model here is just for simple demo app under apps Don't use it for production dude. ''' import numpy as np import keras import tensorflow as tf import matplotlib.pyplot as plt class Mo...
gregoiredervaux/face_recognition
apps/face_recognition_.py
<filename>apps/face_recognition_.py<gh_stars>0 import cv2 import numpy as np from models import face_track_server, face_describer_server, nn, camera_server from configs import configs ''' The demo app utilize all servers in model folder with simple business scenario/logics: I have a camera product and I need to use it...
gregoiredervaux/face_recognition
models/face_track_server.py
<gh_stars>0 import cv2 from faced import FaceDetector from faced.utils import annotate_image ''' This server: Input: Camera frame Output: Relative locations for each face, with [(tr_x, tr_y, bl_x, bl_y)] x1,y1 ------ | | | | | | --------x2,y2 ''' class FaceTrackServer(object): ...
gregoiredervaux/face_recognition
models/dataloader.py
<filename>models/dataloader.py import numpy as np import cv2 from configs import configs import os from keras.preprocessing.image import ImageDataGenerator import json from models import face_track_server class DataLoader: def __init__(self, face_describer): self.face_describer = face_describer se...
DavidTorresOcana/pointcloud_streamer
app.py
<gh_stars>10-100 ## (c) 2020 <NAME> ## This code is licensed under MIT license (see LICENSE.txt for details) from flask import Flask, render_template import argparse from matplotlib import cm from flask_socketio import SocketIO, emit import time import threading import pykitti import itertools from utils import * # A...
DavidTorresOcana/pointcloud_streamer
utils.py
import numpy as np def get_skew_sample_idx(num_samples, velo_vertical_channel_shuffle): ''' Generate non-uniform Velodyne HDL-64 Poincloud sampling idxs''' H_velo = int(132864/64) # 132864 is aprox the maximum points for a Velodyne HDL-64 uniform_probs = np.random.uniform(0,1,(64,H_velo)) x = np.linsp...
prakash218/Advanced-Invoice-generator
dependencies/__edit__address__.pyw
from tkinter import * from tkinter import messagebox from xlrd import open_workbook import openpyxl import runpy from os import path def close(): window.destroy() basepath = path.dirname(__file__) filepath = path.abspath(path.join(basepath, "..", "__invoice__generator__.pyw")) file_g...
prakash218/Advanced-Invoice-generator
__invoice__generator__.pyw
import time t1 = time.time() from tkinter import * from tkinter import messagebox from tkcalendar import Calendar,DateEntry import shutil from time import localtime,strftime from xlrd import open_workbook from num2words import num2words import openpyxl from warnings import filterwarnings import runpy bl...
prakash218/Advanced-Invoice-generator
dependencies/__list__.pyw
<reponame>prakash218/Advanced-Invoice-generator<filename>dependencies/__list__.pyw from tkinter import * from tkinter import messagebox import openpyxl from xlrd import open_workbook import runpy from os import path global items,item,no,inputval,flag flag = 0 def setval(n = 5): global flag flag = ...
prakash218/Advanced-Invoice-generator
dependencies/__yes__or__no__.pyw
from tkinter import * from tkinter import messagebox import sys from xlrd import open_workbook import openpyxl import warnings from os import path import runpy def save(write): Label(text = 'YES ',bg = '#00bfff',fg = '#00bfff').place(x = 160,y = 330,height = 40) ...
prakash218/Advanced-Invoice-generator
dependencies/__search__.pyw
from tkinter import * from xlrd import open_workbook import sys from tkinter import messagebox from os import path import runpy blue = "#4d4dff" lblue = '#00bfff' global root def submit(num = 5): # scrollbar = Scrollbar(search) # scrollbar.grid(row = 0, column = 1,stick = 'ns') # text = 'invoice ...
prakash218/Advanced-Invoice-generator
__save__details.py
<filename>__save__details.py import glob import openpyxl from xlrd import open_workbook from warnings import filterwarnings filterwarnings("ignore", category=DeprecationWarning) while(1): try: start = int(input("Enter the Starting invoice number:")) break except: continue while(1): try: end = in...
prakash218/Advanced-Invoice-generator
dependencies/__delete__.pyw
<gh_stars>0 from tkinter import * from tkinter import messagebox import sys from xlrd import open_workbook import openpyxl import warnings from os import path from os import remove import runpy global passw,attempt,flag,password1,inv_no,root flag = 1 attempt = 0 def main(): global root globa...
jrblevin/scicomp
stat/ou_sim.py
<filename>stat/ou_sim.py<gh_stars>1-10 # ou_sim.py # # Simulates an Ornstein-Uhlenbeck process. # # <NAME> <<EMAIL>> # Durham, March 24, 2008 09:16 EDT import numpy from numpy import exp, sqrt def ou_sim(T, sigma=1.0, eta=1.0, mu=0.0): """Ornstein-Uhlenbeck Simulator Parameters ---------- T -- numbe...
jrblevin/scicomp
stat/fast_sampling.py
<filename>stat/fast_sampling.py import numpy import scipy def fast_sample(w, M, u): """Generates a sample of size M of integers with weights given by w. Parameters ---------- w : array_like A vector of real weights corresponding to each of the integers ``0`` to ``(w.size - 1)``. T...
jrblevin/scicomp
stat/ou_gdp.py
# ou-gdp.py # # Estimates an Ornstein-Uhlenbeck process using data on U.S. GDP. # # <NAME> <<EMAIL>> # Durham, March 24, 2008 09:02 EDT from numpy import * from scipy import stats, optimize from pylab import * def prt(x): print "theta = %f\t%f" % (x[0], x[1]) ## Log-likelihood function def log_likelihood(theta,...
sidneyfilho/capture_request_pyshark
tests/test.py
import pyshark def print_live_notafiscal(): capture = pyshark.LiveCapture("Ethernet", display_filter="http") for packet in capture: # if hasattr(packet, 'host'): # if "livingpharma.com.br" in packet.http.host: # print(str(packet.http.file_data)) if hasattr(packet.http, 'host'): if "webservice.correios...
pdalba/retro
planet_atmosphere.py
""" Name ---- planet_atmosphere.py Description ----------- RETrO: Refraction in Exoplanet Transit Observations This script contains the functions that determine the properties of the planetary atmos- phere. Each function is called from shoulder.py at different times. Right now, the atmosphere is set up as desribed ...
pdalba/retro
planet_mass_radius.py
<filename>planet_mass_radius.py<gh_stars>1-10 """ Name ---- planet_mass_radius.py Description ----------- RETrO: Refraction in Exoplanet Transit Observations This script returns the radius (z_ref) of a planet give its mass. The default is to rely only the Chen & Kipping (2017) mass-radius relation, but the user can i...
pdalba/retro
shoulder_visualization.py
<reponame>pdalba/retro """ Name ---- shoulder_visualization.py Description ----------- RETrO: Refraction in Exoplanet Transit Observations This script creates several plots to visualize the output of the shoulder.py. It can work on a single run or multiple runs (in a loop, where the figures close after each). Input...
pdalba/retro
shoulder.py
""" Name ---- shoulder.py Description ----------- RETrO: Refraction in Exoplanet Transit Observations This script models the secondary stellar image in an exoplanetary atmosphere due to refraction as a function of the angle the planet sweeps out in orbit from mid-transit. This therefore simulates the full structure ...
pdalba/retro
retro_rk4.py
<gh_stars>1-10 """ Name ---- retro_rk4.py Description ----------- RETrO: Refraction in Exoplanet Transit Observations This script contains the RK4 integration scheme for the ray tracing portion of RETrO. It utilizes many of the funcitons from the planet atmosphere module. For the optical depth, it only uses a const...
12MegaA21/LG-FedAvg
models/Update.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # Python version: 3.6 import torch from torch import nn from torch.utils.data import DataLoader, Dataset from tqdm import tqdm import math import pdb class DatasetSplit(Dataset): def __init__(self, dataset, idxs): self.dataset = dataset self.idxs = lis...
npmccord/LyricsGenius
lyricsgenius/artist.py
import json, os class Artist(object): """An artist from the Genius.com database. Attributes: name: (str) Artist name. num_songs: (int) Total number of songs listed on Genius.com """ def __init__(self, json_dict): """Populate the Artist obje...
npmccord/LyricsGenius
lyricsgenius/__main__.py
# Command line usage: # $python3 -m lyricsgenius --search-song 'Begin Again' '<NAME>' # $python3 -m lyricsgenius --search-artist '<NAME>' 3 import sys import os import lyricsgenius as genius def main(args=None): if args is None: args = sys.argv[1:] client_access_token = os.environ.get("GEN...
npmccord/LyricsGenius
tests/test_genius.py
<reponame>npmccord/LyricsGenius<filename>tests/test_genius.py<gh_stars>0 import os import unittest import lyricsgenius from lyricsgenius.song import Song from lyricsgenius.artist import Artist # Import client access token from environment variable client_access_token = os.environ.get("GENIUS_CLIENT_ACCESS_TOKEN", None...
npmccord/LyricsGenius
lyricsgenius/api.py
<reponame>npmccord/LyricsGenius # Usage: # import genius # api = genius.Genius('my_client_access_token_here') # artist = api.search_artist('<NAME>', max_songs=5) # print(artist) # # song = api.search_song('To You', artist.name) # artist.add_song(song) # print(artist) # print(artist.songs[-1]) ...
MadhaviRockandla/Py-BasicStats
statzcw/stats.py
from typing import List import math def zcount(list: List[float]) -> float: return len(list) def zmean(list: List[float]) -> float: return sum(list) / zcount(list) def zmode(list: List[float]) -> float: return max(set(list), key=list.count) def zmedian(list: List[float]) -> float: sorted_list = ...
mriedem/qiskit-experiments
qiskit_experiments/library/characterization/cr_hamiltonian.py
# This code is part of Qiskit. # # (C) Copyright IBM 2021. # # This code is licensed under the Apache License, Version 2.0. You may # obtain a copy of this license in the LICENSE.txt file in the root directory # of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. # # Any modifications or derivative wo...
mriedem/qiskit-experiments
qiskit_experiments/test/utils.py
<gh_stars>1-10 # This code is part of Qiskit. # # (C) Copyright IBM 2021. # # This code is licensed under the Apache License, Version 2.0. You may # obtain a copy of this license in the LICENSE.txt file in the root directory # of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. # # Any modifications o...
mriedem/qiskit-experiments
test/base.py
# This code is part of Qiskit. # # (C) Copyright IBM 2021. # # This code is licensed under the Apache License, Version 2.0. You may # obtain a copy of this license in the LICENSE.txt file in the root directory # of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. # # Any modifications or derivative wo...
mriedem/qiskit-experiments
qiskit_experiments/framework/composite/composite_experiment.py
<reponame>mriedem/qiskit-experiments # This code is part of Qiskit. # # (C) Copyright IBM 2021. # # This code is licensed under the Apache License, Version 2.0. You may # obtain a copy of this license in the LICENSE.txt file in the root directory # of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. #...
mriedem/qiskit-experiments
qiskit_experiments/curve_analysis/visualization/fit_result_plotters.py
<filename>qiskit_experiments/curve_analysis/visualization/fit_result_plotters.py # This code is part of Qiskit. # # (C) Copyright IBM 2021. # # This code is licensed under the Apache License, Version 2.0. You may # obtain a copy of this license in the LICENSE.txt file in the root directory # of this source tree or at h...
mriedem/qiskit-experiments
qiskit_experiments/test/t2hahn_backend.py
<reponame>mriedem/qiskit-experiments<gh_stars>1-10 # This code is part of Qiskit. # # (C) Copyright IBM 2022. # # This code is licensed under the Apache License, Version 2.0. You may # obtain a copy of this license in the LICENSE.txt file in the root directory # of this source tree or at http://www.apache.org/licenses/...
mriedem/qiskit-experiments
qiskit_experiments/library/tomography/fitters/cvxpy_lstsq.py
<reponame>mriedem/qiskit-experiments<filename>qiskit_experiments/library/tomography/fitters/cvxpy_lstsq.py # This code is part of Qiskit. # # (C) Copyright IBM 2021. # # This code is licensed under the Apache License, Version 2.0. You may # obtain a copy of this license in the LICENSE.txt file in the root directory # o...
mriedem/qiskit-experiments
qiskit_experiments/library/tomography/basis/base_basis.py
<filename>qiskit_experiments/library/tomography/basis/base_basis.py # This code is part of Qiskit. # # (C) Copyright IBM 2021. # # This code is licensed under the Apache License, Version 2.0. You may # obtain a copy of this license in the LICENSE.txt file in the root directory # of this source tree or at http://www.apa...
mriedem/qiskit-experiments
test/test_tphi.py
<filename>test/test_tphi.py # This code is part of Qiskit. # # (C) Copyright IBM 2021, 2022. # # This code is licensed under the Apache License, Version 2.0. You may # obtain a copy of this license in the LICENSE.txt file in the root directory # of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. # # ...
mriedem/qiskit-experiments
qiskit_experiments/framework/__init__.py
<reponame>mriedem/qiskit-experiments # This code is part of Qiskit. # # (C) Copyright IBM 2021. # # This code is licensed under the Apache License, Version 2.0. You may # obtain a copy of this license in the LICENSE.txt file in the root directory # of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. #...
mriedem/qiskit-experiments
qiskit_experiments/calibration_management/control_channel_map.py
<reponame>mriedem/qiskit-experiments # This code is part of Qiskit. # # (C) Copyright IBM 2022. # # This code is licensed under the Apache License, Version 2.0. You may # obtain a copy of this license in the LICENSE.txt file in the root directory # of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. #...
mriedem/qiskit-experiments
qiskit_experiments/test/tphi_backend.py
<filename>qiskit_experiments/test/tphi_backend.py # This code is part of Qiskit. # # (C) Copyright IBM 2021, 2022. # # This code is licensed under the Apache License, Version 2.0. You may # obtain a copy of this license in the LICENSE.txt file in the root directory # of this source tree or at http://www.apache.org/lice...
AsherManangan/beginner-projects
beginner-projects-solutions/pythagoreantriple.py
<filename>beginner-projects-solutions/pythagoreantriple.py a = int(input ("Enter side A: ")) b = int (input ("Enter side B: ")) c = int (input ("Enter the size of the hypotenuse: ")) C = c * c print (" \n") if (C == ((a*a)+(b*b))): print ("Pythagorean Triple") else: print ("Not a Pythagorean Triple")
AsherManangan/beginner-projects
beginner-projects-solutions/99Bottles.py
print("Lyrics of the Song 99 Bottles of Beer") bottlecount = int(99) confirm = int (1) i = bottlecount while(i>1): print(f"{bottlecount} bottles of beer on the wall, {bottlecount} bottles of beer. \n") bottlecount=bottlecount-1 i-=1 print(f"Take one down and pass it around, {bottlecount} bottles of beer...
AsherManangan/beginner-projects
beginner-projects-solutions/Fibonacci.py
<reponame>AsherManangan/beginner-projects upto = int(input("How many terms? ")) first = 0 second = 1 i = 2 print(f"Fibonacci Sequence up to {upto}th term: ") print(first) print(second) while (i<=upto): fib = first + second print(fib) first = second second = fib i = i+1
AsherManangan/beginner-projects
beginner-projects-solutions/ArmstrongNumber.py
<gh_stars>1-10 number = int (input ("Enter a number: ")) tempNumber = number sum = 0 while (number > 0): mod = int(number % 10) sum = int(sum + (mod*mod*mod)) number = int(number / 10) print (sum) if (tempNumber == sum): print(f"{tempNumber} is an Armstrong Number") else : print(f"{tempNumber} is n...
prefpkg21/DAMM-arm
scripts/opencr_control.py
<reponame>prefpkg21/DAMM-arm #!/usr/bin/env python import rospy import time from sensor_msgs.msg import Joy from std_msgs.msg import Float32MultiArray, MultiArrayDimension from damm_msgs.msg import Servos, Light move_strength0 = 300 move_strength1 = 100 move_strength_linear = 1.0 DXL0_ID = 1 DXL0_MIN = 730 DXL0_MAX ...
prefpkg21/DAMM-arm
scripts/control_arm.py
<reponame>prefpkg21/DAMM-arm<filename>scripts/control_arm.py #!/usr/bin/env python import rospy import RPi.GPIO as GPIO import time from sensor_msgs.msg import Joy #from dynamixel_workbench_toolbox import dynamixel_workbench from dynamixel_workbench_msgs.srv import DynamixelCommand from dynamixel_workbench_msgs.msg imp...
by09115/Flask-URLshortener
Tests/get_url_test.py
<reponame>by09115/Flask-URLshortener<filename>Tests/get_url_test.py from Tests import TestCaseBase, check_status_code class GetUrlTest(TestCaseBase): def setUp(self): super(GetUrlTest, self).setUp() self.short_url = self.save_url_request() @check_status_code(302) def test_success_get_url...
by09115/Flask-URLshortener
Tests/save_url_test.py
from Tests import TestCaseBase, check_status_code class SaveUrlTest(TestCaseBase): @check_status_code(201) def test_success_save_url(self): rv = self.save_url_request() self.assertEqual(rv.json['url'], 'http://lovalhost/b') return rv @check_status_code(201) def test_exist_url...
by09115/Flask-URLshortener
Tests/__init__.py
<filename>Tests/__init__.py from functools import wraps from unittest import TestCase from Server.app import create_app from mongoengine import connect from mongoengine.connection import _get_db class TestCaseBase(TestCase): def setUp(self): self.app = create_app() self.client = self.app.test_cl...
by09115/Flask-URLshortener
Server/view.py
<reponame>by09115/Flask-URLshortener<gh_stars>1-10 from flask import request, redirect, Response, current_app from flask_restful import Resource from Server.model import URLModel from base62 import encode, decode class URLHandling(Resource): def get(self, input_url): data = URLModel.objects(link=encode(...
by09115/Flask-URLshortener
Server/model.py
from mongoengine import * from datetime import datetime class URLModel(Document): id = IntField(primary_key=True) link = StringField(required=True) generated_date = DateTimeField(default=datetime.utcnow)
by09115/Flask-URLshortener
Server/config.py
class Config: JSON_AS_ASCII = False MONGODB_URI = 'mongodb://altasAdmin:<EMAIL>/test?retryWrites=true'
by09115/Flask-URLshortener
Server/app.py
from flask import Flask, current_app from flask_restful import Api from mongoengine import connect from Server.config import Config def create_app(): app = Flask(__name__) api = Api(app) app.config.from_object(Config) connect(current_app.config['MONGODB_URI']) from Server.view import URLHandlin...
codedsk/hubzero-tool-spiro-flask-1
www/app/views.py
from __future__ import print_function import numpy as np import sys from app import app from flask import render_template, jsonify from flask_wtf import FlaskForm from wtforms import IntegerField from wtforms.validators import DataRequired, NumberRange def debug(*args, **kwargs): print(*args, file=sys.stderr, *...
codedsk/hubzero-tool-spiro-flask-1
www/app/__init__.py
<reponame>codedsk/hubzero-tool-spiro-flask-1 from flask import Flask # Initialize the app app = Flask(__name__, instance_relative_config=True) # Load the views from app import views # Load the config file app.config.from_object('config') # set a secret key for sessions app.secret_key = '<KEY>'
724432436/Login_SYS
login/forms.py
<gh_stars>0 from django import forms from captcha.fields import CaptchaField class UserForm(forms.Form): username = forms.CharField(label='用户名',max_length=128,widget=forms.TextInput(attrs={'class': 'form-control'})) password = forms.CharField(label='密码',max_length=256,widget=forms.PasswordInput(attrs={'class': ...
koukyo1994/streamlit-audio
components/augmentation.py
import librosa import numpy as np import streamlit as st class AudioTransform: def __init__(self, always_apply=False, p=0.5): self.always_apply = always_apply self.p = p def __call__(self, y: np.ndarray): if self.always_apply: return self.apply(y) else: ...
koukyo1994/streamlit-audio
utils/__init__.py
<gh_stars>1-10 from .io import check_folder, check_audio_info, display_media_audio, read_audio, display_media_audio_from_ndarray, read_csv
koukyo1994/streamlit-audio
components/preprocessing.py
<filename>components/preprocessing.py import nussl import numpy as np import streamlit as st import pyroomacoustics as pra from scipy import signal def butterworth_filter(y: np.ndarray, sr: int, N: int, cutoff=500., btype="lo...
koukyo1994/streamlit-audio
main.py
import pandas as pd import streamlit as st import components as C import utils if __name__ == "__main__": st.title("Audio Checking Tool") base_folder = st.text_input("specify directory which contains audio file") tp = pd.read_csv("../input/train_tp.csv") fp = pd.read_csv("../input/train_fp.csv") ...
koukyo1994/streamlit-audio
utils/io.py
import audioread import io import tempfile import struct import wave import librosa import numpy as np import pandas as pd import streamlit as st from pathlib import Path from typing import Optional @st.cache def read_csv(uploaded_file): df = pd.read_csv(uploaded_file) return df @st.cache def read_audio(p...
koukyo1994/streamlit-audio
components/plots.py
<reponame>koukyo1994/streamlit-audio import librosa import librosa.display as display import matplotlib.pyplot as plt import matplotlib.patches as patches import numpy as np import pandas as pd import streamlit as st def waveplot(y: np.ndarray, sr: int, processed=None, tp: pd.DataFrame=None, fp: pd.DataFrame=None): ...
koukyo1994/streamlit-audio
components/base.py
<reponame>koukyo1994/streamlit-audio import streamlit as st from pathlib import Path def write_audio_info_to_sidebar(path: Path, info: dict): filename = path.name st.sidebar.subheader(f"Audio file: {filename}") st.sidebar.markdown("#### Basic info") for key, value in info.items(): st.sidebar...