index
int64
0
1,000k
blob_id
stringlengths
40
40
code
stringlengths
7
10.4M
992,500
aeab09bbf0041fa2a1d8b0ccc6f563f50c3f8d09
# Generated by Django 2.2.7 on 2020-04-27 04:46 from django.db import migrations, models import django.db.models.deletion import django.utils.timezone class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( name='Oner', ...
992,501
4fd4c6a05aa9cbee81abdb459010f27079787994
""" Programming assignment #1 Created by: Raphael Miller PA1 - Due Feb 1st. Purpose: To demonstrate the common filters used in Computer Vision applications. This program is designed to implement various filters for pictures including but not limited to, box, gaussian, and sobel filters. """ """ run.py - run handles...
992,502
74a9ec06a13c7ac36f955ef1b74572c1abc24337
# data strucure thisset = {"she","is","samrt"} print(len(thisset)) thisset.remove("is") say = {"apple","banana","shosho","welcome"} x = say.pop() print(x) print(say) say.clear() print(say) i = (("hello","hello","hello")) print(i)
992,503
2e028ee425849396a0731b677b39922eec331871
### Author: Matiur Rahman Minar ### ### EMCOM Lab, SeoulTech, 2021 ### ### Task: Generating binary mask/silhouette/segmentation ### ### especially for clothing image ### ### Focused method: Binary thresholding ### import os import cv2 import numpy as np from PIL import Image from matplotlib import pyplot as plt def...
992,504
9a439f227533274d40766fa9123dfbe92fbf3fdc
import numpy as np import math from simulation_parameters import * from sensors import Enc, GPS, UWB, Camera, Range import matplotlib.pyplot as plt import sympy as sym class kal_hist(): def __init__(self,xk,Pk,real_state): self.xk = (xk.flatten()).tolist() self.Pk = (Pk.flatten()).tolist() ...
992,505
4aa9138d7b682d18ded02fd1f6d00ffa95d9d395
sqlalchemy_imperative_template_str = """ from dataclasses import dataclass from dataclasses import field from typing import List from sqlalchemy import Column from sqlalchemy import ForeignKey from sqlalchemy import Integer from sqlalchemy import MetaData from sqlalchemy import String from sqlalchemy import Table from...
992,506
e65a2dd56dd2cbe53e5a33bc52cfda66399e888e
# coding:utf-8 from dao.db import session from model.models import TrackingDetail class TrackingDetailDao(object): @staticmethod def get_by_task(task_id, status): tracking_details = session.query(TrackingDetail).filter(TrackingDetail.task_id == task_id, ...
992,507
6bbf56b7ccd4627904d42525ebe646ad1a0507a0
#coding:utf-8 from db.connDB import get_conn,get_cur from random import choice from config import set_uuid,get_uuid class data_manage(): def __init__(self): self.conn = get_conn() self.cur = get_cur() print("cur::L",self.cur) print("conn::L",self.conn) def con...
992,508
9afb9bb20ce6e064165b396d098aa49669a50e70
# -*- coding: utf-8 -*- """ Discription: Preferences Window Author(s): M. Fränzl Data: 19/06/11 """ import os import numpy as np from PyQt5.QtWidgets import QDialog from PyQt5.uic import loadUi from pyqtgraph import QtCore, QtGui class HelpWidget(QDialog): def __init__(self): super().__init__(None...
992,509
ad4236e7e373c693d9d09ddcb61d51a4c9df638d
import logging _LOGGER = logging.getLogger(__name__) class Database: """A base database. Database classes are used to persist key/value pairs in a database. """ def __init__(self, config, asm=None): """Create the database. Set some basic properties from the database config such as th...
992,510
beaa27d0d59d8ce10781480b004d6a031a94673e
from boto.swf.layer1_decisions import Layer1Decisions from flow.api import make_request from flow.core import SWF from flow.core import check_and_add_kwargs def poll_for_decision_task(domain, task_list, identity=None, next_page_token=None, maximum_page_size=1000, ...
992,511
4a56ecd30b746f60c086df6ee89502d44caf8df3
y=eval(char("please enter the variable") if(y=a)&&(y==e)&&(y==i)&&(y==o)&&(y==u) print("Vowel") else print("Consonant")
992,512
9214a329e5735923a01f1a2ecb819f41f1e53f85
""" load HBT data, both processed and unprocessed NOTES ----- The convention for units is to maintain everything in SI until they are plotted. A few of these functions are merely wrappers for other people's code In most of the functions below, I've specified default shotno's. This is largely to make debugging ea...
992,513
2f3238c5717695499c283dc8d12e9774f1cce1a6
from bs4 import BeautifulSoup from selenium import webdriver import time import pandas as pd def scrape_nbacom_tmclutch_by_url(start, end, url): '''Scrape team clutch statistics from NBA.com over a range of seasons given: start, the end year of the first season in the range end, the end year of the last se...
992,514
37f651b9b93332de4d1bf7fc9b1de64b948bfda3
from django.shortcuts import render, get_object_or_404 from .models import Doctor, MedicalPractice from django.db.models import Q # Create your views here. # def do_search(request): # query=request.GET['search_box'] # doctors = Doctor.objects.filter(Q(name__icontains=query) | Q(practice__icontains=query) | Q(l...
992,515
91441bd0acdb5097fe407ceb1735750ff0aa6421
""" Desafio 097 - Faça um programa que tenha uma função chamada escreva(), que receba um texto qualquer como parametro e mostre uma mensagem com tamanho adaptável. Ex. escreva('Ola, Mundo!') Saída. '~~~~~~~~~~~' 'Ola, Mundo!' '~~~~~~~~~~~' """ def escreva(txt): lens = len(txt) + 2 print('~' * lens) prin...
992,516
49eb45f445ad8ab6bdbbc51f94be1b262de1b7fb
# LSTM (Long Short Term Memory) from keras.layers.core import Dense, Dropout, Activation from keras.layers import LSTM import os from keras.models import Sequential, load_model from sklearn.preprocessing import MinMaxScaler import pandas as pd import numpy as np dic={'batch_size': 57.0, 'dropout1': 0.7113823489864...
992,517
a64a62564bd5e7f416d642d3de159e8f5b39afe2
# -*- coding: utf-8 -*- SECRET = '' # 登录transfereasy后台进入设置页面查看 ACCOUNT_NO = '' # 登录transfereasy后台进入设置页面查看 TE_HOST = 'https://open.transfereasy.com/{url}' PUBLIC_KEY = ''' -----BEGIN PUBLIC KEY----- MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA1FuC6Pj3d5qFcK7G0vOD Nbi3H6bTm/1i19KfA/qpKvxHimD2OYU18fqq+1r3FOq...
992,518
6b7c907d5f0c3033ba0b510c0a1abe42c9d33b9d
# DATA WRANGLING WITH PANDAS import pandas as pd # Reading in csv files: csv_data = pd.read_csv('training-set.csv') # Pandas loads the csv data into a DataFrame (table) # Displaying the DataFrame: csv_data.head() # In Pandas, columns are called 'series' # The describe function shows a table of statistics about the ...
992,519
7e783cae694b17565659a1de073a18bb4e16fb18
# coding: utf-8 """ Python Users API This is a simple Users API. It provides basic logic, CRUD operations of users. # noqa: E501 OpenAPI spec version: 1.0.0 Contact: valentin.sheboldaev@gmail.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ from __future__ import absolu...
992,520
948c435a38701e243cef83677ff8c0bae3e06fea
class Student(): def __init__(self, number_in_list, name): self.number_in_list = number_in_list self.name = name # def __str__(self): # return f'Имя студента под номером {self.number_in_list}: {self.name}' class School(): def __init__(self, students, marks): self.students...
992,521
6dd740a962fe62deb6a16a2db4919e3ff0622dd7
import turtle from turtle import Turtle from random import random timmy = Turtle() screen = turtle.Screen() timmy.speed(0) timmy.width(2) def change_color() : R = random() B = random() G = random() timmy.color(R, G, B) for i in range(72): timmy.circle(100) timmy.right(5) ch...
992,522
ea3b937d3a3966b195fb20517098e5ec6d31d249
import os import re import pytest from unit.applications.lang.python import ApplicationPython from unit.option import option prerequisites = {'modules': {'python': 'any'}} client = ApplicationPython() @pytest.fixture(autouse=True) def setup_method_fixture(): assert 'success' in client.conf( { ...
992,523
d0ad2d06c16496b402471f873eef217a8b5c94f4
# 决策树代码实现过程 """ 熵的计算,给出数据集进行计算并返回 对数据集进行切分,返回切分后的数据集 选择最优的切分特征 叶子结点标签不唯一处理--票多为胜 创建决策树 预测函数 进行测试 """ from math import log import numpy as np class ID3: def __int__(self, dataset): self.dataset = dataset[1:] self.labels = dataset[0] def calc_entropy(self,dataset): entropy = 1 l...
992,524
fde4e18b2a6455efe569e42949455c56b7599458
# encoding: utf-8 ''' @author: shiwei hou @contact: murdockhou@gmail.com @software: PyCharm @file: test_head_count.py @time: 19-1-4 09:44 ''' import tensorflow as tf import os import time import cv2 import numpy as np import matplotlib.pyplot as plt from src.lightweight_openpose import light_openpose from src.pose_dec...
992,525
a2e1dc30738d7c3a7e8a670a85f53482989d3399
from fastapi import FastAPI from fastapi.params import Query import pickle from pydantic import BaseModel from tensorflow import keras from tensorflow.keras.preprocessing.sequence import pad_sequences import numpy as np description = """ Teste Prático Ciências de Dados. 🚀 ## Sentiment Analysis Neste endpoint é reali...
992,526
86ca107933c58dbad8c1528ab1e420e006cb9598
# def f(a,b):M=max(a,b);return(a-b)*(-1)**M+M*M-M+1 def f(x, y): diag = 1 if x > y: diag = x * x - x + 1 diff = abs(x - y) if x & 1: diag -= diff else: diag += diff elif y > x: diag = y * y - y + 1 diff = abs(x - y) ...
992,527
78b6472770d95fa469f7accbc2282d21fbaf1f2e
import os import copy import inspect import numpy as np ##---WP2017---## from WPandCut2018 import * aliases['nCleanGenJet'] = { 'linesToAdd': ['.L '+os.getcwd()+'/ngenjet.cc+' ], 'class': 'CountGenJet', }
992,528
3a256c57f439bf04e553f126c6b4e3f39476e346
# Generated by Django 3.1.3 on 2020-11-27 11:09 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('store', '0001_initial'), ] operations = [ migrations.AddField( model_name='books', name='stock', field=m...
992,529
b730a0aebe0cd62ec4b763453c6114b69b1cda2c
import numpy as np import pandas as pd import matplotlib.pyplot as plt from sklearn.preprocessing import scale from matplotlib.colors import ListedColormap from sklearn.model_selection import train_test_split from sklearn.preprocessing import StandardScaler from sklearn.datasets import make_moons, make_circles, make_cl...
992,530
03d31f2dd960d21d9299bf93204b763487cd4165
# Zbiór przedziałów [(a[1], b[1]), ..., (a[n], b[n])], każdy przedział należy do [0, 1]. Opisać algorytm # który sprawdzi czy jest możliwy taki wybór przedziałów, aby cały przedział [0, 1] zawierał się # w wybranych odcinkach. Przedział ma składać się z jak najmniejszej ilości odcinków. def minimum_intervals(T): ...
992,531
82ab32bf882b9d33182e9238c5f0d129526ba913
# -*- encoding: utf-8 -*- # Module iaihwt from numpy import * def iaihwt(f): from iahaarmatrix import iahaarmatrix f = asarray(f).astype(float64) if len(f.shape) == 1: f = f[:,newaxis] (m, n) = f.shape A = iahaarmatrix(m) if (n == 1): F = dot(transpose(A), f) else: B = iah...
992,532
15545a63e72273faa321f9004e26e809fd9560ab
##################################### ### Woodall Numbers ### ##################################### #Formula: n*2n − 1, with n ≥ 1. #Example : {1, 7, 23, 63, 159, 383, 895, 2047, 4607, ...} find_val = int(input("Enter the nth value : ")) print(find_val,"th value of Woodall Number is ",find_val*(2**find_...
992,533
d8d1da0fc372debd1e6ed9f4137743dcc3b798d5
import cv2 img= cv2.imread("E:/img/spiderman.jpg",cv2.IMREAD_UNCHANGED) print('Original Dimensions:',img.shape) ''' The folder structure may vary from individual machines , please replace the write and read path accordingly ''' #Downscaling scale_percent = 60 # percent of original size width = int(img.shap...
992,534
8ff11c2ac72bd4a40d0f8cebd3c8141fc988a264
#!/usr/bin/env python3 from abc import * from virtualmachine.machine import Machine class Instruction: def __init__(self): self.arg_registers = [] self.arg_constant = None @abstractmethod def execute(self, machine: Machine): raise NotImplemented @staticmethod @abstractm...
992,535
953b03f33578ecbc31efef5f2419ef0a787f2d8c
# Low Frequency PWM Driver to control High Inertia Devices # # See GitHub: https://github.com/mchobby/esp8266-upy/tree/master/lfpwm # # # Compatible with: # * Raspberry-Pico : using the only Timer() available. # from lfpwm import LowFreqPWM from machine import Pin from os import uname # User LED on Pico led = None if...
992,536
d8f751ccd669d1ac77194b5507ecbaf7e6f0ecc9
P=int(input()) if P==1: print("One") elif P==2: print("Two") elif P==3: print("Three") elif P==4: print("Four") elif P==5: print("Five") elif P==6: print("Six") elif P==7: print("Seven") elif P==8: print("Eight") elif P==9: print("Nine") else: print("Ten") #j
992,537
eaddb721b602d6a17b430eae29572c00a14c1485
print("a little something to post to git")
992,538
8b64be9482b546cf00c052b94766d3ecd921ca2b
#from system_parameter import lang_tensor import system_parameter which = system_parameter.SystemParam.lang_tensor #which = "cython" if which == "py": from tensor_py import * elif which == "cython": print "using cython implementation of iTensor" import pyximport pyximport.install() # ...
992,539
9e5f65e62f18a179a98f76467395aed2818ead75
import sys sys.path.append('e:\\art\\code\\deepArt-generation\\source') import config, utils from scipy.misc import imsave,imresize import numpy as np from skimage import io from skimage.transform import resize import os import matplotlib.pyplot as plt out_path = 'e:\\art\\wikiportraits' path = config.datafile('po...
992,540
8ef5d224ec6c429c30ab346dc2bb8b3751d9a280
#!/usr/bin/env python import sys,time import json,glob,os,re,itertools from itertools import izip_longest from optparse import OptionParser from collections import OrderedDict def grouper(iterable, n, fillvalue=None): "Collect data into fixed-length chunks or blocks" args = [iter(iterable)] * n return izip...
992,541
f272eaa4d7e9c1a6420b0b8d1cbcb463250bda5a
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file '使用资源文件设置背景.ui' # # Created by: PyQt5 UI code generator 5.15.2 # # WARNING: Any manual changes made to this file will be lost when pyuic5 is # run again. Do not edit this file unless you know what you are doing. from PyQt5 import QtCore, Q...
992,542
91ffa406851185e2cb98aec0e0f0c229490768a1
# -*- coding: utf-8 -*- """ Created on Tue Nov 27 14:05:18 2018 @author: fangyucheng """ import hashlib import uuid import copy import urllib import time import datetime import requests from crawler.crawler_sys.framework.video_fields_std import Std_fields_video from crawler.crawler_sys.utils.trans_duration_str_to_sec...
992,543
2136895c44a437c429956f8224536717a218e7a4
from django.db import models from cards.models import CardTemplate, Deck from npcs.models import NPC, NPCInstance # class EffectEventLink (models.Model): # template = models.ForeignKey (CardTemplate) # effect = models.ForeignKey (Effect) class Event (models.Model): """ This class is designed to conta...
992,544
22de6e27203eb41f9c17dea8fe738a07ad2d61a2
""" Author: Võ Viết Thanh Date: 04/09/2021 Program: The tax calculator program of the case study outputs a floating-point number that might show more than two digits of precision. Use the round function to modify the program to display at most two digits of precision in the output number. Solution: 1. Analy...
992,545
8b845a523dd54654edb88f07c4093137ebef0ac4
from directio import read, write import six.moves.cPickle as pickle import os import shutil from hashlib import md5 from swift.common.utils import config_true_value import sqlite3 from swift.dedupe.time import time, time_diff class DatabaseTable(object): def __init__(self, conf): self.db_name = conf.get('...
992,546
d2cdfd1b9389c2f57794997ea9847ebd02b2c4fd
from django.conf.urls import url from . import views urlpatterns = [ url(r'(?P<id>[0-9]+)', views.show_post, name='event_show_post') ]
992,547
6701c0a783f201a1dd5968f4f9bbe089a3d0c6be
# name: Jake Graham and Chris Schulz # Plot # 1 # Line plot of epochs vs time to build # ------------------------------------------------- import numpy as np import matplotlib.pyplot as plt # Load Model data m1 = np.load('../data/m1_data.npy')[:, 0] m2 = np.load('../data/m2_data.npy')[:, 0] m3 = np.load(...
992,548
77997fb717db3a744b064c4d502cadaea6d283dc
# Copyright (c) 2010-2013 ARM Limited # All rights reserved. # # The license below extends only to copyright in the software and shall # not be construed as granting a license to any other intellectual # property including but not limited to intellectual property relating # to a hardware implementation of the functiona...
992,549
8c7d9bc7c8d098d27b222477630dbb3be91bb4ea
''' 10. В списке все элементы различны. Поменяйте местами минимальный и максимальный элемент этого списка. Создавать новый список недопустимо. ''' a = [1, 33, 5, 7, 2, 5, 99, 36, 3] x = min(a) y = max(a) print(a) print(id(a)) xi = a.index(x) yi = a.index(y) del a[xi] a.insert(xi, y) del a[yi] a.insert(yi, x) print(a) ...
992,550
82bd71bdfd0f522f4960cb7377792d158d88a1d9
x = 'jigneshjigneshjigneshjigneshjignesh' lst = [] for char in x: if char not in lst: lst.append(char) print("".join(lst))
992,551
93055acef8ec9608a619841b6d7b620918db83fd
from compas.geometry import Frame from compas_fab.robots.ur5 import Robot from compas_fab.backends import AnalyticalInverseKinematics ik = AnalyticalInverseKinematics() robot = Robot() frame_WCF = Frame((0.381, 0.093, 0.382), (0.371, -0.292, -0.882), (0.113, 0.956, -0.269)) for jp, jn in ik.inverse_kinematics(robot,...
992,552
5f992d8b2a8e5c06910877863f575399a5e27a05
# 4poznanski import unittest from kol1 import Bank, Client class MyTest(unittest.TestCase): def setUp(self): self.bank = Bank() self.client1 = Client("Brown") self.client2 = Client("Castley") self.client1.input(100) self.client2.input(100) def test_bank_create(self): ...
992,553
2855cb9a5171b930c13680480fe3ab60e91fe1cb
import bpy import os import json from bpy.props import ( BoolProperty, IntProperty, FloatProperty, FloatVectorProperty, StringProperty, EnumProperty, CollectionProperty, PointerProperty ) from bpy_extras.io_utils import ExportHelper, ImportHelper from .addon import ( ADDON_ID, ADDON_...
992,554
3205f08c89ca98fc11de77fe01a954cd76ee6eeb
def word_count(phrase): words_dict = {} words = phrase.lower().split() output = '' for word in words: for ch in word: if ch.isalnum(): output += ''.join(ch).strip() elif ch == word[-1]: output += '' else: o...
992,555
490170ecc150c7ecbe117c0148f17e4e7f6628ef
import subprocess import os from config import config as Config from common_utils import utils import logging logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(name)s - %(levelname)s - %(message)s') logger = logging.getLogger(__name__) append_command='-only-testing:SecureMailUITests/FileRepositoryTests/t...
992,556
d1769c50a6a4b62bd37691a5252862741ea02387
from .base import * from django.conf import settings import os DEBUG = False ALLOWED_HOSTS = [os.environ['ALLOWED_HOST']] ROOT_URLCONF = 'config.urls.production' SECRET_KEY = os.environ['SECRET_KEY']
992,557
3e2c232e3afe83cd2f6c476d6a844ed725a102c0
for k in range(1,5): print('sqrt({0})={1}',format(k,math.sqrt(k)))
992,558
feafc5bfc96bad833c48134062ac2feb40c52e40
#!/usr/bin/env python import pymongo from shapely.geometry import Polygon from shapely.geos import TopologicalError import matplotlib.pyplot as plt from shapely.validation import explain_validity import math import os import cPickle as pickle if os.path.exists("/home/ggdhines"): base_directory = "/home/ggdhines" ...
992,559
e2057b9e0c54249fa828332069befaaae0d97c3c
# Importación de los módulos import time import redis from flask import Flask # Uso de Flask app = Flask(__name__) # Uso de redis cache = redis.Redis(host='redis', port=6379) # Función: Bucle básico de reintentos que nos permite intentar # nuestra petición varias veces si el servicio de redis no está disponible def...
992,560
6268410353c356127d3eb6307484992c16de5529
# Generated by Django 3.0.8 on 2020-07-23 22:30 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('frontend', '0009_price_created_at'), ] operations = [ migrations.CreateModel( nam...
992,561
ff3d8d50df604d8f96720571bfc4a2ddb84ee8cc
# django imports from django.shortcuts import render_to_response, redirect from django.core.urlresolvers import reverse from django.http import HttpResponseServerError, HttpResponse, Http404 from django.template import RequestContext from django.conf import settings # bvclient imports from bv.libclient.libtalks import...
992,562
ec8833d37bf919bab869f1a72311ced3b2a7d3ab
from abc import ABC, abstractmethod import matplotlib.pyplot as plt import numpy as np from scipy import spatial class FitnessLandscape(ABC): """ Template for building landscapes. """ def __init__(self, limits, resolution): """ Initialize bounds and fitness function. Args: ...
992,563
bb421174d8799951cab385e50727e471c9e522a1
__author__ = 'Nancy' import tornado.ioloop import tornado.web # __________________________________________________ # class MainHandler(tornado.web.RequestHandler): # def __get__(self): # items=["Item 1","Item 2","Item3"] # self.render("template.html",title="My title",items=items) # # application=t...
992,564
fc9555524085fbee2b82dd2790db5a8044c18e9d
import paho.mqtt.client as mqtt from messageHandler import message_handler import time # This is the main script for Assignment 2 of IoT # Its purpose is to subscribe to our local mqtt-sn broker (mosquitto.rsmb in my case) # Every time it receives a message, it will send it to the messageHandler, which will do the work...
992,565
4b633328aa000b10f06372ddaa3d627b2fc70f31
#!/usr/bin/python #encoding: UTF-8 #author: str2num import os import glob import string import syntax_tag import bfunction class Source(object): TYPE = 'source' def __init__(self, infile, args, ctx): self._infile = os.path.normpath(infile) self._outfile = self._infile self._args = arg...
992,566
aa15aa6afc45e7f86f38024ddc8b9b8703c3657c
A = [1,1,1,3,12] for elem in A: if elem == 0: A.remove(elem) A.append(0) print A
992,567
a6babc75c107a5d02aaeb6ad72b00b864988ed31
from custodian.custodian import Custodian from custodian.vasp.handlers import VaspErrorHandler, FrozenJobErrorHandler, \ UnconvergedErrorHandler, MeshSymmetryErrorHandler, MaxForceErrorHandler, \ PotimErrorHandler, NonConvergingErrorHandler, WalltimeHandler from custodian.vasp.jobs import VaspJob vasp...
992,568
8fd6b4d981321162a56ef7c5f7568c2f23420c14
# Copyright Pincer 2021-Present # Full MIT License can be found in `LICENSE` at the project root. from enum import IntEnum class InteractionFlags(IntEnum): """ Attributes ---------- EPHEMERAL: only the user receiving the message can see it """ EPHEMERAL = 1 << 6
992,569
fd121fca0f32621f1666699fa67f7bef268af69f
""" Question class diagram: Question - question: String - option1: String - option2: String - option3: String - option4: String - correct_ans: String + set_question + set_option1 + set_option2 + set_option3 + set_option4 + set_correct_ans + get_question + get_option1 + get_option2 + get_opti...
992,570
29f66b76ff191310e1b653c4ea95cb7f894cc115
import numpy as np import matplotlib.pyplot as plt # load data cpu_sizes = np.loadtxt("cpu_convolution_performance_results.txt")[:, 0] cpu_times = np.loadtxt("cpu_convolution_performance_results.txt")[:, 1:] gpu_sizes = np.loadtxt("gpu_convolution_performance_results_tpb128.txt")[:, 0] gpu_times = np.loadtxt("gpu_conv...
992,571
8daf2e9af28360a2ee035f9ead09cd6d54189546
print('Hello There') print('\r') print('\r') print('\r') print('\r') print('\n') print('\n') print('\n') print('\n') print('\n') print('\n')
992,572
b8b8689ef15482d9f183667ff0d9ff67a865e2be
from django.apps import AppConfig class CompanySearchConfig(AppConfig): name = 'company_search'
992,573
6e601f08acad7ef032e7461cb5e7a37991b0dcc9
from math import floor R, L = list(map(float, input().split(" "))) pi = 3.1415 volume_necessario = (4 * pi * pow(R, 3) / 3) qtd_baloes = floor(L / volume_necessario) print(qtd_baloes)
992,574
2b168192476f256e01158b22b41efcd8b17dee01
import bisect ''' General class that handles values of stochastic processes over time ''' class StochasticProcess: def __init__(self, initial_condition=0.0): self.last_arrival = -1.0 self.arrival_times = [] self.values = [initial_condition] '''Returns time of last arrival; None if n...
992,575
83a36e0b1d1955b11f65bf4fa37850cb541bd47c
#//////////////////////////////////////////////////////////////////////////////////////////////////// #/// \file Half_Life_Calculator.py #/// \brief A python program built to calculate the transcript half lives for the three replicates #/// using time series data. #/// #// Author: Divya Singhal #//////////////...
992,576
bb8b92739e6f11f529acb607870aa388ae80872b
test_list_1 = [['https', 'www'], ['python-izm', 'com']] for value in test_list_1: print(value) for value_1, value_2 in test_list_1: print(value_1, value_2)
992,577
3526f0c72ae4ca1bf79d207d49efc91c823f3c0a
from json import JSONDecodeError import requests from xml.etree.ElementTree import fromstring, ElementTree from flask import request, render_template, redirect, url_for, session,\ flash from werkzeug.security import generate_password_hash, check_password_hash from werkzeug.exceptions import abort, HTTPException ...
992,578
69294457d0cb1086415ee129248ef4a83aab473d
from datetime import datetime from flaskmov import db, login_manager from flask_login import UserMixin from io import TextIOWrapper import csv @login_manager.user_loader def load_user(user_id): return User.query.get(int(user_id)) class User(db.Model, UserMixin): id = db.Column(db.Integer, primary_key=True) ...
992,579
c6f7b1d24305dee67c2ae3c8f4145efb1c3ef2fb
# -*- coding:utf-8 -*- # @Time :2019/12/17 20:07 # @Author :testcode_susu # @Email :2804555260@qq.com # @File :__init__.py.py
992,580
71799cce298dda54761d5cd1dfabb2613fbacdf7
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Fri Jul 6 16:26:15 2018 @author: "Anirban Das" """ from timeit import default_timer as timer import os import json import datetime import sys, logging import uuid , tempfile import azure.functions as func sys.path.append("/home/site/wwwroot/audio-pipeline...
992,581
7f125bb7cf869ef14b1e0d1127e16ee7c5a48d98
import requests from bs4 import BeautifulSoup import pprint response = requests.get('http://news.ycombinator.com/news') soup = BeautifulSoup(response.text, 'html.parser') links = soup.select('.titlelink') subtext = soup.select('.subtext') def create_custom_hn(links, subtext, rank=100): hn = [] for idx, item i...
992,582
fb6e57692f92fbd5e7310f7df272c55e2ce0aee3
from django.conf.urls import url from . import views urlpatterns = [ url(r'^$', views.homepage, name='home'), url(r'^easyrider/$', views.riderpage, name='rider'), ]
992,583
3b0b51c41fdc0b07688e47483410bf0eb8e59130
DEEPL_ENGINE = "deepl" GOOGLE_ENGINE = "google" BING_ENGINE = "bing" DEFAULT_SEQUENCE = [ { "source": "EN", "target": "DE", "engine": BING_ENGINE }, { "source": "DE", "target": "ES", "engine": GOOGLE_ENGINE }, { "source": "ES", "target...
992,584
4ea5275a94cbd585d046fec209eb19c9ee2da419
import sys import os from PyQt4 import QtGui from PyQt4 import QtCore,uic import labrad import time REFRESHTIME = .5 #in sec how often PMT is updated class PMT_CONTROL(QtGui.QWidget): def __init__(self, server, parent=None): QtGui.QWidget.__init__(self, parent) basepath = os.environ.get('LABRADPA...
992,585
617fec84bcdb6e4a8a657c943ad167fdef57748f
from django.conf.urls.static import static from django.urls import path, include urlpatterns = [ path('post/',include('app.dashboard.writer.post.urls')), ]
992,586
d284540c6a617066f9cf049f3d0eee91db8a7523
# -*- coding: utf-8 -*- ############################################################################## # # NCTR, Nile Center for Technology Research # Copyright (C) 2011-2012 NCTR (<http://www.nctr.sd>). # ############################################################################## from osv import osv, fields ...
992,587
3d3e0adc0f9fd29f33105ca0dee8580641e15032
def getWarmingLevels(scenario, warmingLev): wly = {} if scenario == 'rcp85': if warmingLev == 1.5: wly = { 'r1': 2024, 'r2': 2033, 'r3': 2025, 'r4': 2028, 'r5': 2029, 'r6': 2025, 'r7': 2027, } elif warmingLev == 2.: wly = { ...
992,588
b3603ea148016fcd7433a18427e8a997fcc6b044
import ast import math import dateutil.parser import requests import json import copy import mysql import xlrd import xlwt import datetime from mysql import connector class Excel_Data: def __init__(self): self.xl_json_request = [] self.xl_excepted_candidate_id = [] self.rownum = 1 se...
992,589
687a0f204fffa89f47ee5aced772dbaead5500c3
class LIST: def __init__(self): self.l=[] def create(self): n=input("Enter length of list") for i in range(n): a=input("Enter") self.l.append(a) def display(self): print "List:", for char in self.l: print char, p...
992,590
e2aa36a9d5f84720cd8b04264086b723449c0e77
from django.apps import AppConfig class TaskBoardConfig(AppConfig): name = 'task_board'
992,591
c28d8c6a46d5ac83ab9834700fda415da3d721b8
#!/usr/bin/python # -*- coding: utf-8 -*- import json """ 判断obj对象是否继承至cls """ def ischildof(obj, cls): try: for i in obj.__bases__: if i is cls or isinstance(i, cls): return True for i in obj.__bases__: if ischildof(i, cls): return True ex...
992,592
5c2e08f18f182d70c3ed6cb4681db1dd250c99e1
""" Django settings for core project. Generated by 'django-admin startproject' using Django 3.2.5. For more information on this file, see https://docs.djangoproject.com/en/3.2/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/3.2/ref/settings/ """ import os from p...
992,593
f69db90d89854185a8b9bd68b7e38edf0017b67d
#!/usr/bin/python # STANDARD_RIFT_IO_COPYRIGHT # -*- coding: utf-8 -*- # ex:set ts=4 et sw=4 ai: import gi gi.require_version('CF', '1.0') gi.require_version('RwTaskletPlugin', '1.0') gi.require_version('RwTasklet', '1.0') gi.require_version('RwDts', '1.0') gi.require_version('RwDtsToyTaskletYang', '1.0') gi.require...
992,594
36f1604e4f2dc067e40abd34312752592dbe9951
from pathlib import Path from typing import Dict, List, Optional, Tuple, Union from pydantic import BaseModel, FilePath, DirectoryPath, AnyUrl from sito_io.dctypes.resource import UriKind, Resource UriT = Union[FilePath, AnyUrl] OptionsT = Optional[Union[Dict[str, str], List[Tuple[str, str]], List[str]]] # todo: pend...
992,595
8cf13d115f19779e50e7cf4b89d4b8f10cc72eb0
from datetime import datetime from bs4 import BeautifulSoup import requests def telasi_bil (ID,now): frst_post = requests.get('http://my.telasi.ge/customers/info/%s' % ID) soup = BeautifulSoup(frst_post.text,'html.parser') result = [] for code in soup.findAll('code'): result.append(code.text)...
992,596
609ad52a2ca76c71e306f23bc997c451a45733b6
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'd:\Users\Administrator\Desktop\My_LED\main.ui' # # Created by: PyQt5 UI code generator 5.15.0 # # WARNING: Any manual changes made to this file will be lost when pyuic5 is # run again. Do not edit this file unless you know what you are doin...
992,597
2e6ed45b4864de2dd3422ddd9c98c806d9a91876
# 13 octobre 2017 # astro_v3.py from pylab import * import os def B3V_eq(x): """ :param x: abcsisse du point de la ligne B3V dont on veut obtenir l'ordonnee :return: ordonnee du point de la ligne B3V correspondant a l'abscisse x (dans un graphique u-g vs g-r) """ return 0.9909 * x - 0.8901 def...
992,598
5f3d522c5c2f48cffeebaa46a399aebfefef4839
import xml.dom.minidom import sys import re import os #<type 'str'> from struct import * from types import * global NameSection, StringSection, ByteSection, Section1, UintSection, DevSection global DeviceID UintSection = [] ByteSection = [] StringSection =[] NameSection = [] DevSection = [] DeviceID = [] Section1 = [...
992,599
1b1ed24fc11f117ccd75724017d9efc4fc6f6b2f
import os import streamlit as st import streamlit.components.v1 as components from streamlit_hgb import hgb, reference_hash, load_samples, hgb_run import pandas as pd import gffutils import glob from streamlit_drawable_canvas import st_canvas import time DB = "hg38.genes.db" _RELEASE = True # app: `$ streamlit run mai...