text
stringlengths
8
6.05M
import unittest from katas.kyu_6.ipv4_to_int32 import ip_to_int32 class IPToInt32TestCase(unittest.TestCase): def test_equals(self): self.assertEqual(ip_to_int32('128.114.17.104'), 2154959208) def test_equals_2(self): self.assertEqual(ip_to_int32('0.0.0.0'), 0) def test_equals_3(self): ...
#!/usr/bin/env python import os import sys os.environ['DJANGO_SETTINGS_MODULE'] = 'tests.settings' from django.test.utils import get_runner from django.conf import settings def runtests(): TestRunner = get_runner(settings) test_runner = TestRunner(verbosity=1, interactive=True, failfast=False) failures...
# coding: utf-8 #geling 修改注释20180424 import gym import matplotlib import numpy as np import sys from collections import defaultdict if "../" not in sys.path: sys.path.append("../") from lib.envs.halften import HalftenEnv import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D from matplotlib.ticker...
import serial import sys class ArgsParse: def __init__(self): self.argMap = {} self.flags = []; offset = 0; for i in sys.argv[1:]: offset = i.find("="); if offset > -1: self.argMap[i[:offset].lower()] = i[offset+1:]; else: self.flags += [i.lower()]; def hasFlag(self, flagName): for i in s...
#!/usr/bin/env python # Copyright (c) 2011 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 simplest-possible build of a "Hello, world!" program using the default build target. """ import TestGyp test = TestGyp.TestGy...
import parallel_utils3 as par import argparse import gc import random import re from collections import namedtuple from functools import partial from pathlib import Path from posixpath import join from sys import argv from time import time import dask.dataframe as dd import pandas as pd from joblib import Parallel, de...
# -*- coding:utf-8 -*- from config import application, environment, database import view app = application.app environment.configure() database.configure() view.register() if __name__ == '__main__': app.run()
class KEY(object): SERVICE_TIME = "service_time" SERVICE_TYPE = 'serv_type' DEPART_TIME = 'depart_time' ROUTE_ID = 'route_id' TRIP_ID = 'trip_id' HEADSIGN = 'headsign' DIRECTION = 'direction' STOP_ID = 'stop_i...
s,v=map(int,input().split()) l=list(map(int,input().split())) l1=[] for x in range(0,len(l)): if(l[x]%2!=0): l1.append(l[x]) print(l1[v-1])
s=[] for i in range(8): s.append(int(input())) print(max(s))
import pandas as pd import streamlit as st import joblib import numpy as np st.title('Sales Forecasting') st.write('We forecast sales') data = pd.read_csv('/Users/alyssa/Desktop/ftw-webapp-deployment/data/advertising_regression.csv') data st.sidebar.subheader('Advertising Costs') TV = st.sidebar.slider('TV Adverti...
import random class Character(object): "main character" def __init__(self): self.stats = {} self.setStats(str=15,dex=15,end=15, name="Nock") self.equipped = [] self.stats["damage"], self.stats["AC"] = 0, 0 self.level = 1 self.experience = [] # Health = d8 + end/2-5 # [curent/max] maxHealth ...
import web_utility def convert(amount, home_currency_code, location_currency_code): #converts the home currency to foreign currency and returns it url_string = "https://www.google.com/finance/converter?a={}&from={}&to={}".format(amount, home_currency_code, ...
import os import time import numpy as np import argparse import importlib from tqdm import tqdm import matplotlib.pyplot as plt import tensorflow as tf from keras import backend as K from keras.models import load_model from keras_contrib.layers.normalization import InstanceNormalization import read_tools import gc re...
# Generated by Django 3.2.3 on 2021-06-12 15:46 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('pizza_app', '0013_auto_20210612_1542'), ] operations = [ migrations.RemoveField( model_name='ingredientsize', name='...
# -*- coding: utf-8 -*- """ Created on Mon Feb 24 18:39:17 2020 @author: shaun """ import numpy as np from gaussxw import gaussxw import matplotlib.pyplot as plt N=100 #grab key points and weights from legendre polymials x,w=gaussxw(N) #define the integrand with input x,y,z def integrand(x,y,z): f=1/(((x**2)+(y**...
from flask import Flask from backend.config.database import init_db,db_session from backend.routes.Pekerjaan import pekerjaan_routes from backend.routes.Pekerja import pekerja_routes from backend.routes.Pekerja_pekerjaan import pekerja_pekerjaan_routes from backend.routes.Aset import Aset_routes from backend.routes.Sta...
import numpy as np ; from tensorflow.keras.backend import int_shape from tensorflow.keras.layers import Input, Cropping1D, add, Conv1D, GlobalAvgPool1D, Dense, Flatten from tensorflow.keras.optimizers import Adam from tensorflow.keras.models import Model from chrombpnet.training.utils.losses import multinomial_nll impo...
import gym import math import random import numpy as np import matplotlib import matplotlib.pyplot as plt from collections import deque from itertools import count from PIL import Image import tensorflow.compat.v1 as tf tf.disable_v2_behavior() # testing on tensorflow 1 import time class ReplayExp(): ...
from django.conf.urls import patterns, include, url from django.views.decorators.csrf import csrf_protect from django.views.decorators.http import require_POST from .urls import urlpatterns from pikapika.common.decorators import serialize_as_json, param_from_post def generic_ajax_func(func): return require_POST(...
#!/usr/bin/env python # coding: utf-8 """ Utility functions and classes @version 1.0 @author Remzi Celebi """ import datetime import pandas as pd from rdflib import Graph, URIRef, Literal, RDF, ConjunctiveGraph, Namespace DC = Namespace("http://purl.org/dc/terms/") DCAT = Namespace("http://www.w3.org/ns/dcat#") RDFS =...
# AUTO GENERATED FILE - DO NOT EDIT from dash.development.base_component import Component, _explicitize_args class SyntaxHighlighter(Component): """A SyntaxHighlighter component. A component for pretty printing code. Keyword arguments: - children (string | list; optional): The text to display and highlight - id...
#encoding=utf-8 ''' Created on 2014��5��22�� @author: yangluo ''' import win32api import win32con from win32api import GetSystemMetrics from ctypes import windll from win32gui import GetCursorPos screenMetrics = (GetSystemMetrics(0),GetSystemMetrics(1)) bottomOfScreen = screenMetrics preDevicePos ...
from contextlib import contextmanager from sqlalchemy import create_engine, text from sqlalchemy.engine.url import URL from sqlalchemy.orm import sessionmaker from config.db import ( db_teradata_prod ) DB_URL = 'teradata://'+ db_teradata_prod['username'] +':' + db_teradata_prod['password'] + '@'+ db_teradata_pro...
import click import feedparser import os.path # import time import json @click.command() @click.option('--address', '-a', multiple=True, help="Add address of site to store, can be multiple sites \n" "Example: -a google.com -a bing.com") @click.option('--list', '-l',...
# Python Standard Libraries # N/A # Third-Party Libraries from django.conf.urls import url from rest_framework.routers import SimpleRouter from rest_framework.schemas import get_schema_view from rest_framework_jwt.views import obtain_jwt_token from rest_framework_jwt.views import refresh_jwt_token from rest_framework_j...
import numpy as np from OpenGL.GL import * from OpenGL.GLU import * from glumpy import app, gloo, gl, glm from glumpy.graphics.text import FontManager from glumpy.graphics.collections import GlyphCollection from glumpy.transforms import Position, OrthographicProjection import glumpy import time import random from math...
import numpy as np import itertools as it class SpectralLearn : problemfile = "" order = 0 p21 = None p31 = [] sym_cnt = 0 U = None V = None Sig = None Bx = [] Sig_inv = None b0 = None binf = None p1 = None def __init__(self, probfile, ord): self.prob...
import math import time start= time.clock() def isprime(n): if n<2: return False elif n==2: return True else: for x in xrange(2, int(math.ceil(math.sqrt(n)))+1): if n%x==0: return False return True def prime(n): list=[]; i=0; while len(list)<n: if isprime(i): list.append(i) i+=1 return li...
from backbone import * import re ''' This is to check that SAN disk connectivity is done correctly. This Script will check the following on a system of datanodes : 1. Check SAN interface 2. Check tps fs configs on datanode 3. Check SAN memory available ''' nodes = get_nodes_by_type('datanode') # Check...
from django.contrib import admin from .models import Dprofile # Register your models here. admin.site.register(Dprofile)
from typing import List from leetcode import test def unique_paths_with_obstacles(grid: List[List[int]]) -> int: if not (grid and grid[0]): return 0 m, n = len(grid), len(grid[0]) if grid[0][0] == 1 or grid[m - 1][n - 1] == 1: return 0 dp = [0] * n for j in range(n): if ...
import matplotlib.pyplot as plt import numpy as np import pandas as pd import tensorflow as tf import data.climate.window_generator as wg # https://www.tensorflow.org/tutorials/structured_data/time_series train_df = pd.read_csv("jena_climate_2009_2016_train.csv") val_df = pd.read_csv("jena_climate_2009_2016_val.csv")...
# -*- coding: utf-8 -*- class MyHashSet: def __init__(self): self.data = [False] * (2**20) def add(self, key): self.data[key] = True def contains(self, key): return self.data[key] def remove(self, key): self.data[key] = False if __name__ == "__main__": obj = My...
from django.contrib import admin # Register your models here. from .models import Teacher, Teamim, Class, TalmudSponsor, TalmudStudy from .models import create_transcoder_job class ClassAdmin(admin.ModelAdmin): search_fields = ['division', 'segment', 'section', 'unit', 'part', 'series'] list_display = ['__str...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('basketball', '0004_auto_20150629_2040'), ] operations = [ migrations.RemoveField( model_name='game', ...
# -*- coding: UTF-8 -*- import collections import os import sys import pickle import codecs import pandas as pd import numpy as np from sklearn.model_selection import KFold from sklearn.model_selection import train_test_split # pathDir = os.path.dirname(__file__) # curPath = os.path.abspath(pathDir) # rootP...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Wed Oct 28 12:41:12 2020 @author: kondrate """ import matplotlib.pyplot as plt import numpy as np def draw_plots(readings, point, fig_size = None, caption = 'Plot', decision = np.empty((3,1))): # Readings are pandas frame r = 0 if len(decision...
from functools import wraps def onlyonce(fn): """Wraps a function to run once and return the same result thereafter.""" result = [] @wraps(fn) def doit(*a, **k): if not result: result.append(fn(*a, **k)) return result[0] return doit
from collections import defaultdict def vec(): return set() n ,m = map(int,input().split()) d = defaultdict(vec) for t in range(m): u,v = map(int,input().split()) d[u].add(v) d[v].add(u) def dfs(i): vec[i] = 1 for j in d[i]: if vec[j] == 0: dfs(j) c = ...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- from setuptools import setup from setuptools import find_packages def get_long_description() -> str: with open("README.md", "r") as file: return file.read() setup( name="hushboard", version="0.0.1", description="Mute your mic while you're typin...
# Generated by Django 2.1.2 on 2018-10-06 10:58 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('app', '0005_project'), ] operations = [ migrations.AddField( model_name='project', name='reject_reason', ...
# -*- coding: utf-8 -*- # pylint: disable=invalid-name,missing-docstring # Copyright 2017 IBM RESEARCH. All Rights Reserved. # # 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://ww...
"""calculavirus URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/3.0/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: path('', views.home, name='home') Class-...
#!/usr/bin/python ##James Parks import sys import json import matplotlib.pyplot as pyplot import numpy as np from optparse import OptionParser def autolabel(rects, textOffset): # attach some text labels for rect in rects: height = rect.get_height() print height + textOffset ...
#coding:gb2312 #比较数字 num=18 print(num==18) #检查两个数字是否相等 print(num<14) #返回结果为False print(num<=14) #返回结果为False print(num>14) #返回结果为True print(num>=18) #返回结果为True #检查多个条件 #例如检查两个人是否都小于18岁,and要都满足条件,表达式才为True age_0= 15 age_1= 19 print((age_0<=18) and (age_1<=18)) #and是测试两个人是否都小于18 age_1=17 ...
import os from pathlib import Path import json import random import numpy as np import pickle import tables import os def pickle_dump(item, out_file): with open(out_file, "wb") as opened_file: pickle.dump(item, opened_file) # def delete_existing_files(): # os.remove(r"/data/home/Shai/UNET_3D_NEW/deb...
from keras.models import Sequential from keras import layers import pandas as pd from sklearn.model_selection import train_test_split import numpy as np from keras.preprocessing.sequence import pad_sequences from keras.preprocessing.text import Tokenizer from sklearn.preprocessing import OneHotEncoder from sklearn.prep...
#!/usr/bin/env python3 from ctypes import CDLL from os import listdir, path, times from signal import SIGHUP, SIGINT, SIGKILL, SIGQUIT, SIGTERM, signal from sys import argv, exit, stderr, stdout from time import monotonic, process_time, sleep def errprint(*text): """ """ print(*text, file=stderr, flush=T...
from django.db import models from django.db.models.signals import post_delete from applications.libro.models import Libro from .managers import PrestamoManager class Lector(models.Model): nombre = models.CharField(max_length=50) apellidos = models.CharField(max_length=50) nacionalidad = models.CharField(...
default_app_config = 'namelist.apps.NamelistConfig'
class TMI: message_limit = 90 whispers_message_limit_second = 2 whispers_message_limit_minute = 90 @staticmethod def promote_to_verified(): TMI.message_limit = 7000 TMI.whispers_message_limit_second = 15 TMI.whispers_message_limit_minute = 1150
from django.conf.urls import url, include from django.urls.conf import path from rest_framework.routers import DefaultRouter from .views import AdditionalMaterialSet, StructuralUnitSet, UserStructuralUnitSet, CompetencesSet, \ ChangeSemesterInEvaluationsCorrect router = DefaultRouter() router.register(r'api/gene...
import re import numpy as np import itertools as it from random import random from sympy import Symbol, poly class FitData(dict): def __init__(self, fname, path="output/"): self.__data = {} self.__name = fname self.__file = path + fname.replace(' ', '_') def __setitem__(self, key, val...
import socket import random import struct from helpers.file_io_helper import save_snapshot_channel from helpers.file_io_helper import save_snapshot_state from helpers.trading_helper import unpack_list_data from helpers.trading_helper import update_logical_timestamp from helpers.trading_helper import update_vector_times...
from rest_framework import serializers from resume.apps.pages.models import Page class PageSerializer(serializers.ModelSerializer): class Meta: model = Page fields = ('title', 'content')
import datetime from pyspark.sql import SparkSession from pyspark.sql.functions import col, lit, avg, date_format,concat from pyspark.sql.types import DoubleType, TimestampType, DateType sparkSession = SparkSession.builder \ .config("spark.driver.maxResultSize", "2000m") \ .config("spark.sql.shuffle.partitions...
# ============LICENSE_START======================================================= # Copyright (c) 2018-2022 AT&T Intellectual Property. All rights reserved. # ================================================================================ # Licensed under the Apache License, Version 2.0 (the "License"); # you may not...
from django.contrib import admin from sherlock.models import Profile, About, Relative, Image admin.site.register([Profile, About, Relative, Image])
from main import Handler class Information(Handler): def get(self): if not self.user: self.redirect('/login') else: error = 'You have reached this page at an error' link_src = '/' link_name = 'Home' self.render( 'informat...
from django.contrib import admin from .models import MostRecent,Feedback admin.site.register(MostRecent) admin.site.register(Feedback)
import pandas as pd import numpy as np from lorenz_gan.submodels import SubModelGAN, AR1RandomUpdater from sklearn.neighbors import KernelDensity from sklearn.mixture import GaussianMixture from glob import glob from os.path import join import tensorflow as tf import tensorflow.compat.v1.keras.backend as K import gc d...
from collections import defaultdict from math import asin, cos, radians, sin, sqrt from random import sample import csv from operator import itemgetter import matplotlib as mpl import matplotlib.pyplot as plt class BaseAlgorithm(): #def __init__(self): # self.update_data() def update_data(self): ...
''' Created on Mar 5, 2013 @author: pvicente ''' from src.data import Node, City, CityMap from src.data_exceptions import NotValid2DPointFormat, WrongLink, NotCities, \ NotLinks, NotValidCitiesFormat, NotValidLinksFormat import unittest class TestNode(unittest.TestCase): def setUp(self): pass ...
#erster Versuch import cv2 from PIL import Image import pytesseract import numpy as np #print pytesseract.image_to_string(Image.open('roemisch2.PNG')) #path = './bilder/roemisch2.PNG' path = 'randomzahlen.jpg' img = Image.open(path) print (pytesseract.image_to_string(img)) image = cv2.imread(path) cv2.imshow('hall...
#MatthewMascoloCH7P1.py #I pledge my honor that I have abided #by the Stevens Honor System. Matthew Mascolo # #This program calculates BMI and determines #whether it is in a healthy range. def main(): weight = eval(input("Enter your weight in pounds: ")) height = eval(input("Enter your height in inches: "...
# -*- coding: utf-8 -*- # @Time : 2020/5/23 19:49 # @Author : J # @File : 视频入门.py # @Software: PyCharm #打开摄像头 import numpy as np import cv2 as cv cap = cv.VideoCapture(0) if not cap.isOpened(): print("cannot not open camera") exit() while True: ret,frame = cap.read() #第一个参数ret 为True 或者False,代...
#!/usr/bin/env /data/mta/Script/Python3.8/envs/ska3-shiny/bin/python ######################################################################################### # # # update_html_page.py: udate html pages ...
#!/usr/bin/env python #-*- coding:UTF-8 -*- import os path='/home/tla001/myworks/zrworks/mykk/resource/iceskater1' f=open("images1.txt",'w') files = list() for pic in os.listdir(path): if(pic.find('.jpg')!=-1): files.append(pic) files.sort() for pic in files: f.write(os.path.join(path,pic)+'\n') f.close()
import requests from bs4 import BeautifulSoup from PyQt5 import QtWidgets from vindue import Ui_MainWindow import sys class MyWindow(QtWidgets.QMainWindow): def __init__(self): super(MyWindow, self).__init__() self.ui = Ui_MainWindow() self.ui.setupUi(self) self.ui.pushButton.clicked.conn...
class Empleado: def __init__(self, nombre, edad, legajo, sueldo): self.nombre = nombre self.edad = edad self.legajo = legajo self.sueldo = sueldo def calcular_sueldo(self, descuento, bonos): return self.sueldo-descuento+bonos class AgentesVentas(Empleado): def __i...
# Generated by Django 3.2.7 on 2021-10-06 05:32 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('products', '0006_bill_employee'), ] operations = [ migrations.RemoveField( model_name='employeebank', name='employee...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Thu Mar 8 16:44:00 2018 @author: ppxee """ ### Import required libraries ### import matplotlib.pyplot as plt #for plotting from astropy.io import fits #for handling fits from astropy.table import Table #for handling tables import numpy as np #for handling...
def min(values): smallest = None for value in values: if smallest is None or value < smallest: smallest = value return smallest print(min([3, 4, 82, 71]))
from main import PKT_DIR_INCOMING, PKT_DIR_OUTGOING # TODO: Feel free to import any Python standard moduless as necessary. import struct import socket import time import pickle from firewall import * from helpers import * # length of header in bytes # hard coded constants data = pickle.load(open('testpacket.p', 'rb...
''' Project: AirBnB Clone File: test/user.py By: Mackenzie Adams, Gloria Bwandungi In this file we create our first test for the root of our Rest API. ''' import unittest import json from app import app import logging from app.models.base import db from app.models.user import User class FlaskrTestC...
from django import forms from django.db import models from django.forms import ModelForm
""" Author: Rokon Rahman File: training a CNN architucture using cifer-10 dataset """ import keras import numpy as np # project modules from .. import config from . import my_model, preprocess model = my_model.get_model() model.summary() #loading data #X_train, Y_train = preprocess.load_train_data() X_train, Y_trai...
""" CPSC-51100, SUMMER 2019 NAME: JASON HUGGY, JOHN KUAGBENU, COREY PAINTER PROGRAMMING ASSIGNMENT #6 """ import pandas as pd import numpy as np import matplotlib.pyplot as plt df = pd.read_csv('ss13hil.csv') # Replaces each value with the first number in the range of amounts from # PUMS documentation...
# Generated by Django 2.2.4 on 2019-10-01 17:31 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('job', '0022_auto_20190929_0352'), ] operations = [ migrations.AlterField( model_name='sharejob', name='content', ...
def uppercase_letters(s): for c in s: yield c.upper() uppercase_letters('abcdefgh')
""" These are subscription related models. """ from dataclasses import dataclass, field from typing import List, Optional from .base import BaseModel from .common import BaseApiResponse, BaseResource, ResourceId, Thumbnails from .mixins import DatetimeTimeMixin @dataclass class SubscriptionSnippet(BaseModel, Date...
def findMax(arr): maxVal = arr[0] for i in arr[1:]: if i > maxVal: maxVal = i return maxVal a = [1,3,4,5,0,-6,8] b = findMax(a) print b
# 建立空序對 a = () # 建立具有五個元素的序對 b = (1, 2.0, "3", [4], (5)) # 印出 b 的第 1 個元素 2.0 print(b[1]) # 印出 b 的第 3 個元素 [4] print(b[3]) # 檔名: typedemo05.py # 作者: Kaiching Chang # 時間: July, 2014
import unittest from katas.beta.geometric_progression import geometric_sequence_elements class GeometricSequenceElementsTestCase(unittest.TestCase): def test_equals(self): self.assertEqual(geometric_sequence_elements(2, 3, 5), '2, 6, 18, 54, 162') def test_equals_2(self): ...
import json import logging from typing import Optional import requests from core.env import Environment from services.chat_token_service import ChatTokenService class MessageService: def __init__(self, env: Environment, token_service: ChatTokenService) -> None: self._env = env self._token_service ...
import os import subprocess from gtts import gTTS from espeak_bot.utils import generate_random_string def get_text_to_speech_file(text): tmp_file_path = '/tmp/{path}.mp3'.format( path = generate_random_string(20)) tts = gTTS(text=text, lang='es') tts.save(tmp_file_path) return tmp_file_path
import pandas as pd from plotnine import * import scipy snp_regions=pd.read_csv("variant_scores.tsv",header=0,sep='\t') snp_regions[["logratio", "sig"]] = snp_regions["META_DATA"].str.split(',', expand=True).astype(float) print(scipy.stats.pearsonr(snp_regions['logratio'],snp_regions['log_probs_diff_abs_sum'])) p = ...
# Changed news to community in this file import graphene from graphene_django.types import DjangoObjectType # from bootcamp.news.models import News from bootcamp.community.models import Community from bootcamp.helpers import paginate_data class CommunityType(DjangoObjectType): # Changed news to community """Dja...
import os from distutils.sysconfig import get_config_var # taken from https://github.com/pypa/setuptools/blob/master/setuptools/command/bdist_egg.py NATIVE_EXTENSIONS = dict.fromkeys('.dll .so .dylib .pyd'.split()) def sorted_walk(dir): """Do os.walk in a reproducible way, independent of indeterministic fil...
import base64 import pickle import cv2 import os import mediapipe as mp # Import mediapipe mp_drawing = mp.solutions.drawing_utils mp_holistic = mp.solutions.holistic import csv import pandas as pd from sklearn.ensemble import RandomForestClassifier, GradientBoostingClassifier from sklearn.linear_model i...
from tkinter import * import os def delete2(): screen3.destroy() def delete3(): screen4.destroy() def delete4(): screen5.destroy() def session(): screen8 = Toplevel(screen) screen8.title("dashboard") screen8.geometry("400x400") Label(screen8, text="Welcome to Dashboard").pack() But...
# -*- coding: utf-8 -*- class TreeNode: def __init__(self, x): self.val = x self.left = None self.right = None class Solution: def pathSum(self, root, sum): result, _ = self._pathSum(root, sum) return result def _pathSum(self, root, sum): if root is None:...
app = None queue = None
# Generated by Django 2.2.20 on 2021-09-28 15:24 from django.db import migrations from django.db.models import DateField, ExpressionWrapper, F from django.utils.timezone import timedelta def add_created_date(apps, schema_editor): Election = apps.get_model("elections", "Election") delta = timedelta(weeks=8) ...
import datetime import unittest from zoomus import components, util import responses def suite(): """Define all the tests of the module.""" suite = unittest.TestSuite() suite.addTest(unittest.makeSuite(ListV1TestCase)) suite.addTest(unittest.makeSuite(ListV2TestCase)) return suite class ListV1T...
''' Defines the function that starts the gateway. .. Reviewed 11 November 2018. ''' import traceback import threading import logging import mqttgateway.mqtt_client as mqtt import mqttgateway.mqtt_map as mqtt_map from mqttgateway.app_properties import AppProperties from mqttgateway import __version__ LOG = logging.g...
import SimpleHTTPServer import SocketServer Handler = SimpleHTTPServer.SimpleHTTPRequestHandler httpd = SocketServer.TCPServer(('localhost', 80), Handler) httpd.serve_forever()
from django.db.models.signals import post_save from django.contrib.auth.models import User from django.dispatch import receiver from .models import ShinyUserHash from secrets import token_hex @receiver(post_save, sender=User) def create_hash(sender, instance, created, **kwargs): if created: hash =...
from panda3d.core import Point3, NodePath, BitMask32, RenderState, ColorAttrib, Vec4, LightAttrib, FogAttrib, LineSegs from panda3d.core import Vec3, LPlane, GeomNode from PyQt5 import QtWidgets, QtCore from .BaseTool import BaseTool from .ToolOptions import ToolOptions from bsp.leveleditor.geometry.Box import Box fr...