text
stringlengths
8
6.05M
''' Created on Dec 3, 2015 @author: Jonathan Yu ''' import RecommenderEngine, json import SimpleFoodReader import BookReader if __name__ == "__main__": (jitems,jratings) = BookReader.getData("bookratings.txt") #(jitems,jratings) = SimpleFoodReader.getData("foodratings_example.txt") items = json.loads...
from . import db class Scone(db.Model): id = db.Column(db.Integer, primary_key=True) place_name = db.Column(db.String(100)) place_address = db.Column(db.String) flavour = db.Column(db.String(50)) image = db.Column(db.String, nullable=True) rating = db.Column(db.Float) note = db.Column(db.S...
a = int(input("Enter a: ")) b = int(input("Enter b: ")) oper = input("Enter operation: ") if oper == "+": result = a + b print("Result is: " + str(result)) elif oper == "-": result = a - b print("Result is: " + str(result)) elif oper == "*": result = a * b print("Result is: " + str(result)) eli...
from time import time import math start = time() def roof(n): return int(math.sqrt(n / 2)) def is_prime(n): if n < 2: return False if n == 2: return True if not n & 1: return False for x in range(3, int(n**0.5) + 1, 2): if n % x == 0: return False ...
class IdGenerator(): def __init__(self): self._id = 0 def next(self): self._id += 1 return self._id
#!/usr/bin/env python """ Small program that requests input from a user, then opens a file and replaces particular string matches with user input. Saves the content to a new file. """ import re from pathlib import Path import pyinputplus as pyip FILEPATH = "/home/ross/AllThingsPython/ATBS/Testing/" FILENAME = "strin...
def product(a,b): if b==1: return a return product(a,b-1)+a print(product(5,2)) # 10 #5+5 print(product(9,3)) # 27 #9+9+9 print(product(6,5)) # 30
""" multiple control element logic. Used for displaying multiple bluegraph widgets in a single application. """ import sys import numpy import logging from PySide import QtCore, QtGui from bluegraph import views from bluegraph import utils from bluegraph.devices import DeviceWrappers log = logging.getLogger(__name_...
__author__ = 'Alexey' from graph_tools.graph_builder import build_connected_graph from graph_tools.graph_drawer import draw_graph from graph_tools.common_graph_utils import init_random_weights from algorithms.algorithms import build_minimum_spanning_tree import algorithms.disjoint_set_structure as dss n = input("Ente...
# Dr. Chaos, el malevolo semiótico # "Chaos es caos en inglés" te diría Dr. Chaos, charlando con una taza de té Chai en la mano. En verdad no es tán malo como su nombre lo hace aparentar... si es que tenés un buen manejo de los idiomas. # Dr. Chaos esta armando un diccionario. Este diccionario tiene la particularidad ...
from django.contrib.auth.models import User, Group from rest_framework import serializers from .models import * class UserSerializer(serializers.HyperlinkedModelSerializer): class Meta: model = User fields =("username","password","first_name","last_name", 'email') def get_mybooking(self, i...
def asal_mi(x): for i in range(x): if i>1 and x%i!=0 and x!=2: k=1 if x==2: k=1 if i>1 and x%i==0 and x!=2: k=0 return 0 return k sayi=0 while(sayi!=-1): a=input() sayi=int(a) ctr=asal_mi(sayi) if ctr==1: ...
import os import pandas as pd import numpy as np from ccdc.descriptors import MolecularDescriptors from ccdc.io import MoleculeReader, EntryReader from tqdm import tqdm def check_dir(d): if not os.path.exists(d): os.mkdir(d) return d def remove_dummy_atoms(mol): rm = [] for...
def isSymmetric(self, root): """ :type root: TreeNode :rtype: bool """ def goThrough(left,right): if not right and not left: return True if not left or not right: return False if left.val == right.val: firstPair = goThrough(left.left, rig...
#Face Recognition using Facenet model and MTCNN detector #Pre-requisite: pip install mtcnn from PIL import Image from numpy import asarray from mtcnn.mtcnn import MTCNN from os import listdir from os.path import isdir from matplotlib import pyplot from numpy import load from numpy import expand_dims from numpy import ...
#coding:utf-8 """ LSTM demo for MNIST dataset """ from tensorflow.examples.tutorials.mnist import input_data import tensorflow as tf import numpy as np tf.enable_eager_execution() #在这里做数据加载,还是使用那个MNIST的数据,以one_hot的方式加载数据,记得目录可以改成之前已经下载完成的目录 URL = "http://yann.lecun.com/exdb/mnist/" mnist = input_data.read_data_sets("...
# Generated by Django 2.2.5 on 2020-04-24 21:47 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('listings', '0006_auto_20200425_0230'), ] operations = [ migrations.AddField( model_name='mobilephone', name='is_wkp'...
from django.db import models from django import forms # New imports added for ClusterTaggableManager, TaggedItemBase, MultiFieldPanel from modelcluster.fields import ParentalKey, ParentalManyToManyField from modelcluster.contrib.taggit import ClusterTaggableManager from taggit.models import TaggedItemBase from django....
import os, sys sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))) from flask_uploads import patch_request_class # import atexit # from apscheduler.schedulers.background import BackgroundScheduler from flask_script import Manager, Server from application import create_app # from utilities...
# Generated by Django 3.2.8 on 2021-10-27 23:55 from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('activities', '0002_auto_20211027_2331'), ] operations = [ migrations.RenameField( model_name='submission', old_name='activit...
from datetime import datetime from behave import given, then from behave.runner import Context from pepy.domain.model import ProjectName, ProjectDownloads, Downloads, DayDownloads from tests.tools.stub import ProjectStub @given("the following projects exists") def step_impl(context: Context): projects = [Projec...
from game.items.item import Log from game.skills import SkillTypes class TeakLog(Log): name = 'Teak Log' value = 97 xp = {SkillTypes.firemaking: 105, SkillTypes.fletching: 1} skill_requirement = {SkillTypes.firemaking: 35, SkillTypes.fletching: 1}
# map = function and sequence # function = def haha(x,c,f,d) # return x,c,d,f # secuence = [2,4,5,2,7,3] # list,set,tuple def haha(x): return x ** 2 b = [1, 2, 3, 4, 5] a = list(map(haha,b)) c = list(map(lambda x:x**2,b)) print(a) print(c)
import pytest from pystachio.base import Environment from pystachio.basic import String from pystachio.composite import Default, Required, Struct from pystachio.container import List from pystachio.naming import Ref from pystachio.parsing import MustacheParser def ref(address): return Ref.from_address(address) d...
#!/usr/bin/python import httplib import httplib2 from urllib2 import Request, urlopen import urllib import urllib2 import random import time import os import unicodedata import sys import csv from datetime import datetime import fileinput import re import HTMLParser from bs4 import BeautifulSoup dat...
#========================================================================= # Modular Python Build System __init__ file #========================================================================= # List of collection modules import elf import pisa_inst_test_utils # List of single-class modules from IsaImpl ...
from app import app, db from app.models import User, Autobase @app.shell_context_processor def make_shell_context(): return {'db': db, 'User': User, 'Autobase': Autobase}
import random x=random.randrange(1,100); print(x) for i in range (100): x=random.randint(1,1000); print(x) # if ur using the random module and then never name ur file random.py i=1 while i<=20: if(i%2==0): i+=1 continue# so wat constinue does is if statement is true it will leave rest of...
import subprocess as sp import json import sys import ipaddress from shutil import which # Global error codes CONFIG_ERROR = 20 BIN_ERROR = 21 # Dig error codes SUCCESS = 0 USAGE_ERROR = 1 BATCH_FILE = 8 NO_REPLY = 9 INTERNAL_ERROR = 10 # Scamper error codes SCAMPER_CONFIG_ERROR = 255 # Default input parameters PAR...
# Generated by Django 3.0.2 on 2020-04-04 16:35 import datetime from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('obsapp', '0022_auto_20200402_1444'), ] operations = [ migrations.AddField( model_name='product', nam...
def encode(s): r = '' f = 1 for i, c in enumerate(s): cnext = s[i + 1] if i < len(s) - 1 else '' if c == cnext: f += 1 else: if f == 1: r += c else: r += str(f) + c f = 1 return r def decode(s):...
from flask import render_template from . import web @web.route('/', methods=['GET']) def root(): return web.send_static_file('html/setadvertise.html') #return render_template('setadvertise.html')
from enum import Enum, auto from BoschShcPy.base import Base from BoschShcPy.error import ErrorException class state(Enum): NO_UPDATE_AVAILABLE = auto() DOWNLOADING = auto() UPDATE_IN_PROGRESS = auto() UPDATE_AVAILABLE = auto() NOT_INITIALIZED = auto() state_rx = {'NO_UPDATE_AVAILABLE': state.NO...
import numpy as np from function import * from utils import * A = -4 B = 4 EXACT_VALUE = 4.967532679086564 FIVE_POINTS = [7, 32, 12, 32, 7] FIVE_POINTS_COEF = 2 / 45 SEVEN_POINTS = [41, 216, 27, 272, 27, 216, 41] SEVEN_POINTS_COEF = 1 / 140 NINE_POINTS = [989, 5888, -928, 10496, -4540, 10496, -928, 5888, 989] NIN...
# encoding: utf-8 from .templates.lastplayed import lastplayedtemplate class LastPlayed: __dispatch__ = 'resource' __resource__ = 'lastplayed' def __init__(self, context, *arg, **args): self._ctx = context self.queries = self._ctx.queries def get(self, *arg, **args): lplist =...
# Generated by Django 2.1.4 on 2019-09-03 17:24 from django.db import migrations, models import django.utils.timezone class Migration(migrations.Migration): dependencies = [ ('tracks', '0012_auto_20190903_0920'), ] operations = [ migrations.AddField( model_name='exam', ...
import csv import os from html_creator import * from enum import Enum # defining the dictionary which will indiate index of the attributes in an specific csv file Attribute_Index = {} # defining the default folder to read metrics from it Metrics_Folder = "metrics" # a list to store metric file addresses Metric_File...
from django.shortcuts import render # Create your views here. def helloDjango(request): return render(request, 'hello.html') def helloDjango2(request): return render(request, 'helllo2.html')
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Thu Mar 21 16:33:10 2019 @author: ben """ import gym import pyworld.common as pyw from pyworld.common import Info from Policy_Gradient import PolicyGradientAgentImproved, PolicyGradientNetwork from tensorboardX import SummaryWriter class PolicyGradient...
primeiro = int(input('Digite o primeiro termo: ')) razao = int(input('Digite a razão da PA: ')) termo = primeiro cont = 0 while cont <= 9: print(f'{termo} > ', end=(' ')) termo = termo + razao cont += 1 print('Fim')
def square_of_sum(n): sum = ((n + 1) * n) / 2 squared = sum**2 return squared def sum_of_squares(n): sum = 0 for i in range(n + 1): sum += i**2 return sum def difference(n): return square_of_sum(n) - sum_of_squares(n) if __name__ == '__main__': print(difference(10))
#-*-coding: utf-8 -*-# class HousePark: __last_name__ = "박" #프라이빗의 의미 full_name = "" def __init__(self,name): self.full_name = self.__last_name__ + name def travel(self,where): print("%s, %s 여행을 가다"%(self.full_name, where)) def love(self,other): print("%s, %s와 사랑에 빠졌다."%(self...
def slices(string, d): if d> len(string): raise ValueError elif d==0: raise ValueError else: slices = [] for indx, elem in enumerate(string): if len(string) - indx >= d: curr_slice = [] curr_indx = indx while len(cur...
import datetime from typing import Iterable from google.cloud.bigquery import Client from google.cloud.bigquery.table import RowIterator from pepy.domain.pypi import StatsViewer, Result, Row class BQStatsViewer(StatsViewer): TIMEOUT = 20 * 60 # timeout of 20 minutes PAGE_SIZE = 5_000 def __init__(self...
import unittest import requests import time from vaurienclient import Client from vaurien.util import start_proxy, stop_proxy from vaurien.tests.support import start_simplehttp_server _PROXY = 'http://localhost:8000' class TestSimpleProxy(unittest.TestCase): def setUp(self): self._proxy_pid = start_pro...
#!/usr/bin/env python import hashlib import argparse import os parser = argparse.ArgumentParser() parser.add_argument("--directory", help="") options = parser.parse_args() SAME_SIZE = {} SAME_HASH = {} def hashmd5(filename): f = open(filename) filehash = hashlib.md5() while True: data = f.read(1024*1024) ...
# -*- coding: utf-8 -*- """MRI waveform import/export files. """ import struct import numpy as np __all__ = ["signa", "ge_rf_params", "philips_rf_params", "siemens_rf"] def siemens_rf( pulse, rfbw, rfdurms, pulsename, minslice=0.5, maxslice=320.0, comment=None ): """Write a .pta text file for Siemens Pulse...
#!/usr/bin/python import re import os import sys import uuid import json import urllib import httplib2 import shutil import subprocess import Queue import threading from exception import URLNotValidException from downloadThread import DownloadThread sys.path.append('logger') from logger import Logger class VideoURL: ...
import sys from application.ide.coderun.coderunner import * from PyQt4.QtCore import * from PyQt4.QtGui import * class DockToTabWidget(QDockWidget): """ QDockWidget dockable in a DockingTabWidget (subclassed QTabWidget) rather than in a QMainWindow """ def __init__(self, title, parent=0): QDo...
#! /usr/bin/env python # -*- coding: utf-8 -*- """ Sistemi Corporation, copyright, all rights reserved, 2022-2023 Martin Guthrie """ import logging from core.test_item import TestItem from public.prism.api import ResultAPI import os from public.prism.drivers.nrfprog.NRFProg import NRFProg, DRIVER_TYPE NRF52833DK_ASS...
print('¬ведите размеры окна через пробел:') X = list(map(int, input().split())) print('¬ведите координаты углов рамки:') A = list(map(int, input().split())) for i in range (A[1] - 1): print('.' * X[0]) print('.' * (A[0] - 1), end = '') print('a' * (A[2] - A[0] + 1), end = '') print('.' * (X[0] - A[2])) for i in ran...
# baselineTeam.py # --------------- # Licensing Information: You are free to use or extend these projects for # educational purposes provided that (1) you do not distribute or publish # solutions, (2) you retain this notice, and (3) you provide clear # attribution to UC Berkeley, including a link to http://ai.berkeley...
#!/usr/bin/env python3 from ev3dev2.motor import LargeMotor, MediumMotor, OUTPUT_A, OUTPUT_B, SpeedPercent, MoveTank from ev3dev2.sensor import INPUT_1 from ev3dev2.sensor.lego import TouchSensor from ev3dev2.led import Leds m = LargeMotor("in1:i2c3:M2") m.on_for_rotations(SpeedPercent(100), 10)
# -*- coding: UTF-8 -*- import os, sys, re import xml.etree.ElementTree as etree import xml.dom.minidom as doc import math import numpy as np import pdb from pylab import * import matplotlib.pyplot as plt traffic_demand = ['400','600','800','900','1000','1100','1200','1300']#,'700','1400','1500']#,'1600','1700','1800...
#!/usr/bin/env python # -*- coding: utf-8 -*- desc = """Выключение удаленных ПК под управлением Windows. Зависимости: Python3, Samba (для net rpc shutdown) В качестве PC_FOR_SHUTDOWN может выступать IP-адрес, DNS-имя компьютера, или номер кабинета (237, 239). Скрипт запрашивает пароль для указанного пользователя. """...
# -*- encoding: utf-8 -*- print('Введите слова через пробел') string = input() string = string.split() dictionary = {} for x in string: if x in dictionary: dictionary[x] += 1 else: dictionary[x] = 1 maximum = max(dictionary.values()) for key, value in dictionary.items(): if( value < maximum): break print(s...
import jinja2 import jinja2.ext from cutout.constants import STENCIL_PATH_PREFIX class Stencil(jinja2.ext.Extension): counter = 0 def __init__(self, environment, *args, **kwargs): @jinja2.contextfilter def stencil(ctx, value, pattern): cookiecutter_config = ctx.get("cookiecutter",...
import numpy as np from scipy.signal import spectrogram class PreProcessing(): def __init__(self,sampling_rate=22050): self.sampling_rate = sampling_rate def __call__(self,audio_array,logging): audio_array = np.squeeze(audio_array) spectrum = self.spect(audio_array) normal_spe...
import sys import getopt import re import struct import numpy from application.lib.instrum_classes import VisaInstrument # VISAINSTRUMENT __DEBUG__ = True class AwgException(Exception): pass class Instr(VisaInstrument): """ The QL355TP instrument (voltage source to bias amplifiers) """ def...
import cgi import datetime import os from http.cookies import * import sqlite3 try: if 'HTTP_COOKIE' in os.environ: cookie_string=os.environ.get('HTTP_COOKIE') ck=SimpleCookie() ck.load(cookie_string) if 'username' in cookie_string: id=ck['username'].value e...
from django.db import models # Create your models here. class Metals(models.Model): metal_short = models.CharField(max_length=3, unique=True) metal_name = models.CharField(max_length=25) created = models.DateTimeField(auto_now_add=True) class Meta: verbose_name_plural = 'Metal\'s' def __...
alus=int(input("Sisestage astme alus: ")) astendaja=int(input("Sisestage astendaja: ")) väärtus=alus**astendaja print(väärtus)
# coding=utf-8 from django.db import models from django.contrib.auth.models import User, UserManager from article.models import Article class CustomUser(User): timezone = models.CharField(max_length=50, default='Europe/Moscow') ava = models.ImageField(upload_to='avatars', verbose_name=u'Аватар', blank=True) ...
from collections import Counter english_freq = { 'a': 8.2389258, 'b': 1.5051398, 'c': 2.8065007, 'd': 4.2904556, 'e': 12.813865, 'f': 2.2476217, 'g': 2.0327458, 'h': 6.1476691, 'i': 6.1476691, 'j': 0.1543474, 'k': 0.7787989, 'l': 4.0604477, 'm': 2.4271893, 'n': 6.8084376, 'o': 7.5731132, 'p': 1.9459884...
#!/usr/bin/env python ''' Program : TableToTGraph.py Author : b.k.gjelsten@fys.uio.no Version : 1.0 22.11.2013 Description : STATUS 2014-01-30 - Has given some features to munch.py (which makes plots (.pdf)), which is then uptodate with the latest technologies - TableToTGraph.py is still the state-of-the-art T...
##########################DATA LABEL PROPERTIES############################### cameraInfo = {"Pelco" : 11.34, "Andor" : 8.1} qualityParameters = ["Good","Very Good", "Amazing"],[0.1,0.05,0.01],["Bad"] qualityN = {"N":3} columnLocations = {"calX":3,"calTime":0,"pullP1X":1,"pullP2X":3,"FWHM":1} alphabet = ["a","b","c","...
# -*- coding: utf-8 -*- from django.shortcuts import render from my_quote_app.models import Quote def get_quotes(request): return render(request, "quoteTest/home.html", {'quote_list':Quote.objects.all()})
# Generated by Django 2.1.5 on 2019-01-19 01:00 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('posts', '0002_article_slug'), ] operations = [ migrations.AddField( model_name='article', name='content_preview', ...
from odoo import api, models, fields class ResUsers(models.Model): _inherit = 'res.users' first_name = fields.Char(string="First name", related='partner_id.first_name', inherited=True, readonly=False) last_name = fields.Char(string="Last name", related='partner_id.last_name', inherited=True, readonly=Fal...
# Generated by Django 2.0 on 2019-10-30 16:13 import datetime from django.db import migrations, models import django.db.models.deletion from django.utils.timezone import utc class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( ...
from math import sqrt import numpy as np import copy class BitBlock: def __init__(self,hex_data): ''' hex_data : hexa decimal data ''' self.bit_string = self.get_bitstring_from_hex(hex_data) #debug #print("BitBlock(): ",self.bit_string) self.size = len(self....
from django.apps import AppConfig class MederoblogConfig(AppConfig): name = 'mederoblog'
#!/usr/bin/env python import os, sys, argparse, json, sha, base64, re # Directory to save image files IMAGE_DIR = "img" # Prefix for Markdown image URLs IMAGE_URL_PREFIX = "img" def cleanup(s): return re.sub(r"[^0-9a-zA-Z]+", "", s) if __name__ == "__main__": parser = argparse.ArgumentParser() parser.ad...
from charms.layer.ksql import KSQL_PORT from charms.reactive import when @when('website.available', 'ksql.configured') def setup_website(website): website.configure(KSQL_PORT)
# -*- coding: utf-8 -*- # Generated by Django 1.10.7 on 2017-08-18 14:13 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('nova', '0011_auto_20170818_1827'), ] operations = [ migrations.AlterField( ...
import functools from . import ValidationError, _dict_validate, _postprocess def typecheck(types, x): if not isinstance(x, types): raise ValidationError("Not a member of %s", str(types)) def typechecker(types): """Returns a function that checks whether an object matches types """ return func...
import numpy as np import pandas as pd import matplotlib.pyplot as plt import seaborn as sns import networkx as nx import spartan as st from .metrics import metrics, MetricCollection class BipartiteFramework: ''' Framework for evaluating bipartite graph models found in bipartiteModels/models.py ''' ...
import numpy as np import cv2 import matplotlib.pyplot as plt import os import sys import math # Training Image def skinToneData(img): hsvImg = cv2.cvtColor(img, cv2.COLOR_BGR2HSV) # Shape of the HSV Image height = hsvImg.shape[0] width = hsvImg.shape[1] freq = np.zeros((180, 256)) # HS...
import hashlib import psycopg2 import datetime import random def randf(min, max, precision=2): return round(random.uniform(min, max), precision) def generate_unique_code(text): m = hashlib.md5() m.update(text.encode('utf-8')) l = list(m.hexdigest()) l[7] += '-' l[11] += '-' l[15] += '-'...
from collections import OrderedDict from threading import RLock import datetime from Crypto.Hash import SHA import binascii import hashlib import Crypto import Crypto.Random import json class Block: def __init__(self, index, previous_hash, nonce, listOfTransactions=[], timestamp=None, current_hash=0,mine_time = Non...
from collections import Counter input = """hqcfqwydw-fbqijys-whqii-huiuqhsx-660[qhiwf] oxjmxdfkd-pzxsbkdbo-erkq-ixyloxqlov-913[xodkb] bpvctixr-eaphixr-vgphh-gthtpgrw-947[smrkl] iwcjapey-lhwopey-cnwoo-wymqeoepekj-992[eowpy] mvhkvbdib-agjrzm-zibdizzmdib-317[bizdm] excdklvo-lkcuod-dbksxsxq-146[ztwya] ocipgvke-ejq...
class BrickGl: def __init__(self, draw_atoms): self.draw_atoms = draw_atoms pass def horiz_line(self, h0, w0, length): args = [(h0, w) for w in range(w0, w0 + length)] self.draw_atoms(*args) def vert_line(self, h0, w0, length): args = [(h, w0) for h in ...
import pygame as pg, time, math, sys from pygame.locals import * from random import randint class Building(): #initialization def __init__(self, screen): self.x = 691 self.y = randint(270, 310) self.sprite = pg.image.load("images/building.png") self.sprite = pg.transform.scale(s...
class Documents: def __init__(self, tipo, path): self.tipo = tipo self.path = path self.listOfDocuments = [] self.categorieOfDocuments = [] self.metaData = [] # Righe, Colonne, Data e Dizionario. Guardare in Stemmer. def setDictionary(self, dictionary): ...
import cv2 import numpy as np import tflite_runtime.interpreter as tflite import urllib3 import time def requestToThingSpeak(): # upload value to thingSpeak url = "https://api.thingspeak.com/update?api_key=" key = "your key" val = f"&field1={noMaskedNum}" r = urllib3.PoolManager().request("GET", u...
# import library. import urllib try: from urllib.request import urlopen except ImportError: from urllib2 import urlopen # catch google website. html = urlopen("http://www.google.com/") print (html.read())
#!/usr/bin/env python # encoding: utf-8 """ utils.py Created by edu on 2010-11-10. """ from _pitchtools import * import os def _note_to_music21(note): return n2m(note) def _open_pdf(pdf_file): os.system('open %s' % pdf_file) def _show_note_in_finale(note): note = _note_to_music21(note) import music2...
import click from mazel.label import Target # Import module for easier patching during test from . import label_common @label_common.label_command @click.option( # Replicated from bazel: # https://docs.bazel.build/versions/master/user-manual.html#flag--test_output "--test_output", type=click.Choic...
''' Given a root of a binary tree flatten the tree ''' class Node: def __init__(self, value): self.value = value self.left = None self.right = None def _flatten_tree(root): if not root: return None if root.left is None and root.right is None: return root leftTail ...
""" TODO Think about how best to manage properties associated with constraint sources. In maya this seems to be managed more effectively: Constraint sources, offset attributes and weight attributes are index based. So when a source node is renamed, the connections are still valid. The ex...
username=input("enter the name") if username=="supriya": print("yaa") if username=="ankita": print("yes") if username=="pihu": print("ok") else: print("Invalid") else: print("no") else: print("noooo")
hours = input('how many hours') rate = input('how many rate ') pay = int(hours) * int(rate) print(pay)
""" INCOMPLETE, UNUSED Learn PID using the encoder readings assuming a PID control model. TODO: Make it less dependent on correct path. """ import sys sys.path.insert(0, "/Users/hikhan/Desktop/Autonomous Robotics Navigation/E160_Code/") from E160_config import CONFIG_DELTA_T from E160_environment import * from E160...
from django.shortcuts import render # Create your views here. from django.shortcuts import render, redirect from .models import Patient from LariatApp import utils from .forms import PatientForm from django.contrib.auth.decorators import login_required from django.contrib.auth import login, authenticate from django.c...
# !/uer/bin/env python3 # coding=utf-8 __version__ = '0.0.1' __author__ = "MedivhXu" __create__ = "2018-07-20"
from .skew_scaler import SkewScaler
from qiskit import QuantumRegister, QuantumCircuit, Aer, execute, ClassicalRegister class qubit: def __init__(self, q, qc): self.q = q self.qc = qc def measure(self): c = ClassicalRegister(len(self.q)) self.qc.measure(self.q, c) # Get backend backend = Aer.get...
# import gamengine modules from bge import logic from bge import events from bge import render from . import OPCreate from . import datastoreUtils from .helpers import * from .settings import * import random, pdb def deleteObjs(): if any(logic.mvb.preActiveObj): logic.undo.append("Deleted") for obj in logic.mv...
#!/usr/bin/env python import pygame, glob from pygame import * class Scenario: ''' Classe com as informações de cenario do jogo. ''' def __init__(self, game): self.screen = game.screen self.img = pygame.image.load("recursos/background.jpg") def update(self): self.screen....
#!/usr/bin/env python3 import sys from pathlib import Path from subprocess import run, PIPE SHARED = Path(__file__).resolve().parent.parent / 'shared' def echo_run(cmd): print('+', *cmd) run(cmd) def main(script): arch = run(['uname', '-m'], stdout=PIPE).stdout.decode('latin1').strip() vm = 'vm-{}'....