text stringlengths 8 6.05M |
|---|
# from scrapy import Item,Field
from scrapy.linkextractors import LinkExtractor
import scrapy
from ..items import book_info
#---字段定义放在了items.py中---
# class book_info(Item):
# name = Field()
# price = Field()
# rank = Field()
# ISBN = Field()
# stockamount = Field()
# reviewamount = Field()
class bookspider_mor... |
#!/usr/bin/env python3
"""
Example script for plotting reaction times across all sessions for a cohort of mice as a
lineplot of averages.
"""
import os
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
import sys
import pandas as pd
from reach import Cohort
from reach.session import Outcomes
... |
#!/usr/bin/env python
import sys
import matplotlib.pyplot as plt
import class_analyse_tools as tools
if __name__ == '__main__':
iteration = list()
perf_rand = list()
perf = list()
perf_rand_sort = list()
perf_sort = list()
diff= list()
iteration, perf, perf_rand = tools.load_class_eval(sys.argv[1])
iterat... |
# -*- coding:utf-8 -*-
# Created by LuoJie at 11/16/19
import re
import jieba
import pandas as pd
from utils.multi_proc_utils import parallelize
from utils.config import train_seg_path, test_seg_path, merger_seg_path, user_dict, train_x_seg_path, test_x_seg_path, \
train_x_pad_path, train_y_pad_path, test_x_pad_pat... |
"""Preprocess the Yelp Dataset"""
import json
def read_and_process_businesses(json_file_path):
"""Read in the json dataset file and process it line by line."""
post_codes = {}
num_businesses = 0
with open(json_file_path) as fin:
for line in fin:
line_contents = json.loads(line)
... |
from ucfg_updater import *
from ucfg_utils import info, error
from ucfg_main import ConfigUtilities
import os
import re
from _use import USEUpdater
class UUpdater(USEUpdater):
def printDescription(self, options):
info(options, "Updates Unicore/X configuration from pre 6.6.0 versions to the 6.6.0 syntax")
def... |
# import labop
# from labop.lib.library_type_inference import primitive_type_inference_functions
#
# ##############################
# # Class for carrying a typing process
#
#
# class ProtocolTyping:
# def __init__(self):
# self.flow_values = {} # dictionary of labop.Flow : type value, includes subprotocol... |
import string
import os
from datetime import datetime
from django.conf import settings
from django.contrib.auth.models import User
from django.utils.crypto import get_random_string
from celery import shared_task, task
from subprocess import Popen
from eventlogUploader.models import Document
import shutil
@shared_task... |
import datetime
import PackageStatus
class Package:
def __init__(self, id, address, city, state, zip, delivery_deadline, mass, special_notes):
self._id = id
self._address = address
self._city = city
self._state = state
self._zip = zip
self._delivery_dea... |
#!/usr/bin/env python
# author (alterer is a more suitable word) : Guillaume Pierron - "Guiwiz"
#
# This script is largely based on the work of Arnaud Bertrand - "Arn-O"
# You can find his original work (a wonderful python script to control XBMC) here :
# https://github.com/Arn-O/py-xbmc-remote-controller
#
# This scr... |
# -*- coding: utf-8 -*-
import scrapy
import os
import csv
class OnlineradioboxSpider(scrapy.Spider):
name = 'onlineradiobox'
allowed_domains = ['onlineradiobox.com']
start_urls = ['https://onlineradiobox.com/']
def parse(self, response):
links = response.xpath('.//*[@class="catalog__mainland... |
import os
import sys
sys.path.insert(0, 'scripts')
import experiments as exp
def get_possible_strategies():
return ["SPR", "EVAL"]
def get_jointsearch_datasets():
root_datadir = os.path.join(exp.datasets_root, "joint_search")
datasets = {}
for dataset in os.listdir(root_datadir):
datasets[dataset] = os... |
# NAME EMOJI EMOJIXPRESS, MIL. INSTAGRAM, MIL. TWITTER, MIL.
# Grinning image 2.26 1.02 87.3
# Beaming image 19.1 1.69 150
# ROFL image 25.6 0.774 0
# Tears of Joy image 233 7.31 2270
# Winking image 15.2 2.36 264
# Happy image 22.7 4.26 565
# Heart Eyes image 64.6 11.2 834
# Kissing image 87.5 5.13 432
# Thinking imag... |
from .model import FusionModel
from .poisson import PoissonFusion
|
def parse_stringAlphabetic(s):
i = 0
j = 0
temp = str(s[i])
string_list = []
index = 1
while True:
j = i + 1
if s[i] <= s[j]:
temp += str(s[j])
i += 1
print temp
else:
i = j
string_list[inde... |
# ############################################################################ #
# #
# ::: :::::::: #
# error.py :+: :+: :+: ... |
import config
import gui
import config_io
import usb_reader
import midi_output
import midi_event_sender
import midi_key_router
import hmi_event_interpreter
from threading import Thread
STORAGE_FILENAME = "configuration.sav"
DEVICE_VENDOR_ID = 0x17CC
DEVICE_PRODUCT_ID = 0x1410
class kontrol_main:
def __init__(se... |
#!/usr/bin/python3
def decode_string(code, upper_limit):
lower_limit = 0
for e in code:
if e in ['F', 'L']:
upper_limit = (lower_limit + upper_limit) // 2
elif e in ['B', 'R']:
# I think the +1 is needed just because we start at 0, but i'm not sure
lower_limit... |
# def foo():
# print("starting...")
# while True:
# res = yield 4
# print("res:",res)
# g = foo()
# print(next(g))
# print("*"*20)
# print(g.send(7))
# print(next(g))
def foo(num):
print("starting...")
while num<10:
num=num+1
yield num
for n in foo(0):
... |
from scipy.fftpack import fft
import scipy.signal as signal
import numpy as np
def get_fft(y, t):
N = len(y)
fft_y = fft(y)
fft_freq = np.linspace(0., 1./(2. * t), N//2)
fft_rs = np.reshape(fft_y, (N))
fft_rs = 2.0/N * np.abs(fft_rs[0:N//2])
return (fft_rs, fft_freq)
def get_dominant_periods... |
# Copyright 2022 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from pants.backend.build_files.fmt.base import FmtBuildFilesRequest
from pants.backend.python.lint.yapf import subsystem as yapf_subsystem
from pants.backend.python.lint.yapf.rules import ... |
#!/usr/bin/python
#-*-coding:UTF-8-*-
import random
import struct
def work():
#产生一个随机浮点数
nNum = random.randint(1,10)
if nNum == 1:
nValue = random.uniform(0,1)
elif nNum > 1 and nNum < 10:
nValue = random.uniform(1,5)
else:
nValue = random.uniform(5,6)
#“HH”以两个字节为分界,把4个字节... |
from rest_framework import serializers
from .models import Room, Time
class RoomSerializer(serializers.ModelSerializer):
class Meta:
model = Room
fields = (
'name',
'updated_at',
'created_at',
'pk')
class TimeSerializer(serializers.ModelSerializ... |
#!/usr/bin/python
#-*- coding: utf-8 -*-
import tensorflow as tf
from tensorflow.examples.tutorials.mnist import input_data
import types
# ==========================================================
#
# Dataset loading
#
mnist = input_data.read_data_sets("./samples/MNIST_data/", one_hot=True)
# =====================... |
from django_filters.rest_framework import DjangoFilterBackend
from rest_framework import generics, filters
from rest_framework.exceptions import NotFound
from workprogramsapp.expertise.models import UserExpertise, ExpertiseComments, Expertise
from workprogramsapp.expertise.serializers import UserExpertiseSerializer, C... |
class FindMilk(object):
def __init__(self, width=10):
self.width = width
self.milk_pos = (width-1, width-1)
self.neg_pos = [(6,6), (4,5), (3,4), (8,7), (2,1), (6,3), (3,8), (4,9), (8,0), (7,9)]
self.pos_pos = [(1,3), (7,6), (4,4), (7,4), (5,5)]
self.actions = [0, 1, 2, 3]
... |
import requests
from bs4 import BeautifulSoup
# I change the size of the film name data set from 500(I mentioned in Milestone1)to 200.
# Since the API I need to use in next steps has a 1000 limits per day.
# I don't want my program can only run two times a day...
def get_film_name():
name_list = []
pages = [1,... |
# -*-coding: UTF-8-*-
from numpy import *
import matplotlib.pyplot as plt
import random
'''加载文件,返回数据集和标签集'''
def openFile(fileName):
dataSet = loadtxt(fileName, str, delimiter=',')
data = dataSet[1:, 0:len(dataSet[0])-1].astype(float)
label = dataSet[1:, len(dataSet[0])-1].astype(float)
# print(dataSe... |
import sys
import BFS
import Common
startState = Common.read_data_set(sys.argv[1]);
goalState = Common.read_data_set(sys.argv[2]);
outfile = sys.argv[4];
path = ""
if sys.argv[3] == 'dfs':
path = Common.dfs_main(startState,goalState);
elif sys.argv[3] == 'bfs':
path = BFS.BFS(startState, goalState);
elif sys.... |
# Andrew算法,学到了但没完全学到,太🐂了
# 凸包定理 O(logn)
class Solution:
def outerTrees(self, trees: List[List[int]]) -> List[List[int]]:
# 判断是否逆时针左拐
def cross(p: List[int], q: List[int], r: List[int]) -> int:
return (q[0] - p[0]) * (r[1] - q[1]) - (q[1] - p[1]) * (r[0] - q[0])
n = len(trees)
... |
#!/usr/bin/env /data/mta/Script/Python3.8/envs/ska3-shiny/bin/python
#####################################################################################
# #
# create_top_sun_angle_html.py: creating the top sun angle html page ... |
#!/usr/bin/python3
import re
# from p6Driver import *
from p5Dict import *
from exceptionHandler import *
verbose = False
def tokenizePrint(line):
matchObj = line.split()
for item in matchObj:
if item.upper().startswith("\"") and item.endswith("\""):
print(item[1:-1],end=" ")
else:... |
import configparser
import logging
import os
class App(object):
def __init__(self):
"""
Initiate the different parameters, i.e. import all the default settings from the parameters.ini file.
"""
self.feature = None
self.classifier = None
# Instantiate Logging (chan... |
import requests
from lxml import html
sess = requests.Session()
headers = {
'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36',
}
url = "https://stackoverflow.com/"
r = sess.get(url, headers=headers)
tree = html.fromstring(r.text)
l... |
class Banque:
_titulaires = 0
_nomBanque = ""
def __init__(this, nomBanque):
this_nomBanque = nomBanque
def creerClient(this, nom, prenom, comptes = []):
this._titulaires.append(Titulaire(nom, prenom, comptes))
def supprimerClient(this, nClient):
this._titulaires.rem... |
number = input("Input number:")
print(int(number[0])+int(number[1])+int(number[2]))
|
from config import wallet_address, wallet_password
from connector import contract_instance, web3
def get_end_blocks():
result = contract_instance.getEndBlocks()
return result
def check_to_end(index):
web3.personal.unlockAccount(wallet_address, wallet_password)
contract_instance.checkToDelete(index, ... |
val = float(input('Qual o valor do produto? '))
print('Digite a forma de pagamento:')
print('[1] À vista no dinheiro')
print('[2] À vista no cartão')
print('[3] Até 2x no cartão')
print('[4] 3x ou mais no cartão')
tip = int(input('Qual sua opção de pagamento? '))
if(tip == 1):
pagamento = val*0.9
elif(tip == 2):
... |
from django.apps import AppConfig
from watson import search as watson
class BooksConfig(AppConfig):
name = 'books'
def ready(self):
Product = self.get_model("Product")
watson.register(Product)
|
from django.contrib import admin
from .models import Decade, Fad
# Register your models here.
admin.site.register(Decade)
admin.site.register(Fad) |
import pytest
import pulp
from .core import Problem, Variable, negate, logical_and, logical_or, minimum, maximum, logical_xor, implies
from .errors import NonBinaryVariableError, CitrusError, assert_binary
def test_that_negate_produces_negated_variable():
p = Problem('negation test', pulp.LpMinimize)
x = p.mak... |
#Defining a script
'''
Introduction:
1. A function is a self block of code
2. A function can be called as section of a program that is written once and can be executed
whenever required in the program, thus making code reusability
3. A function is a subprogram that works on data and produce same output.
Types of f... |
#Finding the product of numbers upto a limit
n=int(input("Enter the limit"))
product=1
for i in range(1,n+1):
product=product*i
print("Product of numbers is:",product) |
from time import sleep # Library will let us put in delays
import RPi.GPIO as GPIO # Import the RPi Library for GPIO pin control
button1_pin=12 # Button 1 is connected to physical pin 12
GPIO.setmode(GPIO.BOARD) # Use Physical Pin Numbering Scheme
GPIO.setup(button1_pin,GPIO.IN,pull_up_down=GPIO.PUD_UP)
# Make butto... |
import socket
import threading
import logging.config
import os
import re as reg
import client_protocol_support
import Queue
from Tkinter import *
import ConfigParser
import ctypes
import time
import json
ENCODING = "utf-8"
USERNAME_MAX_LENGTH = 15
MAX_ROOM_NAME_LENGTH = 15
ROOM_USERS_REFRESH_RATE = 200
CONFIG_FILE = ... |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.4 on 2017-02-01 01:29
from __future__ import unicode_literals
import django.core.validators
from django.db import migrations, models
import up_ride_finder.rides.validators
class Migration(migrations.Migration):
dependencies = [
('rides', '0004_auto_2017... |
from django.db import models
class Team(models.Model):
number = models.PositiveSmallIntegerField()
MATCH_TYPE_CHOICES = (
('P','Practice'),
('Q','Qualification'),
('E','Elimination'),
)
class Match(models.Model):
number = models.PositiveSmallIntegerField()
type = models.CharField(max_length=1, choices=MATCH_TY... |
import os
path = "D:/deeplab/tensorflow-deeplab-v3/grass/VOCdevkit/VOC2012/SegmentationClassVisualization" #文件夹目录
files= os.listdir(path) #得到文件夹下的所有文件名称
s = []
for file in files: #遍历文件夹
if not os.path.isdir(file): #判断是否是文件夹,不是文件夹才打开
str = ""
str = os.path.split(file)[-1].split('.')... |
# SE
from common import *
debug_control = [
boolOut('LOOPBACK', 'Normal', 'Loopback', OSV = 'MAJOR', VAL = 0,
DESC = 'Enable internal data loopback'),
boolOut('COMPENSATE', 'Normal', 'Disabled', OSV = 'MAJOR', VAL = 0,
DESC = 'Disable internal delay compensation')]
trigger_pvs = [] #... |
#!/usr/bin/python
# -*- mode: python -*-
'''
Looks up in database for nearby srtm files. Downloads if necessary and
then processes them with GDAL
'''
import os , shutil , psycopg2 , configparser , inspect
from viewsheds import initGrassSetup , grassViewshed , grassCommonViewpoints
from subprocess import call
from pyp... |
with open("C:\\Users\\Anna\\Desktop\\Learning Community\\copypoem.txt", "r") as infile, open("C:\\Users\\Anna\\Desktop\\Learning Community\\blank.txt","w") as outfile:
for line in infile:
outfile.write(line[5:])
|
import cv2
import numpy as np
import dlib
import matplotlib.pyplot as plt
import matplotlib.patches as patches
from PIL import Image
path = 'Detection/data/Image/Ai_Sugiyama_0001.jpg'
im = Image.open(path)
im = np.array(im)
cv2.imshow("dsa", im) |
penny_Value = 1
nickel_Value = 5
dime_Value = 10
quarter_Value = 25
dollar_Value = 100
print("\nMoney Counting Game")
pennies = int (input("Enter the number of pennies: "))
nickels = int (input("Enter the number of nickels: "))
dimes = int (input("Enter the number of dimes: "))
quarters = int (input("Enter the number... |
#!/usr/bin/env python
import os
from PIL import Image
from tqdm import tqdm
import os.path
import pathlib
def cropimage_files(foldar_name,first_num,last_num,Acrop,Bcrop,Ccrop,Dcrop,time):
basename = os.path.basename(foldar_name)
p_sub = pathlib.Path(foldar_name)
p_sub_name= str(p_sub.parent)
for x in... |
import pytest
from server.ServiceStore import *
TEST_ELEMENT_NAME = "test_element"
TEST_ELEMENT_DATA = {"Value":"1", "Color":"red"}
TEST_CONTROL_NAME = "test_control"
TEST_CONTROL_DATASET = {"value":{"desc":"Value to set the light", "type":"number"},
"color":{"desc":"Color to set the light", "... |
import re
import requests
import json
import os
import pdfkit
from bs4 import BeautifulSoup
from urllib.parse import quote
from time import sleep
import random
import datetime
def get_data(url, headers, before=None, after=None):
"""
before 默认为None,否则请填入内容,格式为:'2021-06-31 21:00',所有小于等于该时间的才会被获取
after 默认为No... |
def egypt(num,den):
ciel = 0
if(num==1):
print('1/',den)
elif(num<den):
if(den%num == 0):
print('1/',den//num)
else:
ciel = den//num +1
print('1/',ciel)
egypt((num*ciel-den),(ciel*den))
egypt(12,13) |
""" Interpolate horizon from a carcass. """
#pylint: disable=attribute-defined-outside-init
from textwrap import indent
from .horizon import HorizonController
class Interpolator(HorizonController):
""" Convenient class for carcass interpolation. """
def train(self, dataset=None, cube_paths=None, horizon_pat... |
from django.db import models
# Create your models here.
class Cart(models.Model):
user_id = models.IntegerField()
goods_id = models.IntegerField()
count = models.IntegerField()
goods_name = models.CharField(max_length=50)
pic = models.CharField(max_length=250)
price = models.DecimalField(max_... |
import multiprocessing
import string
import time
def readPuzzle(fileName):
with open(fileName) as File:
lines = File.readlines()
lines = (filter(lambda line: line!="\n",lines))
return [list(string.replace(line," ","")) for line in lines]
def readWordList(fileName):
with open(fileName) as File:
lines = File... |
# coding=UTF-8
import argparse
parser = argparse.ArgumentParser(description='Um programa de exemplo.')
parser.add_argument('--frase', action='store', dest='frase',
default='Hello, world!', required=False,
help='A frase que deseja imprimir n vezes.')
parser.add_argument('-n', ... |
# 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 (the
# "License"); you may not u... |
from .kitti_eigen_cameras_calibration import KittiEigenCamerasCalibration
from .video_dataset_adapter import VideoDatasetAdapter
from ..data_transform_manager import DataTransformManager
from ..unsupervised_depth_data_module import UnsupervisedDepthDataModule
from ..video_dataset import VideoDataset
class KittiEigenV... |
from django.shortcuts import render
import getpass
import requests
from bs4 import BeautifulSoup
# Create your views here.
from django.http import HttpResponse
import os, sys
cwd=os.getcwd()
cwd+="/template"
sys.path.insert(0, cwd)
def home(request):
return render(request, 'home.html')
def calculate_sgpa(req... |
#
# @lc app=leetcode.cn id=76 lang=python3
#
# [76] 最小覆盖子串
#
# @lc code=start
class Solution:
def minWindow(self, s: str, t: str) -> str:
need, window = {}, {}
# 初始化need字段,每个字符分别需要出现几次
for c in t:
if c in need:
need[c] += 1
else:
need[... |
from pyzabbix import ZabbixAPI
import datetime
import time
zapi=ZabbixAPI(server="http://192.168.44.4/zabbix")
try:
#zapi.login(user="userforapi",password="'Pakkass##18!'")
zapi.login(user="Admin",password="zabbix")
print("Yes Connected")
count=0
except:
print("Ops getting issue in connecting....")
ale... |
import cv2
import tensorflow as tf
CATEGORIES = ['Dog','Cat']
def prepare(filepath):
IMG_SIZE = 96
img_array = cv2.imread(filepath, cv2.IMREAD_GRAYSCALE)
new_array = cv2.resize(img_array,(IMG_SIZE,IMG_SIZE))
return new_array.reshape(1, IMG_SIZE, IMG_SIZE, 1)
model = tf.keras.models.load_mo... |
import pandas as pd, numpy as np
from sklearn.model_selection import train_test_split
data = pd.read_csv('../processed_data/processed_wikihow.csv')
X_train, X_test = train_test_split(data, test_size=0.1, random_state=42)
print(X_train, X_test.shape) |
#User Input
"User input is simple compared to java and javascriipt"
"You assign a varibale and use the input()methid following the question or prompt "
username = input("What is your name ")
print(username)
"When python takes in numbers they are converted to string thus you need to convert them to numbers in order t... |
import abc
class AbstractEnv(metaclass=abc.ABCMeta):
@staticmethod
@abc.abstractmethod
def dynamics(self,state,act,rng):
'''Generate next state & reward after taking action 'act' from state 'state', using provided rng'''
'''All rewards should be in the range (0,1)'''
@staticmethod
@abc.abstractmethod
def ... |
i=int(input("Enter a number:"))
for i in[]:
print(i)
print(i)
print("BLASTOFF!!")
|
n = int(input())
code = input().split('W')
result = [len(c) for c in code if c != '']
print(len(result))
print(*result)
|
#!/usr/bin/python3
"""
Function that divides all elements of a matrix.
matrix (int, float)
div (int, float)
"""
def matrix_divided(matrix, div):
"""
Function that divides all elements of a matrix.
"""
msj = "matrix must be a matrix (list of lists) of integers/floats"
if type(matrix) != list or mat... |
from django.db import models
from django.template.defaultfilters import slugify
from django.urls import reverse
from django.contrib.auth.models import User
from django.core.files import File
# Create your models here.
class Livre(models.Model):
titre = models.CharField(max_length = 50)
slug_title = models.Slug... |
from src.parameters import *
import numpy as np
import os
import matplotlib.image as mpimg
# Extract patches from a given image
def img_crop(im, w, h):
list_patches = []
imgwidth = im.shape[0]
imgheight = im.shape[1]
is_2d = len(im.shape) < 3
for i in range(0,imgheight,h):
for j in range(0... |
"""
Created by Alex wang
on 20170512
"""
def ifelse(weight):
body = "fat" if weight > 120 else "thin"
print(body)
def test_cnumerate():
print("test enumerate.........")
str_list = ["one", "two", "three", "four"]
for i, str in enumerate(str_list):
print("{}\t{}".format(i, str))
def test... |
inpt = int(input ("Enter Number: "))
for i in range(inpt):
print("hello")
|
#coding:utf-8
list = [1,"physics","chinese",2]
print list[0:]
list[3]= 'happy'
print list[2:3]
del list[1]
print list #列表可以删除和更新 |
lst=[10,12,13,16,20,25]
searchF=13
def searchL(lst,frm,to,findN):
if to>=frm:
centerIndex=int((frm+to)/2)# int(len(lst)/2)
if findN==lst[centerIndex]:
return centerIndex
if findN<lst[centerIndex]:
return searchL(lst,frm,centerIndex-1,findN)
else:
return searchL(lst,centerIndex+1,t... |
import json
import pandas as pd
import numpy as np
import folium
from folium.plugins import FloatImage
import vincent
import branca
import branca.colormap as cm
from PIL import Image, ImageDraw, ImageFont
def create_title_image(title, image_path):
W, H = (500,200)
image = Image.new("RGBA",(W,H))
draw =... |
from math import factorial
def tarkista(n,p):
if p < 0 or n < 0:
print("Pallojen määrän oltava positiivinen luku.")
elif p > n:
print("Arvottavia palloja saa olla enintään pallojen kokonaismäärän verran.")
else:
a = True
return a
def laske(n,p):
t = int(n-p)... |
import random
import subprocess
from base import *
import clsTestService
import enums
from general import General
from selenium.webdriver.common.keys import Keys
try:
import win32com.client
except:
pass
# This class is for multiple upload
class UploadEntry():
filePath = ''
name = ''
description = ... |
def solution(players, callings):
players = dict(zip(players, [i for i in range(len(players))]))
players_index = dict(zip([i for i in range(len(players))], players))
for i in callings:
p1, p1_index = i, players[i]
p2, p2_index = players_index[p1_index - 1], p1_index - 1
players[p1],... |
import os
import requests
from .Photo import Photo
from .repository import UnsplashRepository
class UnsplashService:
def __init__(self, repository: UnsplashRepository):
self.base_url = "https://api.unsplash.com"
self.access_key = os.environ["UNSPLASH_ACCESS_KEY"]
self.repository = reposito... |
from enum import Enum
class tags(Enum):
discover = 0
acknowledge = 1
authenticate = 2
request_auth = 3
auth = 4
message = 10
message_ack = 11
sub_declare = 12
sub_removal = 13
sub_ack = 14
data = 10... |
from django.shortcuts import render
from .models import Product
from orders.models import Order
from .forms import RegisterForm
from .forms import LoginForm
from .forms import ResetTelForm
from products.models import Type
from products.models import Photo
from django.contrib.auth import authenticate
from django.contrib... |
__author__ = 'Matthijs'
class RequestVars:
POST = {}
GET = {}
Path = ''
|
from .utils import decorator
class Test(object):
def __init__(self, accept, description, host, port, cafile=None, name=None, forced_result=None):
self.accept = accept
self.description = description
self.host = host
self.port = port
self.cafile = cafile
if name is N... |
from django.contrib import admin
from accounts.models import UserProfile
from django.contrib.auth.models import User
from django.contrib.auth.admin import UserAdmin as BaseUserAdmin
class UserAdminInline(admin.StackedInline):
model = UserProfile
class UserAdmin(BaseUserAdmin):
inlines = (UserAdminInline, )
... |
import argparse
from argparse import RawTextHelpFormatter
desc = """==================================================================================================
Bias factorized, base-resolution deep learning models of chromatin accessibility reveal
cis-regulatory sequence syntax, transcription factor footp... |
from django.urls import path
# from .views import MovieListView, MovieDetailView, MovieCreateView, MovieUpdateView, MovieDestroyView
from rest_framework.routers import DefaultRouter
from .views import MovieViewSet
# urlpatterns = [
# path('', MovieListView.as_view()),
# path('<pk>', MovieDetailView.as_view()),... |
#!/usr/bin/env python3
import os
import sys
import unittest
pkg_root = os.path.abspath(os.path.join(os.path.dirname(__file__), '..')) # noqa
sys.path.insert(0, pkg_root) # noqa
from data_store_agent import DataStoreAgent
class CleanupTestBundles(unittest.TestCase):
test_bundle_query = {
"query": {
... |
import numpy as np
from scipy.optimize import curve_fit
from matplotlib.pyplot import figure, show, cm, xticks, yticks
import full_henon as fh
import helper as he
def closest(array, val):
""" Finding closest value in list """
# lst = np.asarray(lst)
ind = (np.abs(array - val)).argmin()
retu... |
from .response import ResponseViewSet
|
# coding=utf-8
import logging
import os.path
import uuid
import tornado.httpserver
import tornado.ioloop
import tornado.options
from tornado.options import define, options
import tornado.web
import tornado.websocket
from setting import TORNADO_SETTINGS
define("port", default=8000, help="run on the given port", type=in... |
import csv
import random
import string
from sklearn.feature_extraction.text import CountVectorizer
from sklearn.naive_bayes import MultinomialNB
from sklearn.svm import LinearSVC
from sklearn.linear_model import LogisticRegression
from sklearn import cross_validation
from nltk.stem.porter import *
# Parameters
vali... |
# -*- coding: utf-8 -*-
import uuid
import inject
import logging
import base64
from model.registry import Registry
from model.mail.mail import Mail
from model.files.files import FileDAO
from model.laboralinsertion.inscription import InscriptionDAO
import model.laboralinsertion.user
import model.users.users
class E... |
import logging
from openprocurement.auction.utils import get_latest_bid_for_bidder, make_request
from openprocurement.auction.worker.auctions import multilot
from openprocurement.auction.worker.utils import prepare_service_stage
from openprocurement.auction.worker.journal import AUCTION_WORKER_API_APPROVED_DATA
FORM... |
from django.shortcuts import render
from .forms import ClientForm
from orders.models import Order
from products.models import Photo
from products.models import Type
from products.models import Category
from products.models import Product
from systemoptions.models import Systemoptions
from blogs.models import Comment
fr... |
import numpy as np
import cv2
from reference_line import ReferenceLine
class PeaksIdentifier:
def __init__(self, triangles, ref_line=None):
self.triangles = triangles
if ref_line is None:
self.ref_line = ReferenceLine(triangles)
else:
self.ref_line = ref_line
d... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.