text
stringlengths
38
1.54M
x1 = int(input('сколько человек в 1 классе: ')) x2 = int(input('сколько человек во 2 классе: ')) x3 = int(input('сколько человек в 3 классе: ')) import math a = math.ceil(x1 / 2) b = math.ceil(x2 / 2) c = math.ceil(x3 / 2) x = (a + b + c) print(x)
def check_if_valid(): while True: try: num = float(input("Please enter a number: ")) except ValueError: print("That is not a number. Please try again.") else: return num def f_to_c(a): return (a-32)*(5/9) x = check_if_valid() print("That temperature...
import numpy as np import pprint as pp aaa = np.array([1,2,3,4,5]) print(aaa.shape) print(aaa) aaa = aaa.reshape(5,1) print(aaa.shape) print(aaa) bbb = np.array([[1,2,3], [4,5,6]]) print(bbb.shape) bbb = np.array([[[[1,2,3],[4,5,6]]]]) print(bbb.shape) ccc = np.array([[1,2],[3,4],[5,6]]) print(ccc.shape) ddd = cc...
#!/usr/bin/env python3 ###################################################### ## Python implementation of the following examples ## ## https://github.com/IntelRealSense/librealsense/blob/master/doc/post-processing-filters.md ## https://github.com/IntelRealSense/librealsense/tree/master/wrappers/opencv/depth-filter ##...
""" Small hand-written recursive descent parser for SVG <path> data. This software is OSI Certified Open Source Software. OSI Certified is a certification mark of the Open Source Initiative. Copyright (c) 2006, Enthought, Inc. All rights reserved. Redistribution and use in source and binary forms, with or without mo...
# Import the needed referances import pandas as pd import numpy as np import csv as csv from sklearn.model_selection import cross_val_score from sklearn.linear_model import LogisticRegression from sklearn.svm import SVC, LinearSVC from sklearn.ensemble import RandomForestClassifier from itertools import combinations ...
#!/usr/bin/env python import unittest from dominion import Card, Game, Piles ############################################################################### class Card_Destrier(Card.Card): def __init__(self): Card.Card.__init__(self) self.cardtype = Card.CardType.ACTION self.base = Card.C...
# Codeforces Beta Round #65 # Problem A -- Way Too Long Words for _ in xrange(input()): word = raw_input() if len(word) > 10: print word[0] + str(len(word) - 2) + word[-1] else: print word
import datetime import gardenFunction ''' Header of the program ''' def printBanner(): print("*"*40) print("|" +" "*38+"|") print("|"+ " "*10 + "Garden Restaurant"+" "*10 +" |") print("|" +" "*38+"|") print("*"*40) print() print('Welcome to Garden Restaurant Booking Management System.') ...
import numpy as np from collections import Counter import itertools import matplotlib.pyplot as plt import random import copy from sklearn import metrics def reduce_dataset(data, number): '''A function to reduce the MNIST dataset by taking 100 random samples of each digit''' Y=data[:,0] labels_set=lis...
from gurobipy import * import numpy as np import math import readIn def solve(full_path_instance): nBakeryProducts, Timehorizon, l, h, K, a, d, s, st = readIn.readFile(full_path_instance) Timehorizon = Timehorizon+1 #-Define model variables---------------------------------------------- ...
string = input() dictionary = {} for char in string: if char not in dictionary and char != " ": dictionary[char] = 0 if char != " ": dictionary[char] += 1 for key, value in dictionary.items(): print(f"{key} -> {value}")
#Abrir un archivo miArchivo = open("miArchivo.txt","w") #Obetener informacion de esre archivo print("Name:", miArchivo.name) print("esta cerrado:", miArchivo.closed) print("modo abierto:", miArchivo.mode) #Escribir algo al archivo miArchivo.write ("Me encanta Python") miArchivo.write("Me encanta Disney") miArchivo.cl...
from Extras.extras import * PawnValue = 1 KnightValue = 2 BishopValue = 3 RookValue = 4 QueenValue = 5 KingValue = 6 class Piece: #param Piece value (integer), CPU if it's computer's piece then CPU==True else CPU# ==False def __init__(self,CPU,posX,posY): self.posX=posX #Position X - row self....
flag = "" key = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'] for x in range(46): _file = "file%s.txt" % x enc = open(_file, "r").read().split() missing = enc.index("*") flag += key[missing] print flag.decode("hex") # Each of the text files has a character replace...
#################################################################################### ## Runner script | Handles arguments, creates contexts and runs the ETL process. ## #################################################################################### import sys from aws2hive import etl from pyspark import SparkCon...
def dfs(i): global count for j in array[i]: count+=1 dfs(j) from collections import deque def bfs(v): q=deque([v]) visited=[False]*(n+1) visited[v]=True count=1 while q: v = q.popleft() for e in array[v]: if not visited[e]: q.app...
#!/usr/bin/python # -*- coding: utf-8 -*- import argparse import sys def atualizaLog(log, imageLog): logLines = [] imageLogLines = imageLog.readlines() for log in log.readlines(): log = log.strip().split(';') logLines.append(log) for line in imageLogLines: line =...
from django.db import models from .Usuario import Usuario class Aluno(Usuario): curso = models.ForeignKey(to='Curso', related_name="alunos", null=False, blank=False) #onetomany #nome = models.CharField(max_length=120,null=False) #email = models.CharField(max_length=80) celular = models.CharField(max_len...
print("Please enter a positive integer") required_count = int(input()) count = 1 # required_count = 3 # count = 4 # Display: # Count: 1 # Count: 2 # Count: 3 print("Start counting") while count <= required_count: # The following runs as long as this condition is true print("Count: {0}".format(count)) count ...
from django.shortcuts import render, HttpResponse def Classifieds(request): #return HttpResponse("Welcome") return render(request,'classifieds.html', {})
from rest_framework_nested import routers class SimpleRouter(routers.SimpleRouter): """A little secret sauce that adds the router attribute onto the viewset if possible """ def __init__(self, *args, name='root', **kwargs): self.name = name super().__init__(*args, **kwargs) def regist...
from __future__ import print_function import pickle import os.path from googleapiclient.discovery import build from google_auth_oauthlib.flow import InstalledAppFlow from google.auth.transport.requests import Request # If modifying these scopes, delete the file token.pickle. SCOPES = ['https://www.googleapis.c...
# This code is part of OpenFE and is licensed under the MIT license. # For details, see https://github.com/OpenFreeEnergy/openfe import click import glob import itertools import pathlib from plugcli.params import MultiStrategyGetter, Option, NOT_PARSED # MOVE TO GUFE ##################################################...
from nltk import word_tokenize, pos_tag from nltk.corpus import wordnet as wn def penn_to_wn(tag): """ Convert between a Penn Treebank tag to a simplified Wordnet tag """ if tag.startswith('N'): return 'n' if tag.startswith('V'): return 'v' if tag.startswith('J'): return 'a' ...
#!/usr/bin/env python # -*- coding:utf8 -*- from deepdive import * import re import handle_string import divlaw def lenIterator(list): sum = 0 for i in list : sum += 1 return sum def getTitle(string): temp = re.finditer(r"(\s|\n|\*|\_|\#){0,10}(\“|\")+.{2}",string,re.DOTALL) end_title = le...
from .app import app from flask.ext.sqlalchemy import SQLAlchemy db = SQLAlchemy(app) ### Add models here
# Сортировка вставками # сложность: O(n**2)/лучшее время O(n) # Устойчивсть: Устойчивая. Если есть 2 одинаковх элемента, то сохраняется их порядок. # Тип(категория): Вставками # Потребление памяти: Не требует доп. памяти # Из массива последовательно берется каждый элемент, кроме первого(index == 0) # И вставляется в ...
from networkx import strongly_connected_components from LSD.auxiliary_graph import AuxiliaryGraph def get_strongly_connected_component(g): """Create the SCC components.""" sccs = strongly_connected_components(g) dag = AuxiliaryGraph(0) n = 1 non_singelton = [] for scc in sccs: if len(s...
import logging import torch from torch import nn from nlplay.data.cache import WordVectorsManager, DSManager, DS, WV from nlplay.features.text_cleaner import * from nlplay.models.pytorch.classifiers.att_conv_net import AttentiveConvNet from nlplay.models.pytorch.dataset import DSGenerator from nlplay.models.pytorch.pre...
import os import torch import argparse import logging from dataset import Dataset from utils import compute_F1, compute_exact_match from torch.utils.data import DataLoader from transformers import AdamW from tqdm import tqdm from trainer import train, valid from transformers import AutoModelForQuestionAnswering, AutoT...
# python3 def count_inversions(array): def inversions_merge(left, right): result = [] l, r = 0, 0 inversions = 0 while l < len(left) and r < len(right): if left[l] > right[r]: result.append(right[r]) r += 1 inversions += ...
#!/usr/bin/python Usage = """ Convert the FASTA sequences to static FASTQ format Quality values are encoded as H for 39 needs input file and ouputfile names Usage: -version 1.0 (Python3) fasta2fastq.py inputfile.fasta output.fastq Kan Liu liukan.big@gmail.com 11/04/2018 """ import sys from Bio.SeqIO.FastaIO import...
import os import subprocess import sys def untar(file, output_dir): subprocess.check_call("tar -xf {file} -C {output_dir}".format(file=file, output_dir=output_dir).split()) for dataset in ["ILSVRC2012_img_train.tar", "ILSVRC2012_img_val.tar"]: dataset_name, _ = dataset.split(".") os.mkdir("{dset}".format...
# -*- coding: utf-8 -*- """ Created on Thu Jan 26 16:24:36 2017 @author: ankit """ import sys #f = open('housepriceinput.txt','r') fn = input().split() #print(fn) f = int(fn[0]) n = int(fn[1]) #print(type(n),n) xtrain = [] nrow =[] for i in range(0,n): row = input().split() for number in row: number = ...
#!/usr/bin/python3 """This module holds a class BaseModel that is the main class in the project """ import uuid import datetime from models import storage class BaseModel: """BaseModel main class set the value of a new instance or instance a class from a dictionary of an object previous created ...
import os import time import datetime import glob import MySQLdb from time import strftime os.system('modprobe w1-gpio') os.system('modprobe w1-therm') rain_sensor = ' ' # Variables for MySQL db = MySQLdb.connect(host="localhost", user="root",passwd="123", db="rain_database") cur = db.cursor() def moistRead(): t...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import pandas as pd from sklearn.base import TransformerMixin,BaseEstimator from TextNormalizer import TextNormalizer from sklearn.pipeline import Pipeline from nltk.tokenize import TreebankWordTokenizer import numpy as np from sklearn.feature_extraction.text import CountV...
import numpy as np import sys #dataname - string - name of dataset #ns - integer - number of sets to generate #otype - string - type of output sets (binary or text files) def generating_datasets(dataname, ns=20, otype='binary'): if dataname == 'cereales': orig_name = 'cereales.data' elif dataname == 'credit': ...
import torch import torch.nn as nn from . constants import * from transformers import AutoModel class Abbreviator(nn.Module): def __init__(self): super().__init__() self.prediction_layers = [ nn.Linear( 1024, len(SYMBOLS) ) for _ in range(MAX_OUT_LEN) ] self.abbrnet = nn.Sequential( ...
from flask import Flask from flask import request from flask import render_template from datetime import date import sqlite3 from sqlite3 import Error blog = Flask(__name__) @blog.route('/novotopico', methods=['GET', 'POST']) def cadastro(): if request.method == 'POST': topico = request.form['topico'] ...
# -*- coding: utf-8 -*- # Copyright (c) 2020. Distributed under the terms of the MIT License. from math import log10 from typing import List from matplotlib import pyplot as plt from plotly import graph_objects as go from vise.analyzer.dielectric_function import DieleFuncData from vise.analyzer.dielectric_function_da...
import math, random, string import numpy as np target = "kuldeeplovesgeneticalgorithm" def diff(s1, s2) : sum = 0 for i in range(len(s1)) : sum += (ord(s1[i])-ord(s2[i]))**2 return math.sqrt(sum) def getRandomString() : # s = ''.join(random.SystemRandom().choice(string.ascii_lowercase + string.ascii_uppercase ...
import time import pickle import random from http.client import HTTPConnection import hashlib import urllib import random import json import re import os #用于将外文知识图谱的信息翻译成中文的 #这里使用的是百度的NMT模型的api #翻译完的结果中,在本次实验仅使用名字部分来学习语义表示,其他部分暂不使用 #return result_list,flag. def baiduapi(text,from_lang,to_lang): appid = 'xxxxxxx'...
from typing import Union from objects.player import Player from objects.const import Privileges from config import prefix import packets import json import re commands = {} def command(rgx: str, perms: int): def inner(func): commands[json.dumps({'rgx': rgx, 'perms': perms})] = func return func ...
import os import typing import jk_typing import jk_utils import jk_json import jk_prettyprintobj class DrivePartitionInfo(jk_prettyprintobj.DumpMixin): ################################################################################################################################ ## Constructor ##########...
from django.shortcuts import render import cookie_handler from decorate import * import requests import json api_link = settings.API_ADDRESS headers = settings.HEADERS EQUIPID_COMPANY = settings.EQUIPID_COMPANY EQUIPID_OUR = settings.EQUIPID_OUR # 获取所有设备数据 def get_Device_Data(request): userid, presend_cookie = c...
# Generated by Django 2.0.3 on 2018-05-16 07:03 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('estaciones', '0008_auto_20180515_2221'), ] operations = [ migrations.AddField( model_name='estacion', name='impactar...
from django.conf.urls import patterns, url from .views import refresh_status from .views import CredentialView, CredentialSSLView urlpatterns = patterns('', url(r"^credential/(?P<pk>\d*)$", CredentialView.as_view(), name="credential-detail")...
names = [] while True: print("Input the name of person " + str(len(names) + 1) + ", or input nothing to stop.") name = input() if(name == ''): break else: names += [name] print("The object names are: ") for name in names: print(" " + name)
#lab8 James Dumitru #Using built in number_1 = int(input("Enter a number: ")) number_2 = int(input("Enter a number: ")) number_3 = int(input("Enter a number: ")) number_4 = int(input("Enter a number: ")) number_5 = int(input("Enter a number: ")) number_6 = int(input("Enter a number: ")) num_list = [] num_list.append(n...
#!/usr/bin/env python from lib.OptionsParser import * from lib.PlummerModel import * from lib.DiscModel import * from lib.IsoModel import * from lib.EtaModel import * def plot(plot): if plot: fig = plt.figure() ax = fig.add_subplot(111) ax.hist(eccs,bins=40,cumulative=True,normed=True,...
import urllib.request import urllib.parse import urllib.error from bs4 import BeautifulSoup import re import ssl import sys import json import ast import os from urllib.request import Request, urlopen # For ignoring SSL certificate errors ctx = ssl.create_default_context() ctx.check_hostname = False ctx.verify_mode =...
from person import Person person_john = Person("John", "01/03/1984", "male") class Student(Person): def __init__(self, name, b_date, sex, faculty): super().__init__(name, b_date, sex) self._change_name() self.faculty = faculty self._test_value = self.blabla(name, 2) @propert...
species( label = 'C=[C]OO[C](CCCC)CCOO(29153)', structure = SMILES('C=[C]OO[C](CCCC)CCOO'), E0 = (126.125,'kJ/mol'), modes = [ HarmonicOscillator(frequencies=([1685,370,2750,2800,2850,1350,1500,750,1050,1375,1000,2950,3100,1380,975,1025,1650,360,370,350,2750,2761.11,2772.22,2783.33,2794.44,2805....
# Main program for whole thing from hero import hero from minion import minion import random def main(): print("Welcome to heartstone chance calculator.") print("Initializing teams.") # Class initialization hero1 = hero() hero2 = hero() # We will keep these as numbers right now he...
# -*- coding: utf-8 -*- from odoo import models, fields, api from calendar import monthrange class PosOrder(models.Model): _inherit = 'pos.order' x_rank_id = fields.Many2one('crm.customer.rank', "Rank") @api.onchange('partner_id') def onchange_partner(self): self.x_rank_id = self.partner_i...
import tornado.web class ImgSlide(tornado.web.UIModule): def render(self,info): return self.render_string('modules/img_slide.html', post_info=info)
from django.core.exceptions import ObjectDoesNotExist from django.db import models from django.contrib.auth.models import User from django.conf import settings from django.db.models.base import Model from django.db.models.deletion import DO_NOTHING from django.db.models.signals import post_save from django.dispatch imp...
import csv import re from cassandra.cluster import Cluster from datetime import * cluster = Cluster(['172.17.0.2']) session = cluster.connect('test') sql = "BEGIN BATCH \n" with open('gun_ownership.csv') as tsvfile: reader = csv.reader(tsvfile) header = False counter = 0 for row in reader: i...
# try and except -- exception handling a = 2 x = 2 while (x >-2): try: a/x except ZeroDivisionError: print("This is inside the exception") print("{0},{1} - 0 division error".format(a,x)) finally : print("this is executed always") print("{0},{1} - 0 - always e...
while True: def grade(x): if x in range(0, 101): if x >= 90: if x < 94: return 'A-' elif x < 97: return 'A' elif x <= 100: return 'A+' elif x >= 80: if x < 84...
""" function helpers for user checkups """ from bson.objectid import ObjectId from src.commons.errors import InvalidUser def is_active(mongo, user_id): """ Check if a current user is active or not :param mongo: Database connection :param user_id: User ID :return: bool """ user = get_use...
#!/usr/bin/env python2.7 import pandas as pd import os def topXbinTrans(df,top): ''' :param df: a dataframe with a single column :return:outputs a dataframe with single column and same indecies as df, 3 is 'high, 2 is 'middle', and 1 is 'low' ''' nrows = df.shape[0] df = df.sort_values(asc...
# Quiz description URL: #https://leetcode.com/problems/palindrome-linked-list/ # Point: # 1.Use list # Result # Runtime: 2612 ms, faster than 5.00% of Python3 online submissions for Palindrome Linked List. # Memory Usage: 47.3 MB, less than 37.11% of Python3 online submissions for Palindrome Linked List. # class Li...
class Friend: friends_dict = {} def __init__(self, name): Friend.friends_dict[name] = 'No party...' self.name = name # returns the string with the last invite that the person has received # with the right place, day and time show_invite = lambda self: Friend.friends_dict[self.name]...
import requests from twilio.rest import Client VIRTUAL_TWILIO_NUMBER = "your virtual twilio number" VERIFIED_NUMBER = "your own phone number verified with Twilio" STOCK_NAME = "TSLA" COMPANY_NAME = "Tesla Inc" STOCK_ENDPOINT = "https://www.alphavantage.co/query" NEWS_ENDPOINT = "https://newsapi.org/v2/everything" S...
fibo = list() n = int(input()) fibo.append(0) fibo.append(1) for i in range(2, n + 1): fibo.append(fibo[i - 1] + fibo[i - 2]) print(fibo[n])
from django.conf import settings from django.conf.urls import include, url from django.conf.urls.static import static from django.contrib import admin from django.views.generic.base import RedirectView from obs.views import CreateObservationView, ObservationDetailView, \ CreateObservationPhotoView urlpatterns = ...
class BinaryTreeNode: def __init__(self, data): self.data = data self.left = None self.right = None def insert_left(self, value): self.left = BinaryTreeNode(data) return self.left def insert_right(self, value): self.right = BinaryTreeNode(data) return self.right MAX_INT = 4294967296...
from IPython import display import matplotlib import matplotlib.pyplot as plt import gym import numpy as np def distant_render(env, agent, state_size): s = env.reset() done = False img = plt.imshow(env.render(mode='rgb_array')) # only call this once while not done: img.set_data(env.render(mod...
# Sublime Text plugin for Parinfer # v0.8.0 # https://github.com/oakmac/sublime-text-parinfer # # More information about Parinfer can be found here: # http://shaunlebron.github.io/parinfer/ # # Copyright (c) 2015, Chris Oakman and other contributors # Released under the ISC license # https://github.com/oakmac/sublime-t...
#!/usr/bin/env python import os import sys def main(argv): if not len(sys.argv) == 2: print 'Usage: prout.py <src_directory>' sys.exit(2) ##Need to create a list ptf directory that ends in .git src_dir = str(sys.argv[1]) ##Dirs to update with full path_name lines_to_insert = list()...
from argparse import ArgumentParser from datetime import datetime from secrets import MYSQL_USER, MYSQL_PASSWD import MySQLdb import sys HOST = "192.168.1.195" DATABASE_NAME = "QnA" db = MySQLdb.connect(host=HOST, user=MYSQL_USER, passwd=MYSQL_PASSWD, db=DATABASE_NAME) cur = db.cursor() class QnAArgParser(Argument...
import pygame import sys import os from pygame.locals import * #from Maingame import * windowWidth = 1280 windowHeight = 720 pygame.init() Display = pygame.display.set_mode((windowWidth,windowHeight)) #screen leftBorder = 1 rightBorder = 1 topBorder = 5 downBorder = 5 screenHeight = 768-topBorder-downBorder screenWi...
from django.http import HttpResponseRedirect from django.shortcuts import render from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger from recordtype.models import RecordType, RecordTypeForm # Create your views here. def index(request): recordtype_list = RecordType.objects.all().order_by('lab...
# -*- coding: utf-8 -*- """Visibility settings for use with entities.""" from verta._internal_utils import documentation from ._org_custom import OrgCustom from ._org_default import OrgDefault from ._private import Private from ._workspace_default import _WorkspaceDefault documentation.reassign_module( [ ...
import sys import ipdb import os sys.path.append("/home/m/MediaMonitor") os.environ.setdefault("DJANGO_SETTINGS_MODULE", "MediaMonitor.settings") from monitor.lib import share_getter from monitor.models import Link, LinkStats from django.utils import timezone import json import django django.setup() import datetime ...
from django.apps import AppConfig class SystemauthenticationConfig(AppConfig): name = 'systemAuthentication'
#coding=utf-8 #用户注册的视图 from control.base.base_handler import BaseHandler from models.models import PersonalTable from models.db.dbsession import dbSession class RegisterHandler(BaseHandler): def get(self): self.render("user/register.html") def post(self): username = self.get_argument("name", "...
from math import sqrt def miller_test(m, base): k, q = 0, m - 1 while q % 2 == 0: q >>= 1 k += 1 r, i = pow(base, q, m), 0 while True: if (i == 0 and r == 1) or (i >= 0 and r == m - 1): return False i += 1 r = pow(r, 2, m) if i >= k: ...
#! /usr/bin/env python import sys, re, os, socket, time, shutil, string, optparse # 'set' is new in Python 2.4, but almost exists in 2.3 version = string.split(string.split(sys.version)[0], ".") if '2' == version[0] and '3' == version[1]: from sets import Set as set # allowed options for config file allowed = se...
import ret import pandas # coding=utf-8 import xml.dom.minidom L = [] for i in range(3): path = '../static/string' + str(i) + '.xml' # 打开xml文档 dom = xml.dom.minidom.parse(path) # 得到文档元素对象 root = dom.documentElement cc = dom.getElementsByTagName('string') for c in cc: L.append(c.fir...
def find_peak(nums): left, right = 0, len(nums) - 1 if nums[right] >= nums[left]: return right while right > left: m = (right + left) // 2 if nums[m] >= nums[left]: left = m else: right = m if right - left == 1: if nums[right] > num...
#1 question:写了很多用作数据结构的类,不想写太多烦人的__init__函数 #2 solution: import math class Structure1: _fields = [] def __init__(self, *args): if len(args) != len(self._fields): raise TypeError('Expected {} arguments'.format(len(self._fields))) for name, value in zip(self...
import pygame import pygame.rect # Citation: https://www.pygame.org/docs/ref/sprite.html#pygame.sprite.Sprite # I am using this for solving the collide problem, I learnt how to use it from this website. class Tile(pygame.sprite.Sprite): def __init__(self, color=0, width=0, height=0,position_x = 0,position_y = 0,file ...
import os from datetime import datetime from flask import current_app from flask import Blueprint from flask import flash from flask import g from flask import redirect from flask import render_template from flask import request from flask import url_for from werkzeug.exceptions import abort from rtracker.db import ge...
import bluetooth print("performing inquiry...") nearby_devices = bluetooth.discover_devices( duration=8, lookup_names=True, flush_cache=True, lookup_class=False) print("found %d devices" % len(nearby_devices)) for addr, name in nearby_devices: try: print(" %s - %s" % (addr, name)) ...
import logging import time import os import pytest from helpers.cluster import ClickHouseCluster from helpers.utility import generate_values from helpers.wait_for_helpers import wait_for_delete_inactive_parts from helpers.wait_for_helpers import wait_for_delete_empty_parts from pyhdfs import HdfsClient SCRIPT_DIR = ...
# coding: utf-8 # data_sender_node.py import multiprocessing as mp from node import Node class DataSenderNode(Node): """ データを読み取るノードを表す基底クラス """ def __init__(self, process_manager, msg_queue): """コンストラクタ""" super().__init__(process_manager, msg_queue) # 入力を処理するためのプロセス ...
# Declaration of a few floats x = 7.0 y = 21.0 z = 45.0 # Basic math operations using floats addInt = x + z subtractInt = z - y multiplyInt = x * y divideInt = y / x modInt = z % x powerInt = y ** z everythingInt = (y ** 7) / ((z + y) - (-(y * x))) # Printing of the math calculations print(addInt) print(subtractInt) ...
def rot13(mess): alphabet = 'abcdefghijklmnopqrstuvwxyz' encrypted = '' for char in mess: if char == ' ': encrypted = encrypted + ' ' else: rotated_index = alphabet.index(char) + 13 if rotated_index < 26: encrypted = encrypted + alphabet[ro...
# Check two condition at same time # and ,Or Operator name='raj' age =19 if name=='raj' and age==29: print("condition is true ") else : print("condition is false") name="rahul" age=23 if name=="ram" or age==23: print("Conditiopn is true .....") else: print("Condition is false ...") # ...
# Generated by Django 2.2.5 on 2019-10-14 14:59 import STTEAPI.models from django.conf import settings from django.db import migrations, models import django.db.models.deletion import django.utils.timezone class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ ...
#Leetcode 739. Daily Temperatures #Monotonic Stack - build a decreasing stack while finding next greater/larger element class Solution: def dailyTemperatures(self, T: List[int]) -> List[int]: if len(T) == 0: return [0] nextWarmerTemp = [0] * len(T) stack = [] ...
from flask import request, jsonify, abort from flask_restful import Resource, reqparse from carstore3000.models.cars import CarModel, CarSchema parser = reqparse.RequestParser() parser.add_argument("car_id", type=int) parser.add_argument("color_slug", type=str) parser.add_argument("door_count", type=int) parser.add_a...
import os, random, discord, sys, getopt, time from dotenv import load_dotenv from urllib.request import urlopen, Request from discord.ext.commands import Bot from discord.ext import commands load_dotenv() def main(argv): client = discord.Client() # intents = discord.Intents().all() bot = commands.Bot(...
# ___________________________________________________________________________ # # Parapint # Copyright (c) 2020 # National Technology and Engineering Solutions of Sandia, LLC # Under the terms of Contract DE-NA0003525 with National Technology and # Engineering Solutions of Sandia, LLC, the U.S. Government retains...
# Generated by Django 2.1.5 on 2019-01-28 16:09 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('homepage', '0004_posts_views'), ] operations = [ migrations.AlterField( model_name='posts', name='views', ...
# -*- coding: utf-8 -*- # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "Li...