index
int64
0
1,000k
blob_id
stringlengths
40
40
code
stringlengths
7
10.4M
999,400
597f2180bb9613889aac4549e5e5d461d72d8177
import tkinter as tk from tkinter import * from tkinter import messagebox import mysql.connector import main_window root = tk.Tk() root.title('Wypożyczalnia kostiumów - login') w = 350 h = 175 ws = root.winfo_screenwidth() # width of the screen hs = root.winfo_screenheight() # height of the screen x = (ws/2) - (w/2) ...
999,401
f572ce46260bf2d2527210ca427e657aab81271f
from pypal import private_globals as _pal import ctypes as c import weakref from ..bodybase import BodyBase class MeshTerrain(BodyBase): def __init__(self, pos, points, triangles): """ constructs a static convex and adds it to the world pos: a 3 part tuple with x,y,z. size: ...
999,402
ddf899f373a043f9981ccb16a10e1f0078142643
#Escribir un programa que pregunte el nombre del usuario en la consola y un número entero e imprima por pantalla en líneas distintas el nombre del usuario tantas veces como el número introducido. name = input('Ingrese su nombre: ') repet = int(input('Ingrese cuantas veces se tiene que repetir: ')) if repet <= 0 : ...
999,403
22031aad62185b90e6d0fc1c0b10002b9927f49d
from spdk.rpc.client import print_json def perform_tests(args): print_json(args.client.call('perform_tests')) def spdk_rpc_plugin_initialize(subparsers): p = subparsers.add_parser('perform_tests', help='Returns true when hotplug apps starts running IO') p.set_defaults(func=...
999,404
2131562a7c99dc951cf8f8affcd6c9268cdb89df
import json import requests import uuid from Framework.Library.Function.Function.PocSuite.lib.utils import random_str import binascii from Framework.Valueconfig import FORMATTIME, ValueStatus from Framework.Library.Function.Function.PocSuite.api import paths class file_upload: def __init__(self, url): se...
999,405
b761a695904f8fc0212718bb5792d3fcbbd0cf22
#!/usr/bin/python import re import os rootdir='/home/gagan/stockquotes' newdir='/home/gagan/newstockquotes' def modify(line): s = re.findall("\[(.*?)\]", line) if not s: return del s[0] del s[6:12] for i in range(1,5): p = s[i].split(',') p[1] = str(int(float(p[1])+0.5)) ...
999,406
d8a498cab50262f999ef17afee7a1442794e9832
from web_app import app
999,407
6e09ca91ae1c178b3f18591263485247c2e16364
from model import Account import unittest class TestModel(unittest.TestCase): def test_constructor(self): dan = Account("4221","333409",0) self.assertEqual(dan.pin, "4221") self.assertEqual(dan.account_num, "333409") self.assertEqual(dan.balance, 0) # def test_self(self): ...
999,408
ee1fbf490e6c6051e5c4640fc9675a827ed6ceea
#!/usr/bin/env python # coding=utf-8 # Copyright 2022 The HuggingFace Team 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-...
999,409
029513a81f8d96e2ba15514c199c2de042019e47
import os from xml.etree import ElementTree from stemming.porter2 import stem import string from nltk.corpus import wordnet as wn import re from constants import * from scipy.linalg import * from scipy.spatial import distance from numpy import * import string import enchant def enrich(queryString): ''' enrich th...
999,410
56c27ab607dae80411b26edea72595da65dbb62e
import pygame import random import math from pygame import mixer import os #for playing with sounds in pygame #initialize pygame pygame.init() #print(f'mixer init: {pygame.mixer.init()}') pygame.mixer.init() #clock = pygame.time.Clock() #create a screen W H screen = pygame.display.set_mode((800,6...
999,411
91cd0f37e6c076c3388bf58798b335fac101a49c
import sys import hashlib if __name__ == '__main__': if len(sys.argv) != 3: print("Invalid number of arguments") print("Usage: integrity.py path_to_file path_to_dir ") sys.exit() else: path_to_file = sys.argv[1] path_to_dir = sys.argv[2] if path_to_d...
999,412
d70d64cf71d0607b655e240b4e8646d108a4d81c
import time import unittest2 from selenium import webdriver class loginTest(unittest2.TestCase): def test_login(self): self.driver.find_element_by_id("username").send_keys("changcheng") self.driver.find_element_by_id("password").send_keys("111111") self.driver.find_element_by_class_name("lo...
999,413
f22aa93464cc6c93acd5f1ebc5e531d29448ffc7
""" ANN implementation (Keras). """ import keras # DNN library from preprocessing import * # Data preprocessing from keras.models import Sequential # ANN model from keras.layers import Dense # ANN layers from keras.layers import Dropout # ANN regulatization from keras.wrapper...
999,414
18251106888ee4cba47f66550122f993c3e10ea4
# AST nodes for micro-ML. # # Eli Bendersky [http://eli.thegreenplace.net] # This code is in the public domain. class ASTNode: def visit_children(self, func): """Visit all children with a function that takes a child node.""" for child in self._children: func(child) # Used by the ty...
999,415
e9230402b95a6df30f8be617f74146dcf7d7b2be
# delete import pymysql.cursors try: conexao = pymysql.connect( host = "localhost", user = "root", password = "4linux", db = "4linux", charset = "utf8mb4", cursorclass = pymysql.cursors.DictCursor) except Exception as err: print("*** ERRO AO TENTAR CONE...
999,416
717925d0bfe80d55a981d5ed08eb5a50540da2ea
#!/usr/bin/python # -*- coding:utf-8 -*- from ByPlatform.ProtocolHelper.ProtocolHelper import * from ByPlatform.ProtocolHelper.Protocols.ProtocolBase import * from ByPlatform.Base.OutPutHelper import * from ByPlatform.StorageHelper.StorageType import StorageType from ByPlatform.StorageHelper.StorageHelper import Storag...
999,417
7cfae498c9e4925f86b8426c02c6963ee14367bd
import ast from typing import Set from flake8_named_arguments import Plugin def _results(s: str) -> Set[str]: tree = ast.parse(s) plugin = Plugin(tree) return {f'{line}: {col} {msg}' for line, col, msg, _ in plugin.run()} def test_trivial_case(): assert _results('') == set()
999,418
3dd338881924e3d917157dc9f258f082ca9815fc
""" Script to analyze Fast Neutron Background in JUNO detector: In the first part of the script: - Calculate the pulse shape of the prompt signal of fast neutrons. - As simulated neutrons, the files user_neutron_10_MeV_{}.root, user_neutron_100_MeV_{}.root, user_neutron_300_MeV_{}.root and user...
999,419
a638b874d9f5a3eb463777041196f3e7b99d3b52
import numpy as np arr2d=np.array([[1,2,3 ],[4,5,6],[7,8,9]]) print(arr2d) #print(arr2d[1][2]) #slices of 2d array slice1=arr2d[0:2,0:2] #print(slice1) #arr2d[:2,1:]=15 #print(arr2d) #using loops to index arr_len=arr2d.shape[0] for i in range(arr_len): arr2d[i]=i #print(arr2d) #one more way of accesing the r...
999,420
a4b426d481f1da01c9707ca659d968f1a97794cd
"""Export resources.""" from .logging import LOGGER as logger from .logging import config_logs
999,421
5d7bcc246f81228836f7d1baa730f032218b486c
from threading import Lock from core.base.data.LSHBasedFixSizeHash import LSHBasedFixSizeHash from datasketch import MinHash from services.NLPService import NLPService class DistinctTask: _lock = Lock() _instance = None @classmethod def instance(cls): if cls._instance is None: wit...
999,422
74074c63fdc7cd361802ac781bef241980a85946
# -*- coding: utf-8 -*- quant = int(input('Quantos elementos você quer? ')) lista = [] sompar = 0 somimpar = 0 qpar = 0 qimpar = 0 for i in range(0,quant,1): lista.append(int(input('Digite o elemento: '))) print(desvpad)
999,423
7ef842725980207f1b21c62a9d1b7355138c6046
from ast import walk, For import os import sys sys.path.append(os.path.abspath(os.path.join(os.path.dirname(sys.argv[0]), "..", ".."))) from testrunner import CodersLabTestSuite, CodersLabException, p, dedent tc = CodersLabTestSuite("Kolejne potęgi") @tc.test("Skrypt wypisuje zdania na ekranie", aborts=True) de...
999,424
6864de2e5057aeb328378ec94d3973146614f790
""" Import CSV file module """ def parser(): return { 'help': 'Import Visual Genome into KGTK format' } def add_arguments(parser): """ Parse arguments Args: parser (argparse.ArgumentParser) """ parser.add_argument("-sgf", "--scene-graphs-file", action="store", type=str, d...
999,425
f277f92f010376d55f56bfc2a49dbccea25e22b8
import os from opcua import ua from .base import BasicSystem class FileSystem(BasicSystem): ua_dir_type = 13353 ua_file_type = 11575 def __init__(self, data_handler, inputs=None, outputs=None, **kwargs): BasicSystem.__init__(self, data_handler, inputs, outputs) options = dict() ...
999,426
0fa2d55a64be00bcd4b533446fed4ddec3d045a3
import threading import base, gen import gtk, gobject, cairo import time import config gtk.gdk.threads_init() class Line: def __init__(self, h, begin, tam, cor): self.altura = h self.comeco = begin self.tamanho = tam self.r = cor[0] self.g = cor[1] self.b = cor[2] ...
999,427
efa3b0b338d4c1469cf18875d307f0d4c83f777e
import sys import unittest import testing_utilities as t_u sys.path.insert(0, '..') class TestIOInstructions(unittest.TestCase): def test_print_A(self): before = {'_integer': [7]} after = {'_stdout': '7'} self.assertTrue(t_u.run_test(before, after, '_print_integer')) def test_print_B...
999,428
699e1503d1eacdbcb39a1e8f6d9d7bff29612c58
from django.shortcuts import render from .models import ContactData,FeedbackData from .forms import FeedbackForm,ContactForm from django.http.response import HttpResponse def home_view(request): return render(request,'home.html') def contact_view(request): if request.method == 'POST': form = ContactF...
999,429
43a0dacd7c4477131a331bc7a7cba89a4047d826
import numpy as np import matplotlib.pyplot as plt import math from parse_log_files import parseAndClusteredLogFiles def main(): path = "../images/run_2019_10_08" #output_path = path + "/plots" logs_datasets = parseAndClusteredLogFiles(path) for dataset in logs_datasets: output_path = path...
999,430
e98471891ec1e6780a9c5cb3e15a802363110ad0
#!/usr/bin/env python # -*- coding: utf-8 -*- ''' Created on Nov 7, 2015 Don't blink... @author: Juan_Insuasti ''' from Model import Sensor from Model import Actuator, Camera import sys import datetime from Shared import Logger from Broker import Broker import json class Device: def __init__(self, database, st...
999,431
fca43ed5584500fa3ae7b166f5d4aca67b0ad569
import tensorflow as tf import numpy as np weights3d_dir = '/home/vador/Documents/project/AI/drl-rpn-tf-video/pretrained-data/data3D/' model3d = weights3d_dir + 'model_test' vn1 = np.array(np.random.randint(0, 10, (4,5,5))) vt1 = tf.Variable(vn1, name='v1') vn2 = np.array(np.random.randint(0, 10, (4,5,5))) vt2 = t...
999,432
8b27829c755702793c6717ff4b4304730d5e1a3c
import uuid import os from datetime import datetime from django.db import transaction from api.management.data_script import OperationalDataScript from api.models.ApprovedFuel import ApprovedFuel from api.models.ApprovedFuelProvision import ApprovedFuelProvision from api.models.CarbonIntensityDeterminationType impor...
999,433
b7cb3e868a9fea5daa3ea58d4c55601c7cab0d81
import requests servers = ['https://paxos-1.herokuapp.com', 'https://paxos-2.herokuapp.com', 'https://paxos-3.herokuapp.com', 'https://paxos-4.herokuapp.com', 'https://paxos-5.herokuapp.com'] def check_values(key): print('Checking values...') for server in servers:...
999,434
347f94513e2d14bcb75f4fd817b45cb5b4606204
# https://www.codewars.com/kata/take-a-picture/train/python def sort_photos(pics): years = [pic.split('.')[0] for pic in pics] numbers = [int(pic.split('g')[-1]) for pic in pics] data = sorted(zip(years, numbers))[-5:] data.append((data[-1][0], data[-1][1] + 1)) return ['{}.img{}'.format(year, numb...
999,435
72998ff601e414c42815274b1a60c1e997cc0600
import sys from functools import reduce with open(sys.argv[1]) as answer_fle: group_answers = answer_fle.read().split('\n\n') total1 = 0 total2 = 0 for group in group_answers: all_answers = list(filter(None, group.split("\n"))) # for part one total1 += len(set(''.join(all_answers))) # for part ...
999,436
24cf1f1c4ab020d7e5aa47e63f0e29d160149ccc
key = input() s = 56 i=0 pbox =[57, 49, 41, 33, 25, 17, 9, 1, 58, 50, 42, 34, 26, 18, 10, 2, 59, 51, 43, 35, 27, 19, 11, 3, 60, 52, 44, 36, 63, 55, 47, 39, 31, 23, 15, 7, 62, 54, 46, 38, 30, 22, 14, 6, 61, 53, 45, 37, 29, 21, 13, 5, 28, 20, 12, 4 ] n = 64 input_table = key binary_input_table...
999,437
33a663f400c3152109bf51618d6b46ef1680210e
import os from distutils.core import setup def find_stubs(package): stubs = [] for root, dirs, files in os.walk(package): for file in files: path = os.path.join(root, file).replace(package + os.sep, '', 1) stubs.append(path) return {package: stubs} setup( name="django...
999,438
19b9e1ed608da44db1ea1a667a40131728ab4042
# -*- coding: utf-8 -*- from rest_framework import serializers from .models import User class UserSerializer(serializers.ModelSerializer): class Meta: model = User exclude = ["password", "is_active", "is_staff", "is_superuser", "groups"] read_only_fields = ["email"]
999,439
46e33e6d5fd35a2acd642f74d72ee731e14b03d8
# -*- coding: utf-8 -*- from types import SimpleNamespace import numpy as np from pyyeti import expmint class SolveExp1(object): """ 1st order ODE time domain solver based on the matrix exponential. This class is for solving: ``yd - A y = f`` This solver is exact assuming either piece-wise linear or...
999,440
54414d273853f30f4ca8f951b6c1e36ce9ca8250
# pass the name of dataset you want to check for existence and bigquery client object def exists(dataset_name,client): dataset_names_list = [] for dataset in client.list_datasets(): #print dataset d_name = dataset.dataset_id.encode('ascii','ignore') dataset_names_list.append(d_name) if dataset_name in dataset...
999,441
3d73053b479c2efdabd39fb6fbb62d877389cd66
def solve(): print("magna") # converting the number into tsh profit_margin=200000*2290 # percentage cut for profit p_cut1=0.005 p_cut2=0.0025 number_transaction1=812000 number_transaction2=50000 # sales_1=number_transaction1*p_cut1 sales_2=number_transaction2*p_cut2 # tcap=3000000 v2 =(profit_ma...
999,442
a799f05ef5f17eeffcdf849d2b1dea1e3bde66cb
from onnx_tf.handlers.frontend_handler import FrontendHandler from onnx_tf.handlers.handler import onnx_op from onnx_tf.handlers.handler import tf_op from .math_mixin import BasicMathMixin @onnx_op("Floor") @tf_op("Floor") class Floor(BasicMathMixin, FrontendHandler): @classmethod def version_1(cls, node, **kwar...
999,443
57f077f94e55909bd9128699f80d6a5d4eed5155
#!/usr/bin/python from cydmx import dmxwidget import math import random class SurfBall (dmxwidget.Widget) : def init(self, panel) : self.hue = 0.9 self.center_x=0.0 self.center_y=0.0 self.dx=0.4 self.dy=0.5 def draw(self, panel) : self.center_x+=self.dx ...
999,444
27951f294851f0a001069a4c37fc8d29bfdb8a77
import pygame import sys from pygame.locals import * pygame.init() screen=pygame.display.set_mode((600,500)) pygame.display.set_caption("Drawing A Line") while True : for event in pygame.event.get(): if event.type==QUIT: sys.exit() screen.fill((0,80,0)) #draw the line color=100,255,2...
999,445
d1ade014f5827eb0f4e000fac225d683558f51b8
from django.core.management.base import BaseCommand from django.db.models import Q from animals.models import Animal, Person, Location from datetime import datetime import xlrd from xlrd import xldate_as_datetime class Command(BaseCommand): help = 'Import existing data from mice2giveaway excel list' def add_a...
999,446
f2b9870cab764e5026f29b34973e17693057418e
"""locum 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-based...
999,447
22439165fb41cb1f4418054c8981772a92165e2c
from Actions.Quit import QuitAction from Actions.ActionManager import ActionManager
999,448
feb95362d8a1788007a470db093237bae9b3ec05
# simultaneous reading and writing to a file in python queue
999,449
2bd3cd2e89478ab46588c277f3f0c6fb635983f3
# 导入unittest import unittest from funcdemo.CalcDemo import Calc from Commonlib.ReadXml import readXml # # 创建对象 # r = readXml() # a = int(r.read_xml("../DataXml/data.xml","jia","num1")) # b = int(r.read_xml("../DataXml/data.xml","jia","num2")) # ex = int(r.read_xml("../DataXml/data.xml","jia","expect")) # 优化 r = readX...
999,450
aec584327831b44545169d3b8aa26b1ccce6a97b
# Library of functions to list, download and save ECCC Precipitation data # Andrew Ireson # 17-March-2020 import pandas as pd import matplotlib.pyplot as pl import numpy as np def StationList(): return pd.read_csv('ECCC_Precip/Station Inventory EN.csv',skiprows=3) def SearchByProvince(SearchTerm,stations): p...
999,451
ab71ac2567febe2da5ad950919b6e7f2de12ade6
from django.db import models # from django.core.urlresolvers import reverse (Descontinuado) from django.urls import reverse from systemgrafo.neo4japp import db # Create your models here. class NodeHandle(models.Model): handle_id = models.CharField(max_length=64, unique=True, editable=False) created = models.D...
999,452
12c37cb28440fc4034800d5df782621fb8c42557
import pymongo with pymongo.MongoClient() as conn: db = conn.stu myset = db.ccc p = [ {'$group': {'_id': 'name', 'count': {'$sum': 1}}}, {'$match': {'count': {'$gt': 1}}} ] cursor = myset.aggregate(p) for item in cursor: print(item)
999,453
c79cdcfed6d862a5c6b9d74e38190fbfa0dd1369
import matplotlib.pyplot as plt import cv2 import numpy as np import sys import glob import os sys.path.append('/usr/local/lib/python2.7/dist-packages/') def imageDistance(imgName1, imgName2, link=3):# returns distance between 2 images img1 = cv2.imread(imgName1) img2 = cv2.imread(imgName2) if img1 is None or im...
999,454
93b37c09cbc6a76fc6ed4722253c91fb3580aa09
import numpy as np import random import time L=24 theta=np.zeros((L,L)) phi=np.zeros((L,L)) s=np.zeros((L,L,3)) f=open('Heat2.csv','ab') g=open('Heat1.csv','ab') def chirality(theta,phi): s=np.zeros((L,L,3)) s[:,:,0]=np.sin(theta)*np.cos(phi) s[:,:,1]=np.sin(theta)*np.sin(phi) s[:,:,2]=np.cos(theta) ...
999,455
c0a1365596ef027e6c169b132e426da03d84ef56
""" 날짜 : 2021/05/20 이름 : 김철학 내용 : 파이썬 데이터베이스 SQL 실습하기 """ import pymysql # 데이터베이스 접속 conn = pymysql.connect(host='192.168.10.114', user='chhak2021', password='1234', db='chhak2021', charset='utf8') # SQL 실행 객체 생성 cur = conn.cu...
999,456
c9e53e2dfc659dd51e7f4cf4471a6b39c598ce6f
# -*- coding: utf-8 -*- #by liangwenhao # 第 0019 题: 将 第 0016 题中的 numbers.xls 文件中的内容写到 numbers.xml 文件中 def write_numbers_to_xml(list=None, to_path=None): if list is None or to_path is None: return None root_node = etree.Element('root') root_node.text = "\n\t" number_node = etree.SubElement(...
999,457
df3d45bb0460b966197aa10e10fcd86a66f31f63
from django.http import JsonResponse from django.shortcuts import render from .serializers import StudentSerializer from .form import StudentForm from .models import Student from django.views import View class CRUDOps(View): # def getmodal(self): #never used - just for future reference # data = Student.o...
999,458
8a7ee4e3a972d13d2af989c80408a9049268c1cf
import setup_environment import util.task util.task.run()
999,459
d4a640fc7676ec35b7ac408a1fbe0dd7385c54e0
def sum_two_numbers(num1,num2): sum=num1+num2 return sum num1=input('enter first number') num2=input('enter second number') x=sum_two_numbers(num1,num2) print("sum={0}".format(x))
999,460
983d9748416e318c99c2ca67c06053e87a4cadcd
def lengthOfLastWord(s): if not s: return 0 ss = s.split() return len(ss[-1])
999,461
faaf636c62eaec6d1c5e4700d75a70f3eabf7913
#!/usr/bin/python import r2pipe from time import sleep from colorama import Fore, Back ''' import angr import pydot import io r2 = r2pipe.open() func_start = int( r2.cmd('?v $FB'), 16 ) func_end = int( r2.cmd('?v $FE'), 16 ) func_code = ''.join( map( lambda b: chr(b), r2.cmdj("pcj $FS") ) ) proj = angr.Project( io.By...
999,462
583affd51c5a42ea84cc9d629f0f5239dea41fb0
import numpy as np import pandas as pd import matplotlib as mlp import matplotlib.pyplot as plt # https://github.com/JerryKurata/MachineLearningWithPython/ diabetes_data = pd.read_csv(r'src/ML Algorithms/1.ml.pima-data.csv') # ticket_data = pd.read_csv(r'D:\svnTicketDispatcher\Inex Ticket Dispatcher\data\Inex Remedy ...
999,463
0c5bb43c2668f2351cb142ce139881b56eefaa18
""" url mapping for user app a part of OpenAl8az project. By : Mahmoud Elshobaky (mahmoud.elshobaky@gmail.com). """ # import app engine frameworks import webapp2 from webapp2_extras import routes # import app settings from settings import * #import project modules and request handlers from request_handlers import * ...
999,464
ec79794dfd314a8f450713e990570bfc619ffb04
"""Plugin based functionality.""" # ============================================================================= # >> IMPORTS # ============================================================================= # Source.Python from translations.strings import LangStrings # Source.Python Admin from .. import admin_core_lo...
999,465
f2654d062c7b19416f31252901ac7985fd0ae009
import compileall compileall.compile_dir("/app/", force=True,legacy=True)
999,466
3ee819ef2ab833bb75dcf9b6d4349d97bd910348
def doblar(n): return n*2 def doblarla(n): return n*2 dobla = lambda num: num*2 print(dobla(3)) impar = lambda num: num%2 != 0 print(impar(5)) revertir = lambda cadena: cadena[::-1] print(revertir("hola calahonda")) sumar = lambda x,y: x+y print(sumar(5,9))
999,467
d8f41ae5f5fc7898d2c0ae8cbdcf117ce623ed91
# -*- coding:utf-8 -*- import numpy as np import h5py def load_cv(FOLD_FOR_TEST): # X h5 = h5py.File('../DATA-CROP-RAW-IN-IS.mat', 'r') X = h5['X'][:] X = np.reshape(X, [X.shape[0], X.shape[1], X.shape[2], 1])# 1 channel # Y Y = h5['LBL'][:] Y = np.hstack(Y) Y = np.float32(np.eye(7)[Y...
999,468
7b8361d2026c8c6c39565f8333cf7230e95c8bbb
#!/usr/bin/env python from noos_seed import noos_seed_from_json # Examples from specification_request_package_v2.0_20190208 # From file ############# lon, lat, time = noos_seed_from_json('seed_example4.2.json', plot=True) lon, lat, time = noos_seed_from_json('seed_example4.5.json', plot=True) # From dict ##########...
999,469
a4511170ea7b4f72243f2d852c38db888e5c6b7a
from .Nissan import Nissan
999,470
a9f22100fbdcd1b9ceaeb1db2ce121334b58e045
from PlayGame import * from Agent import * import multiprocessing def writeStrategy(filename, dataname): f = open(filename, 'a') for i in dataname.keys(): f.write("(" + str(i[0]) + "," + str(i[1]) + ")" + ': {') for j in dataname[i].keys(): f.write(str(j) + ": " + str(dataname[i][j...
999,471
67e070a591ee33e7f46a820af5de0dc939721b4e
from fastapi import FastAPI from oxigraph_admin.api import middleware from oxigraph_admin.api import api_v1 from oxigraph_admin import settings tags_metadata = [ { 'name': 'Security', 'description': 'Manage security settings.' }, { 'name': 'Users', 'description': 'Manage a...
999,472
0cf91dd8006ddd610ef41cd86be6492f7bdc0bf4
# pylint: disable=C0103, too-few-public-methods, locally-disabled, no-self-use, unused-argument '''This module contains various misc helper functions'''
999,473
9cf55023786c67483ae32007393271136cf090ed
import hlt from hlt import config, strategies, spawner, ships, tactics, pathfinding, entity, positionals, constants import logging, time, os from itertools import product import pandas as pd from scipy import signal import numpy as np # logging.info("Initializing:") config.load_constants() for param in hlt.control.d...
999,474
c3a32200b65844a13a99097645fe7e1dcf3f3fb6
import requests import oauth2 as oauth import urllib import urlparse from webapp import settings from webapp.settings import LINKEDIN_API_KEY, LINKEDIN_API_SECRET, LINKEDIN_REDIRECT_URI request_token_url = 'https://api.linkedin.com/uas/oauth/requestToken' authorize_url = 'https://api.linkedin.com/uas/oauth/autho...
999,475
a2c57d97e7ea0e0ecfb49bcff63d17d569e16fa4
# -*- coding: utf-8 -*- # Define here the models for your spider middleware # # See documentation in: # https://doc.scrapy.org/en/latest/topics/spider-middleware.html from scrapy import signals import random class UserAgentDownloadMiddleware(object): USER_AGENT = [ 'Mozilla/5.0 (Macintosh U Intel Mac O...
999,476
3095477cc6a4a0bd7578b147d0fe6b88f786cbcb
import datetime from typing import Dict, Union from core.enums import ItemTypes from core.locale import _ DEFAULT_ITEM_PRICES = { ItemTypes.CURSOR: 30, ItemTypes.CPU: 100, ItemTypes.CPU_STACK: 1000, ItemTypes.COMPUTER: 10000, ItemTypes.SERVER_VK: 50000, ItemTypes.QUANTUM_PC: 200000, ItemTy...
999,477
c379b3d86ed26e0d48c8b114257ff0c81e623fc3
from .ItemReader import read_items from random import randint items_collection = { 'boot': read_items('botas'), 'weapon': read_items('armas'), 'helmet': read_items('cascos'), 'glove': read_items('guantes'), 'armor': read_items('pecheras') } def items(type): return items_collection[type] class...
999,478
340227221b28c86f235553d1391462a788ae8ead
class GroupAddError(Exception): ## raised when the group object gets a non-addable object (non group or engine object) ## __module__ = Exception.__module__ def __init__(self, inst, class_type): """ instance inst - the illegal instance that is added to a group type class_type - the type of instance inst """ ...
999,479
25ecec114df46d534e73c213dd4fd6e3cbf91e5e
from flask import render_template, url_for, flash, redirect, session from datetime import timedelta from functools import wraps from app import app from passlib.hash import sha256_crypt import app.forms as forms import app.dbconnection as db import app.helpers as hp @app.before_request def before_request(): sessi...
999,480
a460604f4060d6372824508786781e9878d8173b
import os from django.db import models from project import settings PART_DATA_FILE = 'static/csv/upload/pdata.csv' PART_FAIL_FILE = 'static/csv/upload/pfail.csv' class PartDataFile(models.Model): class Meta: db_table = 'part_data_file' def content_file_name(instance, filename): return PART...
999,481
a47b385484aec906f63eb84f71d47c9e803fbb73
import time from selenium import webdriver import unittest from opensource_demo_orangehrmlive.POMProject.Pages.loginPage import LoginPage from opensource_demo_orangehrmlive.POMProject.Pages.homePage import HomePage import HtmlTestRunner class LoinTest(unittest.TestCase): @classmethod def setUp(Self): ...
999,482
5cb35cc33b7635e28ad578e7ef0fbc674e53996f
#!/usr/python env # class to represent node in bst class Node(object): def __init__(self, value): # value of the node self.value = value # left child of the current node self.left = None # right child of the current node self.right = None # parent node of c...
999,483
9d153197f8b1d9572251835949ccdf51e2f89d42
from django import forms from core.orders.models import Order from crispy_forms.helper import FormHelper from crispy_forms.layout import Layout, Submit, Row, Column class OrderCreateForm(forms.ModelForm):\ class Meta: model = Order fields = ['first_name', 'last_name', 'email', 'address', 'post...
999,484
4f3a97fc2291d4986624c7bbbfb992833bff93bf
from .dribble_ball import * from .action import * from .helper_functions import * from .move_to import * from .Goalie import * from .robot import *
999,485
e23935673d77c642c60039106f4844b3d5e6737a
#!/usr/bin/python from multiprocessing import Process, Pool, Queue import time import random def f(x): print x*x time.sleep(random.randint(1, 10)) return x if __name__ == '__main__': pool = Pool(processes=4) result = pool.map(f, range(100)) print result
999,486
5902dc7eb145b4bb8319a9734458dcb40d868751
class Solution: def majorityElement(self, nums: List[int]) -> int: # 开心消消乐,不一样的两个数相互抵消掉,剩下最后一个(或n)个数就是众数 stack = [] for item in nums: if len(stack) == 0: stack.append(item) else: if stack[-1] != item: stack.pop() ...
999,487
79cfd875d3bd84e481411276f93393bc70a6be75
#!C:\Users\Lenovo\Desktop\Online_Angular_8_Batch\My-Neighborhood-master\venv\Scripts\python.exe from django.core import management if __name__ == "__main__": management.execute_from_command_line()
999,488
eb12e8b89799359afa2812019cf7dba8ea343060
import pandas as pd import requests # ______________________________________________________________________________ def update_store_data(df): '''This function takes the complete_data for stores changes the date to be datetime sets indesx to be date create a month, day of the week, and sales total fe...
999,489
50249a02957041431378634eddf4e39fbaa30963
import pygame Ga1 = input("Herzlich WIllkommen zum Test der Idioten.[ENTER]") Ga2 = input("Normalerweise müsste jeder den Test ohne Fehler hinbekommen.[ENTER]") Ga3 = input("Du musst immer mit nur einem Wort antworten![ENTER]") Ga4 = input("Bist du Bereit?[ENTER]") aa1 = input("Fangen wir mit der ersten Frage an.[ENT...
999,490
d1ced553c62414d3729e105890e09a4f48e50450
/Users/duran/anaconda/lib/python2.7/stat.py
999,491
630c326b10cb10c8e8e275a86e1366db52a89802
''' Project Euler #7 Find the 10001st Prime ''' from primes import prime_list primes = prime_list(500000) prime_count = 1 x = 2 while x < 100001: x += 1 if primes[x]: prime_count += 1 print x
999,492
e0fdb08fdb996730f5a5de467080ba4dd754e1f0
#Author :afeng #Time :2018/5/27 17:11 import requests url="http://fanyi.baidu.com/basetrans" data={"query":"你好,世界","from":"zh","to":"en"} headers={"User-Agent":"Mozilla/5.0 (Linux; Android 6.0; Nexus 5 Build/MRA58N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.181 Mobile Safari/537.36"} response=requests....
999,493
7b130d02867d7d722083faf6d74c792f3f1ebea3
from django.test import TestCase from .models import Category, Origin, Location, Product # Create your tests here. class TestModels(TestCase): # Set up non-modified objects used by all test methods @classmethod def setUpTestData(cls): # Set up non-modified objects used by all test methods Categ...
999,494
209759dfd3117cd9ac134de4a900cae1c97c102a
#!/usr/bin/env python3 import pathlib import os rootpath = pathlib.Path(__file__).parents[1] libpath = os.path.join(rootpath,"src","game","lib","res") playerpath = os.path.join(libpath,"player") buttonspath = os.path.join(libpath,"buttons") enemypath = os.path.join(libpath,"enemy") print(libpath) print(playerpath)...
999,495
70162cde07bf1724fde2baf5a0a4af73d2b18170
config = { 'GOALIE_PARAMS': (57, 5, 9), 'OFFENSE_PARAMS': (61, -2, -2), 'PIXELS_PER_CM': 12.598, 'ROI': [[200, 80], [1004, 95], [990, 662], [199, 646]], 'BALL_THRESH': ((7, 0, 0), (61, 167, 255)), 'ROBOT_THRESH': ((150, 74, 37), (198, 255, 207)), 'HUMAN_THRESH': ((104, 175, 0), (128, 255, 25...
999,496
9ccc2e90150a91651eda378384eb9a322b569a1d
from django.apps import AppConfig class UsersConfig(AppConfig): name = 'users' # Import the signals declared in signals.py (this is just Django a Django convention intended to avoid side effects) def ready(self): import users.signals
999,497
89da6b9be72cbbad275e83a9558c22d983b7748c
#!/usr/bin/python3 from __future__ import print_function from main import run from layers import * network = compose( conv2D(3, 128, 3), relu(), max_pool_2d(2), conv2D(128, 128, 3), relu(), max_pool_2d(2), conv2D(128, 128, 3), relu(), max_pool_2d(2), flatten(), xaffine(512, 512), bnorm(512, 0.1), ...
999,498
58a330d87393999fdaad6db40cd973e8a79caed6
from setuptools import setup import shutil with open('usefulholidays/requirements.txt') as f: required = f.read().splitlines() setup(install_requires = required, name='usefulholidays', version='0.4', description='The disrupting package to check the school calendar :) ', url='https://github....
999,499
9f1bf4202b4f9f23530cd0d4686e484058c6c33b
# Copyright 2015 Oliver Cope # # 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 writing, ...