text
stringlengths
8
6.05M
# Import requried modules import fresh_tomatoes import media # Initialize instances of specific movies fitzcarraldo = media.Movie("Fitzcarraldo", "http://www.impawards.com/1982/posters/fitzcarraldo.jpg", # NOQA "https://www.youtube.com/watch?v=gqugru2d1h8") nos...
name = "dayyan" print(len(name)) #Finds the Length of the variable print(name.find("n")) #Finds which character th first is located on print(name.capitalize()) #Capitalizes the first letter print(name.upper()) #Makes it all uppercase print(name.lower()) #Makes it all lowercase print(name.isdigit()) #Answers if...
# Selection sort implementation numbers = [3,53,65,1,321,54,76,43,2,4,66] # Time: O(n^2) || Space: O(1) def selectionSort(array): length = len(array) for x in range(length): minimum = x temp = array[x] for j in range(x+1, length): if array[j] < array[minimum]: ...
import csv from pathlib import Path path = Path(r'C:/Data/Python/NLP/FatAcceptance/Training/Final/ULMFiT') with open(path / 'pred.csv', encoding='utf') as f: reader = csv.reader(f) line = 0 num = 0 for row in reader: line += 1 if line == 1: continue if row[0] == '0' ...
# -*- coding: utf-8 -*- class Solution: def minTimeToType(self, word: str) -> int: current_char, result = "a", 0 for char in word: current_char, result = ( char, result + self.timeToMove(current_char, char) + 1, ) return result d...
from ICICI import ICICI #from icici.py module we import icici class and its contents ravi = ICICI()#object created with ref variable ravi ravi.deposit(1000)#calling method with refvar ravi ravi.showBalance()#showing the bal
#python imports import sys import os import time import datetime import subprocess import json import requests from termcolor import colored #third-party imports #No third-party imports #programmer generated imports from logger import logger from fileio import fileio ''' ***BEGIN DESCRIPTION*** Type: Triage - Descri...
from collections import OrderedDict from typing import Dict, Optional from torch import nn, Tensor from torch.nn import functional as F from ...utils import _log_api_usage_once class _SimpleSegmentationModel(nn.Module): __constants__ = ["aux_classifier"] def __init__(self, backbone: nn.Module, classifier: ...
#number 1 # Create a variable savings savings = 100 # Print out savings print(savings) #number 2 # Create a variable savings savings = 100 # Create a variable factor factor = 1.10 # Calculate result result = savings * (factor**7) # Print out result print(result) #number 3 # Create a variable desc desc = "compound...
#!/usr/bin/env python import math import rospy from nav_msgs.msg import Odometry benda=[] benda.append(('Cube', 0.31,-0.99)); benda.append(('Dumpster', 0.11,-2.42)); benda.append(('Cylinder', -1.14,-2.88)); benda.append(('Barrier', -2.59,-0.83)); benda.append(('Bookshelf', -0.09,0.53)); def jarak(x1,y1,x2,y2): xd=...
#coding:gb2312 #while循环简介 print("Whlie 循环从1数到5:") num = 1 while num <=5: print(num) num += 1 #让用户选择何时退出 prompt = "\nTell me something,and i will repeat it back to you:" prompt += "\nEnter 'quit' to end the program." message = '' while message !='quit': message=input(prompt) if message !='quit': print(message)
from app import app as application if __name__ == '__main__': app.run() ''' from wsgiref.simple_server import make_server httpd = make_server('localhost', 8051, application) print("Serving at http://localhost:8051/ \n PRESS CTRL+C to Terminate. \n") httpd.serve_forever() print("Terminated!!") ...
class solution: def maxProfile(self, prices): buy1 = [0]*len(prices) buy1[0] = -1*prices[0] sell1 = [0]*len(prices) buy2 = [0]*len(prices) buy2[0] = -1*prices[0] sell2 = [0]*len(prices) for i in range(len(prices)): if i>0: buy1[i] = max(buy1[i-1],0-prices[i]) sell1[i] = max(sell1[i-1],buy1[i-1...
phonebook = {'Anirach': '777-1111','Mickey': '777-2222', 'Donald': '777-3333'} phonebook['Bart'] = [1, 3, 5] elements = len(phonebook) print('There are ', elements, ' names in phonebook') for key in phonebook: print(key, ' phone number is: ', phonebook[key]) phonebook['Bart'][1] = 9 print(phonebook) print(list(...
from discord import Member, Embed, Color from discord.ext import tasks, commands from tinydb import Query from time import time from Utilities.Database import commissionsTable from Utilities.CommissionsHelper import ( add_commission, remove_commission, update_all_commissions, ) from Utilities.HasPermissions...
import matplotlib.pyplot as plt import matplotlib.ticker as mticker def plotByMonth(df, name, title): ticklabels = [item.strftime('%b %Y') for item in df.index] ax = df.plot(kind='bar', figsize=(15, 5), alpha=0.6) ax.xaxis.set_major_formatter(mticker.FixedFormatter(ticklabels)) plt.title(title) pl...
from itertools import product, chain from .. import grid from . import tile bg_colors = ['red', 'magenta', 'green', 'cyan', 'blue', 'cyan', 'yellow'] fg_colors = ['black', 'black', 'black', 'black', 'white', 'black', 'black'] class Grid(grid.Grid): vert_div = '||' hor_div = '=' cross_div = 'XX' def...
#Normal Import import time import os import sys #emails: from Core.eletter import Instagram from Core.eletter import Facebook from Core.eletter import Gmail from Core.eletter import Twitter from Core.eletter import AskFM from Core.eletter import Webhost000 from Core.eletter import Blockchain from Core.eletter impor...
import torch import torch.nn as nn from model.audio_encoder import RNN class res_linear_layer(nn.Module): def __init__(self, linear_hidden = 1024,time=1024): super(res_linear_layer,self).__init__() self.layer = nn.Sequential( nn.Linear(linear_hidden, linear_hidden), ...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from xpinyin import Pinyin from django.shortcuts import render, render_to_response from django import forms # 重点要导入,使用 Django 的 表单 from django.http import HttpResponse from .models import Image class ImageForm(forms.Form): name = forms.CharField() ...
# Copyright 2017 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 or agreed to in writin...
from pypm.icp import ICP from pypm.data_points import DataPoints
# class Test(): # def __init__(self): # self.name = 'aaa' # # # def function(self): # pass # # # test1= Test() # print(Test().name) import time try: add = 5 assert(add == 5, '错误') # raise NameError('错误') except Exception as e: print(e) else: print('pass') print(time.strftime...
#!/usr/bin/env python3 # # This example illustrates the use of the 'TRANSFORMER' boundary # condition for the poloidal flux equation, whereby a resistive wall # is assumed, along with a non-zero applied loop voltage via the # transformer (passing through major radius R = 0). # # Run as # # $ ./generate.py # $ ../.....
# Copyright Ramón Vila Ferreres - 2021 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, # INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR # PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE # FOR AN...
lamb = lambda x: x ** 3 print(lamb(3)) def writer(): title = 'Sir' name = (lambda x: title + ' ' + x) return name w = writer() print(w('Breno Polanski')) L = [lambda x: x ** 2, lambda x: x ** 3, lambda x: x**4] for f in L: print(f(3))
# -*- encoding:utf-8 -*- # __author__=='Gan' # Given a string s, partition s such that every substring of the partition is a palindrome. # Return all possible palindrome partitioning of s. # For example, given s = "aab", # Return # [ # ["aa","b"], # ["a","a","b"] # ] # 22 / 22 test cases passed. # Status: Accepte...
def fibonacci(n): """ This function returns the nth value of fibonacci series Input: integer (n) Output: fibonacci[n] """ if n == 0: return 0 if (n==1 or n ==2): return 1 else: return fibonacci(n-1) + fibonacci(n-2) def lucas(n): """ This function ret...
import os.path import pickle import sys from google.auth.transport.requests import Request from google_auth_oauthlib.flow import InstalledAppFlow from googleapiclient.discovery import build from googleapiclient.http import MediaFileUpload from termcolor import colored # ================ CONFIG ================ # ID o...
import unittest import sbol3 import tyto import labop import uml from labop.execution_engine import ExecutionEngine from labop.primitive_execution import initialize_primitive_compute_output from labop_convert import MarkdownSpecialization from labop_convert.behavior_specialization import DefaultBehaviorSpecialization...
santaX = 0 santaY = 0 robotX = 0 robotY = 0 locations = [(0, 0)] ticker = False instructions = "" with open("inputData.txt", "r") as infile: for line in infile: instructions += line for i in instructions: y = 0 x = 0 if i == "^": y = 1 elif i == "v": y = -1 el...
#문자열변수[start:end-1] a = "Life is too short, You need Python" book = a[0:7] #0 ~ 6번 인덱스까지 슬라이싱 print(book) book = a[12:17] print(book) print(a[0:7] + " " + a[12:17])
""" Unit test for EC2 ipa. """ import unittest import mock from treadmill.infra.setup.ipa import IPA from treadmill.infra import constants class IPATest(unittest.TestCase): """Tests EC2 ipa setup.""" @mock.patch('time.time', mock.Mock(return_value=1000)) @mock.patch('treadmill.infra.subnet.Subnet') ...
# -*- coding: cp932 -*- """このソースコードは blanco Frameworkによって自動生成されています。 """ class SampleHanKatakanaCharacterGroup: """半角カタカナのサンプル。blancoCharacterGroupの実装には影響しません。 """ def __init__(self, encoding='cp932'): """クラス初期化メソッド self -- このメソッドを含むクラス自身。 encoding='cp932' -- エンコーディング。デフォルトは'cp932'...
import mouse # pip install mouse import pygetwindow as gw # pip install pygetwindow import time AUORemoteWindow = gw.getWindowsWithTitle('iconnectts2.auo.com')[0] while(1): if AUORemoteWindow.isMaximized: print("Working from home now") else: AUORemoteWindow.maximize() ...
#!/usr/bin/env python # -*- coding: utf-8 -*- from head import * class Task(): """ 任务类型 """ def __init__(self, birth_type = BIRTH_TYPE_AUTO, frame = '', birth_time = datetime.now()): #: 任务初始方向(UP/DOWN) self.birth_type = birth_type #: 来源套接字的文件描述符(用于到连接字典查询相应连接句柄) self.bir...
import os import re from logging import warning, error import requests from api import http from utilities import types, constants def build_session(): command_args = types.Arguments() def get_cert(): if not command_args.cert: return True return command_args.cert def get_pr...
#!/usr/bin/env python # ----------------------------------------------------------------------- # user.py # Author: Sophie Li, Jayson Wu, Connie Xu # ----------------------------------------------------------------------- class User: def __init__(self, name, netid, email): self._name = name self....
def parse_line(line): ### Determine syls/stress in all words in line, store other data too. ### Divide the line into word tokens with spaCy. ### Look up each in dictionary, and there or by calculation in the ### Syllabizer determine syllabification and stress. Lay all basic if len(line) < 1: ...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- __version__ = '1.0.1' get_nvl_point_list_query = """ SELECT npt.id AS id, ST_FlipCoordinates(npt.geom)::geometry AS geom, npt.label AS label, npt.color AS color, npt.icon AS icon, npt.location_id AS lo...
#!/usr/bin/env python from fabricate import * import sys def output_file(): run('cp','input file','output file') # Hacky, perhaps a bug that can be fixed by fabricate? for i, x in enumerate(sys.argv): if x == 'output file': sys.argv[i] = 'output_file' main()
def convertArmor(armor): convertedArmor = {} convertedArmor['id'] = int(armor.get('id')) convertedArmor['price'] = armor.get('Price') convertedArmor['part'] = armor.get('Part') convertedArmor['rarity']= int(armor.get('Rarity')) convertedArmor['slot'] = int(armor.get('Slot')) convertedArmor[...
#!/usr/bin/env impala-python # 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 (th...
print('hello github!i\"m coming!')
###UI #Copyright 2005-2008 J. David Gladstone Institutes, San Francisco California #Author Nathan Salomonis - nsalomonis@gmail.com #Permission is hereby granted, free of charge, to any person obtaining a copy #of this software and associated documentation files (the "Software"), to deal #in the Software without rest...
""" Created by Alex Wang On 2018-07-20 """ import os import sys import shutil import traceback import numpy as np import cv2 from face import face_detect import sort import opencv_trackers def rectangle(image, x, y, w, h, color, thickness=2, label=None): """Draw a rectangle. Parameters ---------- x...
class Solution: def wordPattern(self, pattern: str, s: str) -> bool: dic = dict() x = s.split() i = j = 0 pen = sen = "" di = dict() ic = dict() if len(x) != len(pattern): return False for p in pattern: if p not in di.k...
import os,sys import numpy as np import ROOT from root_numpy import root2array, root2rec, tree2rec import pandas as pd from badchtable import get_badchtable from pulsed_list import get_pulsed_channel_list def get_index( crate, slot, femch ): index = crate*64*15 + (slot-4)*64 + femch return index def get_pulse...
import os import re import glob # global comment tracker in_comment_section = False prev_comment_section = False # returns either an empty string, the unmodified line, or a replaced line def process_line(line): global in_comment_section global prev_comment_section section_match = re.compile(r'^\s{0,}// #'...
# -*- coding: utf-8 -*- from odoo import models, api, fields from datetime import date class HrContract(models.Model): _inherit = 'hr.contract' historial_salario_ids = fields.One2many('contract.historial.salario','contract_id', 'Historial Salario') @api.multi def write(self, vals): re...
import os from .common import Common BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) class Local(Common): DEBUG = True SECRET_KEY = 'local' # Testing ALLOWED_HOSTS = [ "*", ] INSTALLED_APPS = Common.INSTALLED_APPS INSTALLED_APPS += ( 'uritemplate', ...
import logging import os, sys import json import time import numpy as np #from pydap.handlers.dap import DAPHandler from pydap.client import open_url#, Functions from pydap.cas.urs import setup_session HOME = os.path.expanduser('~') info = os.path.join(HOME, '.earthdataloginrc') if os.path.isfile(info): with open(...
# -*- coding: utf-8 -*- """ Created on Thu May 13 16:45:33 2021 @author: ad """ from collections import deque process_list = [] #['id','arrival time','service time','state', 'waiting time'] 프로세스 리스트 process_queue = deque() process_num = 0 #프로세스 개수 t = 0 #가상의 현재 시간 end_process = [] #Log of Process Schedu...
# Split target image into an MxN grid def splitImage(image, size): W, H = image.size[0], image.size[1] m, n = size w, h = int(W/n), int(H/m) imgs = [] for j in range(m): for i in range(n): # append cropped image imgs.append(image.crop((i*w, j*h, (i+1)*w, (j+1)*h...
""" Use this script to generate access tokens for use in development. This requires that you configure in your .env the username and password for the OCCUR Test User account. Reach out to Luke for help using this script. """ import requests import os import dotenv from datetime import datetime, timedelta dotenv.load_...
# Generated by Django 2.2.7 on 2019-11-17 17:14 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('tssite', '0003_auto_20191117_1712'), ] operations = [ migrations.AlterField( model_name='teacher', name='mname', ...
from django.db import models class InventoryTrackingUrl(models.Model): serial_number = models.CharField(max_length=50, null=False) model_string = models.CharField(max_length=50, null=False) gtin_number = models.CharField(max_length=50, null=False) base_model = models.CharField(max_length=50, null=Fals...
#!/usr/bin/env python # converts a .m3u8 (Plex) => .txt (Pulsar for Android) import sys import os import urllib.parse import re import time filepath = sys.argv[1] sd_card_music="/storage/3366-6437/Music" plex_playlist_prefix="/Volumes/backup/bnixbook-music/Music" if not os.path.isfile(filepath): print("File path ...
/Users/daniel/anaconda/lib/python3.6/struct.py
def is_prime(number): # Implement the tests onee by one here return False class InvalidNumberError(Exception): pass
import os from os.path import dirname, abspath import nodebin as project def _env(env): """If ENV exit but with empty value, return empty string.""" return env if os.getenv(env) else '' def _getenv(env, default=None): """If ENV doesn't exist or None, return default value.""" # Note that os.getenv('...
# -*- coding: utf-8 -*- # Generated by Django 1.10.4 on 2016-12-25 10:52 from __future__ import unicode_literals import datetime from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('mygoals', '0002_auto_20161223_2032'), ] operations = [ migr...
#!/usr/bin/env python3 # Advent of code Year 2019 Day 7 solution # Author = seven # Date = December 2019 import itertools import sys from os import path sys.path.insert(0, path.dirname(path.dirname(path.abspath(__file__)))) from shared import vm with open((__file__.rstrip("code.py") + "input.txt"), 'r') as input_fil...
#Inputs ibalance = 4773 annualInterestRate = 0.20 #Initialized month = 0 payment = 10 total = 0 #Dependents monthlyRate = annualInterestRate/12 balance = ibalance while balance >= 0: #print 'Month: ' + str(month) month += 1 print balance balance = balance - payment balance = balance + m...
# encoding: utf-8 ''' @Version: V1.0 @Author: JE2Se @Contact: admin@je2se.com @Website: https://www.je2se.com @Github: https://github.com/JE2Se/ @Time: 2020/6/10 12:22 @File: __init__.py.py @Desc: 自加载文件 ''' from exphub.conference.ConferenceScan import ConferenceScan
from __future__ import absolute_import import os from StringIO import StringIO from tempfile import NamedTemporaryFile import webbrowser from peggy.peggy import Label _HTML_TEMPLATE_FILE = "data/dot_renderer.html" _HTML_TEMPLATE = "" def __init(): global _HTML_TEMPLATE path = os.path.dirname(os.path.abspat...
from mcvf import core, filters print("Loading sample video...") v = core.Video('test-video-4.mp4') print("Filtering...") # v.apply_filter(filters.MCGaussianFilter(block_size=20)) # v.apply_filter(filters.MCDarkenFilter(block_size=10)) # v.apply_filter(filters.MFDrawerFilter(block_size=20)) v.apply_filter(filters.MCM...
""" Add your Client class from your TCP assignment here """ # copy and paste your code from your client.py file ######################################################################################################################## # Class: Computer Networks # Date: 02/03/2020 # Lab3: TCP Client Socket # Goal: Learni...
import pygame.mixer sounds=pygame.mixer sounds.init() def wait_finish(channel): while channel.get_busy(): pass #s=sounds.Sound("correct.wav") #wait_finish(s.play())#wait_finish 确保当前声音播放完再播放下一个 #s2=sounds.Sound("wrong.wav") #wait_finish(s2.play()) s3=sounds.Sound("why.wav") wait_finish(s3.play...
import pandas import random def main(): #city(10) #nomer(1000) #chelovek(10) sadnnie_nomera(1000) #chelovek(1000) def city(n): ''' df1 = pandas.read_csv('cities.csv', sep = ';') array_people = [random.randint(10000, 10000000) for i in range(1000)] d = {'Population': array_people} df2 = pandas.DataFrame...
import wx import pygame import serial.tools.list_ports class MainFrame(wx.Frame): def __init__(self,parent,ptitle): wx.Frame.__init__(self,parent,title=ptitle) self.selectedPort = None pygame.init() pygame.joystick.init() self.InitUI() def InitUI(self): menubar ...
import numpy as np from tensorboardX import SummaryWriter from K_Armed_Testbed import K_Armed class UCB_Agent(object): def __init__(self, env, maxItr = 10000, c = 2): self.env = env self.maxItr = maxItr self.c = c self.avgReward = [] self.bestAction = [] ...
import json import matplotlib.pyplot as plt import numpy as np import sys from constants import image_height, image_width from img import get_img from preprocess import get_true_mask def show(id, img_path, true_masks): fig = plt.figure(figsize=(10, 10)) fig.canvas.set_window_title("Deep Mask: Check mask {}".f...
from fastapi.testclient import TestClient from app.main import app client = TestClient(app) def test_read_docs(): response = client.get("/docs") assert response.status_code == 200
from testfixtures import log_capture from testsuite.base_fs import BaseFilesystem from testsuite import config from core.sessions import SessionURL from core import modules from core import utilities from core import messages import core.utilities import subprocess import os class FileGrep(BaseFilesystem): def se...
import requests import simple.config3 # print(simple.config3.obj.Headers()) headers = simple.config3.obj.Headers() print(headers)
# -*- coding: utf-8 -*- from bottle import route,request from siteglobals import env, db, config from utils import * from backend import Record @route('/details', method='GET') def output(): try: session = db.sessionmaker() id = getSingleField( 'id', request ) if not id: raise ElementNotFoundException( id ) ...
from mapyourcity import db from werkzeug.security import generate_password_hash, check_password_hash from datetime import datetime # COMMENTS class Player(db.Model): id = db.Column(db.Integer, primary_key=True, unique=True) username = db.Column(db.String(25), unique=True) email = db.Column(db.String(120), unique=Tr...
# notify.py # Copyright (C) 2011-2014 Andrew Svetlov # andrew.svetlov@gmail.com # # This module is part of BloggerTool and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php import asyncore import pyinotify from bloggertool.log_util import class_logger class EventProcessor(pyin...
def get_data(path=''): """Gets content of each file in path and adds it to list. Returns list with files contents""" import os import re import string documents = [] for filename in os.listdir(path): with open(os.path.join(path, filename), encoding="utf-8") as f: file_contents = ''.join(f.readlines()).replac...
from abc import ABC, abstractmethod class Algorithm(ABC): """Base class for all machine learning algorithms. This class provides a easy way to use different ML algorithms transparently. """ @abstractmethod def fit(self): """Should implement the algorithms training procedure.""" ...
def task1(): s1 = '00014402', 'Sam', 'Tashkent' s2 = '00014403', 'Said', 'London' print(s1 < s2) def task2():
# 1. scope x = 5 def carp(): # 2. scope global t t = 50 carp() print(t)
# -*- coding: utf-8 -*- """ Author: Lily Date: 2018-09-13 QQ: 339600718 中影国际影城 China Film ChinaFilm-s 抓取思路:在首页获取每个城市的code,根据获取到的code做为参数,获取每个城市的具体数据 URL(获取城市的code):http://m.cfc.com.cn/?code=031GOyP82mrnFE0LmeP82CuyP82GOyPv&state=123 URL(每个城市的数据)http://m.cfc.com.cn/cinema/index.html?cityCode=320100 注意:抓取到的数据有不同的影院,有些不是中...
import torch import numpy import gym class HandDesignedSampler: """ Uniformly samples the input space of an env. """ def __init__(self, env, idm): print('building sampler') self.env = env self.skill_dict = [(1, False), (0, False), (-1, False), (1, True), (0, True), (-1, True), (1, 0), (0, 0), (-1, 0), (1.0, ...
# Most of these tests have been adapted from the stdlib OrderedDict tests. from collections import MutableMapping import copy from operator import itemgetter import pickle from random import shuffle import sys from test import mapping_tests import pytest from schematics.common import PY2, PY3 from schematics.datastr...
from django import forms class LoginForm(forms.Form): # 登录表单数据检验 username = forms.CharField(required=True, min_length=4, max_length=10, error_messages={ 'require': '用户名不能为空!', 'min_length': '用户名不能少于4个字符!', ...
DATA_DIR = './data/' DATA_SOURCE_FILE = 'source.csv' DATA_SAVE_FILE = 'dataset.pickle' DB_USER = 'ethan' DB_PASS = 'qwerasdf' DB_HOST = '120.76.126.214' DB_NAME = 'soccer' TREND_MAX_HOUR = 6 NUM_LABELS = 8 FEATURE_SIZE = TREND_MAX_HOUR * 12 * 6 + 2
from django.urls import path from . import views app_name = "exhibition" urlpatterns = [ path('init/', views.InitialExhibition.as_view()), path('exhibition/', views.Exhibition.as_view()), path('exhibition/detail/artwork/', views.ExhibitionDetailByArtwork.as_view()), path('exhibition/view/', views.Exhib...
# NO IMPORTS! ################################################## ### Problem 1: batch ################################################## def batch(inp, size): """ Return a list of batches, per quiz specification """ inp = list(inp) batches = [] current_batch = [] current_sum = 0 for elem in i...
from django.db import models from django.contrib import admin # Create your models here. class MyPhoto(models.Model): title = models.CharField(max_length=250) comment = models.TextField() detail_info = models.TextField() upload_time = models.DateField() photo = models.FileField(upload_to='photo') c...
import httplib2 import os import xlwt import xlrd import tmdbsimple as tmdb from xlutils.copy import copy from Movie import Movie, get_image from apiclient import discovery from oauth2client import client from oauth2client import tools from oauth2client.file import Storage # Not really sure what this is, how Google d...
#!/usr/bin/env python # # Copyright (c) 2019 Opticks Team. All Rights Reserved. # # This file is part of Opticks # (see https://bitbucket.org/simoncblyth/opticks). # # 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...
from django.conf.urls import patterns, url, include urlpatterns = patterns( '', url(r'^', include('client.urls_api', namespace='companies')), )
# -*- coding: utf-8 -*- ''' Created on Thu Jun 6 20:48:32 2019 @author: HP ''' import math class Node: def __init__(self,key): self.k=key self.d=math.inf self.parent=None self.color="white" self.adj=[] def insert(self,node): self.adj.append(node) g = { '...
def readFromFile(txtFile): names = {} with open(txtFile,'r') as open_file: all_text = open_file.read().split('\n') for name in all_text: if name not in names: names[name] = 1 elif name in names: names[name] += 1 print(names) if __n...
from tkinter import * from interface import mainInterface gris = '#333333' def lancement(): x = 0.05 main = Tk() main.config(bg=gris) main.attributes('-fullscreen', 1) mainInterface(main, 'chasseur.png') main.mainloop()
# -*- coding: utf-8 -*- """ Created on Mon Jul 22 09:37:45 2019 @author: tpc 02 """ from selenium import webdriver from selenium.common.exceptions import NoSuchElementException import time import os def checarExiste(xpath): try: driver.find_element_by_xpath(xpath) except NoSuchEleme...
from pwn import * import time import sys def exploit(): raw_input('wait') buf = '%9$018p' proc.sendline(buf) proc.recvuntil('can you tell me their sum?\n') guess = int(proc.recv(18), 16) print(guess >> 32) print(guess & 0x00000000ffffffff) guess = (guess >> 32) + (guess & 0x00000000fff...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Thu Sep 24 13:49:41 2020 @author: thomas """ import os, sys import pandas as pd import time as t import pathlib #CONSTANTS cwd_PYTHON = os.getcwd() + '/' ReList=['0.5','0.6','0.7','0.8','0.9','1.0','2.0','3.0','4.0','5.0','5.5','6.0','6.5','7.0','7.5', ...