text
stringlengths
8
6.05M
from .eLABJournalPager import * class SampleSeries(eLABJournalPager): pass
# -*- coding: utf-8 -*- """ Main pyramid_basemodel module. Provides global scoped ``Session`` and declarative ``Base``, ``BaseMixin`` class and ``bind_engine`` function. To use, import and, e.g.: inherit from the base classes:: >>> class MyModel(Base, BaseMixin): ... __tablename__ = 'my_model' ... >>> in...
#!/usr/bin/env python from os import path from subprocess import call from argparse import ArgumentParser, ArgumentDefaultsHelpFormatter DEFAULT_LANG = "en" DEFAULT_OUTPUT = path.normpath(path.join(path.dirname(__file__), "dist")) JSON = path.join(path.dirname(__file__), "generated-json/game.json") def get_args(): ...
# -*- coding: utf-8 -*- # !/usr/bin/env python import tensorflow as tf import ConfigParser import json from word import Word from data_unit import cut2list def add_gradient_noise(t, stddev=1e-3, name=None): """ Adds gradient noise as described in http://arxiv.org/abs/1511.06807 [2]. The input Tensor `t` ...
# input number and get a perfect number from 1 to number def perfect(num) : sum = 0 for i in range(1,num+1): for j in range(1,i): if i%j==0 : sum+=j if sum == i : print sum, #print("%d "%sum, end= ' ') python 3.0 sum = 0 num = int(input("input the number: ")) perfect(num)
from rest_framework.serializers import ModelSerializer from tracks.api.serializers import lesson_serializer from contacts.api.serializers import user_serializer from ..models import question,answer class question_serializer (ModelSerializer): lesson = lesson_serializer(required=False) user = user_serializer(re...
h = input("Digite o valor da altura: ") h = int(h) b = input("Digite o valor da largura: ") b = int(b) soma = b * h print("A área do retângulo é: ", soma, "metros quadrados.")
#!/usr/bin/python3 def divisible_by_2(my_list=[]): new_list = my_list.copy() index = 0 for a in new_list: if a % 2 == 0: new_list[index] = True else: new_list[index] = False index = index + 1 return new_list
import pickle from pathlib import Path from typing import List import torch from torch.utils.data import Dataset import Voxel_MOF class MOFDataset(Dataset): def __init__(self, path, no_grid=False, no_loc=False,transform=None): self.path = path self.no_grid = no_grid self.no_loc = no_loc ...
from django.urls import path, include from rest_framework.routers import DefaultRouter from . import views # LECTURE_2 URLS --> router = DefaultRouter() router.register('products', views.PublicProductViewSet) router.register('products/category', views.PublicProductCategoryViewSet, 'public_category') router.register('...
from django.db import models from django.core.validators import FileExtensionValidator from django.utils.html import format_html from django.utils.functional import cached_property from django_resized import ResizedImageField from django.shortcuts import reverse import uuid import os def get_image_path(instance, img_n...
""" resources.py provides useful tools for resources processing. There are 2 commands available. - clean: clean and unify the resources file names with some rules. - round: generate the rounded images from the original squared images. """ import os import subprocess import sys import config as cfg from . import reso...
from pippi import dsp from pippi import tune midi = {'lpd': 3} def play(ctl): param = ctl.get('param') lpd = ctl.get('midi').get('lpd') freqs = [ (10000, 15000), (5000, 15000), (5000, 10000), ] low = dsp.rand(50, 100) high = dsp.rand(80, 120) low = 80 high =...
""" """ import phantom.rules as phantom import json from datetime import datetime, timedelta def on_start(container): phantom.debug('on_start() called') # call 'Transform_Hosts_to_List' block Transform_Hosts_to_List(container=container) return def Get_Volatility_Dump_scripts_and_exe(action=None,...
from .source_target_data_processor import SourceTargetDataProcessor from .data_processor import DataProcessor import torch import random from torch import nn from BFT.utils import cuda_variable from DatasetManager.piano.piano_midi_dataset import PAD_SYMBOL, START_SYMBOL class PianoDataProcessor(DataProcessor): def...
# coding: utf-8 # Copyright 2013 The Font Bakery Authors. 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://www.apache.org/licenses/LICENSE-2.0 # # Unless re...
""" Wemakeprice Recommendation Project. Authors: - Hyunsik Jeon (jeon185@snu.ac.kr) - Jaemin Yoo (jaeminyoo@snu.ac.kr) - U Kang (ukang@snu.ac.kr) - Data Mining Lab. at Seoul National University. File: data/columns.py - Constants of DataFrame column names. Version: 1.0.0 """ TIMESTAMP = 'timestamp' ACTION_TYPE = 'ac...
from flask_wtf import FlaskForm from wtforms import StringField, IntegerField, SubmitField from wtforms.validators import InputRequired from property_price_model.postcodes import pcode class PropertyInputForm(FlaskForm): pcode = StringField("Postcode", validators=[pcode(), InputRequired()]) sqft = IntegerFiel...
from random import seed, randint print("H A N G M A N") while True: print('Type "play" to play the game, "exit" to quit:') prompt = input() if prompt == "play": pass elif prompt == "exit": break else: continue word_list = ['python', 'java', 'kotlin', 'javascript'] w_n...
import os, time, multiprocessing import numpy as np import tensorflow as tf import tensorlayer as tl from config import FLAGS_CMNIST, FLAGS_CIFAR from data import get_dataset_train, get_dataset_eval from models import get_G, get_img_D, get_E, get_z_D import random import argparse import math import scipy.stat...
import glob import numpy as np from kd_helpers import read_labels # Checking the number of points in each model max_pts = 0 for main_folder in ["./data/train_data/*","./data/val_data/*","./data/test_data/*"]: print(main_folder) folders = glob.glob(main_folder) model_files = [] for folder in folders: ...
l=['mi','sony','samsung'] a='sony' find(l) def find(l =[], *args) #for i in l: # print('the position of ' + l[i] +'is' + i) #return '' print(len(l))
import os import sys sys.path.append(os.path.join(os.path.dirname(__file__), os.pardir)) from jimovpn import settings from django.core.management import setup_environ setup_environ(settings)
from django.urls import path from tutorials import views urlpatterns = [ path('', views.tutorial_list), path('<int:pk>', views.tutorial_detail), path('published', views.tutorial_list_published) ]
n = int(input()) all = list(map(int,input().split())) result = 0 while(True): for i in range(n): if(all[i] % 2 ==1 or all[i]==0): print(result) exit() result += 1 all = list(map(lambda x:x//2,all))
# -*- coding: utf-8 -*- """ Created on Fri Jun 9 19:18:20 2017 @author: Gavrilov """ #example to do squaring by repetitive addition x = 27 #I'm going to start off with something that I want to square ans = 0 #That's going to be where my answer goes itersLeft = x #And I'm going to keep track of how many times...
from decimal import Decimal import Domoticz from devices.device import Device class TemperatureHumiditySensor(Device): def create_device(self, unit, device_id, device_name): return Domoticz.Device(Unit=unit, DeviceID=device_id, Name=device_name, TypeName="Temp+Hum").Create() def get_numeric_value(sel...
#!/usr/local/bin/python # coding: utf-8 import sys import pkg_resources from framgiaci.report_app import ReportApplication from framgiaci.commands.run_finish import RunFinishCommand from framgiaci.commands.run_report import RunReportCommand from framgiaci.commands.run_test import RunTestCommand from framgiaci.commands...
# -*- coding: utf-8 -*- import sys import tweepy import couchdb import json import webbrowser # Query terms server = couchdb.Server('http://localhost:5984') DB = 'database' # Get these values from your application settings CONSUMER_KEY = 'fFRVfkuoNyafZglDwDGKpWF1o' CONSUMER_SECRET = 'lRMw1avbxoKF13eJ0CeF9WYC6jqMga4...
class Person: def __init__(self, first='', last='', eye_color='', age=0): self.first = first self.last = last self.eye_color = eye_color self.age = age # def __repr__(self): # return (repr(self.first) + ' ' + # repr(self.last) + ' ' + # repr(self....
from math import * def getCos30(): return 0.866 def getSin30(): return 0.5 class Vector2(): def __init__(self, x, y): self.x = x self.y = y def getX(self): return self.x def getY(self): return self.y def get(self): return (self.x, self.y) def setX(self, x): self.x = x def setY(self, y): s...
#!/usr/bin/python3 Square = __import__('5-square').Square my_square = Square(3) my_square.my_print() print("--") my_square.size = 10 my_square.my_print() print("--") my_square.size = 0 my_square.my_print() print("--")
import argparse import torch import torch.onnx import onnx from model.dataset.dataloader import make_dataloader from model.model.make_model import make_model from model.config import cfg import onnxruntime as ort import numpy as np import os import onnxruntime current_dir = os.getcwd() parent_dir = os.path.abspath(os...
# Yahoo Financeからリアルタイムデータを取得する import yfinance as yf def main(code): ticker = yf.Ticker(code) for k, v in ticker.info.items(): print("{:<40}:{}".format(k, v)) if __name__ == '__main__': import sys if len(sys.argv) != 2: print('銘柄コードを入力して下さい') print('python {} コード'.format(__...
from tensorflow.keras.applications import VGG16 from tensorflow.keras.models import Sequential from tensorflow.keras.layers import Dense, Flatten vgg16 = VGG16(weights='imagenet', include_top=False, input_shape=(32, 32, 3)) # include_top : False로 해야 input_shape를 원하는 사이즈로 가능 print(vgg16.weights) vgg16.trainable = Fals...
import res_partner import marketing_campaign
import csv import xlwt import json from books.models import Book, Author, Log, RequestBook from books.forms import BookForm, AuthorForm from django.contrib.auth.mixins import LoginRequiredMixin from django.urls import reverse_lazy from django.views.generic import ( CreateView, ListView, UpdateView, DeleteView, Tem...
# -*- coding: utf-8 -*- from rest_framework.decorators import api_view from rest_framework.response import Response from rest_framework.views import APIView from src.api.serializers.user_serializer import CitySerializer from src.users.models import City class ApiUserDetailView(APIView): @api_view(['GET']) d...
import sys N = int(raw_input().strip()) if N % 2 != 0: print 'Weird' elif N >= 2 and N <= 5: print 'Not Weird' elif N >= 6 and N <= 20: print 'Weird' else: print 'Not Weird'
# MEG object class # %% Importing # System import os import sys import pickle # Computing import mne import sklearn import numpy as np # Private settings sys.path.append(os.path.join(os.path.dirname(__file__), '..', 'private')) # noqa from dir_settings import RAW_DIR, MEMORY_DIR from parameter_settings import PARAME...
from adb import adb import time a = adb() levels = [] current = 0 with open('battery_stats.log', 'a') as log: while True: levels[current] = a.battery_level() log.write("{} - {}\n".format(time.strftime("%H:%M"),level)) old = (current - 1) % 5 if levels[current] < levels[old]: ...
import cv2 import numpy as np from PIL import ImageGrab def screenrecorder(): fourcc= cv2.VideoWriter_fourcc(*'XVID') out = cv2.VideoWriter("output.mp4",fourcc,5.0,(1920,1080)) while True: img=ImageGrab.grab() img_np=np.array(img) frame = cv2.cvtColor(img_np,cv2.COLO...
#import sys #input = sys.stdin.readline def main(): sx,sy, gx, gy = map(int,input().split()) if sx == gx: print(sx) return print((sx*gy+gx*sy)/(gy+sy)) if __name__ == '__main__': main()
import json with open("termostato.json", "r") as termostato_config: termostato = json.load(termostato_config) print(termostato["proxy_bateria"])
class Solution(object): def canJump(self, nums): reachable = 0 for i in range(len(nums)): if i > reachable: return False current_reachable = nums[i] + i if current_reachable >= reachable: reachable = current_reachable retur...
from summertime.model.base_model import SummModel class SingleDocSummModel(SummModel): def __init__( self, trained_domain: str = None, max_input_length: int = None, max_output_length: int = None, ): super(SingleDocSummModel, self).__init__( trained_domain=tr...
import unittest import fraction class FractionClassTests(unittest.TestCase): def setUp(self): self.such_number = fraction.Fraction(3, 4) self.such_number2 = fraction.Fraction(5, 4) self.simplify_number = fraction.Fraction(6, 3) def test_init_(self): self.assertEqual(self.such...
# class Foo: # def __init__(self): # print('hahah') # # def __call__(self, *args, **kwargs): # print('call') # # foo = Foo() # 执行init方法 # foo() # 执行call python特殊方法,实例加()自动执行call方法 # # class Foo: # def __init__(self): # pass # def __int__(self): # return 111 # def...
varx=300-123 number=int(input("enter value")) if(number==varx): print("barabar hai") else: print("nahi hai")
s = "Now I need a drink, alcoholic of course, after the heavy lectures involving quantum mechanics." print([len(word) for word in s.split(" ")])
# # Copyright 2015-2016 Bleemeo # # bleemeo.com an infrastructure monitoring solution in the Cloud # # 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/lice...
from .canny_detector import canny_detector
# -*- coding:utf-8 -*- print("i will now count my chickens:") print("hens",25+30/6) # print("roosters",100-25*3%4) # 输出句子 print("now i will count the eggs:") # 输出3+2+1-5+4%2-1/4+6计算值 print(3.0+2.0+1.0-5.0+4.0%2.0-1.0/4.0+6.0) # 输出句子 print("is it true that 3+2<5-7?") # 输出计算值(真伪判断) print(3+2<5-7) # 输出句子以及3...
''' A Pythagorean triplet is a set of three natural numbers, a < b < c, for which, a^2 + b^2 = c^2 For example, 3^2 + 4^2 = 9 + 16 = 25 = 5^2. There exists exactly one Pythagorean triplet for which a + b + c = 1000. Find the product abc. ''' from math import sqrt target_sum = 1000 try: for c in range(target_sum): ...
#-*- coding:utf-8 -*- ''' 描述: 现有从2002年1月到3月收集的调查数据(url为http://112.124.1.3:8050/getData/101) 每条数据包括 caseid(标识符), prglength(婴儿第几周出生), outcome(怀孕结果,1表示活产), totalwgt_oz(婴儿出生重量,单位盎司), birthord(第几胎,1表示第一胎), agepreg(怀孕时年龄), finalwgt(被调查者的统计权重,表明这名调查者所代表的人群在美国总人口中的比例。过采样人群的权重偏低)等信息 另据某研究显示,婴儿出生周数符合方差为16的正态分布,试写函数solve估...
import pygame from os.path import join import tile colors = { #integer values of common colors "white" : 0xFFFFFF, "black" : 0, "red" : 0xFF0000, "blue" : 0x00FF00, "green" : 0x0000FF } class Chunk(): def __init__(self, a, b, image, width = 5, height = 5): self.width = width self.he...
# Generated by Django 2.1.5 on 2019-02-07 14:35 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ ('shelf', '0004_remove_book_authors'), ] operations = [ migrations.CreateModel( ...
# ================================================================================================== # Copyright 2015 Twitter, Inc. # -------------------------------------------------------------------------------------------------- # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use thi...
#!/usr/bin/env python """This is an attempt to drive the gait2d model with a controller derived from real data.""" # standard library import os # external import numpy as np from scipy.integrate import odeint from scipy.interpolate import interp1d from pydy.codegen.code import generate_ode_function from pydy.viz imp...
# -*- coding: utf-8 -*- """ Created on Mon Mar 25 14:57:36 2019 @author: zhangtong """ from sklearn.metrics import * from sklearn.linear_model import LinearRegression from al_data_tool import * import numpy as np import pandas as pd import math def to_score(x): import math if x <=0.001: x =0.001 ...
print "Welcome, to the real world, Neo" def matrix(): print "You take the blue pill, the story ends. You wake up in your bed and believe whatever you want to believe. You take the red pill, you stay in Wonderland, and I show you how deep the rabbit hole goes" answer = raw_input("Type blue or red").lower() i...
# -*- coding: utf-8 -*- #import is_pricelist
from abc import ABCMeta, abstractmethod class Sequence(metaclass=ABCMeta): @abstractmethod def __len__(self): """return the length""" pass @abstractmethod def __getitem__(self, i): """return the element at this index i""" pass def __contains__(self, val): ...
import numpy as np a1 = np.array(([1,2,3], [4,5,6])) print('matrix a1 dengan ukuran:', a1.shape) print(a1) #resize matrix print("resize matrix a1:") a1.resize(3,2) print(a1) print('matrix a dengan ukuran:',a1.shape)
def Punctuation(string): punctuations = '''!()-[]{};:'"\,<>./?@#$%^&*_~''' for x in string.lower(): if x in punctuations: string = string.replace(x, "") print(string) string = input('Enter the string') Punctuation(string)
""" Python Wechaty - https://github.com/wechaty/python-wechaty Authors: Huan LI (李卓桓) <https://github.com/huan> Jingjing WU (吴京京) <https://github.com/wj-Mcat> 2020-now @ Copyright Wechaty Licensed under the Apache License, Version 2.0 (the 'License'); you may not use this file except in compliance wit...
import sys import urllib2 import urllib import json url = 'http://localhost:8083/parse?' for line in sys.stdin: sent = line.strip() data = urllib.urlencode(dict(sent=sent)) resp = urllib.urlopen(url + data) results = json.loads(resp.read()) for x in results['result']: score = x['score'] ...
# -*- coding: utf-8 -*- """ Created on Mon Sep 22 11:59:36 2014 @author: toli """ import maya.OpenMayaMPx as OpenMayaMPx import maya.OpenMaya as OpenMaya class DoublerNode(OpenMayaMPx.MPxNode): kPlugNodeId = OpenMaya.MTypeId(0x00047251) aInputA = OpenMaya.MObject(); aInputB = OpenMaya....
# ================================================================================================== # Copyright 2014 Twitter, Inc. # -------------------------------------------------------------------------------------------------- # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use thi...
from django.apps import AppConfig class EducacaoConfig(AppConfig): name = 'educacao'
# Crie um algoritmo que leia um número e mostre o seu dobro, triplo e raiz quadrada. n = int(input('Digite um número: ')) print('O dobro de {} vale {}.'.format(n, n * 2)) print('O triplo de {} vale {}.'.format(n, n * 3)) print('A raiz quadrada de {} é {:.2f}'.format(n, n ** (1 / 2)))
# apply stack DS import ch1_Stack.stack as stack string = "gninraeL nIdekniL htiw tol a nraeL" reversed_string = "" s = stack.stack() for c in string: s.push(c) while not s.is_empty(): reversed_string += s.pop() print(reversed_string)
from django.conf.urls import url from . import views from . import cart from django.conf import settings from django.conf.urls.static import static from django.conf.urls import include, url from django.contrib import admin from orders.views import Home, success, failure app_name = 'orders' urlpatterns = [ #url(r'...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.shortcuts import render,HttpResponse from rest_framework.generics import RetrieveUpdateDestroyAPIView,CreateAPIView,ListAPIView,ListCreateAPIView from rest_framework.authentication import SessionAuthentication, BasicAuthentication from django....
a = 37 print('num a convertir:', a) global i i=0 lst = '' base = 2 def printWithPower(var, val): global i,base if val != 0: print(var,'x '+str(int(base))+'^'+str(i), ' = ',int(val)) else: print(var,'x '+str(int(base))+'^'+str(i)) pass i=i+1 pass while a > 0: r=0 ...
from game.scrabble_box import Rulebook from game.scrabble_players import ComputerPlayer from unittest import TestCase import os import string # Move up to the parent directory so that we can access the correct ground files. os.chdir("../..") rb = Rulebook() class TestComputerPlayer(TestCase): def test_find_word...
from django.urls import path from rtmeli.accounts.views import ( login_view, logout_view, authorize_view, signout_view ) app_name = "accounts" urlpatterns = [ path("login/", view=login_view, name="login"), path("logout/", view=logout_view, name="logout"), path("signout/", view=signout_view...
from django.urls import path from .views import ( ProductFilterListAPIView, ProductImageListAPIView, all_product, ProductMarkaListAPIView, SearchListAPIView, ) app_name = 'product_apis' urlpatterns = [ path('filter-api-product/', ProductFilterListAPIView.as_view(), name='filter_api_product...
from typing import TYPE_CHECKING if TYPE_CHECKING: from decimal import Decimal from typing import Literal, Protocol from typing_extensions import TypedDict PaymentMethod = Literal['free', 'cc', 'manual'] PaymentState = Literal['open', 'paid', 'failed', 'cancelled'] class PriceDict(TypedDict): ...
#product dictionary products = { "americano":{"name":"Americano","price":150.00}, "brewedcoffee":{"name":"Brewed Coffee","price":110.00}, "cappuccino":{"name":"Cappuccino","price":170.00}, "dalgona":{"name":"Dalgona","price":170.00}, "espresso":{"name":"Espresso","price":140.00}, "frappuccino":{...
#!/usr/bin/env python # coding: utf-8 import os import numpy as np import argparse from preprocess import rotate from utils import for_each_sample, isCancerSample # Globals rotated_num = 0 def handle_sample(sample, patient, patientDir): global rotated_num if isCancerSample(sample) and not "R" in sample: ...
import os import matplotlib if os.name == 'posix': matplotlib.use('Qt4Agg') # Force Mac users to use this backend import tkinter as tk from tkinter import ttk import numpy as np import matplotlib.pyplot as plt from matplotlib import __version__ as pltVersion from matplotlib.patches import Rectangle from astropy.io ...
import errno import os import re import shutil import sys import yaml import json import tempfile def expand_at_params(s, fn, listfn=None): def subfn(m): result = fn(m.group(1)) if result is None: raise RuntimeError("Unexpected @-parameter '{}' in {}".format(m.group(1), s)) return result if isinstance(s,...
#coding: utf-8 #利用filter输出回文数 def is_palindrome(n) : n = str(n) return n == n[::-1] output = filter(is_palindrome,range(0,1000)) for i in list(output) : print(i)
#!/usr/bin/python class Node: weight = 0 name = "" parent = "" children = "" def __init__(self, weight, name, parent, children): self.weight = weight self.name = name self.parent = parent self.children = children def recursiveCircus(file): with open(file) as f: content = f.readlines() content = ...
# дебильный калькулятор v2 from colorama import init from colorama import Fore, Back, Style init() print( Fore.GREEN ) what = input ("что делаем (+,-,)") print( Fore.CYAN ) a = float( input("Веди первое число: ") ) b = float( input ("Введи второе число: ") ) print( Fore.YELLOW ) if what == "+": c = a + b print...
#雪花曲线 mport turtle tr = turtle.getturtle() def koch(n,len): if(n==0): tr.forward(len) elif(n==1): tr.forward(len/3.0) tr.left(60) tr.forward(len/3.0) tr.right(120) tr.forward(len/3.0) tr.left(60) tr.forward(len/3.0) else: koch(n-1,len/3.0) tr.left(6...
from waitress import serve import web_app serve(web_app.app, port=9000, threads=6)
#!/usr/bin/python ############################################################################# ### ### ### Antisense Project - 2018 ### ### Density Plots From Output of PeakCaller_mNET-Seq (Rui Luis) ...
from objects.RandomObject import RandomObject # Dungeon is a blank object used for flavor at the moment. class Dungeon(RandomObject): parameter_types = [] def describe(self,from_perspective=None): print(super().describe())
from intent_handling.signal import Signal class ClassTitleIntent: NAME = 'CLASS_TITLE' def __init__(self, parameters): self.parameters = parameters def execute(self, db): code = db.course_code(self.parameters.class_name) sql = 'SELECT pretty_name ' \ 'FROM main_cour...
def add(x,y): """Add function""" return x+y print(add(5,7))
# -*- coding: utf-8 -*- """ Created on Sun Apr 29 23:15:55 2018 无线网工程相关的操作 @author: lenovo """ from project.jntele_sap import OperateLteSAP from project.jntele_zaijian import OperateZaijian import os import warnings class OperateLteProject(object): '''无线网工程操作处理整合类''' def __init__(self): self.dir_base = ...
#!/usr/bin/env python # # Copyright 2007 Google Inc. # # 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 o...
import os import sys import argparse import datetime import time import re import numpy as np import pandas as pd import ee import geopandas as gpd import rasterio import rioxarray import shapely import requests import lxml.html import urllib from dateutil.relativedelta import * from osgeo import ogr, osr, gdal from ...
# if in dict -> 그대로 반영 # if not in dict -> 반영 X word_n = int(input()) words = [] words_dict = {} max_length = 0 answer = 0 alph_value = 9 for _ in range(word_n): word = input() if len(word) > max_length: # max_length엔 길이가 저장되게 될 것. max_length = len(word) words.append(word) # 현재 words는 스트링 형태 word...
# dictionary use {} a_dict = {'apple':'a',1:1} #{'key':'value'} print(a_dict) print(a_dict['apple']) del a_dict['apple'] #delete apple key print(a_dict) a_dict['pear'] = 'p' #add key pear value 'p' print(a_dict)
# -*- coding: utf-8 -*- """ Created on Sun Sep 6 15:19:25 2015 Homework 2: Implement perceptron training using data given in /u/cs448/data/pos. What is your accuracy on the test file when training on the train file? Plot a graph of accuracy vs iteration @author: Md Iftekhar Tanveer (itanveer@cs.rochester.edu) """ im...
#!/usr/bin/python #\file ros_wait_srvp.py #\brief Test wait service. #\author Akihiko Yamaguchi, info@akihikoy.net #\version 0.1 #\date Aug.30, 2015 import roslib; roslib.load_manifest('std_srvs') import rospy import std_srvs.srv #import rospy_tutorials.srv def SetupServiceProxy(name, srv_type, persistent=Fal...
from django.db import models from django.utils.encoding import smart_text from django.utils import timezone from django.utils.timesince import timesince from django.utils.text import slugify from django.db.models.signals import pre_save,post_save,pre_delete, post_delete import datetime from datetime import timedelta # ...