text
stringlengths
8
6.05M
""" 도시분할 계획 https://www.acmicpc.net/problem/1647 1. 유지비 최소 (크루스칼 알고리즘) 2. 2개로 분리 -> 코스트가 젤 큰 도로 제거 첫째 줄에 집의 개수 N, 길의 개수 M이 주어진다. N은 2이상 100,000이하인 정수이고, M은 1이상 1,000,000이하인 정수이다. 그 다음 줄부터 M줄에 걸쳐 길의 정보가 A B C 세 개의 정수로 주어지는데 A번 집과 B번 집을 연결하는 길의 유지비가 C (1 ≤ C ≤ 1,000)라는 뜻이다. 7 12 1 2 3 1 3 2 3 2 1 2 5 2 3 4 4 7 3 6 5 ...
def calc_tax(price, per): return price * per
import os import numpy as np from random import randint p_location = "/skew/skew_train/" n_location = "/skew/result_skew/" p_folders = os.listdir("." + p_location) n_folders = os.listdir("." + n_location) t_folders = os.listdir("./skew/skew_test") train = open("./train.txt", "w") validate = open("./validate.txt", "w"...
def kadanealgo(array): maxEndingHere = array[0] maxSum = array[0] for num in array[1:]: maxEndingHere = max(maxEndingHere + num, num) maxSum = max(maxSum, maxEndingHere) return maxSum
from django.db.models.sql import compiler class SQLCompiler(compiler.SQLCompiler): def as_sql(self, with_limits=True, with_col_aliases=False): raw_sql, fields = super(SQLCompiler, self).as_sql(False, with_col_aliases) # special dialect to return first n rows if with_limits: if...
#!/usr/bin/env python # coding: utf-8 # Copyright (c) Qotto, 2019 from datetime import datetime, timezone from tonga.models.records.command.command import BaseCommand from typing import Dict, Any __all__ = [ 'TestCommand' ] class TestCommand(BaseCommand): test: str def __init__(self, test: str, **kwa...
from flask import request from flask_restplus import Namespace, Resource, fields, abort from app.utils.exceptions import OdooIsDeadError api_alumni = Namespace('alumni', description='Requests to alumni model.') resource_fields = api_alumni.model('Create alumni user payload', { "odoo_contact_id": fields.String, ...
input = [['.'] + list(x) + ['.'] for x in open('data/11.txt').read().split('\n')] input = [['.'] * len(input[0])] + input + [['.'] * len(input[0])] def check_adjacent(i, j): near_seats_count = 0 # check above: if input[i - 1][j - 1] == '#': near_seats_count += 1 if input[i - 1][j] == '#': ...
#!/usr/bin/python3 class MyList(list): """ A class MyList that inherits from list. Public instance method that prints the list, but sorted (ascending sort) """ def print_sorted(self): print(sorted(self))
import discord import sqlite3 import atexit import json import os import time, sched, pytz # Initiating bot with settings files = os.listdir() # list of 3-tuples (var_name, description, processing function) settings_list = [("db_name", "What would you like to name your database file (text): ", str), (...
#!/usr/bin/python import re import sqlite3 UPDATE_TMPL = 'UPDATE fresh SET base_name = ? , usable = ?, unusable_reason = ? WHERE asin = ?' conn = sqlite3.connect('../../data/data') c = conn.cursor() c.execute('select asin, name from fresh') match1 = 0 match2 = 0 no_match = 0 updates = [] for row in c: name = r...
# Problem name: Weird Algorithm # Description: Consider an algorithm that takes as input a positive integer n. # If n is even, the algorithm divides it by two, and if n is odd, the algorithm multiplies it by three and adds one. # The algorithm repeats this, until n is one. For example, the sequence for n=3 is as fol...
# Operating on lists # Update an entire list # for x in l: # x = f(x) # Define a function to do this in general # def applylist(f, l): # for x in l: # x = f(x) # Built in function map() # map(f, l) applies f to each element of l # Output of map(f, l) is not a list! # Use list(map(f, l)) ...
test_case = int(input()) for _ in range(test_case): n, x, a, b = map(int, input().split()) print(min(n-1, abs(a-b)+x))
# Created by longtaoliu at 17.04.21 from tkinter import * from tkinter import messagebox from tkinter import filedialog import json as js from classes.Cell import * from classes.Util import * import matplotlib import random from util.helper import list_duplicates, indices_matches from classes.Strategy import find_...
# -*- coding: utf-8 -*- from collections import Counter class Solution: def numSmallerByFrequency(self, queries, words): frequencies = [self.getFrequencyOfSmallest(word) for word in words] frequency_counts = Counter(frequencies) result = [] for query in queries: freq...
import ee from ee_plugin import Map # Load a FeatureCollection from a table dataset: 'RESOLVE' ecoregions. ecoregions = ee.FeatureCollection('RESOLVE/ECOREGIONS/2017') # Display as default and with a custom color. Map.addLayer(ecoregions, {}, 'default display', False) Map.addLayer(ecoregions, {'color': 'FF0000'}, '...
__author__ = "Барыбин, Вячеслав, Русланович" a = [1, 2, 3, 4, 5, 6, 7, 8] b = [] c = len(a) for i in range(c): if a[i] % 2 == 0: b.append(a[i] / 4) else: b.append(a[i] * 2) print(b)
""" Options abstract away different class of options (e.g. matplotlib specific styles and plot specific parameters) away from View and Stack objects, allowing these objects to share options by name. StyleOpts is an OptionMap that allows matplotlib style options to be defined, allowing customization of how individual V...
import numpy as np from matplotlib import pyplot as plt from sklearn.preprocessing import StandardScaler from data_ml_models.grid_search_models import calculate_best_clf from data_partition.data_partition import create_xmatrix_ylabels, create_train_test_sets from data_pre_processing.prep_process_data import read_data,...
import json import os data = { "president": { "name": "Zaphod Beeblebrox", "species": "Betelgeusian" } } write_file_name = "data_file.json" with open(write_file_name, "w") as write_file: # json.dump takes two positional arguments: the json data to write out, and the file-like object to which...
from django import template import re import pygments from pygments.lexers import * from pygments.formatters import HtmlFormatter register = template.Library() regex = re.compile(r'<code class="(?P<id>[a-zA-Z_]\w*)">(.*?)</code>', re.DOTALL) @register.filter(name='pygmentize') def pygmentize(value): try: ...
# -*- coding: utf-8 -*- # Developed by Rave (DO NOT REMOVE) from flask import Blueprint from flask import jsonify from flask import request from google.oauth2 import service_account from google.auth.transport.requests import AuthorizedSession from google.cloud import bigquery import logging import uuid import j...
def nextvect(arr): arr = arr[::-1] c_b = 1 for i in range(len(arr)): tmp, arr[i] = arr[i], arr[i] ^ c_b c_b &= tmp return arr[::-1] def findrstat(x, z): r = 0 for _ in range(len(x)): r += x[_] ^ z[_] return r def get_candidates(lfrs, arr, numb, c): cand = [] ...
# -*- coding: utf-8 -*- from app.tests import WebTestCase, UserData from app.utils import session from web import config import web HTTP_OK = "200 OK" HTTP_SEE_OTHER = "303 See Other" HTTP_FORBIDDEN = "403 Forbidden" HTTP_NOT_FOUND = "404 Not Found" class ControllerTestCase(WebTestCase): """ Parent ...
import numpy as np import tensorflow as tf def ReadImage(filename): """ IN filenames: string - read file names OUT (***int, int[3]) - image, size of image """ filename_queue = tf.train.string_input_producer([filename]) reader = tf.WholeFileReader() key, value = reader.read(filename_queue) ...
def main(command=""): '''(str) -> None Given the string of a command, prints out a message to explain how to use it ''' if (command == "extract"): entry = """Command: extract \n\nSynopsis:\n\textract [options]\n\n Description: Extracts planets that have been updated since the last commit date from exoplanet and N...
from fpdf import FPDF import requests from bs4 import BeautifulSoup as bs base = "https://lecturenotes.in/" page = open("html.html") # parsing a saved html soup = bs(page,'html.parser') ll = soup.select(".pic") # pdf details pdf=FPDF() w=200 h=300 #make image def make_image(url,name,x): image = requests....
from allennlp.predictors.predictor import Predictor import dash from dash.dependencies import Output, Input import dash_core_components as dcc import dash_html_components as html import json import pandas as pd import plotly app = dash.Dash(__name__) app.layout = html.Div( html.Div( [ html.I( ...
from peewee import * from cards import cards cardset = cards db = PostgresqlDatabase('flashcards', user="postgres", password='', host='localhost', port=5432) db.connect() class BaseModel(Model): class Meta: database = db class Cards(BaseModel): spanish = CharField() english = CharField(...
import os,sys sys.path.append("/Users/twongjirad/working/uboone/vireviewer") from vireviewer import getmw import numpy as np import pandas as pd from hoot import gethootdb from pyqtgraph.Qt import QtCore, QtGui import pyqtgraph as pg import math from pulsed_list import get_pulsed_channel_list def plot_run( mw, run, s...
import urllib2 import time import Queue import threading from bs4 import BeautifulSoup hosts = ['http://yahoo.com', 'http://amazon.com', 'http://google.com', 'http://apple.com'] queue = Queue.Queue() out_queue = Queue.Queue() class ThreadUrl(threading.Thread): def __init__(self, queue, out_queue): threading.Th...
# Copyright 2022 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import annotations from dataclasses import dataclass from pants.backend.go.subsystems.golang import GolangSubsystem from pants.core.util_rules.system_binaries import ( ...
from __future__ import division import cv2 import numpy as np import scipy import matplotlib.pylab as plt import random as rd image = cv2.imread('example.jpg', 0) # wczytanie pliku jpg _, bw_img = cv2.threshold(image, 127, 255, cv2.THRESH_BINARY) # konwersja na tablice binara #cv2.imshow("Binary Image",bw_img) #tes...
from typing import Optional, List from dataclasses import dataclass from fewshot.stores.base import StoreCfg from ..samplers import DefaultSamplerCfg @dataclass class DatasetCfg: labeled_store: StoreCfg sampler: DefaultSamplerCfg total_samples: int = 999999999999 seed: int = 0 unlabeled_store: Opt...
import numpy as np import matplotlib.pyplot as plt from matplotlib import gridspec from sklearn.gaussian_process import GaussianProcessRegressor from sklearn.gaussian_process.kernels import Matern def target(x): y = np.exp(-(x-2)**2)+np.exp(-(x-6)**2/5)+1/(x**2+1)+0.1*np.sin(5*x)-0.5 return y <<<<<<< HEAD...
def main(): weight = int(input("please enter your weight in pounds: ")) height = int(input("please enter your height in inches: ")) bmi = (weight * 720)/(height**2) if bmi >= 19 and bmi <= 25: health = "healthy" else: health = "unhealthy" print(bmi) print(health) main()
pi = 3.14159 A, B, C = input().split() triangle = float(A)*float(C)/2 circle = pi*float(C)*float(C) trapezium = ((float(A)+float(B))*float(C))/2 square = float(B)*float(B) rectangle = float(A)*float(B) print('TRIANGULO: {:.3f}'.format(triangle)) print('CIRCULO: {:.3f}'.format(circle)) print('TRAPEZIO: {:.3f}'.format...
GET_USER_DESCRIPTIONS = { 'SUCCESS': 'User successfullly founded.', 'NOT_FOUND': 'User not found.' } GET_USER_NOTIFICATIONS_DESCRIPTIONS = { 'SUCCESS': 'Notifications successfully founded.', 'NOT_FOUND': 'Notifications not found' } GET_USER_QUESTIONS_DESCRIPTIONS = { 'SUCCESS': 'Questions successfully found...
def string(): string = str(input("Please give me a word : ")) a = string[::-1] if (a == string): print("You've given me a palindrome!") print(a + " == " + string) else: print("That ain't no palindrome") print(a + " != " + string)
# Generated by Django 2.1.5 on 2019-06-16 20:11 from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('chat', '0006_auto_20190616_0340'), ] operations = [ migrations.RemoveField( model_name='chat', name='messages', ), ...
../chef.py
import os import shutil from bs4 import BeautifulSoup from five import grok from io import BytesIO from os import path, walk, remove from zipfile import ZipFile from zope.component.hooks import getSite from Products.CMFPlone.interfaces import IPloneSiteRoot from collective.documentviewer.settings import GlobalSettings ...
# Copyright 2017 The Forseti Security 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 required by ap...
from distutils.core import setup from distutils.extension import Extension from Cython.Build import cythonize """ ext_modules = [ Extension( "ex_prange", ["ex_prange.pyx"], extra_compile_args=['-fopenmp'], extra_link_args=['-fopenmp'], ) ] ""...
import sys sys.path.append("..") # Adds higher directory to python modules path. from importlib import reload import datetime as dt import numpy as np import pandas as pd from time import time as t_clock from os import path import os from pathlib import Path import pickle as pk import matplotlib.pyplot as plt import sq...
from plotly.basedatatypes import BaseTraceHierarchyType class Transform(BaseTraceHierarchyType): # property parent name # -------------------- @property def _parent_path_str(self): return 'heatmapgl' # Self properties description # --------------------------- @property def _p...
from ronto import verbose, run_cmd from ronto.model.docker import docker_factory def process(args): docker = docker_factory() # only on docker host successful/usefull if docker: docker.build_privatized_docker_image() docker.create_container() docker.start_container() docker...
#!/usr/bin/python3 """ MyList Module """ class MyList (list): """ MyList class. This class inherits from list """ def print_sorted(self): """ Print the list in an orderly way """ new = self[:] new.sort() print(new)
a = int(input("Enter the 1st no. = ")) b = int(input("Enter the 2nd no. = ")) i=0 j=0 k = 0 if (a<b and a<100 and b<100): for i in range(a,b): #j = i+1 #print(i," ",j) for j in range(2,i): #j = i+1 #print(i," ",j) if(i%j == 0): k = 0 break; else: j+=1 k = 1 if(k == 1): print("hl...
"""simple numerical integration code. left and right Riemann sums, mdpoint Riemann, and something of my own: value of a strip is (f(left)+f(right))/2, over all streips that becomes f(a)/2 + f(b)/2 + f(b)/2 + f(c)/2 + f(c/2)... +f(y)/2 + f(z)/2 So it simply sums up f(b)...f(y), and adds half of f(a) and f(z) Conlcusion...
import logging import os import random import string from datetime import datetime from flask import Flask, render_template, redirect, session, request, flash, url_for from flaskext.mysql import MySQL from passlib.hash import argon2 from main import Device device = Device() logging.basicConfig(level=logging.DEBUG) l...
#!/usr/bin/env python import unittest import allocations as allocations_module import re class TestAllocationValidAllocations( unittest.TestCase ): """ """ VALID_DATE_STRING = "Monday 1/1\n" FIRST_VA_LINE_NUMBER = 2 # allocations should be parsed strictly so exceptions are raised rather than...
from django import forms from .models import Friend class FriendForm(forms.ModelForm): class Meta: model = Friend fields = ['name','mail','gender','age','birthday'] class FindForm(forms.Form): find = forms.CharField(label='Find', required=False, \ widget=forms.TextInput(attrs={'class':...
# -*- coding: utf-8 -*- """ Created on Tue Feb 18 15:11:00 2020 @author: shaun """ import numpy as np from gaussxw import gaussxw import matplotlib.pyplot as plt\ N=50 #find legedre polynomial weights x,w=gaussxw(N) #define integrand function def function(x): a=(x**4)*(np.e**(x)) b=((np.e**(x))-1)**2 y=a...
class Person: def __init__(self, initial_age): if initial_age > 0: self.age = initial_age elif initial_age < 0: self.age = 0 print("age is invalid, setting age to 0.") def am_i_old(self): if self.age >= 0 and self.age < 13: print("young"...
''' File name: make_fakeSplitMerge.py Author: Patrick Monnahan Date created: 09/01/18 Python Version: 3.6 Project: Split Genes Upstream of: calcVarRatios.R Downstream of: JMM's longest transcript code Description: This program generates fake split and merged sets of genes to be used as a...
from ._title import Title from plotly.graph_objs.histogram2dcontour.colorbar import title from ._tickformatstop import Tickformatstop from ._tickfont import Tickfont
# -*- coding: utf-8 -*- #: #: Author: redkern #: Date: #: Version: #: License: MIT #: #: This module is a pure implementation of the AES encryption algorithm. #: import os import binascii import hashlib from app.crypto.rsa import rsacommon ## # @see: https://www.emc.com/collateral/white-papers/h11300-pkcs-1v2-2-r...
import sys import traceback import vdb.testmods import vdb.testmods.regtest as v_t_regtest import vdb.testmods.writemem as v_t_writemem import vdb.testmods.basictest as v_t_basictest import vdb.testmods.breaktest as v_t_breaktest import vdb.testmods.attachtest as v_t_attachtest import vdb.testmods.threadtest as v_t_th...
def voto(ano): from datetime import datetime now = datetime.now().year i = now - ano if(i < 16): return 'NEGADO', i elif(i >= 16 and i < 18): return 'OPCIONAL', i else: return 'OBRIGATÓRIO', i n = int(input('Em que ano você nasceu? ')) status = voto(n) print(f'Com {stat...
from figura_geometrica import FiguraGeometrica from color import Color class Cuadrado(FiguraGeometrica, Color): def __init__(self, lado, color): FiguraGeometrica.__init__(self, lado, lado) Color.__init__(self, color) def area(self): print('Area') return self.get_alto() * se...
import numpy as np import torch import torch.nn as nn import torch.backends.cudnn as cudnn import random import torch.nn.init as init ###############################random seed############################################################################## manualSeed = random.randint(1, 10000) # fix seed print("Random S...
# -*- coding: utf-8 -*- ''' Set nbspace to same width as space ''' def check(font, masters, fix=False): print '***Checking space and nbspace have same width***' for id in range(len(masters)): if font.glyphs['nbspace'].layers[id].width != font.glyphs['space'].layers[id].width: print 'ERROR: n...
# flake8: noqa from .auth import * from .benchmark import * from .download import * from .graphql import * from .import_export import * from .other import * from .request import * from .request_history import * from .test import * from .upload import *
#! /usr/bin/env python3 # -*- coding: utf8 -*- import argparse import shutil from tqdm import tqdm from subprocess import check_output, run parser = argparse.ArgumentParser(description='Update every entries found in cask folder.') parser.add_argument('--pretend', dest='pretend', action='store_true', ...
###################################################################### # OFFICIAL ELECTRIC INSTALLER # ###################################################################### import os os.system('pip install tqdm') os.system('pip install requests') os.system('pip install click') i...
# This is a program to learn how to use a function (user defined). # The funtion will be used to send sout outs. def shout_outs (holla): # This user defined function utilizes string data types. return ("shout out ma' hommie " + holla + "!") # This statement command the function to return a certain value, a greeting i...
import secure import handlers
def result(name, *args): res = 0 for i in args: res += i print(f"Name: {name} Total: {res}") res=result("Rajesh",67, 89, 56, 98, 45,67)
"""travelx URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.8/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home') Class-bas...
# ▄▀▄ ▄▀▄ # ▄█░░▀▀▀▀▀░░█▄ # ▄▄ █░░░░░░░░░░░█ ▄▄ #█▄▄█ █░░▀░░┬░░▀░░█ █▄▄█ ####################################### ##### Authors: ##### ##### Stephane Vujasinovic ##### ##### Frederic Uhrweiller ##### ##### ##### ##### Creation: 201...
from tensorflow.keras.models import load_model import argparse import imutils import cv2 import copy import numpy as np from skimage import transform from skimage import exposure from skimage import io model = load_model(r"C:\Users\User\MPVI\traffic-sign-recognition\output\istrenirano.model") image = cv2.imread("Slike...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Fri May 3 15:53:19 2019 @author: allen """ stuff = {'asd':1, 'asdf':2} for y in stuff: print(y)
# coding: utf-8 import os import sys from time import sleep sys.path.append(os.environ.get('PY_DEV_HOME')) from selenium.webdriver.support.ui import Select from selenium import webdriver import SendKeys import win32con import win32api import webTest_pro.common.init as init from webTest_pro.common.init import login...
#!/usr/bin/python3 ''' blueprint for state ''' from api.v1.views import app_views from flask import jsonify, abort, request from models import storage from models import State from models import City from models import Amenity from models import User from models import Place @app_views.route("/cities/<city_id>/places...
from appconfig import helpers def test_getpwd(mocker): mocker.patch('appconfig.helpers.getpass', mocker.Mock(getpass=mocker.Mock(return_value='abc'))) assert helpers.getpwd('x') == 'abc'
import re str = "rat hat cat mat bat pat" allstr = re.findall("[a-z]at",str) # allstr = re.findall("^[a-z]at",str) # allstr = re.findall("[h-m]at",str) for i in allstr: print(i)
""" ------------------------------------------------------------------------------- | Copyright 2016 Esri | | 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/...
import os import random import cv2 import numpy as np import tensorflow as tf import joblib from facedetector import detect def rotateImage(image, angle): row,col = image.shape center = tuple(np.array([row,col])/2) rot_mat = cv2.getRotationMatrix2D(center,angle,1.0) new_image = cv2.warpAffine(image,...
import time from selenium import webdriver from bs4 import BeautifulSoup news_land = {'title': [], 'body': []} driver = webdriver.Chrome() code = ['024110'] driver.get(f'https://search.naver.com/search.naver?query={code[0]}&where=news&ie=utf8&sm=nws_hty') html = driver.page_source soup = BeautifulSoup(htm...
#------------------------------------------------------------------------------- # Name: FirstEnemy # Purpose: This is the file that stores the enemy class # # Author: Marko Nerandzic # # Created: 16/01/2013 # Copyright: (c) Marko Nerandzic 2013 # Licence: This work is licensed under the Crea...
# import libraries import numpy as np import potentials import atomman as am import iprPy # Load database database = iprPy.load_database('iprhub') print(database) # Define executables and commands prepare_terms = {} prepare_terms['lammps_command'] = '/users/lmh1/LAMMPS/2020_03_03/src/lmp_mpi' prepare_terms['mp...
import pandas as pd import numpy as np import os import sklearn from imblearn.over_sampling import SMOTE from sklearn.ensemble import RandomForestClassifier def train_and_recommend(root_dir, directory, province) : print('Recommending...') full_taffy = pd.read_json(directory+'/full_taffy.json', dtype = {'i': 'str'}) ...
# -*- coding:utf-8 -*- class Solution: # 这里要特别注意~找到任意重复的一个值并赋值到duplication[0] # 函数返回True/False # 使用哈希表的方式,利用字典进行查找,duplication是否为空不能作为判断是由有重复数字的依据,因为duplication不是自己设定的。 def duplicate(self, numbers, duplication): # write code here n = len(numbers) dic = {} for i in range(n...
import sys import os import ete3 def get_taxa_number(msa_file): seqs = ete3.SeqGroup(open(msa_file).read()) #, format="phylip_relaxed") return len(seqs.get_entries()) def print_info(msa_file, form): seqs = ete3.SeqGroup(open(msa_file).read(), format=form) taxa = len(seqs.get_entries()) sites = len(seqs.get_...
# -*- coding: utf-8 -*- # @Time : 2020/7/3 10:02 # @Author : LiuYang # @email : 317431629@qq.com # @FileName: file_fun.py # _+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+ import os import json import yaml class File(object): def __init__(self, file_path): self.__path = file_path ...
import sys import queue input = sys.stdin.readline deals = [] num_orchid, num_deals = list(map(int, input().split())) for _ in range(num_orchid): meh = [0 for __ in range(num_orchid)] meh[_] = 1 deals.append([int(input())] + meh) for _ in range(num_deals): deals.append(list(map(int, input().split()))) quantit...
def solution1(input): input = list(input) trigger = True while trigger: for i, (a, b) in enumerate(zip(input, input[1:])): u, l = sorted([a, b]) if u.isupper() and l.islower() and u.lower() == l: input.pop(i) input.pop(i) break ...
from theonlyone import loadPhpCode #line = '<html> blabla </html> <head> <? echo "hello!"; ?> </head><body> bla-bla-fsdfdsf...???<? kuku(); ?> <?php echo $a; ?><? bac; ?>?>?>?>' #line = '<? bac;?>?>' #line = "<?php echo 'bla-bla'; //comment ?> <br/> <? hello();break; /*/ */?> <?" #line = "<?php echo 'bla-bla'; /...
import random from pre_solving.pre_solving import * from numpy import * def variation(sample,rate): num=random.randint(0,len(sample)) count=0 while count<num: bit=random.randint(0,len(sample)) np=random.randint(0,1) sample[bit]=sample[bit]*(1+(pow(-1,np)*rate)) count=count+1 ...
''' Created on 5 feb. 2014 @author: Pieter ''' import unittest from dungeonz.Cage import Cage,Upgrade class TestCage(unittest.TestCase): def setUp(self): self.testCage1=Cage("cage_1.png",strength=2,magic=1) self.testCage2=Cage("cage_3.png",strength=1,magic=1,play=1) self.testCage3=Cage("...
import os import pygame from Card import Card from clientNetwork import Network from Player import Player from Map import Map from ClueBoard import ClueBoard from Button import Button, MenuButton pygame.init() width = 800 height = 900 dimension = 5 win = pygame.display.set_mode((width, height)) pygam...
from common.run_method import RunMethod import allure @allure.step("极客数学帮(家长APP)/用户行课/查询某班是否有效可报名") def app_classes_studentId_queryIsEffectiveClasses_post(studentId, params=None, body=None, header=None, return_json=True, **kwargs): ''' :param: url地址后面的参数 :body: 请求体 :return_json: 是否返回json格式的响应(默认是) ...
#!/usr/bin/env python import sys foundKey = "" foundValue = "" isFirst = 1 currentCount = 0 # remember - we want it to sort last currentcounty = "Z" currentstate2digit = "Z" iscountyMappingLine = False currentFiveDigitCode = "Z" currentpopulation = 0 # STDIN - watch indents and note unix pipe for line in sys.stdin: ...
with open("input1.txt","r") as f: data = f.readlines() data[0] = data[0].split(',') data[1] = data[1].split(',') # Might need to change w if too big w = 22000 h = w # 2000x2000 Wirespace wireSpace = [[0 for x in range(w)] for y in range(h)] centerX = w//2 centerY = h//2 currentPosX = centerX currentPosY = center...
#--------------------------------------------------------------- # # 1. Read new pattern and a existing Rule Base # 2. modify the Rule base according the new pattern. #--------------------------------------------------------------- # The rule base is expressed in terms of connected sets and lonly_rules # #-------...
{ "devices": { "Alice": { "app-root": "../plus", "app-path": "test_driver/plus_inst.dart" }, "Bob": { "app-root": "../minus", "app-path": "test_driver/minus_inst.dart" } } }
#!/usr/bin/env python # Copyright (c) 2009 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """ Verified things don't explode when there are targets without outputs. """ import TestGyp # TODO(evan): in ninja when there are no targ...
import unittest from katas.kyu_6.float_or_integer_verifier import i_or_f class IntegerOrFloatTestCase(unittest.TestCase): def test_true(self): self.assertTrue(i_or_f('1')) def test_true_2(self): self.assertTrue(i_or_f('1.0')) def test_true_3(self): self.assertTrue(i_or_f('1e1'))...