text
stringlengths
8
6.05M
from schema.user import FIELDS from cerberus import Validator from cerberus.errors import ValidationError from util.error.errors import NotValidParameterError def validate_user_create(req, res, resource, params): schema = { 'username': FIELDS['username'], 'email': FIELDS['email'], 'passwor...
# This file is part of AstroHOG # # Copyright (C) 2013-2017 Juan Diego Soler import numpy as np from astropy.convolution import convolve_fft from astropy.convolution import Gaussian2DKernel from congrid import * from scipy import ndimage import pycircstat as circ from nose.tools import assert_equal, assert_true impo...
from selenium import webdriver import time a=webdriver.Chrome() a.get("http://www.baidu.com") a.maximize_window() a.find_element_by_id('kw').send_keys('哈哈哈 kimoji') a.find_element_by_xpath("") #相对定位 以//开头 //标签名[@属性名=值 and 或者or ]例如 //input[@name="wd" and @autocomplete="off"] #层级定位 //父标签[@属性名-值]/子标签[@属性名-值]//子孙标签[@属...
from collections import defaultdict d = defaultdict(list) d['a'].append(1) d['a'].append(2) d['b'].append(4) print d d = defaultdict(set) d['a'].add(1) d['a'].add(2) d['b'].add(4) print d d = {} d.setdefault('a', []).append(1) d.setdefault('a', []).append(2) d.setdefault('b', []).append(4) print d print d['a'][1] '...
import time base=float(input("Please enter the base of the triangle :")) height = float(input("Please enter the height of the triangle :")) print("Calculating area of triangle on the basis of your input ...") area=(0.5)*base*height time.sleep(1) print("AREA :",area)
import click import confuse import sqlalchemy.dialects from .alias import alias from .domain import domain from .user import user cfg = confuse.Configuration("vmail-manager", __name__) @click.group(context_settings=dict(max_content_width=120)) @click.option( "--dialect", type=click.Choice(sqlalchemy.dialect...
import collections import os from xml.etree.ElementTree import Element as ET_Element from .vision import VisionDataset try: from defusedxml.ElementTree import parse as ET_parse except ImportError: from xml.etree.ElementTree import parse as ET_parse from typing import Any, Callable, Dict, List, Optional, Tuple...
###################################################################### #Programmer: Mateusz Przezdziecki date: 1/30/21 #File: prac_proj_1.py #Purpose: Change the color of a single color. ###################################################################### import numpy as np import matplotlib.image as mpimg # mpimg....
import sys sys.path.append('../queue_and_stack') from dll_queue import Queue from dll_stack import Stack from queue import Queue class BinarySearchTree: def __init__(self, value): self.value = value self.left = None self.right = None # Insert the given value into the tree def inser...
#!/home/zcyang/git/script/Python/venv/bin/python from ddos import Control_ddos import sys aclname = "acl1" if __name__ == "__main__": ar = sys.argv ob = Control_ddos("10.0.100.114") if ar[1] == "s1": print(ob.send_command("show ddos global acl-ipv4")) if ar[1] == "s2": print(ob.send_co...
AIRPORTS = {'origin': 'x', 'destination': 'y'} TEMPERATURES = {'x': 'temperature_x', 'y': 'temperature_y'} PRECIPITATION = {'x': 'precipitation_x', 'y': 'precipitation_y'} VISIBILITY = {'x': 'visibility_x', 'y': 'visibility_y'} WINDSPEED = {'x': 'wind_speed_x', 'y': 'wind_speed_y'} CATEGORICAL_INPUTS = ['carrier_code',...
import pockexport.export import json import pickle from load.gsheet import Gsheet def extract_pocket(consumer_key, access_token): pocketData = pockexport.export.get_json(consumer_key=consumer_key, access_token=access_token) with open('source/pocket/all.json', 'w') as outfile: json.dump(pocketData,outfi...
''' Author: MK_Devil Date: 2022-01-13 11:13:09 LastEditTime: 2022-01-14 14:13:31 LastEditors: MK_Devil ''' #!/usr/bin/env python # -*- coding:utf-8 -*- import sqlite3 # 建立数据库连接 conn = sqlite3.connect(r'.\实例\4、sqlite3\Alchemy.db') # 创建游标 cur = conn.cursor() # 查询输出所有 # cur.execute(r'select * from material') # print(cur...
#!/usr/bin/env python # Copyright (c) 2013 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """ Verifies library_dirs (in link_settings) are properly found. """ import sys import TestGyp test = TestGyp.TestGyp() lib_dir = test.t...
# Copyright 2019 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). import os import pytest from pants.fs.fs import safe_filename class FixedDigest: def __init__(self, size): self._size = size def update(self, value): pass ...
import click import numpy as np import logging import pickle from sklearn.preprocessing import RobustScaler from sklearn.utils import check_random_state from recnn.preprocessing import rewrite_content from recnn.preprocessing import permute_by_pt from recnn.preprocessing import extract from recnn.recnn import event_p...
#!/usr/bin/env python # coding: utf-8 # In[1]: import cv2 # pip install opencv-python import readInput # this is not a package, this is a local file (located in the folder) import pandas as pd from sklearn.decomposition import PCA import numpy as np import time import pickle import os import sys # In[2]: dir_...
from value_objects.util.decorate import wraps def once( compute ): ''' Use @once instead of @property when you want a cached property ''' # global count ensures uniqueness even when the function is unnamed (i.e. lambda) global once_count once_count += 1 # including __name__ for debugging conven...
import numpy as np import matplotlib.pyplot as plt from mnist import MNIST def load_data(): # Load data mndata = MNIST('data_files') train_x, train_y = mndata.load_training() test_x, test_y = mndata.load_testing() # Convert to numpy arrays train_x = np.array(train_x).T / 255 train_y = np....
#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= # 2018 July 7 polygon set import os os.chdir('C:\\Users\\James\\Documents\\data science education\\GA\\DSI\\capstone\\stars\\code') %run -i alpha_utils %run -i train_prep_lib os.chdir('C:\\Users\\James\\Documents\\data science education\\...
#I pledge my honor that I have abided by the Stevens Honor System. Jill McDonald #Problem 1 def bmi(weight, height): bmi = weight * 720 / height ** 2 print('Your BMI is', bmi) if bmi < 19: print('Your BMI is considered below the healthy range.') elif bmi <= 25: print('Your BMI is cons...
# import tcs # import daqctrl, inspect # ------------------------------------------------------------------ # install the script by: # cd $INTROOT/config/scripts # ln -s $guiInstalDir/ctaOperatorGUI/ctaGuiBack/ctaGuiBack/acs/guiACS_schedBlocks_script0.py # ----------------------------------------------------------...
import unittest from katas.kyu_6.validate_credit_card_number import validate class ValidateCreditCardNumberTestCase(unittest.TestCase): def test_true(self): self.assertTrue(validate(26)) def test_true_2(self): self.assertTrue(validate(91)) def test_true_3(self): self.assertTrue(...
#!/usr/bin/env python3 # # This example demonstrates the use of consistent radial transport # on f_re and n_re. # # Run as # # $ ./generate.py # $ ../../build/iface/dreami dream_settings.h5 # # ################################################################### import numpy as np import sys sys.path.append('../.....
from django import forms from .models import Read class ReadingForm(forms.ModelForm): class Meta: model = Read fields = ('title', 'url', 'data') # your_name = forms.CharField(label='Your name', max_length=100) # title = forms.CharField(label='Title',max_length=200) # url ...
from flask_sqlalchemy import SQLAlchemy from flask_marshmallow import Marshmallow from config import pms_app # sqlite_url = "postgresql://postgres:nikhil@localhost:5432/probe_management_system" sqlite_url = "postgresql://postgres:nikhil@localhost:5432/probe_management_system" pms_app.config["SQLALCHEMY_ECHO"] = True p...
# Generated by Django 2.2.1 on 2019-05-19 20:15 from django.db import migrations import localflavor.generic.models class Migration(migrations.Migration): dependencies = [ ('events', '0007_event_event_country'), ] operations = [ migrations.AlterField( model_name='event', ...
from os.path import join from SCons.Script import Import, SConscript Import("env") SConscript( join(env.PioPlatform().get_package_dir("framework-zephyr"), "scripts", "platformio", "platformio-build.py"), exports="env")
html_template = """ <html> <head> <title>Widget export</title> <!-- Load RequireJS, used by the IPywidgets for dependency management --> <script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.4/require.min.js" integrity="sha256-Ae2Vz/4ePdIu6ZyI/5ZGsY...
import time from server.blockchain.blockchain import Blockchain from server.config import SECONDS blockchain = Blockchain() times = [] for i in range(1000): start_time = time.time_ns() #add_block function takes time to execute; which makes a time difference blockchain.add_block(i) end_time = time.ti...
import unittest from katas.beta.only_readable_once_list import SecureList class SecureListTestCase(unittest.TestCase): def setUp(self): self.base = [1, 2, 3, 4] def test_equals(self): a = SecureList(self.base) self.assertEqual(a[0], self.base[0]) self.assertEqual(a[0], self.b...
truthy = True falsy = False age = 20 is_over_age = age >= 18 is_under_age = age < 18 is_twenty = age == 20 my_number = 5 user_number = int(input("Enter a number: ")) print(my_number == user_number) print(my_number != user_number) yes = True and True no = True and False print(no) which_one_is_it = True or False se...
import matplotlib.pyplot as plt import matplotlib.colors import numpy as np import seaborn as sb import math class Plot: def __init__(self): self.name = "Plot" # colour map: agent properties in time def Fig1(self, sellerP, numB, capital): if sellerP.any() != 0: fig = plt.figur...
from Utilities.ConfigurationsHelper import set_configuration, get_configuration def initialize(bot): for guild in bot.guilds: guild_id = guild.id # Default ADMIN_ROLE is either a role named Commissions or # the top role in role hierarchy if not get_configuration(guild_id, "ADMIN_R...
from django.shortcuts import render from manager.models import * from django import http from django.views import View import json, requests from django.db.models import Max from django.db import transaction from django.db import IntegrityError from django.db.models import Sum, Count, Max, Min, Avg def login_check(req...
import numpy as np import os import clify import argparse from config import rl_config as config config.update( image_shape_grid=(2, 2), reductions="sum", ) grid = [dict(n_train=1, do_train=False)] + [dict(n_train=x) for x in 2**np.arange(0, 18, 2)] parser = argparse.ArgumentParser() parser.add_argument("--...
# -*- coding:utf-8 -*- import numpy as numpy from sympy import * from math import log ''' 新的博弈模型 ''' def game(S,C = 3,C_DU = 2,C_BS = 1,N = 32,a = 2,e = 0.1): C = 3 #RU对包的基本支付单价 C_DU = 2 #DU传输一个包的成本 C_BS = 1 #BS传输一个包的成本 N = 32 #总包数 a = 2 #满足因子 e = 0.1 #丢包率 x = Symbol('x') # expr1...
import datetime import threading import matplotlib.pyplot as plt import matplotlib.dates as mdates class Plotif(): def __init__(self): self.axl=[] self.twinx_l=[] plt.ion() def init_twinx(self, fig_list, n_fig, n_total_data): c_twinx_l=[] for i ...
print("Hello World") print("Goodbye World") #shows goodbye world on terminal
#!/usr/bin/env python # encoding: utf-8 """ Created by 'bens3' on 2015-01-21. Copyright (c) 2013 'bens3'. All rights reserved. Unpublish records marked non web publishable python tasks/unpublish.py --local-scheduler --date 20150702 """ import luigi import ckanapi from datetime import datetime, timedelta from ke2mon...
""" This type stub file was generated by pyright. """ import marshmallow as ma """Exception handler""" class ErrorSchema(ma.Schema): """Schema describing the error payload Not actually used to dump payload, but only for documentation purposes """ code = ... status = ... message = ... erro...
import os,sys import string from optparse import OptionParser import glob import json import pymongo from pymongo import MongoClient import datetime __version__="1.0" __status__ = "Dev" ############################### def main(): usage = "\n%prog [options]" parser = OptionParser(usage,version="%prog vers...
import json import logging import os import re import boto3 from botocore.exceptions import ClientError from cfn_resource_provider import ResourceProvider log = logging.getLogger() log.setLevel(os.environ.get("LOG_LEVEL", "INFO")) request_schema = { "type": "object", "required": ["Name"], "properties": {...
from django.apps import AppConfig class L24OConfig(AppConfig): name = 'l24o'
# -*- coding: utf-8 -*- import os.path # Parsing Paths for path in ['/one/two/three', '/one/two/three/', '/', '.', '']: print path, ' : ', os.path.split(path) ''' /one/two/three : ('/one/two', 'three') /one/two/three/ : ('/one/two/three', '') / : ('/', '')...
#-*- coding: utf-8 -*- import pandas as pd data_file = 'discretization_data.xls' data = pd.read_excel(data_file) data = data[u'肝气郁结证型系数'].copy() k = 4 d1 = pd.cut(data, k, labels=range(k)) print d1 w = [1.0 * i / k for i in range(k+1)] # w = data.describe()
""" https://leetcode.com/problems/merge-two-sorted-lists/ Easy Merge Two Sorted Lists Merge two sorted linked lists and return it as a sorted list. The list should be made by splicing together the nodes of the first two lists. Input: l1 = [1,2,4], l2 = [1,3,4] Output: [1,1,2,3,4,4] Example 2: Input: l1 = [], l2 = ...
import gzip import os from gensim import interfaces from gensim.corpora.csvcorpus import CsvCorpus from gensim.corpora.textcorpus import walk from iranlowo.preprocessing import is_valid_owé_format, normalize_diacritics_text from iranlowo.utils import is_text_nfc class Corpus(interfaces.CorpusABC): def __init__(...
from typing import Any from pyVmomi.vmodl import ManagedObject def __getattr__(name: str) -> Any: ... # incomplete class InvalidArgument(Exception): ... class ManagedObjectNotFound: obj: ManagedObject
from pymongo import MongoClient # Criando a conexao com o Banco mongo_con = MongoClient() # Usar o Banco db = mongo_con['flask-app']
from gensim.models import LdaModel import numpy as np import os import pickle from scipy.stats import entropy import pandas as pd import seaborn as sns import plotly import plotly.graph_objects as go import plotly.express as px import pyLDAvis import pyLDAvis.gensim import matplotlib.pyplot as plt from utilities import...
#!/usr/bin/env python # -*- coding: utf-8 -*- import os, ast from ConfigParser import ConfigParser class Config(): def __init__(self, filename="settings.ini"): self.defaulttimedict = { "06:00":(12,151,250), "06:30":(251,13,52), "12:00":(247,37,21), ...
n, m = map(int, input().split(' ')) txt = input().split(' ') c = [] for i in range(n): c.append(int(txt[i])) answer = [] for i in range(len(c)-2): for j in range(i+1, len(c)-1): for k in range(j+1, len(c)): o = c[i] + c[j] + c[k] if c[i] + c[j] + c[k] <= m: answe...
# Copyright 2021 DAI Foundation # # 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,...
from pyspark import SparkContext from pyspark import SparkConf def CreateSparkContext(): ''' spark配置: 1.显示在spark或 hadoop-yarn UI界面的App名称 2.设置不显示spark执行进度以免界面太乱 ''' sparkConf = SparkConf().setAppName('FilmRecommend') \ .set('spark.ui.showConsoleProgress','false') sc = SparkCont...
""" Представлен список чисел. Определить элементы списка, не имеющие повторений. Сформировать итоговый массив чисел, соответствующих требованию. Элементы вывести в порядке их следования в исходном списке. Для выполнения задания обязательно использовать генератор.""" num_list = [1, 2, 3, 2, 4, 5, 5, 6, 1] new_list ...
# Ryan Spies # 8/5/2014 # Python 2.6.5 # This script calculates a mean daily max and min temperature for each month #!!!!!!!!!!! Units left in degrees F !!!!!!!!!!!!!!!!!!!!!!! #!!!!!!!!!!! Data must be 6 hour time steps !!!!!!!!!!!!!!!!!!!!!! import os import numpy as np from dateutil import parser from d...
import string KEYS_TO_ORD = { 'c' : 0, 'cis': 1, 'des': 1, 'd': 2, 'dis' : 3, 'e' : 4, 'es' : 4, 'f': 5, 'fis': 6, 'ges': 6, 'g' : 7, 'gis': 8, 'as': 8, 'a': 9, 'b': 10, 'ais': 10, 'h' : 11 } ORD_TO_KEY = { 0 : 'c', 1 : 'cis',...
#!/usr/bin/env python ''' chat_server.py -- Simple chat server for chat_client.py ''' import sys import socket import select from twisted.internet import protocol, reactor, endpoints # TODO: Store all config values in a YAML config file. HOST = '127.0.0.1' PORT = 5000 MAX_CLIENTS = 3 RECV_BUFFER = 4096 # Zero valu...
from django.contrib.auth.models import User, AbstractUser from django.contrib.contenttypes.fields import GenericForeignKey, GenericRelation from django.contrib.contenttypes.models import ContentType from django.db import models # Create your models here. from django.db.models import CASCADE from django.utils.datetime_...
from threading import Thread import requests import time import json class wtm (Thread): def __init__(self,win): #Intializing the request for the Yahoo Weather API ############### ALL COMMENTEND WAITING FOR API KEY ############### #Basic info self.url = "https://weather-fetcher-nmiot.herok...
from PyQt5 import QtGui, QtWidgets from bsp.leveleditor.DocObject import DocObject from enum import IntEnum # What viewport type can a tool be used in? class ToolUsage(IntEnum): View2D = 0 View3D = 1 Both = 2 class BaseTool(DocObject): Name = "Tool" KeyBind = None WantButton = True Tool...
import subprocess import psutil import platform import tensorflow_datasets as tfds import json import os import http.client import requests import multiprocessing from SCASSHManager import listen_and_accept_requests import time agent_registered = False base_conda_env_installed = False accepting_jobs = False anaconda_u...
import socket addr=("0.0.0.0",19562) ss = socket.socket(socket.AF_INET,socket.SOCK_STREAM) ss.bind(addr) while 1: data,addr= ss.recvfrom(1024) ss.sendto(data, addr)
# -*- coding:utf-8 -*- # 匿名函数 from math import log #引入Python数学库的对数函数 # 此函数用于返回一个以base为底的匿名对数函数 def make_logarithmic_function(base): return lambda x:log(x,base) # 创建了一个以3为底的匿名对数函数,并赋值给了My_LF My_LF = make_logarithmic_function(3) # 使用My_LF调用匿名函数,参数只需要真数即可,底数已设置为3。而使用log()函数需要 # 同时指定真数和对数。如果我们每次都是求以3为...
try: from charm.core.math.elliptic_curve import elliptic_curve,ZR,G,init,random,order,getGenerator,bitsize,serialize,deserialize,hashEC,encode,decode,getXY #from charm.core.math.elliptic_curve import InitBenchmark,StartBenchmark,EndBenchmark,GetBenchmark,GetGeneralBenchmarks,ClearBenchmark except Exception as err...
import random a = str(input('First student:')) b = str(input('Second student')) c = str(input('Third student')) d = str(input('Forh student')) list =[a, b, c, d] random.shuffle(list) print(list)
"""FTDs to VPNs Class.""" from fmcapi.api_objects.apiclasstemplate import APIClassTemplate import logging class FTDS2SVPNs(APIClassTemplate): """The FTDS2SVPNs Object in the FMC.""" VALID_JSON_DATA = [ "id", "name", "type", "ipsecSettings", "endpoints", "ikeSe...
#!/usr/bin/env python # -*- coding: utf-8 -*- # # copia.py # # Copyright 2015 Cristian <cristian@cristian> # """ Escreva um programa que cria uma cópia de um arquivo via CLI. Exemplo: python3 copia.py <arquivo original> <arquivo copia> """ import sys def copia(nomeArquivo, nomeNovoArquivo): PARAMETROS = 3 c...
import re comment = re.compile(r'/\*(.*?)\*/') text1 = '/* abcsdfasdfasdf */' text2 = '''/* abcsdfasdfasdf ddddz;z;z;z;z;z;z */''' print comment.findall(text1) print '--------------' print comment.findall(text2) comment = re.compile(r'/\*((?:.|\n)*?)\*/') print '--------------' print comment.findall(text1) ...
#!/usr/bin/python3 ''' eval is to parse a expression from a str to a command and run it then return a result of it ''' list_str="[5,6,7,8,9]" list_str=eval(list_str) print(list_str) print(list_str[4]) x=input("code:") check_this_out=eval(input("code:")) print(check_this_out)
# http://fun.coolshell.cn/unix.html D = dict(zip('pvwdgazxubqfsnrhocitlkeymj', 'abcdefghijklmnoqprstuvwxyz')) string = 'Wxgcg txgcg ui p ixgff, txgcg ui p epm. I gyhgwt mrl lig txg ixgff wrsspnd tr irfkg txui hcrvfgs, nre, hfgpig tcm liunz txg crt13 ra "ixgff" tr gntgc ngyt fgkgf.' answer = '' for c in ...
def Key_Generator(message, key): key = list(key) if len(message) == len(key): return (key) else: for i in range(len(message) - len(key)): key.append(key[i % len(key)]) return ("".join(key)) def encrypt(message, key): Encrypted_Message = [] fo...
#-*- coding: utf-8 -*- from django.core import serializers from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger from django.http import HttpResponse, HttpResponseRedirect, Http404, HttpResponseServerError from django.shortcuts import render from django.template import loader, RequestContext from c...
num = int(input("请输入阶乘num:")) factorial = 1 if num < 0: print("负数没有阶乘!") elif num == 0: print("0的阶乘为1") else: for i in range(1,num+1): factorial = factorial * i print("%d的阶乘为%d"%(num,factorial))
from django.db.models import Q from django.conf import settings from django.contrib.auth import get_user_model, authenticate from rest_framework.response import Response from rest_framework.status import HTTP_200_OK, HTTP_400_BAD_REQUEST from rest_framework.views import APIView from django.db.models.signals import p...
szamla=[] print(szamla) print(total)
# coding=utf-8 def triangles(max): c, n = [1], 1 while n <= max: print(c) c = [1]+[c[i-1]+c[i] for i in range(1, len(c))]+[1] n += 1 def main(): while True: cmd = raw_input("输入杨辉三角数字?") if cmd == 'q': return else: num = int(cmd) ...
# -*- coding: utf-8 -*- from selenium import webdriver from pyunitreport import HTMLTestRunner from selenium.webdriver.common.by import By from selenium.webdriver.chrome.options import Options from selenium.webdriver.common.keys import Keys from selenium.webdriver.support.ui import Select from selenium.common.exception...
import logic import random from AbstractPlayers import * from math import log import copy import signal import time # commands to use for move players. dictionary : Move(enum) -> function(board), # all the functions {up,down,left,right) receive board as parameter and return tuple of (new_board, done, score). # new_boa...
name = input("Qual o nome do funcionario: ") salary= int(input("Digite valor do Salario: ")) if (salary <= 5000): newSalary = salary*1,10 print ("O Funcionario",name," recebera o nova salario =", newSalary) if (salary > 5000) and (salary <= 20000): newSalary = (salary/100)*105 print ("O Funcionario",nam...
from django.apps import AppConfig #class MilliardConfig(AppConfig): # name = 'milliard' import re if re.match (r'^[а-яА-ЯёЁa-zA-Z\s]+$', ' '): print (1000)
print("Juste _un test")
# -*- coding: utf-8 -*- import os, re rs = os.popen("./iat_sample") text = rs.read() arr = text.split('=============================================================') print(arr[1].strip('\n'))
# ============LICENSE_START======================================================= # Copyright (c) 2020-2022 AT&T Intellectual Property. All rights reserved. # ================================================================================ # Licensed under the Apache License, Version 2.0 (the "License"); # you may not...
#!/usr/bin/env python3 import meal_planner from bottle import * import logging import os import copy logging.basicConfig(level=logging.INFO) logger = logging.getLogger('web_server') mp_log = logging.getLogger('meal_planner') mp_log.setLevel(logging.INFO) @get('/') def index(): return static_file('index.html', '.')...
name = "Roberta" print("Hello, " + name.title())
def add(num1, num2): return num1 + num2 def subtract(num1, num2): return num1 - num2 def multiply(num1, num2): return num1 * num2 def divide(num1, num2): return num1 / num2 def vowels(string): vowel = "aeiou" string = string.lower() count = 0 for x in string: if x in vowel: ...
from panda3d.core import CKeyValues from .Entity import Entity # The root entity of each map class World(Entity): ObjectName = "world" def __init__(self, id): Entity.__init__(self, id) self.setClassname("worldspawn") self.np.node().setFinal(False) def doWriteKeyValues(self, pare...
from flask import Flask, request, render_template, session, redirect, url_for from user import Newbike from sdt import New import mlab import smtplib mlab.connect() app = Flask(__name__) @app.route("/", methods=["GET", "POST"]) def home(): if request.method == "GET": #User request form ret...
from controller import Robot, DistanceSensor, Motor,Receiver,Emitter,LightSensor,LED,Keyboard, GPS import struct #import RRT import math import RRT2 import sys import my_parser import IdealPos EN = "utf-8" pI=3.14159265359 #dummy car location #goal_x = -1 #goal_y = -1 #fire car dimension #fire_length = 0.2 #fire_widt...
from sqlalchemy import * from sqlalchemy.ext.declarative import declarative_base from sqlalchemy.orm import sessionmaker, relationship from subscripts import bls_api_query_app as BLS import pdb, json Base = declarative_base() BLS_API_KEY = 'c4aceae070ec4aa88bd85a9323947770' # A year has many consumer demographics # ...
#!/usr/bin/env /data/mta/Script/Python3.8/envs/ska3-shiny/bin/python ################################################################################# # # # extract_goes.py: extract GOES-R data and plot the results # # ...
from filecache import filecache import feedparser from unidecode import unidecode import urllib import urlparse import re from nab.files import Searcher, Torrent @filecache(60 * 60) def _get_feed(url): feed = feedparser.parse(url) if feed['entries']: return feed['entries'] else: raise IOE...
from django.apps import AppConfig class ZipcodesConfig(AppConfig): name = 'zipcodes'
#%% import pandas as pd from sklearn.preprocessing import StandardScaler from sklearn.decomposition import PCA from sklearn.cluster import KMeans import hvplot.pandas # %% file_path = "/Users/oshadi/Desktop/Analysis Projects/Cryptocurrencies/module examples/new_iris_data.csv" df_iris = pd.read_csv(file_path) df_iris.h...
cont = 0 for cont in range(0,51): if cont%2 == 0 and cont != 0: print(cont)
from playsound import playsound print('voice playing') playsound('happyvoice.wav') print('voice stopped')
########################################### # Assessing the number of reads that # were filtered out from the host-filtering # step from bowtie2 ########################################### #imports import os from Bio import SeqIO import gzip from collections import defaultdict #Path to raw reads path_raw = '/Volume...
import numpy as np from numba import cuda, float32 from pyqtgraph.Qt import QtCore, QtGui import pyqtgraph as pg import pyqtgraph.opengl as gl from time import clock from math import sqrt '''------------------------------------------------ Disclaimer ------------------------------------------------''' # # Only ...