text
stringlengths
8
6.05M
''' define the type assert decorator ''' from .exception import ArgumentLengthError, ArgumentTypeError def argument_check(*types): def check(f): if len(types) != f.__code__.co_argcount: raise ArgumentLengthError("type length is not same with function argument count!") def new_f...
""" Scraper for foodnetwork.com. Collectis all recipe links from website. Author: John Li """ from .scraper_base import ScraperBase from selectolax.parser import HTMLParser import json import requests import string import re class FoodNetwork(ScraperBase): """ Class for scraping recipe links from foodnetwork.c...
#!/usr/bin/env python import sys import argparse import time from helpers import parameters as params from methods import * def main(args): outbamfn = args.outBamFile configReader = params.GetConfigReader() params.InitConfigReader(args.configfile) params.SetGainCNV(args.cnvAmpFile) params.SetLossCN...
#!/usr/bin/env python import rospy import smach import smach_ros from std_msgs.msg import Int32 from std_msgs.msg import String import game_setting import actionlib from sound_play.msg import SoundRequest, SoundRequestAction, SoundRequestGoal from watson_developer_cloud import TextToSpeechV1 import roslib; roslib.load...
import jsonpickle from django.http import JsonResponse from django.shortcuts import render, redirect from django.views import View from django_redis import get_redis_connection from goods.models import GoodsSKU # Create your views here. class CartAdd(View): '''加入购物车''' def post(self, request): # 判...
def array123(nums): i = 2 while i < len(nums): if nums[i]==3 and nums[i-1]==2 and nums[i-2]==1: return True i+=1 return False def array_front9(nums): i = 0 while i<len(nums) and i < 4: if nums[i] == 9: return True i+=1 return False def array_count9(nums): i = 0 occur = 0 ...
# -*- coding: utf-8 -*- # Generated by Django 1.11.1 on 2017-06-03 23:40 from __future__ import unicode_literals import django.core.validators from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('userprofiles', '0006_auto_20170521_1919'), ] operatio...
import unittest import contracts from VM import VM class VNTestCase(unittest.TestCase): pass if __name__ == "__main__": unittest.main()
import tkinter as tk from tkinter import ttk from tkinter import * import bcrypt import sqlite3 from tkinter import messagebox as mb from MenuPrincipal import Menu class Ingreso: def __init__(self, ventanaPrincipal): self.auxiliar=False #Creacion de la ventana self.ve...
base_url = "https://eb-fp-test:8101" # set url
#!/usr/bin/env python3 import rospy import time import numpy as np from mpl_toolkits.mplot3d import Axes3D import matplotlib.pyplot as plt import random import argparse #from tensorflow import keras from tensorflow.compat.v1.keras.models import model_from_json, Model,load_model from tensorflow.compat.v1.keras.models ...
from django.db import models # Create your models here. class jobListing(models.Model): title = models.TextField(null=True,blank=True) description = models.TextField(null=True,blank=True)
# coding: utf-8 # Definition for a binary tree node. # class TreeNode(object): # def __init__(self, x): # self.val = x # self.left = None # self.right = None from made_bitree import TreeNode class Solution(object): def isValidBST(self, root): """ :type root: TreeNode ...
#!/usr/bin/env python class HelloWord: tab = [] def __init__(self): self.add_tab("Script Python") self.add_tab("Hello") self.add_tab("Word") self.toString() def add_tab(self, val): self.tab.append(val) def toString(self): print(' '.join(map(str, self....
''' Created on 3Nov.,2016 @author: u76345 ''' import sys import os from jetcat2argus import JetCat2Argus def main(): assert len(sys.argv) == 5, 'Usage: %s <jetcat_path> <db_alias> <db_user> <db_password>' % sys.argv[0] jetcat_path = sys.argv[1] db_alias = sys.argv[2] db_user = sys.a...
import random from datetime import datetime from unittest import mock, TestCase import pytest import responses from freezegun import freeze_time from libtrustbridge.websub.repos import NotificationsRepo, DeliveryOutboxRepo, SubscriptionsRepo from api.models import Message, MessageStatus from api.use_cases import ( ...
import os import h5py def loadh5(dump_file_full_name): ''' Loads a h5 file as dictionary ''' with h5py.File(dump_file_full_name, 'r') as h5file: dict_from_file = readh5(h5file) return dict_from_file def readh5(h5node): ''' Recursive function to read h5 nodes as dictionary ''' dict_from...
import sys grade = float(sys.argv[1]) if (grade < 0 or grade > 5): print("Program expects a number from 0-5.") elif grade < 1.0: print("F") elif grade < 1.5: print("D-") elif grade < 2.0: print("D") elif grade < 2.5: print("D+") elif grade < 2.85: print("C-") elif grade < 3.2: print("C") elif grade < 3.5: pri...
from ED6ScenarioHelper import * def main(): # 蔡斯 CreateScenaFile( FileName = 'R3102_1 ._SN', MapName = 'Zeiss', Location = 'R3102.x', MapIndex = 1, MapDefaultBGM = "ed60010", Flags = 0, En...
import h5py import numpy as np import sys import matplotlib import matplotlib.pyplot as plt import argparse from genome import * from read import * from bc_read import * from alphabet import * from kmer_model import * from base import * from model import * import yaml import os parser = argparse.ArgumentParser() parse...
import tensorflow as tf ## 定義變數 給予名稱 state = tf.Variable(25, name='counter') ## 定義常數 one = tf.content(30) new_value = tf.add(state, one) ## 定義分配量 update = tf.assign(state, new_value) ## 初始化變數 init = tf.global_variables_initializer() with tf.Session() as sess: sess.run(init) print(sess.run(update))
def str2bool(v): return v.lower() == "true"
""" 문제 N을 입력받은 뒤, 구구단 N단을 출력하는 프로그램을 작성하시오. 출력 형식에 맞춰서 출력하면 된다. 입력 첫째 줄에 N이 주어진다. N은 1보다 크거나 같고, 9보다 작거나 같다. 출력 출력형식과 같게 N*1부터 N*9까지 출력한다. 예제 입력 1 2 예제 출력 1 2 * 1 = 2 2 * 2 = 4 2 * 3 = 6 2 * 4 = 8 2 * 5 = 10 2 * 6 = 12 2 * 7 = 14 2 * 8 = 16 2 * 9 = 18 """ N=int(input()) for i in range(1,10): print("%d * %d = %d...
#!/usr/bin/env python # -*- coding: utf-8 -*- import collections import os import sys import re import html5lib import packaging.specifiers import packaging.version import six from .endpoints import Endpoint from .utils import ( WHEEL_EXTENSION, WHEEL_FILENAME_RE, match_egg_info_version, package_names_match,...
class Sound(): """docstring for Template""" def __init__(self): self.sound_id = 0; self.user_id = ''; self.longitude = 0; self.latitude = 0; self.description = ''; self.tag = ''; class User(): def __init__(self): self.user_id = ''; self.name = ''; self.photo_id = ''; self.voice_id = '';
import os for i in range(0,255): add = "192.168."+str(i)+".0-254" os.system("nmap -sn "+add)
__author__ = 'm&g' import sys from zipline.api import ( order_target, order_target_percent, symbol, option_symbol, ) from zipline.assets import ( Equity, Option, ) from backtester.models.order import ( PlainOrderModel, PercentOrderModel, ) class BaseOrderExecutorModel(object): ""...
#!/usr/bin/python3 from models.state import State from tests.test_models.test_base_model import TestBaseModel class TestState(TestBaseModel): ''' ========================= User tests ========================= ''' def __init__(self, *args, **kwargs): ''' Constructor ''...
from scraper.spiders.auto_spider import CarSpider from scrapy.settings import Settings from scrapy.crawler import CrawlerProcess try: settings = Settings() settings.setmodule('scraper.settings') process = CrawlerProcess(settings=settings) process.crawl(CarSpider) process.start() except Excep...
import rhinoscriptsyntax as rs a = 0.06 #kukan no futosa b = 0.5 #haji no futosa b0 = 1.5 #mannaka no hutosa c = 0.2 #chotto sita zure def periods_ofcurve( curve, n ): domain = rs.CurveDomain( curve ) cpoint_list = [ ] point0 = rs.EvaluateCurve( curve , domain[0] ) point1 = rs.EvaluateCurve( curve ...
from cl_app.utils import general_error_response from .models import(Employee, Fmspw) from rest_framework.authtoken.models import Token from django.contrib.auth.models import User from rest_framework.response import Response from rest_framework import status # log start # import logging # logging.basicConfig(filename='...
class Solution: def removeKdigits(self, num, k): """ :type num: str :type k: int :rtype: str """ # brute force, TLE # another solution # maintain a increasing stack if len(num) == k: return '0' stack = [] for n in ...
names = ['admin', 'panda', 'tiger', 'dog', 'cat'] for name in names: if name == 'admin': print("Hello admin, would you like to see a status report.") else: print("Hello " + name + ", thank you for logging in again.")
from django.db import models # Create your models here. class jrny(models.Model): start = models.CharField(max_length=100) destination = models.CharField(max_length=100) time = models.CharField(max_length=12) number = models.IntegerField() date = models.CharField(max_length=12) def __str__(s...
import networkx as nx import numpy as np from constants import * from fastdtw import fastdtw from utils import dist, compressed_degree_list, avg_2d_array from utils import neg_softmax class RandomWalkerFactory: def get_random_walker(name, options): if name == 'node2vec': assert 'p' in options...
import tools import paperInfo import plots import matplotlib.pyplot as plt # -*- coding: utf-8 -*- def allCountries(papers): countries = tools.countries(papers) filteredCountries = tools.filteredUE(countries,6) print(filteredCountries) plots.pieChart(filteredCountries,"Publications by countries") de...
# Generated by Django 3.1 on 2020-09-01 19:44 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('gaz_counter', '0001_initial'), ] operations = [ migrations.AlterField( model_name='gazcountermodel', name='unit_price'...
''' A collection of functions for DS8-Unit3-Sprint1 ''' import pandas import numpy as np def train_val_test_split(df, test_size=0.2, val_size=0.2): ''' Returns three dataframes. First splits DF into initial/test based on test_size, then splits initial into train/val based on val_size. df = Pandas...
#!/usr/bin/python # -*- coding: utf-8 -*- # 什么是面向对象 #需求 # - 老妈的交通工具有两个,电动车和自行车 # - 家里离菜场共 20 公里 # - 周一的时候骑电动车去买菜,骑了 0.5 小时 # - 周二的时候骑自行车去卖菜,骑了 2 小时 # - 周三的时候骑电动车去卖菜,骑了 0.6 小时 # - 分别输出三天骑行的平均速度 # def main(): # distance = 20 # e_bicycle = '电动车' # bicycle = '自行车' # day1 = '周一' # hour1 = 0.5 # speed1 = 20/h...
import json import elasticsearch8 from share import models as db from share.search import exceptions from share.search.index_strategy.elastic8 import Elastic8IndexStrategy from share.search import messages from share.util import IDObfuscator from share.util.checksum_iris import ChecksumIri class Sharev2Elastic8Inde...
#!/cs/puls/Projects/business_c_test/env/bin/python3 # -*- coding: utf-8 -*- import tensorflow as tf import os, sys import numpy as np from tqdm import trange sys.path.append(os.path.abspath(os.path.dirname(__file__))) from sklearn.metrics import classification_report from gensim.models import KeyedVectors from gensim....
import main.core.similarity as sim from main.info import config config.Config().configdict['user_item_CF']['model'] = 'item-based' config.Config().configdict['user_item_CF']['similarity'] = 'adjusted_cos' config.Config().apply_changes() dao = sim.new_DAO_interface() sim.init_user_mean_matrix(dao) sim.get_other_item_s...
import numpy as np import tensorflow as tf from tensorflow import keras from tensorflow.keras import layers, optimizers, datasets a = tf.constant(1) # 标量 print(a.device) # 运行设备:CPU/GUP b = tf.range(4) print(b) print(b.device) print(b.numpy()) print(b.ndim) # 维度 print(tf.rank(b)) # 维度(Tensor变量表示) print(tf.ones([3...
# coding: utf-8 """ Apache NiFi Registry REST API The REST API provides an interface to a registry with operations for saving, versioning, reading NiFi flows and components. OpenAPI spec version: 1.19.0 Contact: dev@nifi.apache.org Generated by: https://github.com/swagger-api/swagger-codegen.git ...
# Задача 3. Вариант 6. # Напишите программу, которая выводит имя "Самюэл Ленгхорн Клеменс", и запрашивает его псевдоним. Программа должна сцеплять две эти строки и выводить полученную строку, разделяя имя и псевдоним с помощью тире. # Ivanov S. E. # 19.09.2016 PSEUDONYM = "Марк Твен" NAME = "Самюэл Ленгхорн Клеменс"...
import argparse import os from typing import List, Tuple, Dict from Plotter import Plotter from shapely.geometry.polygon import Polygon, LineString, orient from shapely.geometry import Point from math import atan2 from math import pi import numpy as np ########################################### # Algorithmic Motion ...
from ED6ScenarioHelper import * def main(): # 蔡斯 CreateScenaFile( FileName = 'R3401 ._SN', MapName = 'Zeiss', Location = 'R3401.x', MapIndex = 1, MapDefaultBGM = "ed60030", Flags = 0, En...
import time import sys # file = open('flush.txt','w') # file.write('a') # # file.flush() # time.sleep(20) # file.close() # # for i in range(20): # # sys.stdout.write('#') # # sys.stdout.flush() # print('#',end='') # time.sleep(0.2) # file = open('flush.txt','a') # # file.write('a') # file.truncate(1) ...
from django import forms from .models import Candidato, Experiencia class CandidateForm(forms.ModelForm): class Meta: model = Candidato fields = ( 'cedula', 'nombre', 'puesto', 'departamento', 'salario_aspira', 'competencias'...
class Solution: def ladderLength(self, beginWord, endWord, WordList): from collections import deque from string import ascii_lowercase WordList.add(endWord) n = len(beginWord) queue = deque([(beginWord, 1)]) while queue: word, res = queue.popleft() ...
# Generated by Django 3.0.8 on 2020-11-05 16:52 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('LandingPage', '0004_auto_20201103_1935'), ('campus', '0002_auto_20201105_2214'), ] operations = [ m...
# -*- coding: utf8 -*- import torch import torch.autograd as autograd import torch.nn as nn import torch.nn.init import torch.nn.functional as F # import numpy as np from loader import CAP_DIM from torch.autograd import Variable import math ''' def _calculate_fan_in_and_fan_out(tensor): dimensions = tensor.ndimen...
import tensorflow as tf import matplotlib.pyplot as plt import numpy as np data=tf.keras.datasets.mnist (x_train,y_train),(x_test,y_test)=data.load_data() x_test=tf.keras.utils.normalize(x_test,axis=1) x_train=tf.keras.utils.normalize(x_train,axis=1) model=tf.keras.models.Sequential() model.add(tf.k...
from blogging.models import Post, Category from rest_framework import serializers class PostSerializer(serializers.HyperlinkedModelSerializer): class Meta: model = Post fields = ['title', 'text', 'author', 'created_date', 'modified_date', 'published_date', 'categories'] class CategorySerializer(s...
''' Created on 11-Feb-2019 @author: prasannakumar ''' class work1: def cutting(self): print("the worker can cut the trees") def jump(self): print("the man can jump") print("pk")
import threading from time import sleep from HRMListener import * from usb import USBError import requests import config import json class HRMThread(threading.Thread): # #inerval is the period the thread get HR from device def __init__(self, monitorScreen, statusMessage, interval=10, userID=None): th...
from pre_exam_concert_data import student_data, with_accompaniment_costs, no_accompaniment_costs # Variables final_cost = 0 audience_ticket = 10 print("Pre-Exam Concerts\n") for i in range(2): new_dictionary = {} performer_name = input("Name of performer: ") new_dictionary['Performer name'] = performer...
from django.contrib import admin from .models import Link, SideBar from blog_sys.custom_site import custom_site from blog_sys.base_admin import BaseOwnerAdmin # Register your models here. @admin.register(Link, site=custom_site) class LinkAdmin(BaseOwnerAdmin): list_display = ('title', 'href', 'weight', 'status'...
""" @author: Gaetan Hadjeres """ from BFT.handlers import EncoderDecoderHandler from BFT.positional_embeddings import PositionalEmbedding import importlib import os import shutil from datetime import datetime import click import torch import torch.multiprocessing as mp import torch.distributed as dist from torch.nn.p...
from .sign_up import SignUpForm
# flake8: noqa from . import model
import matplotlib.pyplot as plt import numpy as np import torch def plot_graph(data, labels, legends, title): """ Plot multiple graphs in same plot :param data: data of the graphs to be plotted :param labels: x- and y-label :param legends: legends for the graphs :param title: Title of the gra...
""" Support for Zoneminder. For more details about this component, please refer to the documentation at https://home-assistant.io/components/zoneminder/ """ import logging import json from urllib.parse import urljoin import requests import voluptuous as vol import homeassistant.helpers.config_validation as cv from ...
a=int(input()) b='' for i in range(2,a,2): if a%i==0: b+=str(i)+" " print(b+str(a))
from to_send_a_fax import E, f import unittest class ToSendAFaxTest(unittest.TestCase): def test_E(self): self.assertEqual(4, E(0)) # zero self.assertEqual(3, E(1)) # one self.assertEqual(3, E(2)) # two self.assertEqual(5, E(3)) # three self.assertEqual(4, E(4))...
from django.contrib import admin from .models import Aluno, Professor admin.site.register(Aluno) admin.site.register(Professor)
from django import forms from .models import question,answer class question_form (forms.ModelForm): class Meta : model = question fields = ('question',) class answer_form (forms.ModelForm): class Meta : model = answer fields = ('the_answer',)
import pandas as pd import matplotlib.pyplot as plt TWOTAILED = 'TTT' ONETAILED = 'OTT' ALPHA05 = 0.05 ALPHA01 = 0.05 selalpha = ALPHA05 #selalpha = float(raw_input()) dfw = pd.read_csv("./WSRTdf.csv") df = pd.read_csv("./SystolicBloodPressureAnalysis.csv") number_of_samples = len(df) df['Difference'] = df....
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Tue Jul 2 21:55:47 2019 @author: robertwinslow I want to have a big list of substances tagged with properties for a little doodle. The substances are stored in an outside textfile with the following format. [tags] Name Tags are: H=hot, h=cold D=d...
import argparse import shutil import numpy as np from os import makedirs from os.path import join, exists parser = argparse.ArgumentParser() parser.add_argument('--data_dir', default='data/elmo', help='Directory containing the dataset') parser.add_argument('--output_dir', default='data/averaged_elmo', help='Output dir...
class Employee: """ simple model to blueprint an employee""" def __init__(self,fname,lname,salary): """ set employee name and salary""" self.first_name = fname self.last_name = lname self.salary = salary def give_raise(self,amount=5000): """ give $5000 raise as defa...
#!/usr/bin/env python3 import argparse import itertools import os import posixpath import re try: import cPickle as pickle # Python 2 except ImportError: import pickle # Python 3 import ninja def _parse_args(): parser = argparse.ArgumentParser() # Ninja input file options parser.add_argument...
import torch from braindecode import EEGClassifier from braindecode.models import ShallowFBCSPNet from sklearn.pipeline import Pipeline from skorch.callbacks import EarlyStopping, EpochScoring from skorch.dataset import ValidSplit from moabb.pipelines.features import Resampler_Epoch from moabb.pipelines.utils_pytorch ...
#!/usr/bin/python ## -*- coding: utf-8 -*- # import json #import db_conf import cgi import sys import sqlite3 conn = sqlite3.connect('sqlite/hemap_core3.db') conn.text_factory = str c = conn.cursor() qform = cgi.FieldStorage() inparam = "CML"# inparam = "GSM219392 GSM219393 GSM219394" inparam = qform.getvalue('inparam...
number=int(input("number of terms you want?")) num1,num2=0,1 count=0 if number<=0: print("enter positive number") elif number==1: print("fibonacci series up to:",number,":") print(num1) else: print("fibonacci series:") while count<number: print(num1) num3=num1+num2 n...
def print_welcome_message(): print("This program is a Push-Down Automata (PDA) string simulator.") print("Given a PDA provided as a JSON file under files/, it will generate its transition table.") print("With this transition table, it will then loop through the provided strings and print whether it is acce...
import tensorflow as tf a = tf.constant([1, 2, 3, 4, 5, 6], shape=[1,6]) b = tf.constant([1,1,1,1,1,1,1,1,1,1,1,1],shape=[6,2]) c = tf.matmul(a, b) with tf.Session() as sess: c = sess.run(c) print(a.eval()) print(b.eval()) print(c) ''' PCA随机数据 import matplotlib.pyplot as plt batch_size = 37 seed = 2...
#!/usr/bin/env python # This code is strictly for demonstration purposes. # If used in any other way or for any other purposes. In no way am I responsible # for your actions or any damage which may occur as a result of its usage # dnsSpoof.py # Author: Nik Alleyne - nikalleyne at gmail dot com # http://securitynik.blog...
# Generated by Django 2.1.5 on 2019-10-28 10:58 from django.db import migrations, models class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( name='Company', fields=[ ('id', m...
# Generated by Django 3.0.5 on 2020-05-11 23:35 from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('appointments', '0008_auto_20200510_1654'), ] operations = [ migrations.RemoveField( model_name='appointment', name='attorney...
# -*- coding: utf-8 -*- import os, logging, re, traceback, sys import requests import time # import browsercookie # import settings from bs4 import BeautifulSoup from torrequest import TorRequest logger = logging.getLogger(__name__) logger.setLevel(logging.DEBUG) SESSION = requests.Session() SESSION.cookies = browser...
D, G = map( int, input().split()) DP = [0 for i in range(G/100+1)] for i in range(D): p, c = map( int, input().split()) P.append(p) C.append(c)
#!/usr/bin/env python3 # coding=utf-8 """The setup script.""" from setuptools import setup, find_packages with open("README.rst") as readme_file: readme = readme_file.read() with open("HISTORY.rst") as history_file: history = history_file.read() version = {} with open("./pancakes/version.py") as version_fi...
import os, rasterio import xarray as xr import geopandas as gpd from shapely.geometry import Point import pandas as pd import numpy as np from affine import Affine import datetime base_path = '/atlas_scratch/malindgren/nsidc_0051' out_dict = {} metrics = ['freezeup_start','freezeup_end','breakup_end','breakup_start']...
import scrape_mars scrape = scrape_mars.news_scrape() print(scrape)
import logging log = logging.getLogger('onegov.agency') log.addHandler(logging.NullHandler()) from onegov.agency.i18n import _ from onegov.agency.app import AgencyApp __all__ = ( '_', 'AgencyApp', 'log', )
#!/usr/bin/env python # Author: Jin Lee (leepc12@gmail.com) import sys import os import argparse from encode_lib_common import ( log, ls_l, mkdir_p, rm_f, ) from encode_lib_genomic import ( bam_to_pbam, ) def parse_arguments(): parser = argparse.ArgumentParser(prog='ENCODE bam to pbam', ...
{ "scan_id": "f96e0fe3e21246e3a1cae6d3f59725f2c387f040009766fdfeb11d75487d3e35-1528131725", "resource": "f96e0fe3e21246e3a1cae6d3f59725f2c387f040009766fdfeb11d75487d3e35", "scan_date": "2018-06-04 17:02:05", "permalink": "https://www.virustotal.com/file/f96e0fe3e21246e3a1cae6d3f59725f2c387f040009766fdfeb11d75487d3e...
import os import cv2 import numpy as np import time import copy import cv2 import json import torch import torch.nn as nn import torch.nn.functional as F import torch.optim as optim from torch.utils.data import DataLoader, Dataset from torch.optim import lr_scheduler from torchvision import datasets from facenet_pytorc...
#!/usr/local/bin/python3 import random test_count = 63 for _ in range(test_count): a = str(random.randint(10, 99)) b = str(random.randint(10, 99)) op = '+' if random.randint(0, 1) == 0 else '-' print(a, op, b)
#!/usr/bin/env python import numpy as np import os import ext.progressbar as progressbar from itertools import permutations """ misc.py - Place some often reused functions here """ def drawwidget(discription, ljust=20): """ Formats the progressbar. """ widget = [discription.ljust(ljust), progressbar.Percenta...
# -*- coding: utf-8 -*- from django.core.management.base import BaseCommand, CommandError from lightning import LightningRpc from charged.api import Ln from django.conf import settings class Command(BaseCommand): help = 'lightning info' #def add_arguments(self, parser): # parser.add_argument('command' ,...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ] operations = [ migrations.CreateModel( name='RelatedResource1', fields=[ ('id', models.AutoF...
# Generated by Django 2.2.19 on 2021-03-19 11:28 from django.conf import settings from django.db import migrations class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ('home', '0003_answers_question'), ] operations = [ ...
my_list_1 = [2,2,5,12,8,2,12] # создание словаря с колючами из списка my_dict_1 = dict.fromkeys(set(my_list_1),0) # подсчёт количества повторов каждого значения в списке с занесением резельтата в значение словаря for number in my_list_1: my_dict_1[number] += 1 # финальный список создаём из ключей значение которых р...
import matplotlib.pyplot as plt import datetime import json import os PIE_COLOR = ['#ff9999', '#99ff99', '#ffcc99'] SURVEY_FIELDS = ['good', 'neutral', 'bad'] class Survey: def __init__(self, save_path): """ :param save_path: Where information should be saved """ self.survey_info...
# Python library for the SparkFun's line of u-Blox GPS units. # # SparkFun GPS-RTK NEO-M8P: # https://www.sparkfun.com/products/15005 # SparkFun GPS-RTK2 ZED-F9P: # https://www.sparkfun.com/products/15136 # SparkFun GPS ZOE-M8Q: # https://www.sparkfun.com/products/15193 # SparkFun GPS SAM-M8Q: # https://www.spa...
#coding=utf-8 class test_judgeday_base_yearmonthday: year="" month="" day="" actoryDay="" def years(self): print("请输入年份:") ye=input() if ye.isdigit(): if int(ye)%4==0: return 0 else: return 1 else: ...
# Copyright 2010-2011 OpenStack Foundation # Copyright (c) 2013 Hewlett-Packard Development Company, L.P. # # 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/licens...
import psycopg2 conn = psycopg2.connect("dbname=siavash_database") cur = conn.cursor() cur.execute(""" CREATE TABLE new_schema.Encounters ( Encounter_EntryID integer, MRN text, Encounter_UniqueID integer, Encounter_Date date, Encounter_Status text, Encounter_Type text, Encounter_Department text, ...