text
stringlengths
38
1.54M
from django.urls import path from .views import Index,addWork,UpdateWork,DeleteWork app_name = "SurfaceApp" urlpatterns = [ path('',Index,name="index"), path('add-work-details/',addWork,name="AddWork"), path('update-work-details/<str:slug>/',UpdateWork,name="UpdateWork"), path('delete-work/<str:slug>/',DeleteWork...
from django.http.response import HttpResponse from django.shortcuts import render from django.http import HttpResponse # Create your views here. def sample(request): return HttpResponse("hey! im here")
""" this is all the code I have done for my code. I am useing rover number 1. """ import RPi.GPIO as GPIO from time import sleep import random GPIO.setmode(GPIO.BCM) GPIO.setup(24, GPIO.OUT) GPIO.setup(23, GPIO.OUT) GPIO.setup(27, GPIO.OUT) GPIO.setup(17, GPIO.OUT) GPIO.setup(13, GPIO.IN) while Tr...
glossary = { 'string': 'A series of characters', 'comment': 'A note that the Python interpreter ignores', 'list': 'A collection of items in a particular order and can be amended', 'loop': 'Work through a collection of items, one at a time', 'dictionary': 'A collection of key-value pairs' } for word...
import sys from sklearn.datasets import load_iris import numpy as np import pandas as pd import matplotlib.pyplot as plt from sklearn.model_selection import train_test_split from sklearn import linear_model import mysql.connector DATASET_PATH = "/Users/michaelfilonenko/Downloads/dataset.csv" def get_db_connection():...
import ctypes as ct import logging from contextlib import suppress from ctypes.wintypes import * import PyHook3 import psutil import pythoncom from model.base import Rectangle log = logging.getLogger('app.process') log.setLevel(logging.WARNING) kernel32 = ct.windll.kernel32 user32 = ct.windll.user32 WNDENUMPROC = ...
import webbrowser class Movie(): """this class stores information related to the movie Attributes: title: The title of the video. storyline: The storyline about the movie. poster_image_url: The poster of the movie. trailer_youtube_url: The trailer of the movie""" def __init__(self,...
from pykkar import * import random as rnd import time def generate(r,c,start, finish): # Randomized Prim's algorithm start = [start,start] tries = [[0,0], [0,1], [0,-1], [1, 0], [-1, 0]] lst = [] for i in range(r): temp = [] for j in range(c): temp.append('#') ...
from flask import request from flask_accepts import accepts, responds from flask_restx import Namespace, Resource from flask.wrappers import Response from typing import List from .schema import WhatsitSchema from .service import WhatsitService from .model import Whatsit from .interface import WhatsitInterface api = N...
################################################################################################### from mpl_toolkits.basemap import Basemap import matplotlib import math from scipy import * import pylab as P import numpy as np import sys, glob import os import time from optparse import OptionParser import netCDF4 imp...
from collections import defaultdict from chainn.util import Vocabulary from chainn.util import functions as UF def strip_split(line): return line.strip().split() def unsorted_batch(batches, dicts): for x_batch, dct in zip(batches, dicts): max_len = max(len(x) for x in x_batch) for i in range(...
from math import * def main(): max_num_of_p = 1000 p = [0] * (max_num_of_p+1) for a in range(max_num_of_p): for b in range(max_num_of_p): c = calc_hypotenuse(a, b) if(a+b+c > max_num_of_p): break if(check_if_integer(c)): p[a+b+int(c)] += 1 current_max_p = 0 current_p = 0 for i in range(len(p)...
print(1, 2, 3) print("파" + "이" + "썬") print("파""이""썬") print("파", "이", "썬") print([1, 2, 3])
import numpy as np import Dataset from Dataset import OptimizedDataset, OptimizedDatabase import unittest import Loss import time import random import Activation import math from FullyConnectedLayer import FCLayer class DeNet: """DeNet is similar to LoopyNet. It uses the same algorithms, but each layer hold i...
import argparse import json hierarchy_file = '/home/chamo/Documents/work/OpenImgChamo/config/bbox_labels_500_hierarchy.json' result_file = '/home/chamo/Documents/data/UntitledFolder/test.csv' ouput_file = '/home/chamo/Documents/data/UntitledFolder/expanded_test.csv' ouput_box_file = '/home/chamo/Documents/data/U...
# -*- coding: utf-8 -*- # Define here the models for your scraped items # # See documentation in: # http://doc.scrapy.org/en/latest/topics/items.html import scrapy class DongguanItem(scrapy.Item): # define the fields for your item here like: # name = scrapy.Field() qnum = scrapy.Field() # 编号 qtype ...
fname = input('Please enter a file name: ') try: fhand = open(fname) except: if fname == 'na na boo boo': print('NA NA BOO BOO TO YOU - You have been punk d!') else: print('File cannot be opened: ',fname) count = 0 for line in fhand: if line.startswith('Subject:'): count+=1 print('There were',...
__author__ = 'ruben' __doc__ = 'Query the sqlite database of Buszaki HC database to extract cells, cellType, region. It outputs a txt file' import sqlite3 as sqlite tablesToIgnore = ["sqlite_sequence"] outputFilename = None def Print(msg): if (outputFilename != None): outputFile = open(outputFilename, '...
# -*- coding: utf-8 -*- # Generated by Django 1.10 on 2017-11-03 11:42 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( name='dag', ...
import numpy as np import matplotlib.pyplot as plt x = np.arange(0, 0.1, 0.01) print x plt.plot(x, np.sin(x)) plt.show()
# -*- coding: utf-8 -*- """ Created on Thu Feb 25 10:22:41 2021 @author: holge """ import time import numpy as np import h5py import matplotlib.pyplot as plt import mandelbrot_functions as mf if __name__ == "__main__": I = 100 T = 2 C = mf.create_mesh(4096, 4096) # C = mf.create_mesh(100, 100) nu...
import os import sys # Plot the scatter of generated test case for (y=x**2) epoch_interval = 500 total_epoch = 20000 total = 0 good = 0 for i in range(0,total_epoch, epoch_interval): with open(str(i)+'.txt', 'r') as f: for line in f: a,b = line.split(',') # Condition of good test ...
def m_hamming_distance(s1, s2): if len(s1) < len(s2): return s1 elif len(s1) > len(s2): return s2 else: result = 0 for i in range(len(s1)): if s1[i] != s2[i]: result = result + 1 return result if __name__ == "__main__": print(m_hammin...
import torch from torch import nn from models.resnet import resnet50 class PCBModel(nn.Module): def __init__(self, num_class=None, num_parts=6, bottleneck_dims=256, pool_type="avg", share_embed=False): super(PCBModel, self).__init__() assert pool_type in ['max', 'avg'] self.backbone = re...
def reverseWord(s): #your code here #return s[::-1] #s = list(s) new_s = [] start = 0 end = len(s)-1 while end>=0: # s[start],s[end] = s[end],s[start] # start += 1 # end -= 1 new_s.append(s[end]) end -= 1 return ''.join(new_s) if __name__ == "__mai...
from configparser import ConfigParser def getConfig(file_name, encoding='utf-8'): config = {} cf = ConfigParser() cf.read(file_name, encoding=encoding) sections = cf.sections() for section in sections: options = cf.options(section) for option in options: config[section+option] = cf.get(section, option) re...
import sys sys.path.append("/home/hecher/dev/Projekte/OSGExt/Scripting/Example/TestRefCounting") from MFRefCountTest import (MFRecPtrAccessTest, MFUnrecPtrAccessTest, MFWeakPtrAccessTest) from SFRefCountTest import (SFRecPtrAccessTest, SFUnrecPtrAccessTest, SFWeakPtrAccessTest, SingleFieldTest) tests = [] def addMFP...
def merge_sort(list): if len(list)<=1: return size=len(list) mid=size // 2 left=list[:mid] right=list[mid:] merge_sort(left) merge_sort(right) return merge_two_lists(list,left,right) def merge_two_lists(list,a,b): len_a=len(a) len_b=len(b) i=j=k=0 ...
import pytest from saq.database import Remediation, get_db_connection, User from saq.remediation import * @pytest.mark.parametrize('processing, state, css, restore_key, history', [ (False, 'new', '', None, []), (True, 'new', '', None, [ Remediation( action = REMEDIATION_ACTI...
# 3. В массиве случайных целых чисел поменять местами минимальный и максимальный элементы. import random a = [random.randint(1, i) for i in range(1,10)] min_num = 10 max_num = 0 min_pos = 0 max_pos = 0 i = 0 for x in a: if x < min_num: min_num = x min_pos = i if x > max_num: max_num = x max_pos = i i = i ...
def euler581(): primes = [2,3,5,7,11,13,17,19,23,29,31,37,41,43,47] def is_smooth(n): for p in primes: while n%p==0: n/=p return n==1 cache = dict() smooth_numbers = [1] sum = 0 sum2 = 0 for p in primes: print p, len(smooth_numbers) ...
#_____________________ # simulationsOutput.py #_____________________ from ...path.modulePath import ModulePath from ..io.readLists import readFileProcesses from ..io.readLists import readFileMinValues from ..io.readLists import readFileLevels from ..io.readLi...
#!/usr/bin/python # -*- coding: utf-8 import json import urllib2 import websocket import threading import logging from abstract_bot import AbstractBot, AbstractMessage class SlackBot(AbstractBot): _message_counter = 1 def __init__(self, token): super(SlackBot, self).__init__() self...
from rest_framework import serializers from .models import Equipos class SongsSerializer(serializers.ModelSerializer): class Meta: model = Equipos fields = ('id', 'nombre_equipo', 'liga','tecnico')
#!/usr/bin/env python # BSD 3-Clause License; see https://github.com/scikit-hep/awkward-0.x/blob/master/LICENSE import unittest import numpy from awkward0 import * class Test(unittest.TestCase): def runTest(self): pass def test_masked_nbytes(self): assert isinstance(MaskedArray([True, Fals...
from app import app, cache from app.models import Page, User #from app.big_brain import Interpreter from flask import render_template, request, redirect from werkzeug.exceptions import NotFound @app.route('/facelift/<notion_url>') @cache.cached() def test(notion_url): i = Interpreter('https://www.notion.so/' + n...
from math import log2, floor from torch import nn, cat, add, Tensor from torch.nn import init, Upsample, Conv2d, ReLU, Sequential from torch.nn.functional import interpolate class ScaleLayer(nn.Module): def __init__(self, init_value=1e-3): super().__init__() self.scale = nn.Parameter(Tensor([init...
from django.apps import AppConfig from django.utils.translation import ugettext_lazy as _ class ReportBuilderConfig(AppConfig): name = 'report_builder' verbose_name = _('Reports')
from apps.user.models import AgentGroup def create_agent_group(supplier, name='', desc=''): agent_group = AgentGroup() agent_group.supplier = supplier agent_group.name = name agent_group.desc = desc agent_group.save() return agent_group
import numpy as np def max_profit(t, p, d, n): ''' Compute the maximum profit of a[n] jobs with t[n] times, p[n] profit and d[n] deadline each. This is a variation of the knapsack problem. We just order all vector in function of the relative order of d. ''' order = np.array(d).argsort() t = np.array(t)[order] ...
# -*- coding: utf-8 -*- """ Created on Sun Mar 21 18:40:33 2021 @author: 柏均 """ from mcpi.minecraft import Minecraft import time mc= Minecraft.create() x,y,z = mc.player.getTilePos() time.sleep(6) mc.setBlock(x,y,z,8) time.sleep(6) mc.setBlock(x+5,y,z,8) time.sleep(6) mc.setBlock(x,y,z+5,8) ...
from django import forms from typing import Dict, Any from private.models import * class UploadForm(forms.ModelForm): class Meta: model = Song fields = "__all__" exclude = ["post_author", "counter"] widgets = { "band": forms.TextInput( attrs = { ...
from django.urls import path from . import views urlpatterns = [ path('',views.index,name = 'index'), path('contact',views.contact, name = 'contact'), path('about',views.about,name = 'about'), path('pricing',views.pricing,name = 'pricing'), path('service',views.service,name = 'service'), path('blog',views.blog,n...
def print_constraints_board_style(x, y, constraints): for yy in range(9): for xx in range(9): if x == xx and y == yy: print("X", end=" ") else: print("#" if constraints[y][x][yy][xx] else ".", end=" ") print() def print_variables_board_style(...
# inputting your profile info: birth_year = input('Birth year: ') print(type(birth_year)) age = 2020 - int(birth_year) print(type(age)) print(age) body_weight_lbs = input('your current weight: ') body_weight_kg = 0.45 * int(body_weight_lbs) print(body_weight_kg)
import tkinter as tk from tkinter import ttk class SidebarFrame(tk.Frame): """Frame that manages the sidebar and user input """ # Init and window management def __init__(self, parent, submitCallback, *args, **kwargs): """Args: parent (tk): Tk parent widget ...
# ------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # -------------------------------------------------------------------------- import os ...
thistuple = ("apple", "banana", "cherry") print(thistuple) '''the tuple value cannot be added like this because the tuples are ordered nd unchangeable''' #thistuple[1] = "orange" #print(thistuple) for x in thistuple: print(x) if "apple" in thistuple: print("Yes, 'apple' is in the fruits tuple") print(len(thistupl...
import os from contextlib import contextmanager from typing import ( Iterable, Iterator, List, Optional, Sequence, Type, TypeVar, Union, cast, ) from .objects import ExtResource, GDObject, SubResource from .sections import ( GDExtResourceSection, GDNodeSection, GDSection...
# make_plots.py # Make plots for other codes # # Created 9 Nov 18 # Updated 9 Nov 18 ################################################################### #Backend for python3 on mahler import matplotlib matplotlib.use('TkAgg') import matplotlib.pyplot as plt import os import sys import numpy as np import math # Code...
from flask import * from werkzeug.utils import import_string import requests import googlmap import Googlemap2 app = Flask(__name__) @app.route('/') def pass_val(): if request.method == 'POST': return jsonify('hello') return render_template('index.html') @app.route('/get_ans',methods = ['POST','GET'])...
def maior_numero(): lista = [] contagem = 0 while contagem < 5: num = int(input("Informe um numero: ")) lista.append(num) contagem += 1 lista lista_ordenada = sorted(lista) return lista_ordenada[-1] print(maior_numero())
#!/usr/bin/python2.7 # -*- coding: utf-8 -*- ''' Marínez García Mariana Yasmin 316112840 Taller de Herramientas Computacionales Esto es lo hicimos la clase 10 del curso, convertir de °C a °F y viceversa, de tres maneras diferentes ''' #Con while: S= '===============================================================' C ...
#!/usr/bin/python import os import sys #a few things to make it easier for me import func #get basepath basepath=os.path.dirname(os.path.realpath(__file__))+'/' if len(sys.argv)!=2: print "Usage: director <channel dir>" exit() channelName="" channelPath="" ffmpegname="" ffmpegpath="" ffmpegcmd="" channelFullN...
# coding: utf-8 from django.shortcuts import render_to_response, redirect, get_object_or_404 from django.template import RequestContext from django.contrib.auth.decorators import login_required from skcrm.models import ExpenseConceptSubType from skcrm.tables import ExpenseConceptSubTypeTable from skcrm.forms import Se...
# Generated by Django 2.0.7 on 2018-11-10 05:05 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('subsidy_elig', '0004_subsidyeligibility_subsidy_ftype'), ('apply_subsidy', '0017_auto_20181110_1023'), ] op...
def task1(): i=0 print("Task1") for x in range(10): print(f"Current no. {x}\t Previous no. {i}\t Sum {x+i}") i=x def task2(): list=[10,20,30,40,10] print("\nTask 2 ") if list[0]==list[-1]: print("True\n") def task3(): list = [10, 20, [300, 400, [5000...
# Generated by Django 2.1.2 on 2018-12-01 11:45 from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('accounts', '0012_auto_20181112_2232'), ] operations = [ migrations.AlterModelOptions( name='user', options={'permissions': (...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models import datetime class Migration(migrations.Migration): dependencies = [ ('portalapp', '0001_initial'), ] operations = [ migrations.CreateModel( name='Event', ...
string=raw_input() lno= len(filter(lambda x: x.islower(),list(string))) uno= len(filter(lambda x: x.isupper(),list(string))) if lno<uno: print string.upper() else: print string.lower()
""" Handling of OCaml bytecode files ending with .byte extension. """ import logging from .code import load_code from .marshall import read_value logger = logging.getLogger("ocaml") class ByteCodeReader: """Reader for bytecode files.""" MAGIC_V023 = "Caml1999X023" def __init__(self, reader): ...
# Generated by Django 2.2.7 on 2019-11-19 07:08 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('api', '0003_auto_20191118_1333'), ] operations = [ migrations.AddField( model_name='book', name='image', ...
import unittest from pitcoin_modules.settings import * from pitcoin_modules.transaction import Transaction, Input, Output from pitcoin_modules.storage_handlers.utxo_pool import UTXOStorage class TestUTXOPool(unittest.TestCase): storage_filepath = PROJECT_ROOT + "/storage/.utxo_pool_test.txt" def test_updatin...
from django.urls import path from application.consumers import ApplicationConsumer from application.dashboardConsumer import DashboardConsumer ws_urlpatterns = [ path('application/<app_code>/workspace/', ApplicationConsumer.as_asgi()), path('dashboard/', DashboardConsumer.as_asgi()) ]
#!/usr/bin/python """ Main Class for the Bot """ __author__ = 'BiohZn' import sys sys.dont_write_bytecode = True from irccon import irc class main: def __init__(self): self.buffer = '' self.irc = irc() def connect(self): self.irc.connect() def read(self): self.buffer += self.irc.socket.recv(8192) wh...
from Parser import Parser from Code import Code from SymbolTable import SymbolTable import sys import os import pdb DEFAULTPATH='/Users/pengfeigao/git/assembler/test/add/Add.asm' DEFAULTPATH='/Users/pengfeigao/git/assembler/test/max/MaxL.asm' DEFAULTPATH='/Users/pengfeigao/git/assembler/test/pong/PongL.asm' DEFAULTPAT...
#!/usr/bin/env python from view import * from model import * app = App() app.model = Model() app.model.connect() app.mainloop()
# -*- coding: utf-8 -* - ''' 使用fast ai进行数据增广 ''' ''' 五个步骤避免过拟合: 获取更多数据、数据增广、generalized architectures、正则化、降低网络复杂度 ''' ''' fastai中有三种基本的变化:transforms_basic, transforms_side_on 和 transforms_top_down,这三种变化由fastai源码中的transforms.py中的三个独立的类定义。 transforms_basic包括RandomRotate、RandomLighting; transforms_side_on包括transforms_basi...
# -*- coding:utf-8 -*- import sys import logging def get_level(le=None): if le is None or le.lower() == "noset": return logging.DEBUG if isinstance(le, bytes): le = le.decode() if isinstance(le, str): try: le = int(le) except: if le.upper() in loggi...
#!/usr/bin/env python # -*- coding: utf-8 -*- # ------------------------------------------------------------------------------ """ This module defines the main application classes for the decks. This module defines the following classes: - Deck """ # ----------------------------------------------------------------...
from flask import Flask from flask.ext.sqlalchemy import SQLAlchemy import os app = Flask(__name__) app.config['SQLALCHEMY_DATABASE_URI'] = os.environ['DATABASE_URL'] db = SQLAlchemy(app) from app import views, models
from urllib.request import urlopen url="http://www.baidu.com" #发送请求 response=urlopen(url) #读取内容 info=response.read().decode('utf-8') #打印内容 print(info) #打印状态码 print(response.getcode()) #打印真实url print(response.geturl()) #打印响应头 print(response.info())
import numpy as np # a = np.arange(10,20,2) # 等差数列,包头不包尾 # a = np.arange(12).reshape(3,4) a = np.linspace(0.5 , 10 ,20).reshape(4,5) # 线性等分 print(a)
# Calendar, Graphical calendar applet with novel interface # # test.py # # Copyright (c) 2010, Brandon Lewis <brandon_lewis@berkeley.edu> # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Found...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations import photo.models class Migration(migrations.Migration): dependencies = [ ('photo', '0002_auto_20150304_2023'), ] operations = [ migrations.AddField( model_name='photo'...
import os import sys import unittest from glob import glob from operator import itemgetter def module_name_to_class(module_name): class_name = module_name.replace('_', ' ') class_name = ''.join(x for x in class_name.title() if not x.isspace()) return class_name def get_test_cases(directory): directo...
import os import numpy as np from data import dictClass import pandas as pd import MLI_getElem as getElem from copy import deepcopy as copy import re def run(nCore=None): if nCore==None: os.system('time mli.x > mli.log') else: os.system('time mpirun -n '+str(nCore)+' mli.x > mli.log') def elem2str(e...
# -*- coding: utf-8 -*- __author__ = 'Liu' from sys import argv # 插入的exists模块的作用的是检测该文件是否存在 from os.path import exists script, from_file, to_file = argv print("Copying for %s to %s" % (from_file, to_file)) # 此处in_file作为的是打开的文件,indata是文件的内容 in_file = open(from_file).read() indata = in_file.read() print("This input fi...
from validate_docbr import CNPJ class Cnpj: def __init__(self, documento): documento = str(documento) if self.validador_cnpj(documento): self.cpnj = documento else: raise ValueError('=- CNPJ invalido!! -=') def validador_cnpj(self, documento): ...
from abaqusConstants import * from .Area import Area from .AreaStyle import AreaStyle from .Axis import Axis from .Legend import Legend from .LineStyle import LineStyle from .TextStyle import TextStyle class DefaultChartOptions: """The DefaultChartOptions object is used to hold on default chart and axis attribute...
from SavingsGoal import SavingsGoal def main(): Car = SavingsGoal("Accord", 8000) # Car.start() # Car.setNewTotalAmount(100) print(str(Car.getName())) exit if __name__ == "__main__": main()
#!/usr/bin/env python # -*- coding: utf-8 -*- # author: moddemod # datetime: 2019/12/25 下午9:54 # ide: PyCharm import binascii import base64 s = '636A56355279427363446C4A49454A7154534230526D684356445A31614342354E326C4B4946467A5769426961453067' r = binascii.unhexlify(s) print(r) r1 = base64.b64decode(r) print(r1) # b...
#%% Imports and Declarations import torch import numpy as np import cv2, time class data_encoder_pytorch: def __init__(self, grid_dim): ''' grid_dim = [Height, Width] or [Y,X] or [Rows, Columns] ''' self.grid_dim = grid_dim def __cornered_to_centered__(self, batch): '''...
class Group(object): def __init__(self, parent=None): self.parent = parent self.children = set() if parent: self.depth = parent.depth + 1 parent.children.add(self) else: self.depth = 1 def score_with_children(self): score = self.depth ...
''' Created on Mar 7, 2014 @author: huunguye References: 1. Markov Chains and Monte Carlo Methods (Ioana) ''' import random ####################################################### # Gibbs sampler for bivariate normal (p.49 [1]) # def sample_bivariate_normal(): mu1 = 0.0 mu2 = 0.0 sig1 = 1.0 # sigm...
from setuptools import setup, Extension resistance_yespower_module = Extension('resistance_yespower', sources = ['yespower.c', 'yespower-platform.c', 'yespower-opt.c', 'yespo...
class Solution: def findPerm(self, s, n): max = n min = 1 res = [None]*n Stack = [] j = 0 for i in range(1,n): if (s[i-1] == "I"): Stack.append(i) while(Stack): res[j] = Stack.pop() ...
lista = [] while True: a = int(input()) if a == 0: break lista.append(a) def inverte(lista): return lista[::-1] for i in inverte(lista): print(i)
from django.http import HttpResponse import datetime from django.template import Template, Context #from django.template import loader, get_template#no tan simplificado como el de abajo from django.template.loader import get_template #---> MAS DIRECTO EL PROCESO from django.shortcuts import render class taco_special(o...
# -*- coding:utf-8 -*- class ListNode: def __init__(self, x=None): ListNode.val = x ListNode.next = None class Solution: def deleteDuplication(self, pHead): ''' 题目描述 在一个排序的链表中,存在重复的结点,请删除该链表中重复的结点,重复的结点不保留,返回链表头指针。 例如,链表1->2->3->3->4->4->5 处理后为 1->2->5 :...
#coding: utf-8 #--------------------------------------------------------- # Um programa que recebe duas notas e calcula a média. #--------------------------------------------------------- # Média Aritmética - Exercício #007 #--------------------------------------------------------- n1 = float(input('Digite sua prime...
#!/usr/bin/python """ Starter code for exploring the Enron dataset (emails + finances); loads up the dataset (pickled dict of dicts). The dataset has the form: enron_data["LASTNAME FIRSTNAME MIDDLEINITIAL"] = { features_dict } {features_dict} is a dictionary of features associated with that pers...
""" Copyright (C) 2010 Laszlo Simon This file is part of Treemap. Treemap is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. Treemap is distr...
from django.shortcuts import get_object_or_404 from decimal import Decimal from django.conf import settings from products.models import Product def cart_contents(request): cart_items = [] total = 0 product_count = 0 cart = request.session.get('cart', {}) for item_id, item_data in cart.items(): ...
##################################################### # Python script that reads betaV images which are # FITS images that has pixel values of the flux ratios # between V = g-0.59(g-r)-0.01 (Jester+05) and Spitzer # IRAC 1 band and analyze # written by Duho Kim (2/19/18) #######################################...
import torch import torchvision from nvidia.dali.pipeline import Pipeline import nvidia.dali.ops as ops from nvidia.dali.plugin.pytorch import DALIClassificationIterator, LastBatchPolicy import nvidia.dali.types as types class HybridPipelineTrain(Pipeline): def __init__(self, batch_size, output_size, num_threads, ...
__author__ = 'chira' def module_function(): print('this is a function from Module_import.py')
import abc import numpy as np import tensorflow as tf from tf_v2_support import placeholder from trainer import tf_module class ExplainPredictor: def __init__(self, num_tags, sequence_output, modeling_option="default"): self.num_tags = num_tags self.sequence_output = sequence_output if m...
def Articles(): articles = [ { 'id':1, 'title':'Article One', 'body':'This article is about the Ashes 2005.', 'author':'Chiranth', 'create_date':'14-12-2018' }, { 'id':2, 'title':'Article Two', 'body':'This article is about the Wimbeldon 2003.', 'author':'Vishak', 'create_date':'14-...
from django.test import TestCase from rest_framework.authtoken.models import Token from django.test import Client # self.user = Usuario.objects.create_user( # nome='test', # email='test@email.com', # password='test', # ) # token, created = Token.objects.get_or_create(user=self.user) # self.client = Clien...