text
stringlengths
8
6.05M
import cv2 import numpy as np frameWidth = 640 frameHeight = 480 cap = cv2.VideoCapture(0) cap.set(3, frameWidth) cap.set(4, frameHeight) cap.set(10,150) myColors=[[5,107,0,19,255,255], [133,56,0,159,156,255], [57,76,0,100,255,255]] #these are the values for the orange blue and green ...
#:::SETTINGS SETUP::: import my_utils import printer_library import os import sys from UTILS import insta_settings_lib #:::OBJECTS::: p = printer_library.lib() db = insta_settings_lib.db() #:::DEFINITIONS::: #: Print Menu item with correct format def menu_item(_comm, _desc): p.print('|bold| ' + _comm + ": |res...
def cap_count(a_string): cap_count = 0 for i in a_string: if ord(i)<= 90 and ord(i) >=65: cap_count += 1 return cap_count def low_count(a_string): low_count = 0 for i in a_string: if ord(i)<= 122 and ord(i) >=97: low_count += 1 return low_count def num_c...
import inspect import types import numpy as np from sklearn import utils as skutils from foxhound.rng import np_rng def numpy_array(X): return type(X).__module__ == np.__name__ def iter_data(*data, **kwargs): size = kwargs.get('size', 128) try: n = len(data[0]) except: n = data[0].s...
from django.contrib import admin from django.urls import path from . import views urlpatterns = [ path('',views.index,name="index"), path('see',views.see,name="see"), path('one/<int:id>',views.seeone,name="one") ]
#MovieFind - Search Engine #Requirements import os from flask import Flask, request from flask_cors import CORS from search_movie import search_results #Load DotEnv API_KEY = os.getenv('API_KEY') #API Setup app = Flask(__name__) CORS(app) #Get Data @app.route('/movie', methods=['GET']) def searchMovie(): re...
import pytest from selenium import webdriver link = "https://box-test.boxbattle.ru/game/" @pytest.fixture(scope="class") def test_begin(): print("\nstart browser for test..") browser = webdriver.Chrome() yield browser print("\nquit browser..") browser.quit() class TestSignUp1(): def tes...
import numpy as np import scipy.sparse as sp import time, datetime dimr = (320,480) ld = dimr[0]*dimr[1] stime = time.time() now = datetime.datetime.now() ham_kin = sp.coo_matrix(([],([],[])),shape=(0,ld)) batchsize = 64 nbatch = ld/batchsize for nb in xrange(nbatch): print 'Batch...'+str(nb+1) row4 = np.array([])...
import socket import time import random ### Fake Pade Management Computer def generatePadePacket(bID, count, channel): arr = bytearray(266) arr[0] = 1 arr[2] = bID arr[4] = (count & 0xFF00) >> 8 arr[5] = (count & 0x00FF) arr[6] = channel arr[7] = 1 arr[8] = 1 #generate data p...
from config import engine from api.api import common_api from flask import jsonify from sqlalchemy.sql import text @common_api.route('/api/contacts/<search_text>', methods=['GET']) def get_contacts(search_text): with engine.connect() as connection: #todo: add logic to grab names from all sources - 1.sales...
from .imagenet_train import *
import pygame if __name__ == '__main__': pygame.init() pygame.mixer.music.load('1.mp3') pygame.mixer.music.play() sound1 = pygame.mixer.Sound('2.wav') sound1.play() while pygame.mixer.music.get_busy(): pass
# https://www.mixedcontentexamples.com host = 'MSI:8000' from http.client import HTTPConnection import numpy as np import cv2 import RPi.GPIO as GPIO from picamera import PiCamera from picamera.array import PiRGBArray import time import matplotlib.pyplot as plt from sys import argv import json PORT = 8000 """ 모터 제...
import unittest, json from apay import app, db from apay.models import Merchant from tests import fixtures, utils from flask import jsonify class MerchantTestCase(unittest.TestCase): def setUp(self): app.config.from_object('apay.config.test') db.session.close() db.drop_all() db.cre...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # Copyright # Author: # # 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 ap...
from share.oaipmh import errors as oai_errors class OAIVerb: def __init__(self, name, required=set(), optional=set(), exclusive=None): self.name = name self.required = required self.optional = optional self.exclusive = exclusive @classmethod def validate(cls, **kwargs): ...
# -*- coding: utf-8 -*- import random class Dice(object): def random(self): return random.randint(1, 6)
#!/usr/bin/python # -*- coding: utf-8 -*- # @author: yuanzi # 1. 对照锅蜀黍视频里的过程自己打一遍,自己体会一下 # 2. 解释一遍自己眼中的单一职责原则是什么? # 单一职责原则就是一个code block只做一件事 # 3. [选做]加一个记账函数'record_account',打印:'老妈在小本子记了买菜花销xx元'(xx要计算返回哦) # def buy(): good_price = 3 reasonable_price = 5 buy_amount = 2 who = '麻麻' good_description = '绿油油的...
#!/usr/bin/python import random import time import os import sys import csv from datetime import datetime import fileinput import socket import re import thread from array import array import messaggi import xmlconfReader receive_UDP_IP = "127.0.0.1" #ASCOLTO TRENI UDP_PORT = 1111 confitinerari = "ConfigurazioneItine...
from __future__ import unicode_literals from django.db import models # Create your models here. class university(models.Model): uniName = models.CharField(max_length = 200) uniCode = models.AutoField(primary_key = True) def __str__(self): return self.uniName class Student(models.Model): uniCode = models.Inte...
import sys import datetime # For datetime objects import os.path # To manage paths import sys # To find out the script name (in argv[0]) import backtrader as bt from custom_indicators import * from custom_functions import * import BinaryGenerator as BG import itertools import time import os import glob class NNFX(...
import tensorflow as tf import os import random from progress.bar import Bar FLAGS = tf.app.flags.FLAGS tf.app.flags.DEFINE_string("train_dir", "data/train", "The directory containing all of the files") tf.app.flags.DEFINE_string("test_dir", "data/test", "The directory to save the test files") tf.app....
''' run this file to get up and running all objects will be created no checks will be run (to save time) this is the minimum viable code needed to run after a new session hence its name 0start.py ''' ## pycharm settings # check plt.isinteractive() # set plt.interactive(False) ## create objects # se...
from flask import Flask, request, redirect import datetime import logging import json import os from format_json import hierarchize app = Flask(__name__) if __name__ != '__main__': logHandler = logging.FileHandler('/data/www/infraserver/gunicorn.error') logHandler.setLevel(logging.WARN) app.logger.addHandl...
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'loginwindow.ui' # # Created by: PyQt4 UI code generator 4.11.4 # # WARNING! All changes made in this file will be lost! from PyQt4 import QtCore, QtGui try: _fromUtf8 = QtCore.QString.fromUtf8 except AttributeError: def _fromUtf8(s...
#!/usr/bin/python3 """ create a new class Rectangle """ from models.base import Base class Rectangle(Base): """new classs rectangle Args: Base (class): Inheritance: from Base Class """ def __init__(self, width, height, x=0, y=0, id=None): """Contructor width (int):...
import pygame import random screen_size = [360, 600] screen = pygame.display.set_mode(screen_size) pygame.font.init() background = pygame.image.load('bg.jpg') monkey = pygame.image.load('monkey.ico') fire = pygame.image.load('fire.ico') def display_score(score): font = pygame.font.SysFont('Comic Sans MS', 30) ...
import numpy as np import matplotlib.pyplot as plt import time def solar(INSOLATION, lat, lon, t): sun_longitude = (t%DAY)*360/DAY value = INSOLATION * np.cos(lat*np.pi/180)*np.cos((lon-sun_longitude)*np.pi/180) if value < 0: return 0 else: return value SIGMA = 5.67e-8 EPSILON = 0.75 HEAT_CAPACITY_EA...
import json data='{"name":"harry","add":"pune"}' print(data) a1=json.loads(data) print(a1["name"]) date2={ "helooo ":"gauresh", "Bikes":["ktm","bullet","splander"], "pocket":("one rupee coin","pen hain"), "isbad":False } jsoon=json.dumps(date2) print(jsoon) person_dict = {'name': 'Bob', 'age': 12...
def main(): x = float(input("Valor de x: ")) epsilon = float(input("Valor de epsilon: ")) r_ant = x while True: r = (r_ant +(x / r_ant)) / 2.0 if abs(r - r_ant) < epsilon: break r_ant = r print(r...
#!/usr/bin/python # -*- coding:utf-8 -*- import xml.etree.ElementTree as ET import uuid, hashlib from datetime import datetime import random import time import pdb def CDATA(text): return '<![CDATA[%s]]>' % text def createOrderId(): prefix = datetime.now().strftime('%Y%m%d%H%M%f') randomNum = '%08d' % random.ran...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ app.modules.projects ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 项目模块 """ from flask_smorest import Blueprint blp = Blueprint('Project', __name__, url_prefix='/projects', description='项目模块')
low = int(input("hvar byrjar bilið? ")) high= int(input("hvar endar bilið? ")) counter = low while counter <= high: if counter % 2 == 1: print(counter) counter += 1
###########control flow tools############# #4.1 if statment x=int(input("masukan angka : ")) if x < 0: x=0 print('bilangan negatif diubah ke 0') elif x==0 print('zero') elif x==1: print('single') elif: print('more') #4.2 for kata=['kucing','jendela','lantai'] for w in kata: print(w, len(w)) pr...
results = { 1 : [ {u'body': [u'ny university of <b>new</b> <b>york</b> state'], u'title': [u'title1'], u'tags': [u'tag1']}, {u'body': [u'<b>new</b> mayor of <b>ny</b> state increased tax'], u'title': [u'title2'], u'tags': [u'tag2']} ], 2: [ {u'body': [u'ny university of new <b>york</b> state'], u'title': [u'title1'], ...
# # CHIP-8 interpreter. # # Copyright (C) 2018 Mateusz Furga # This software is released under the MIT license. class Memory(object): """ CHIP-8 memory class. Source: http://devernay.free.fr/hacks/chip8/C8TECH10.HTM#2.1 The CHIP-8 language is capable of accessing up to 4KB (4,096 bytes) ...
import numpy as np from sklearn.base import BaseEstimator, ClassifierMixin from sklearn.tree import DecisionTreeRegressor from sklearn.model_selection import cross_val_score from sklearn.ensemble import GradientBoostingClassifier from line_profiler import LineProfiler from sklearn.datasets import load_iris from sklear...
numbers = raw_input("Enetr nos. with , ").split(",") b = [int(x) for x in numbers] flag=True print len(b) for i in range(1,len(b)): if i!=len(b)-2 and i!=len(b)-1: if (int(b[i])+int(b[i-1]))!=int(b[i+1]): flag=False if flag==True: print "Yes" else: print"NO"
# ---------------------------------------------------------------------------- # Based on SeanNaren's deepspeech.pytorch: # https://github.com/SeanNaren/deepspeech.pytorch # ---------------------------------------------------------------------------- import logging from torch.utils.data import Dataset from .processor...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Sat May 30 10:50:48 2020 @author: TakahiroKurokawa """ #ThreadPoolExecutorクラスはExecutorクラスのサブクラス from concurrent.futures import ThreadPoolExecutor,Future #非同期に行いたい処理 def func(): return 1 #非同期に行いたい処理をThreadPoolExecutorクラスのメソッドsubmit()に渡す future = Threa...
class Solution: def findMin(self, num): left, right = 0, len(num) - 1 while left < right : m = left + (right - left)/2 if num[m] > num[right]: left = m + 1 elif num[m] < num[right]: right = m else: right -= 1 return num[left]
''' @author: Mariano Pais y Tatiana Molinari. ''' import Memoria import PCP import PCB import Programa import sys class Kernel(object): def __init__(self, pcp): self.memoria = Memoria() self.cpu = CPU() self.pcp=pcp self.DispositivoIO = DispositivoIO() ...
import re def regCheck(line): #space = re.compile(" +") sp = "(\s*)"#"([\space]*)" Exp = "(move|turnLeft|turnRight|attack)" Oarg = "(\()" Carg = "(\))" Num = "(\d+)" statement = sp + Exp + sp + Oarg + sp + Num + sp + Carg regex = re.compile(statement) matchObj = re.match(regex, ...
from flask_restful import Resource, reqparse from flask_jwt import jwt_required, current_identity from flask import request,render_template from werkzeug.utils import secure_filename import random import json, forecastio, os, boto3, random, string from models.item import ItemModel from models.closet import ClosetMod...
#=============================================================================== # Sean Corrigan 2017 # ICS 3U1 # Temp Checker #=============================================================================== # import libraries import os # Needed for clearing the terminal in a clear manner import time # Needed to slee...
# -*- coding:utf-8 -*- from elasticsearch import Elasticsearch if __name__ == '__main__': """ 连接到“node-test”节点 创建newsbase索引(数据库) 单条插入10条数据 """ es = Elasticsearch('127.0.0.1:9200') ## 创建索引(数据库) es.indices.create( index = 'newsbase', ignore = 400, b...
import time from flask import Flask, jsonify, render_template, flash, redirect, request, url_for from flask_sqlalchemy import SQLAlchemy DBUSER = 'dayanna' DBPASS = 'sistemas' DBHOST = 'database' DBPORT = '5432' DBNAME = 'productosdb' app = Flask(__name__) # app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///product...
import pystmark from django.conf import settings class EmailSender(object): def __init__(self, to, subject, text=None, html=None): self._to = to self._subject = subject self._text = text self._html = html self._sender = None def send(self): pm = pystmar...
import matplotlib.pyplot as plt import numpy as np inputFolder = "../Data/" outputFolder = "../Plots/IntersectionPlots/" showImage = True def endPlot(): if showImage: plt.show() else: plt.close() def primaryAnalysis(): #load the workload file and visualize it. filePath = inputFolder + "averageTable_AllInter...
#!/usr/bin/env python # SPDX-License-Identifier: BSD-3-Clause # Copyright (c) 2015 Google, Inc. # Copyright (c) 2015 Linaro, Ltd. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # 1. Redistributi...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Author: TaoRui Date: 2020/08/01 14:36:33 Description:返回有序数组中指定元素的索引,二分查找 """ def binary_search(arr, left, right, x): # 基本判断 if right >= left: mid = int(left + (right - left) / 2) # 元素整好的中间位置 if arr[mid] == x: return mid ...
import imp import re import subprocess from os.path import abspath, dirname, join from typing import List, Optional, Tuple from setuptools import find_packages, setup # Package meta-data NAME = "project" VERSION = None # Will use version provided in __version__ if None DESCRIPTION = "A python template project." LONG...
from django.db import models from django.utils import timezone class GhostPost(models.Model): is_boast = models.BooleanField(default=True, blank=True) post = models.CharField(max_length=280) up_votes = models.IntegerField(default=0) down_votes = models.IntegerField(default=0) submission = models.Da...
from rest_framework import serializers from kratos.apps.task.models import Task class TaskSerializer(serializers.ModelSerializer): name = serializers.SerializerMethodField() def get_name(self, instance): return instance.tasktpl.name class Meta: model = Task fields = ('id', 'name'...
import pyglet sound = pyglet.media.load('music.mp3', streaming=False) sound.play() pyglet.app.run()
import tensorflow as tf import numpy as np def cross_entropy_loss_v1(y_true, y_pred, sample_weight=None, eps=1e-6): """ :param y_pred: output 5D tensor, [batch size, dim0, dim1, dim2, class] :param y_true: 4D GT tensor, [batch size, dim0, dim1, dim2] :param eps: avoid log0 :return: cross ...
import os if not os.path.exists("manual"): os.makedirs("manual") with open("unknown-gender.txt") as unknown, \ open("lfw-names.txt") as names, \ open("manual-gender.txt", "w") as manual: nextline = unknown.readline() firstname = "" while nextline: array = nextline.split() ...
arr = [0,0,0,1,2,3] def push_zero_to_end(arr): w_i = 0 r_i = 0 while r_i < len(arr): if arr[w_i] == 0: if arr[r_i] == 0: r_i += 1 else: arr[w_i] = arr[r_i] w_i += 1 r_i += 1 elif arr[r_i] == 0: ...
from django.contrib import admin from .models import Autor # Register your models here. class autorAdmin(admin.ModelAdmin): list_display = ["__unicode__","apellido"] class Meta: models= Autor admin.site.register(Autor, autorAdmin)
# ----------------------------- # -*- coding:utf-8 -*- # author:kangkang # datetime:2019/4/27 14:43 # ----------------------------- import json import re path = '../../../datasets/coco2017/annotations/' val = json.load(open(path+'captions_val2017.json', 'r')) train = json.load(open(path+'captions_train2017.json', 'r')...
from django.db import models from django.utils import timezone from django.contrib.auth.models import User class Post(models.Model): creator = models.ForeignKey( User, on_delete=models.SET_NULL, null=True ) caption = models.CharField(max_length=255) created_at = models.DateTimeField(default=tim...
""" Argumentos a recibir tipos de casilla (primero) 0 = casilla en blanco, las de en medio 1 = casillas objetivo verdes, player 1 (derecha superior) 2 = casillas objetivo rojo, player 2, AI (izquierda inferior) tipos de fichas (segundo) 0 = sin pieza 1 = ficha verde, player 1 2 = ficha roja, player 2, AI """ ...
%load_ext autoreload autoreload 2
import torch import torch.nn as nn import torch.nn.functional as F class ContextFreeEncoder(nn.Module): def __init__(self, element_encoder, element_dims='1d'): """ Applies a module on each element of the set independently. WARNING: only tested with convolution-like encoders :param ...
""" System tests for `gocdapi.go` module. """ import unittest from gocdapi_tests.systests.base import BaseSystemTest class TestAgents(BaseSystemTest): def test_delete_agent(self): agent = self.go.agents.itervalues().next() agent.disable() agent.delete() self.assertTrue(agent not i...
import tkinter as tk class Appliication(tk.Frame): def __init__(self,master=None): super().__init__(master) self.pack() self.create_widgets() def create_widgets(self): self.hi_there=tk.Button(self) self.hi_there["text"]="Hello World\n(click me)" self.hi_there["c...
import requests import json from yafi import YaFi # Otra clase que se llame MAIN y que se le pase el comando y el período, de allí se deriva a las apis según # lo que diga el config apple = YaFi('AAPL') apple.getClose()
import sys from rest_framework import exceptions from caluma.data_source.data_source_handlers import ( get_data_source_data, get_data_sources, ) from . import jexl from .models import Question class AnswerValidator: def _validate_question_text(self, question, value, **kwargs): max_length = ( ...
paisa=[3000, 600000, 324990909, 90990900, 30000, 5600000, 690909090, 31010101, 532010, 510, 4100] i=0 c=0 c1=0 c2=0 while i<len(paisa): if paisa[i]>10000000: c=c+1 elif paisa[i]>100000: c1=c1+1 else: c2=c2+1 i=i+1 print(c,"crorepati") print(c1,"lakhpati") print(c2,"dilwale")
import cv2 import xml.etree.ElementTree as ET import numpy as np imarray=np.zeros((1,100,100)) im = cv2.imread('shiptest.jpg') im=im[:,:,0] imarray[0]=im np.save('test.npy',imarray)
import morepath import os.path from onegov.core.framework import Framework from onegov.core import utils from webtest import TestApp as Client def test_independence(temporary_directory): class App(Framework): pass app = App() app.configure_application( filestorage='fs.osfs.OSFS', ...
import unittest import rh class RobinTest(unittest.TestCase): def test(self): d = rh.robinhood(1) d.insert('te') d.insert('collisions are hard') self.assertEqual(2, len(d))
number=int(input("enter value")) if(number<10): print("10 se chhota hai") elif(number>10 and number<20): print("20 se chhota hai") else: print("20 se bada hai")
from skimage import io import numpy as np from skimage import measure try: from perspective_transform import apply_transform from img import normalize_img, get_2d_image, save_image from timing import get_timestamp except ImportError: from vision_utils.perspective_transform import apply_transform fr...
from bottle import route, run, request, get, post import feedparser import random import os import spacy import psycopg2 @get('/test') def get_test(): # Gives the 5 top stories from CNN, BBC, ABC, NYTimes, and Fox News to test article output # title, summary, link, published cnnRss = feedparser.parse("http...
images_loc = './media' COOKIE_GAME_ID = 'codenames_game_id' COOKIE_USER_ID = 'codenames_name_id'
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('reimbursements', '0009_auto_20150123_0016'), ] operations = [ migrations.AddField( model_name='reimbursement', ...
import time import math import random class HumanGreeter(object): """ A class to react to face detection events and greet the user. """ def __init__(self, app, name, walk=False): """ Initialisation of qi framework and event detection. Walk determines if Pepper should walk rando...
import unittest from ..fields.selection import SelectionStates, State class TestSelectionStates(unittest.TestCase): def test_values(self): alt_name = "Alternative name" class States(SelectionStates): TEST = State() _NON_EXISTENT = State() SECOND = State() ...
def complete(matrix,max): for x in range(max): for y in range(max): if matrix[x][y]==0: return False return True
from Login.BasePage import * from selenium.webdriver.common.by import By from selenium.webdriver.support.ui import Select class CompanyCertificate(Page): company_loc = (By.LINK_TEXT,"企业管理") # 企业管理 operation_loc = (By.CLASS_NAME,"operation_btn_item ") # 申请认证 name_loc = (By.ID,"companyName") ...
import cv2 import numpy as np cap = cv2.VideoCapture(0) while(1): _, frame = cap.read() frame = cv2.flip(frame,1) edges = cv2.Canny(frame,100,200) re,contours,hierachy=cv2.findContours(edges,cv2.RETR_TREE,cv2.CHAIN_APPROX_SIMPLE) cv2.drawContours(frame, contours, -1, (255,255,255), 2) # img =...
import os import sys import warnings import numpy as np from PIL import Image from keras.models import load_model warnings.simplefilter(action='ignore', category=FutureWarning) os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3' np.set_printoptions(threshold=np.nan) running_dir = os.path.dirname(os.path.abspath(__file__)) ...
import datetime import unittest from telnetlib import EC from time import sleep from selenium import webdriver from selenium.common.exceptions import TimeoutException from selenium.webdriver.common.by import By from selenium.webdriver.support.select import Select from selenium.webdriver.support.wait import WebDriverWa...
# Copyright (c) 2011, James Hanlon, All rights reserved # This software is freely distributable under a derivative of the # University of Illinois/NCSA Open Source License posted in # LICENSE.txt and at <http://github.xcore.com/> from functools import reduce from util import vmsg, debug from walker import NodeWalker ...
from dataclasses import dataclass @dataclass class Produto: nome: str preco_inicial: float
LARGE = False SMALL = True def bubble_sort(sort_list, sort_by=LARGE): if type(sort_list) is not list: return list_len = len(sort_list) if sort_by: for i in range(list_len - 1): for j in range(1, list_len - i): if sort_list[j] > sort_list[j - 1]: ...
import json from statistics import mean import hydra import os import torch from omegaconf import OmegaConf import pytorch_lightning as pl from pytorch_lightning import loggers from pytorch_lightning.callbacks import ModelCheckpoint, EarlyStopping from transformers import AutoTokenizer from source.DataModule.PawsData...
import sys import os import string import time ''' Removes the mental ray popup by removing the requirement line in .ma files. Can be used on a folder and left on overnight ''' def replaceLine(fName): #read file FileName = fName f = open(FileName,"r") outName = FileName+".new" o...
#mini proyecto 2 TOTITO # matriz para el tablero tablero= [[" | | "],\ [" | | "],\ [" | | "],\ ["----------|---------|----------"],\ [" | | "],\ [" | ...
import inspect import os import re from collections import deque from shutil import rmtree from bs4 import BeautifulSoup import pytimize def generate(): style = """ div { width: 80%; max-width: 1000px; margin: auto; } pre { display: inline...
import ex38_ states = ex38_.new() ex38_.set(states,"Oregon", "OR") ex38_.set(states,"Florida", "FL") ex38_.set(states,"California", "CA") ex38_.set(states,"Bew York", "NY") ex38_.set(states,"Michigan", "MI") cities = ex38_.new() ex38_.set(cities,"CA","San Francisco") ex38_.set(cities,"MI","Detroit") ex38_.set(citie...
import os import sys import math import argparse import random import numpy as np import matplotlib import matplotlib.pyplot as plt from astropy.io import fits from astropy.io import fits from astropy.io import ascii from astropy.table import Table def JytoABMag(flux): return (-5.0 / 2.0) * np.log10(flux) - 48.60 JA...
person = {} first_name = input("Enter first name: ") person["first_name"] = first_name second_name = input("Enter second name: ") person["second_name"] = second_name third_name = input("Enter third name: ") person["third_name"] = third_name birth_year = input("Enter birth year: ") person["birth_year"] = int(birth_year...
# -*- coding: utf-8 -*- import tic_tac_toe as ttt import unittest import logging logging.basicConfig(level=logging.WARNING) logger = logging.getLogger(__name__) class GameTests(unittest.TestCase): def test_not_Host_arg(self): '''arg passed to __init__ must be Host class instance otherwise NotH...
from __future__ import unicode_literals from django.db import models # Create your models here. class PigcmsUserinfo(models.Model): # id = models.TextField(primary_key=True) # This field type is a guess. portrait = models.CharField(max_length=200) wallopen = models.TextField() # This field type is a g...
# # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. # # 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, including without limitation the rights to ...
from setuptools import setup, find_packages from os import path this_directory = path.abspath(path.dirname(__file__)) with open(path.join(this_directory, 'README.md'), 'r') as f: long_description = f.read() requirements = [ "matplotlib==3.3.4", "numpy==1.19.5", "pandas==1.1.5", "torch==1.8.1", "tensorbo...
#!/usr/bin/env python from gensimudata import UNUM from gensimudata import SNUM from gensimudata import S from gensimudata import advise from gensimudata import invocateCo from gensimudata import curUser from gensimudata import w import time import pprint def qualifySoftware(): sq = [] for i in range(SNUM): ...
import pyautogui import time class cordinates(): replay=(960,450) dino=(663,464) spbreak1=(1000,470) spbreak2=(1100,470) #740 def restartgame(): pyautogui.click(cordinates.replay) restartgame() def speedcal(): speed=0 tester1=pyautogui.pixel(cor...