content stringlengths 5 1.05M |
|---|
import speech_recognition as sr
import os
import windowsapps
import requests
import json
def start(param):
param = param.strip()
param = param.lower()
try:
windowsapps.open_app(param)
response = 'Starting Application '+ param
print(response)
return response
except:
... |
# Exercício 5.13 - Escreva um programa que pergunte o valor inicial de uma dívida e
# o juro mensal. Pergunte também o valor mensal que será pago. Imprima o número
# de meses para que a dívida seja paga, o total pago e o total de juros pago.
divida = float(input('\nInforme o valor da dívida: R$'))
juros = float(input(... |
# Сумма последовательности
def sum_of_sequence(n):
m = n
if m != 0:
m = int(input())
return n + sum_of_sequence(m)
return n
if __name__ == '__main__':
n = int(input())
print(sum_of_sequence(n))
|
import logging
from datetime import datetime
from sqlalchemy.orm import aliased
from aleph.util import PairwiseDict
from aleph.core import db
from aleph.model import Collection, EntitySet, EntitySetItem, Judgement
log = logging.getLogger(__name__)
def collection_profiles(collection_id, judgements=None, deleted=Fals... |
class GeneralIndex:
def __init__(self):
self.__KeyToNode = {}
self.__NodeToKey = {}
def clear(self):
self.__KeyToNode = {}
self.__NodeToKey = {}
def add_node(self, key, node):
"""
Adds node associated with a key. This method ensures that a key already
... |
# -*- coding: utf-8 -*-
"""This script looks up folders in a given directory,
chooses folders and files that follow our old naming conventions,
and renames them with the new convention."""
import os
import os.path as op
do_subfolders=True
# get and sort all the folders from a directory
# parent_dir = '/storage/ana... |
from vtil import *
def on_block(bbl: BasicBlock) -> TaggedOrder:
print(bbl)
return Enumerator.obreak
def main():
rtn = Routine.load('hello_world.vtil')
rtn.for_each(on_block, tagged=False)
rtn.for_each(on_block, tagged=True)
if __name__ == '__main__':
main()
|
from html.parser import HTMLParser
contenthtml=''
def _attr(attrlist, attrname):
for attr in attrlist:
if attr[0] == attrname:
return attr[1]
return None
class MyHTMLParser(HTMLParser):
def __init__(self):
HTMLParser.__init__(self)
self.flag=0
self.endflag=0... |
import csv
import pprint
import json
import re
import jsonlines
all_ = 0
count = 0
with jsonlines.open('jfdb_db.jsonlines', mode='w') as writer:
with jsonlines.open('./jfdb.jsonlines') as reader:
for obj in reader:
movie = {
"id": None,
"title": None,
... |
"""Test modules for result types."""
|
from django.conf.urls import patterns, url
urlpatterns = patterns(
"symposion.proposals.views",
url(r"^submit/$", "proposal_submit", name="proposal_submit"),
url(r"^submit/([\w\-]+)/$", "proposal_submit_kind",
name="proposal_submit_kind"),
url(r"^(\d+)/$", "proposal_detail", name="proposal_det... |
#pack SimpTrain
import simpTrain
# - Description:
# - - This package provides basic, easy use machine learning and visual recognition functionalities. Including visual recognition object determination, handwriting text recognition, and more.
# - Documents:
# - Visual recognition
from simpTrain import vision
vision.t... |
"""
from twisted.internet import defer
Tests borrowed from the twisted.web.client tests.
"""
import os
import shutil
import OpenSSL.SSL
from twisted.trial import unittest
from twisted.web import server, static, util, resource
from twisted.internet import reactor, defer
try:
from twisted.internet.testing import Str... |
#!/usr/bin/env python3
# Copyright 2018-present, HKUST-KnowComp.
# All rights reserved.
#
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
"""Implementation of the R-Net based reader."""
import torch
import torch.nn as nn
import torch.nn.functional... |
"""
File: add2.py
Name: Peter Lin 20220308
------------------------
TODO:
"""
import sys
class ListNode:
def __init__(self, data=0, pointer=None):
self.val = data
self.next = pointer
def add_2_numbers(l1: ListNode, l2: ListNode) -> ListNode:
#######################
# ... |
import time
import numpy as np
from PyQt5.QtCore import pyqtSignal, QRunnable, QObject, QTimer
from PyQt5.QtWidgets import QApplication
from envs.action import Action
from envs.snake_env import SNAKE_ACTION_POOL
from envs.pong_env import PONG_ACTION_POOL
from envs.breakout_env import BREAKOUT_ACTION_POOL
from gui.ut... |
from distutils.core import setup
with open('README.rst') as readme:
long_description = readme.read()
VERSION = '0.5'
setup(
install_requires=['tqdm'],
name='fileshuffle',
version=VERSION,
py_modules=['fileshuffle'],
url='https://github.com/sashgorokhov/fileshuffle',
download_url='https://... |
import queue
from threading import Lock
from typing import List, Tuple, Set, Dict, Any
import json
MessageType = Tuple[str, str]
class Messager:
def __init__(self) -> None:
self.queue_id = 0
self.lock = Lock()
self.queues: Dict[int, Tuple["queue.Queue[MessageType]", List[str]]] = {}
... |
################################################################################
# Python script for ..
# - Description:
# - Author: Hyojoon Kim (joonk@princeton.edu)
################################################################################
####################################################################... |
import sys
from pykob import kob
from pykob import config
try:
interface = config.serial_port
myKOB = kob.KOB(port=interface)
myKOB.setSounder(False)
while True:
print(myKOB.key())
except KeyboardInterrupt:
print()
print("Thank you for using the Closer-Test!")
sys.exit(0) # Ind... |
#! python3
import SimpleITK as sitk
import numpy as np
# Computes the normalzied cross correlation between two images in a given ROI.
def NormalizedCrossCorrelation(image1, image2):
lncc = 0
# Instead of using StatisticsImageFilter, I use LabelStatisticsImageFilter as I need to compute the stats in the label.... |
"""mysite URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.11/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class-bas... |
#!/usr/bin/env python3
#
# Cash Shuffle - CoinJoin for Bitcoin Cash
# Copyright (C) 2018-2019 Electron Cash LLC
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documentation files
# (the "Software"), to deal in the Software without restriction,
# includ... |
from constants import SF
class GameObject:
"""
Base GO class, any object in the game will inherit this class
"""
def __init__(self, surface, color, x, y):
self.surface = surface
self.color = color
self.x = x*SF
self.y = y*SF
@property
def pos(self):
ret... |
#!/usr/bin/env python3
import requests, gi
gi.require_version('Gtk', '3.0')
from gi.repository import Gtk
def downloadImages(button):
search = builder.get_object("TagsEntry").get_text()
pages = builder.get_object("PagesEntry").get_text()
key = builder.get_object("ApiEntry").get_text()
for page in rang... |
# https://npiregistry.cms.hhs.gov/registry/provider-view/[NPI]
|
#
# Copyright 2021 Ocean Protocol Foundation
# SPDX-License-Identifier: Apache-2.0
#
from unittest.mock import Mock
import pytest
from ocean_lib.common.http_requests.requests_session import get_requests_session
from ocean_lib.data_provider.data_service_provider import DataServiceProvider as DataSP
from ocean_lib.data... |
import pandas as pd
import geocoder
def get_geocoder(location):
g = geocoder.osm('{}, UK'.format(location))
print(g)
return g.osm['x'], g.osm['y']
df = pd.read_csv('data/towns.csv')
df['x'], df['y'] = zip(*df['name'].apply(get_geocoder))
df.to_csv('data/towns_geo.csv') |
#!/usr/bin/python3
# -*- coding: utf-8 -*-
# @Time : 2018/6/14 下午4:54
# @Author : LennonChin
# @Email : i@coderap.com
# @File : __init__.py.py
# @Software: PyCharm |
import sys
import os
import nodeast
import config
class BuiltinModule(nodeast.BuiltinNode):
type_d = {
"int":config.ASSIGN_TYPE_INT,
"str":config.ASSIGN_TYPE_STR,
"list":config.ASSIGN_TYPE_LIST,
"tuple":config.ASSIGN_TYPE_TUPLE,
"dict":config.ASSIGN_TYPE_DICT,
"... |
# -*- coding: utf-8 -*-
import sys
from PySide import QtCore, QtGui
def main(argv):
app = QtGui.QApplication(argv)
mainwindow = MyMainWindow()
mainwindow.show()
sys.exit(app.exec_())
class MyMainWindow(QtGui.QMainWindow):
def __init__(self, *args):
QtGui.QMainWindow.__init__(self, *args)... |
import Modules.DataUpdater as DataUpdater
import Modules.VideoCapture as VideoCapture
def Startup():
DataUpdater.DataUpdate()
VideoCapture.VCapt()
if __name__ == "__main__":
Startup() |
import itertools
import multiprocessing
from collections import OrderedDict
from multiprocessing import Pool
import networkx as nx
import pandas as pd
from tqdm import tqdm
from .. import support_utils as sup
from ..configuration import Configuration
class LogReplayer:
"""
This class replays an event log ov... |
import json
import time
# import the Selenium library to automate the web browser
from selenium import webdriver
# import the Selene library to help simplify browser automation
# Selene uses the Selenium library
from selene.api import browser, s, ss, be, have, by
# load libraries to communicate with the browsermob p... |
import json
class PackageRating(object):
RampUp = None
Correctness = None
BusFactor = None
ResponsiveMaintainer = None
LicenseScore = None
GoodPinningPractice = None
NetScore = None
def toJSON(self):
return json.dumps(self, default=lambda o: o.__dict__,
sort_key... |
from optparse import make_option
from os.path import expanduser, expandvars
from cobl.lexicon.views import write_nexus
from cobl.lexicon.models import LanguageList, MeaningList
from cobl.utilities import LexDBManagementCommand
class Command(LexDBManagementCommand):
help = """Export a nexus file from the database"... |
maliste = [2, 1, -5, 8, 7, 3, 4]
i = 0
somme = 0 # commence à 0
while i < len(maliste):
somme = somme + maliste[i]
i = i + 1
print("La somme des éléments de ma liste est", somme)
# ici 2 + 1 + (-5) + 8 + 7 + 3 + 4 = 20
|
# -*- coding: utf-8 -*-
import random
import sys
import datetime
import csv
import itertools
from scipy.stats import poisson
import networkx as nx
class AbstractSimulation:
""" Functions for the simulation of interactions between proteins that are
needed independently from the consideration of protein p... |
import os
import mlflow
import numpy as np
import pytest
import torch
import torchani
from torch import nn, optim
from ael import loaders, models, train
np.random.seed(42)
torch.manual_seed(42)
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
# Radial coefficients
RcR = 5.2
EtaR = torch.tensor... |
from bson.json_util import dumps
import json
from bson.objectid import ObjectId
from database import ConDatabase
from config import CONFIG
'''motor Mongo Db connection '''
db = ConDatabase.connect()
# noinspection PyMethodMayBeStatic
class RasaConversations:
async def get_conversations(self, sender_id):
... |
# pylint: disable=W0621
import numpy as np
import pytest
import rasterio
from rio_cloudmask.equations import cloudmask
@pytest.fixture
def bands():
pref = 'tests/data/LC80130312015295LGN00_'
data = dict(
blue=rasterio.open(pref + "B2_toa.tif").read(1),
green=rasterio.open(pref + "B3_toa.tif")... |
# Generated by Django 3.1.5 on 2021-05-11 09:44
import django.core.validators
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('hr2', '0002_workassignemnt'),
]
operations = [
migrations.AlterField(
model_name='empconfidentiald... |
from __future__ import print_function, unicode_literals
ip_addr1 = '172.16.1.1'
ip_addr2 = '172.31.17.99'
ip_addr3 = '217.88.17.1'
octets = ip_addr1.split(".")
print("\n")
print("-" * 80)
# print("{:^20}{:^20}{:^20}".format(ip_addr1, ip_addr2, ip_addr3))
# print("{:10}{:10}{:10}{:10}".format(*octets))
# print("%s %s... |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
This module provides tools for generating matplotlib colormaps.
"""
from astropy.utils.decorators import deprecated_renamed_argument
import numpy as np
__all__ = ['make_random_cmap']
@deprecated_renamed_argument('random_state', 'seed', '1.0')
def m... |
import os
from PyQt5 import QtCore, QtGui, QtWidgets
from bs4 import BeautifulSoup
code_dir = os.path.dirname(os.path.abspath(__file__))
class WelcomeMessage(QtWidgets.QDialog):
def __init__(self, cache_fname, html_fname, has_file=False, parent=None):
super(WelcomeMessage, self).__init__(parent)
... |
from pytorch_generative import datasets
from pytorch_generative import debug
from pytorch_generative import models
from pytorch_generative import nn
from pytorch_generative import trainer
__all__ = ["datasets", "debug", "models", "nn", "trainer"]
try:
from pytorch_generative import colab_utils
__all__.append... |
#!/usr/bin/env python3
# Copyright (c) 2017 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
from framework.build.step import BuildStep
class Autogen(BuildStep):
"""
Executes './autogen' on the... |
# Python
from __future__ import unicode_literals
# Django
try:
from django.urls import include, re_path
except ImportError:
from django.conf.urls import include, url as re_path
# Test App
from . import views
error_urlpatterns = [
re_path(r'^bad-request/$', views.bad_request, name='bad-request'),
re_p... |
"""
data simulation and fitting for motor adaptation / PomLab task (state space model)
"""
import sys, os
import numpy as np
import pandas as pd
import stan
def sim_motoradapt_single(param_dict, sd_dict, group_name, seed, num_sj=50, num_trial=200, model_name='motoradapt_single', plot=False, plot_raw=False):
"""sim... |
from urllib.request import urlopen
import webbrowser
def connected():
try:
urlopen("http://google.com")
return True
except:
return False
def browse(url):
webbrowser.open_new(url)
|
from pulp import *
class Bakery(object):
def __init__(self, ingredients, products):
self.ingredients = ingredients
self.products = products
for k, v in self.products.items():
v['cost'] = 0
for i, quantity in v['ingredients'].items():
v['cost'] += quantity * ingredients[i]['cost']
... |
while True:
a = input('введите число: ')
if a == '0':
break
|
# encoding: utf-8
import torchvision.transforms as T
from .transforms import RandomErasing
from .temporal_transforms import TemporalBeginCrop
def build_transforms_ST(cfg,is_train=True):
normalize_transform = T.Normalize(mean=cfg.INPUT.PIXEL_MEAN, std=cfg.INPUT.PIXEL_STD)
if is_train:
transform_list =... |
from functools import partial
from graphql.validation import VariablesInAllowedPositionRule
from graphql.validation.rules.variables_in_allowed_position import bad_var_pos_message
from .harness import assert_validation_errors
assert_errors = partial(assert_validation_errors, VariablesInAllowedPositionRule)
assert_va... |
"""
Unittests for testing management commands.
"""
import logging
import unittest
import uuid
from datetime import datetime, timedelta
from django.contrib.auth.models import User
from django.core.management import call_command
from django.core.management.base import CommandError
from provider import constants
from pr... |
cache = {0: 0, 1: 1, 2: 1, 3: 1, 4: 2, 5: 3, 6: 6, 7: 11, 8: 23, 9: 46, 10: 98, 11: 207, 12: 451, 13: 983, 14: 2179, 15: 4850, 16: 10905, 17: 24631, 18: 56011, 19: 127912, 20: 293547, 21: 676157, 22: 1563372, 23: 3626149, 24: 8436379, 25: 19680277, 26: 46026618, 27: 107890609, 28: 253450711, 29: 596572387, 30: 14068187... |
"""Test getattr and associated."""
# --- import --------------------------------------------------------------------------------------
import WrightTools as wt
from WrightTools import datasets
# --- test ----------------------------------------------------------------------------------------
def test_axis_varia... |
import pytest
from sovtokenfees.test.constants import XFER_PUBLIC_FEES_ALIAS
from sovtokenfees.test.view_change.helper import scenario_txns_during_view_change
@pytest.fixture(
scope='module',
params=[
{XFER_PUBLIC_FEES_ALIAS: 0}, # no fees
{XFER_PUBLIC_FEES_ALIAS: 4}, # with fees
], id... |
from .main import BaseUnit, Composite, DerivedUnit
from .units import *
|
"""
Module to determine the wavelength solution of the lris redside using skylines.
TODO: add logging
"""
from mostools import spectools
from lris.lris_red import skysub
import special_functions
import numpy as np
import scipy
from scipy import optimize,interpolate,ndimage,signal,stats
from astropy.io import fits a... |
'''Luigi.Task mixin for data augmentation.
'''
import luigi
def pad_to_minsize(patch_size):
'''
'''
import tensorflow as tf
patch_size = tf.convert_to_tensor(patch_size, name='patch_size')
@tf.function
def _padder(input_dict):
key0 = next(iter(input_dict.keys()))
input_shap... |
import json
import re
import asyncio
from redbot.core import checks, commands, Config
from redbot.core.utils.chat_formatting import box, pagify, inline
class Todo(commands.Cog):
def __init__(self, bot, *args, **kwargs):
super().__init__(*args, **kwargs)
self.bot = bot
self.config = Confi... |
""" Module to manage ssl credentials and session """
__author__ = "gelpi"
__date__ = "$08-March-2019 17:32:38$"
import sys
import os
import stat
import pickle
import paramiko
from io import StringIO
from paramiko import SSHClient, AutoAddPolicy, AuthenticationException, SSHException, RSAKey
class SSHSession():
""... |
# -*- coding: utf-8 -*-
# vim: set ft=python ts=4 sw=4 expandtab:
"""
Main command line interface that delegates most work out to subcommands.
"""
import click
from vplan.client.client import retrieve_health, retrieve_version
from vplan.client.commands.account import account
from vplan.client.commands.plan import pl... |
# coding=utf-8
class HotAnchorCron():
pass
|
#!/usr/bin/python3
from sklearn import tree
# features about apple and orange
# where 0 means smooth and 1 means bumpy
data=[[100,0],[130,0],[135,1],[150,1]]
output=["apple","apple","orange","orange"]
# decision tree algo call
algo=tree.DecisionTreeClassifier()
# train data
trained_algo=algo.fit(... |
import sc2
from sc2.ids.ability_id import AbilityId
from sc2.constants import *
_debug = False
class Fleet:
def __init__(self, unit):
self.tag = unit.tag
self.unit = unit
self.label = 'Idle'
#research flags.
self._pulse_crystals_researched = False
self._grav_catapult_researched = False
... |
import numpy as np
from . import register_env
from .half_cheetah import HalfCheetahEnv
@register_env('cheetah-multi-dir-vel')
class HalfCheetahMultiDirVelEnv(HalfCheetahEnv):
"""Half-cheetah environment with target velocity, as described in [1]. The
code is adapted from
https://github.com/cbfin... |
import pytz
from django.db import models
from django.conf import settings
class Category(models.Model):
name = models.CharField(max_length=100)
title = models.CharField(max_length=100)
order = models.IntegerField(default=0)
def __str__(self):
return '{}:{}:{}'.format(self.order, self.name, s... |
from utils import log
from routes import (
current_user,
login_required,
)
from flask import (
request,
Blueprint,
render_template,
redirect,
url_for,
session,
make_response,
send_from_directory,
)
from models.board import Board
from models.user import User
from config import g... |
# Generated by Django 4.0.1 on 2022-02-02 18:02
import django.db.models.deletion
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("category", "0003_alter_category_options"),
("question", "0001_initial"),
]
operations = [
migration... |
# IMAGE BANK
TILESET = 0
TILESET_PATH = 'assets/tileset.png'
SHIP = 1
SHIP_PATH = 'assets/ship.png'
COLOR_BLACK = 0x000000
PICO8_PALETTE = [
0x000000,
0x1D2B53,
0x7E2553,
0x008751,
0xAB5236,
0x5F574F,
0xC2C3C7,
0xFFF1E8,
0xFF004D,
0xFFA300,
0xFFEC27,
0x00E436,
0x29A... |
# Copyright 2017 Autodesk Inc.
#
# 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 to in writing... |
"""
Title:: Extractor
Brief:: Implementation of the extractor class to be used for extracting data from pdf files
Author:: Nicholas Hemstreet
Date:: 03/27/2019
"""
# Dependencies
import nltk
from pdfminer.pdfinterp import PDFResourceManager, PDFPageInterpreter
from pdfminer.converter import TextConverter
from pdfmin... |
# number = int(input("Which number do you want to check?"))
# if number % 2 == 0:
# print("This is an even number.")
# else:
# print("This is an odd number.")
# year = int(input("Which year do you want to check?"))
# if year % 4 == 0:
# if year % 100 == 0:
# if year % 400 == 0:
# print("Leap year."... |
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
###
# From https://github.com/kuc2477/pytorch-ewc
# Credits to Ha Junsoo - [kuc2477](https://github.com/kuc2477)
###
import itertools
from co... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Written by Lucas Sinclair and Paul Rougieux.
JRC Biomass Project.
Unit D1 Bioeconomy.
Typically you can use this class like this:
>>> from forest_puller.tables.area_ipcc_vs_soef import soef_vs_ipcc
>>> print(soef_vs_ipcc.df)
To export the table:
>>> f... |
"""
Views service.
This Django app manages API endpoints related to managing PostgreSQL
materialized views. These views match to certain PostgreSQL tables via
customizable SQL query, so that view refreshing will bring up a certain set of
data depending on conditions changing with time.
This enables different windows ... |
import numpy as np
import data as dt
import commonFunctions as cf
from calLimits import calLimits
from intervalMinim import intervalMin
from varphiMinim import varphiMin
import matplotlib.pyplot as plt
import time
'''
Proceso de ajuste de curvas de rotación:
1) Cálculo de límites
2) Minimización del intervalo ... |
# -*- encoding=utf-8 -*-
import sys
import json
reload(sys)
sys.setdefaultencoding('utf-8')
# The bulk() api accepts index, create, delete, and update actions.
# Use the _op_type field to specify an action (_op_type defaults to index):
from elasticsearch import Elasticsearch
client = Elasticsearch("localhost:9200")
p... |
from doggo_ears_definitions import *
from multiprocessing import get_context
from utils import generate_aud_features
import librosa
import pickle
import os
def add_data_job(payload):
fn, cat = payload
samples, rate = librosa.load(fn, res_type='kaiser_fast')
samples_per_wind = int(rate * window_durat... |
import os
from setuptools import setup
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname), encoding='utf-8').read()
setup(
name = "Kontejnery",
version = "0.0.1",
author = "Jindrich Samec",
author_email = "jindrich.samec@xjs.cz",
description = ("Shows containers on m... |
#Boa:Frame:RuleChecker
import os
import wx
import wx.stc
import fileinput
import re
import RuleCheckerAPI
import thread
import sys
import pprint # debug purpose
def create(parent):
return RuleChecker(parent)
[wxID_RULECHECKER, wxID_RULECHECKERBOTTONRULECHECK,
wxID_RULECHECKERBUTTONCANCEL, wxID_RULECHECKERB... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from setuptools import setup, find_packages
with open('README.md', 'r') as fh:
long_description = fh.read()
setup(
name='tfembedhub',
version='1.2.1',
description='TensorFlow Hub module produc... |
from statistics import mean, median, stdev
from matplotlib import pyplot
from numpy.random import default_rng
def compute_dcf(cash_flow_values, discount_rate):
dcf = 0
for year, cash_flow in enumerate(cash_flow_values):
dcf = dcf + cash_flow / pow(1 + discount_rate, year + 1)
return dcf
def get... |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'meas_display_ui.ui'
#
# Created by: PyQt5 UI code generator 5.15.1
#
# WARNING: Any manual changes made to this file will be lost when pyuic5 is
# run again. Do not edit this file unless you know what you are doing.
from PyQt5 import QtCo... |
import sys
import argparse
import sounddevice as sd
import queue
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.animation as animation
import r2fft
from random import *
im = None
def update_spectogram(frame):
a = im.get_array()
for i in range(40):
for j in range(40):
... |
#!/usr/bin/python3
import sys
current_word = None
current_count = [0,0]
lol = dict()
for l in sys.stdin:
l = l.strip()
k,v = l.split("\t")
try:
v = [int(i) for i in v.split(",")]
except ValueError:
continue
if k in lol:
lol[k][0]+=v[0]
lol[k][1]+=v[1]
else:... |
from django.shortcuts import render
# Create your views here.
from django.contrib.auth import authenticate, login, logout
from django.views.decorators.csrf import csrf_exempt
from django.template import RequestContext, loader
from django.http import HttpResponse, HttpResponseRedirect, Http404
from django.contrib.aut... |
from PIL import ImageFont, Image, ImageDraw
import random
class YZMInfo:
def __init__(self, img, code):
self.img = img
self.code = code
def ygm(font_size=20, count_min=4, count_max=10, code_height=30,
string='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789',
font_... |
#
# Copyright (c) 2019. Asutosh Nayak (nayak.asutosh@ymail.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
#
"""
Program to demonstrat... |
#! /usr/bin/env python
from PyFoam.Applications.CreateBoundaryPatches import CreateBoundaryPatches
CreateBoundaryPatches()
|
'''
In the 20x20 grid below, four numbers along a diagonal line have been
marked in red.
08 02 22 97 38 15 00 40 00 75 04 05 07 78 52 12 50 77 91 08
49 49 99 40 17 81 18 57 60 87 17 40 98 43 69 48 04 56 62 00
81 49 31 73 55 79 14 29 93 71 40 67 53 88 30 03 49 13 36 65
52 70 95 23 04 60 11 42 69 24 68 56 01 32 56 71 37... |
def mergesort(items):
# Base case, a list of 0 or 1 items is already sorted
if len(items) <= 1:
return items
# Otherwise, find the midpoint and split the list
midpoint = len(items) // 2
left = items[:midpoint]
right = items[midpoint:]
# Call mergesort recursively with the left and ... |
import win32api
from random import randint
class MiniGame:
user_name = win32api.GetUserName()
options = ["Stone", "Paper", "Scissors"]
punctuation_user = 0
punctuation_bot = 0
sum_punctuation = 0
def resetting_score(self):
self.punctuation_user = 0
self.punctuation_bot = 0
... |
import PMW as PMW
import sys
import inspect
import tkinter as tk
from tkinter import ttk
import tkinter.font as font
import Funktionen
import tkintertable as tkt
import time
import numpy
import types
#Klasse für das Fenster
class main(tk.Tk):
def __init__(self):
self.distributions = {"Bi... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
obj_fit_tellu [night_directory] [files]
Using all transmission files, we fit the absorption of a given science
observation. To reduce the number of degrees of freedom, we perform a PCA and
keep only the N (currently we suggest N=5) principal components in absorbance.
... |
import os
import datetime
from pathlib import Path
import dask
import pandas as pd
import ray
import vaex
import dask.dataframe as dd
from pprint import pprint
from time import time as timer
# Display all columns
pd.set_option('display.max_columns', None)
# Refer to https://docs.python.org/3/library/datetime.html#... |
from __future__ import print_function, division
import chronostar.component
"""
Plot a bunch of synth fits
"""
from itertools import product
import numpy as np
import os
import sys
sys.path.insert(0, '..')
import chronostar.retired2.datatool as dt
import chronostar.fitplotter as fp
ages = [30] #[5,15,30,50,100,20... |
# Determine el total a precio_final con respecto al descuento efectuado segun los criterios
precio =int(input("Ingrese el precio del producto: "))
if precio <50000:
precio_final = precio
descuento = 0
elif precio <= 100000:
descuento = 5
precio_final=precio-(precio*0.05)
elif precio <= 700000:
de... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.