text stringlengths 38 1.54M |
|---|
from flask_restful import Resource
from flask import jsonify
from dnd5eApi.models.class_name import ClassName as ClassNameModel
from dnd5eApi.schema.class_name import class_name_schema
from dnd5eApi.schema.class_name import class_names_schema
class ClassName(Resource):
def get(self, id=None):
if id is No... |
import os
import sys
import sqlite3
import hashlib
current_directory = os.getcwd()
database_name = '../psps.db'
def db_check():
try:
open(database_name)
return True
#database does exist
except IOError as e:
if e.args[0] == 2:
... |
# A script that removes all your stared repos.
# > python3 reset_stars.py --token <token>
import argparse
import csv
import requests
import sys
def get_stars(token):
repos = []
url = "https://api.github.com/user/starred?per_page=100"
while True:
if token:
url += f"&access_token={token... |
from tensorflow.examples.tutorials.mnist import input_data
#读取数据
DATA_DIR = '../data/fashion'
fashion_mnist = input_data.read_data_sets(DATA_DIR, one_hot=False, validation_size=0)
train_images = fashion_mnist.train.images
#train_images = train_images.reshape((60000,28,28))
train_labels = fashion_mnist.train.labels
... |
from __future__ import print_function, division, absolute_import
from .compression import compressions, default_compression
from .core import dumps, loads, maybe_compress, decompress, msgpack
from .serialize import (serialize, deserialize, Serialize, Serialized,
to_serialize, register_serialization)
from . import... |
import numpy as np
from CamRunnable import camVideoStream
import math as m
from time import sleep
import cv2
frame_lim = 2000 # Number of independent frames to analyze
curr_frame = 0
previous_time = -1
curr_frame = 0
cam_holder = camVideoStream(0,30,640,480)
cam_holder.start()
# initialize the first frame in th... |
color = "blue"
#color가 레드가 아니면 그린, 그린이 아니면 , 퍼플 퍼플이 아니면 , 블루
if color == "red":
print("It's a red")
elif color == "green":
print("It's a green")
elif color == "purple":
print("It's a purple")
elif color =="blue":
print("It's a blue") |
# This files contains your custom actions which can be used to run
# custom Python code.
#
# See this guide on how to implement these action:
# https://rasa.com/docs/rasa/custom-actions
# This is a simple example for a custom action which utters "Hello World!"
from typing import Any, Text, Dict, List
import requests... |
# Copyright © 2021 Novobi, LLC
# See LICENSE file for full copyright and licensing details.
from odoo import api, fields, models, _
class OpportunityTask(models.Model):
_name = "opportunity.task"
_description = 'Opportunity Tasks'
name = fields.Many2one('opportunity.task.tag', string='Task', help='The t... |
import cv2
import numpy as np
# simplify
image = cv2.imread('./assets/square.jpg')
ratio = image.shape[0] / float(image.shape[0])
reverse = 255 - image
gray = cv2.cvtColor(reverse, cv2.COLOR_RGB2GRAY)
blurred = cv2.GaussianBlur(gray, (5, 5), 0)
thresh = cv2.threshold(blurred, 60, 255, cv2.THRESH_BINARY)[1]
_, cnts, ... |
"""Represent a socket."""
from pytradfri.const import ATTR_DEVICE_STATE, ATTR_SWITCH_PLUG
class Socket:
"""Represent a socket."""
def __init__(self, device, index):
self.device = device
self.index = index
@property
def state(self):
return self.raw.get(ATTR_DEVICE_STATE) == 1
... |
class Solution:
def removeElement(self, nums:list, val:int) -> int:
if not nums:
return 0
i, j = 0, len(nums) - 1
while i < j:
if nums[i] == val and nums[j] != val:
nums[i], nums[j] = nums[j], nums[i]
i += 1
j -= 1
... |
"""
Given: A positive integer n<=7
Return: The total number of permutations of length n, followed by a list of all
such permutations (in any order).
"""
def perm_help(fixed, to_perm):
# nothing left to permute
if len(to_perm) == 1:
return [1, [fixed+to_perm]] # bc fuck space efficiency amirite? :D
# fix one numb... |
import time
sent_1 = "I'm the first sentence."
print(sent_1)
# write your code here
time.sleep(10)
sent_2 = "And I'm the second sentence."
print(sent_2)
|
import os
import time
import numpy as np
import matplotlib.pyplot as plt
from pylab import grid
from mpl_toolkits.mplot3d import Axes3D
import matplotlib.cm as cm
from pylab import grid
from scipy.stats import norm
import matplotlib.mlab as mlab
from numpy import linalg as LA
from keras.models import Sequential,load_m... |
from django.http import HttpResponse
from django.template.loader import render_to_string
from user_agents import parse
from apps.student.decorators import decorator
from apps.student.services.reportservice import ReportService
from apps.student.queries.reportquery import ReportQuery
from apps.student.forms.report.repo... |
#program menghitung biaya bensin mobil
#import waktu
import time
#variabel assigment
jarakKota=795
print('Pak Budi Mengendarai Mobil dari kota A ke kota C dengan jarak 795Km' )
#operasi perhitungan
bensin=1
jarakMinimal=12
bensinDigunakan=jarakKota/jarakMinimal
#kasih jeda 2 detik
time.sleep(2)
#menampilkan Hasil
... |
from django.conf.urls import patterns, include, url
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
url(r'^longitude/', include('longitude.urls')),
url(r'^mygym/', include('mygym.urls')),
url(r'^admin/', include(admin.site.urls)),
)
|
f = open('A-large.in', 'rU')
lines = f.readlines()
t = int(lines[0])
out = open('A-large.out', 'a')
for i in range(1, t+1):
n = int(lines[i])
if n == 0:
out.write('Case #'+str(1)+': INSOMNIA\n')
else:
last_seen=n
count_i = 1
seen_numbers = ''
seen_all = False
while(not seen_all):
last_s... |
import numpy as np
import math
import matplotlib
import cv2
import glob
import shutil
import time
import sys
import os.path as osp
from matplotlib.patches import Polygon
from threading import Thread, Lock
from Queue import Queue
import threading
def add_path(path):
if path not in sys.path:
sys.path.insert(0... |
from django.db import models
# Create your models here.
class LoginTable(models.Model):
id = models.AutoField(primary_key=True)
name = models.CharField(max_length=30)
mail = models.EmailField(max_length=50, unique=True)
password = models.CharField(max_length=50) |
import serial
import time
import bluetooth
from datetime import datetime
from temps import *
try:
from camion import camioncito
except:
pass
bd_addr = "B8:27:EB:79:24:4F"
port = 1
tConPast = None
tRefPast = None
tConNow = None
tRefNow = None
hConPast = None
hRefPast = None
hConNow = None
hRefNow = None
deltatie... |
from django.conf import settings
from purl import Template
import requests
from .models import SimilarResponse
API_URL = Template("http://developer.echonest.com/api/v4/artist/similar"
"?api_key=%s&results=100&name={name}"
% settings.ECHONEST_API_KEY)
def get_similar_from_api(n... |
import os
import time
import datetime
# import enchant
import jieba
class HugoMarkdown:
# __srcDir = 'I:\src\hugo\docs' #源文章目录
# __desDir = 'I:\src\hugo\9ong\content\post' #目的文件目录
__srcDir = 'I:\src\github-page\docs' #源文章目录
__desDir = 'I:\src\hugo\9ong\content\post' #目的文件目录
def __init__(self... |
#Jhon Albert Arango Duque
#Dubel Fernando Giraldo Duque
#Sistemas Distribuidos- Gr 2
#UTP
#-----------------------------------------------------------
from SimpleXMLRPCServer import SimpleXMLRPCServer
from SimpleXMLRPCServer import SimpleXMLRPCRequestHandler
from datetime import datetime
import xmlrpclib
import thre... |
from django.shortcuts import render, redirect
from django.http import Http404
import requests
from tmdbv3api import TV
from tmdbv3api import TMDb
import imdb
ia = imdb.IMDb()
tmdb = TMDb()
tmdb.api_key = '122a9fafd99452516fe83207465ce55d'
img1 = "http://image.tmdb.org/t/p/w500/"
tv = TV()
popular = tv.popular()
li = ... |
#!/usr/bin/python
#Pede para o usuário digitar um valor para ser convertido
n1 = int(input('Digite um valor: '))
#Pede para o usuário escolher qual será a base de conversão
print('''Escolha uma das bases para conversão:
[ 1 ] Converter para BINÁRIO
[ 2 ] Converter para OCTAL
[ 3 ] Converter para HEXADECIMAL.''')
prin... |
# coding: utf-8
__author__ = 'ZFTurbo: https://kaggle.com/zfturbo'
import pandas as pd
from sklearn.metrics import roc_auc_score
from scipy.optimize import minimize
import os
import pickle
import numpy as np
def restore_data(path):
data = dict()
if os.path.isfile(path):
file = open(path, ... |
import ctypes
lib=ctypes.cdll.LoadLibrary('./dist-newstyle/build/x86_64-linux/ghc-8.10.4/project0-1.0.0/f/profile/build/profile/libprofile.so')
lib.main() |
from django.db import models
class Post(models.Model):
image = models.ImageField(upload_to='blogimages/')
title = models.CharField(max_length=100)
body = models.TextField()
time = models.DateTimeField(auto_created=True, auto_now=True)
def __str__(self):
return self.title
def summary(self):
return self.body[... |
#!/usr/bin/python
# Copyright (c) 2015 SUSE LLC
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, p... |
import RPi.GPIO as GPIO
import time
class Freq:
def __init__(self, tfreq, bfreq):
self.tfreq = tfreq
self.bfreq = bfreq
class Pin:
def __init__(self, pin):
self.pin = pin
class DutyCycle:
def __init__(self, tduty, bduty):
self.tduty = tduty
self.bduty = bduty
... |
import tokens
import lexer
import monkey_ast as ast
from typing import List, Dict, Callable
LOWEST = 0
ASSIGN = 1
EQUALS = 2
LESSGREATER = 3
SUM = 4
PRODUCT = 5
PREFIX = 6
CALL = 7
INDEX = 8
precedences = {
tokens.EQ: EQUALS,
tokens.ASSIGN: ASSIGN,
tokens.NOT_EQ: EQUALS,
tokens.LT: LESSGREATER,
t... |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'decryption.ui'
#
# Created by: PyQt5 UI code generator 5.9.2
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
from decryptText import decryptText
class Ui_windowDecryption(object):
de... |
#!/usr/bin/env python
# coding: utf-8
# In[ ]:
import numpy as np
import pandas as pd
import seaborn as sns
from sklearn.preprocessing import StandardScaler
from sklearn.cross_validation import cross_val_score
from sklearn.ensemble import RandomForestClassifier
from sklearn.cross_validation import StratifiedKFold
... |
class g2coreGuiBackendDRO:
def __init__(self):
self.changes = True
self.positionInformation = {}
def getValue(self, name):
name = "pos"+name
if name in self.positionInformation:
return float(self.positionInformation[name])
else:
return No... |
"""Wk 4 Practical - Samuel Barrett 13038579"""
# user_name = input('Name: ').capitalize()
# vowels = ['a', 'e', 'i', 'o', 'u']
# cnt = 0
# letter_cnt = len(user_name)
# for i in vowels:
# if user_name.__contains__(i):
# cnt += 1
# print('Out of {} letters, {} has {} vowels'.format(letter_cnt, user_name, c... |
# @Author : comma
# @Date : 2021-02-14 15:23
import turtle
turtle.fd(-200)
turtle.right(90)
turtle.circle(200) |
"""cursor.execute(
'INSERT INTO pokemon VALUES(%d, "%s", "%s","%s", %d, %d,%d, %d, %d,%d, %d, %d,%r)', int(row[0]), row[1], row[2], row[3], int(row[4]), int(row[5]), int(row[6]), int(row[7]), int(row[8]), int(row[9]), int(row[10]), bool(row[11]))"""
'''
conn = mysql.connect()
cursor = conn.curso... |
"""
Authentication functions for the routes
"""
from functools import wraps
import inspect
from flask import current_app, request, Response
import jwt
import requests
def token_required(f):
"""Checks whether token is valid or raises error 401."""
@wraps(f)
def decorated(*args, **kwargs):
"""Ret... |
from django.urls import path
from . import views
urlpatterns = [
path('',views.toLogin_view),
path('index/',views.Login_view),
path('toregister/',views.toregister_view),
path('register/',views.Register_view),
path('bgm.html/',views.bgm),
]
|
import copy
class Game:
def __init__(self, acc):
self.acc = acc
def run(self, commands):
self.inf = True
self.at = 0
flag = True
while flag:
flag = self.execute(commands[self.at])
if self.at >= len(commands):
self.inf = False
... |
#
# Library
#
def int_to_string(lst):
"""
create a fn called int_to_string, takes in a lst of integers and converts them all to strings. Use Recursion
input = [0,1,2,3,4] ---- output == [str(0), str(1)...str(4)]
"""
if len(lst) == 1:
elt = lst[0]
str_ = [str(elt)]
return s... |
import pygame, sys, random
from pygame.locals import *
from random import randint
from functions import *
from parameters import *
from lower_functions import *
pygame.init()
pygame.mixer.init()
myfont = pygame.font.SysFont('Comic Sans MS', 50)
textsurface = myfont.render('Game Over!', False, BLACK, RED)
game_over_si... |
# -*- coding: utf-8 -*-
import matplotlib.pyplot as plt
from bandit import *
# genere des moyennes pour 'nb_tests' tests. leur moyenne va etre selectionnee
# aleatoirement dans l'intervalle [min_mean,max_mean]
def generate_tests(nb_tests, nb_actions=10, min_mean=0, max_mean=100, variance=1):
tests = []
for i... |
import rclpy
from rclpy.node import Node
from machines.msg import Sensor,Scanner,MAMstatus
from std_msgs.msg import String
from pycomm3 import LogixDriver
import time
class MinimalPublisher(Node):
def __init__(self):
super().__init__('onScanner')
self.subscription = self.create_subscription(MAMst... |
"""
Class to read individual match yaml files
Design:
Methods:
initialise
read yaml
parse yaml
insert into db
Call as follows:
def read_single_match(matchFile.yaml)
match = Match(matchFile.yaml)
match_info = match.metadata()
# add match metadata to match_master table
match_details = ... |
from . import OutputFormatter
from corpus_cleaner.components.cleaner_component import CleanerComponent
from corpus_cleaner.document import Document
import argparse
from typing import Iterable
from typing import Tuple, Optional
import os
class OutputFormatterMapper(CleanerComponent):
def __init__(self, args: argpa... |
import numpy as np
from scipy.io import wavfile
def read_wav(filename):
fs, samples = wavfile.read(filename)
return fs, samples2float(samples)
def samples2float(data):
# divide by the largest number for this data type
return 1. * data / np.iinfo(data.dtype).max
def write_wav(fs, data, filename):
... |
#This program calculate the maximmun common divisor of three numbers introducted by user.
num1 = int(input('Giv me the first number: '))
num2 = int(input('Giv me the second number: '))
num3 = int(input('Giv me the third number: '))
try:
if num1 < num2 and num1 < num3:
mcd = num1
elif num2 < num1 and num2 < num3:
... |
"""college_second_hand URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/2.0/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')... |
# Generated by Django 3.2 on 2021-06-04 05:41
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('hp', '0002_alter_blog_thumbnail'),
]
operations = [
migrations.CreateModel(
name='Contact',
fields=[
(... |
# -*- coding: utf-8 -*-
from .main import DistanceRaster
from .utils import rasterize, export_raster
|
"""
Classes from the 'DocumentManager' framework.
"""
try:
from rubicon.objc import ObjCClass
except ValueError:
def ObjCClass(name):
return None
def _Class(name):
try:
return ObjCClass(name)
except NameError:
return None
DOCConcreteLocation = _Class("DOCConcreteLocation")
... |
# OpenWeatherMap API Key
weather_api_key = "8543a6e0d86c0cc0975180820e40738f"
# Google API Key
g_key = "AIzaSyCVBSPIQJZEL1xB1quNlF08RzNFepamZts"
|
#!/usr/local/bin/python3.6.5
# -*- coding: utf-8 -*-
# @Time : 2018/7/26 PM6:48
# @Author : L
# @Email : L862608263@163.com
# @File : jiandan.py
# @Software: PyCharm
import urllib.request
import urllib.response
import re
import uuid
import base64
import datetime
""" 使用代理
import random
@staticmethod
de... |
import palmerpenguins
def get():
"""
This template function uses the Palmer Peguins dataset as a place holder.
Replace it by your own code to import your project's data.
"""
df = palmerpenguins.load_penguins()
cols = [
"bill_length_mm",
"bill_depth_mm",
"flipper_lengt... |
from django.shortcuts import render
from django.urls import reverse_lazy
from django.views.generic.edit import CreateView, UpdateView,DeleteView
from django.views import View
from django.contrib.auth.mixins import LoginRequiredMixin
from .models import Breed, Cat
class BreedList(LoginRequiredMixin, View):
def get... |
import pytest
def test_login(client):
# Testing to see if a user can log in
response = client.get('/')
assert b'<h2>Log in</h2>' in response.data
assert b'New? sign up' in response.data
response = client.get('/', data={'email': 'Thommond@protonmail.com',
'password': 'PASSWORD'})
assert b... |
# region headers
# escript-template v20190605 / stephane.bourdeaud@nutanix.com
# * author: jose.gomez@nutanix.com
# * version: 20200214
# task_type: Set Variable
# task_name: AwxAddHost
# description: Add host to AWX inventory
# endregion
# region capture Calm variables
# * Capture variables here. This ... |
import subprocess
debug = True
def get_names(num_workers=1):
names = []
for i in range(1, num_workers+1):
names.append("worker" + str(i))
return names
def launch_instances(names):
commands = []
for name in names:
commands.append("multipass launch -d 25G -m 2G -n " + name + " ... |
import sqlite3
conexion = sqlite3.connect("db/tkinter.db")
print("Conectado exitosamente")
cursor = conexion.cursor()
cursor.execute("CREATE TABLE clientes(id integer PRIMARY KEY, nombre text, apellido text)")
conexion.commit() # Guardo los cambios en la base datos |
from flask_restful import Resource, reqparse, abort, fields, marshal_with
from models.cliente import ClienteModel
cliente_post_args = reqparse.RequestParser()
cliente_post_args.add_argument("nome", type = str, help = "Nome do cliente precisa ser preenchido!", required = True)
cliente_post_args.add_argument("razao_soci... |
from .early_stopper import EarlyStopper
from .model_handler import ModelHandler
from .optimizers import Optimizer
from .runners import *
from .scheduler import Scheduler
from .learners import *
from .checkpoint_handler import CheckpointHandler
|
class BubbleSort:
def sort(self, items):
i = 0
length = len(items)
while i < length:
j = 0
while j < length - 1 - i:
if items[j] > items[j + 1]:
temp = items[j + 1]
items[j + 1] = items[j]
ite... |
from turtle import forward, left, right, exitonclick, speed
# 1 ctverec (xsize, ysize=4)
# for i in range(4):
# forward(50)
# left(90)
# 2 ctvercova sit, velikost dale promennych x, y,
# for x in range(4):
# for y in range(4):
# for i in range(4):
# forward(50)
# left(90)
# forward(50)
# left(180)
# forward(200)
# ... |
#print(" ", end='')
print(" " * 3, end='')
for i in range(10):
print(f"{i:3}", end='')
print()
print()
for i in range(10):
print(f'{i}', end=' ')
for j in range(10):
wynik = i * j
print(f'{wynik:3}', end='')
print()
|
from functools import partial
from django.core.cache import cache
from django_filters.rest_framework import DjangoFilterBackend
from rest_framework import status
from rest_framework import viewsets
from rest_framework import mixins
from rest_framework.permissions import IsAuthenticated
from rest_framework.authenticat... |
from database import Base, engine
from db_model import Item
print("Creating Database ...")
Base.metadata.create_all(engine) |
from lxml import etree
import requests
url = 'https://www.chainnode.com/'
head ={"User-Agent": "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3724.8 Safari/537.36"}
str_data = requests.get(url,headers = head).content.decode()
#with open('bta.html','w',encoding="utf-8")... |
import numpy
data = [50,24,50,55,55,72,76,54,57,]
var = (numpy.std(data))
data2 = 0
data2 = sum(data)
num = 1
for data3 in data:
a = -1
a = a + 1
pt = (data[a+1] - (data3/9))*10 + 50
for pt2 in range(9):
print(f'{num}人目の偏差値 is {round(pt,1)}')
num = num + 1
|
"""
WSGI config for oneup project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.8/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
# load environment settings
try:
... |
import numpy as np
def solve_sudoku(sudoku: np.array):
nrows, ncols = sudoku.shape
sdim = int(nrows ** 0.5)
assert nrows == ncols, "sudoku dimensions must be equal."
def _valid(r, c, n):
for i in range(nrows):
if sudoku[r][i] == n:
return False
for j in ra... |
import torch
import torch.nn as nn
import torch.nn.functional as F
class Net(nn.Module):
def __init__(self):
super(Net, self).__init__()
self.conv1 = nn.Conv2d(1, 6, 5)
self.conv2 = nn.Conv2d(6, 16, 5)
self.fc1 = nn.Linear(16*5*5, 120)
|
from tkinter import *
import os
class Calculadora():
def __init__(self):
##variables a utilizar en la interfaz grafica
self.principal = Tk()
self.principal.title("Calculadora")
self.principal.resizable(False,False) #prohibe la ampliación de la ventana
self.ancho_b... |
#!/usr/bin/env python
# Class for common Google sheet operations.
import os
import sys
import json
import doctest
import csv
import gspread
import string
from h1 import h1
from oauth2client.client import SignedJwtAssertionCredentials
from collections import defaultdict
try:
from collections import OrderedDict
excep... |
from django.apps import AppConfig
class MinecraftableConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'Minecraftable'
|
a,b=map(int,input().split())
secs=list(map(int,input().split()))
c=0
for i in secs:
b1=86400-i
b=b-b1
c=c+1
if b<=0:
break
print(c)
|
# main.py
# CompareThreeNumbers_Python
#
# This program will help you get the size of a phrase given by the user, and let you
# know if that size is an even or odd number.
#
# Python interpreter: 3.6
#
# Author: León Felipe Guevara Chávez
# email: leon.guevara@itesm.mx
# date: May 29, 2017
#
# We ... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sun Mar 3 10:13:24 2019
@author: naeemsunesara
"""
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
df = pd.read_csv('hr_employee.csv')
categorical = df.select_dtypes(exclude = np.number )
numerical = df.select_dtypes(include = n... |
import io
import unittest
from vstruct.types import *
from dissect.filelab import *
class CommonTest(unittest.TestCase):
def test_filelab(self):
fd = io.BytesIO( b'asdfqwer' )
class Woot(VStruct):
def __init__(self):
VStruct.__init__(self)
... |
"""Metadata for uniplot."""
__title__ = 'uplt-labview'
__version__ = '0.0.0'
__author__ = 'Sean Marshallsay'
__email__ = 'srm.1708@gmail.com'
__description__ = 'A uniplot parser for LabVIEW files.'
__homepage__ = 'https://github.com/Sean1708/uplt-labview'
__download__ = 'https://github.com/Sean1708/uplt-labview.git'
_... |
a = {'key1': 1, 'key2': 3, 'key3': 2}
b = {'key1': 1, 'key2': 2}
def inter_dict(a, b):
result = {}
for key, value in a.items():
if b.get(key) == value:
result[key] = value
return result
print(inter_dict(a, b))
|
file_reader = open('all_courses_output.txt', 'r')
lines = file_reader.readlines()
a = 0
Science = ['ACMA', 'BISC', 'BPK', 'CHEM', 'EASC', 'MATH', 'MBB', 'PHYS', 'SCI', 'STAT']
AppliedScience = ['CMPT','ENSC','MACM',"MSE",'TEKX']
SocialScience = ['COGS', 'CRIM', 'ECON', 'ENGL', 'FNST', 'FREN', 'GA', 'GERO', 'GSWS', 'HIS... |
# -*- coding:utf-8 -*-
import datetime
import sys
import os
# 项目的根目录 /home/andy/flask_projects/bluelog
basedir = os.path.dirname(os.path.dirname(__file__))
WIN = sys.platform.startswith('WIN')
if WIN:
prefix = 'sqlite:///'
else:
prefix = 'sqlite:////'
SQLALCHEMY_TRACK_MODIFICATIONS = False
class BaseConfig... |
import os
def get_package_data():
paths_test = [os.path.join('data', '*.json')] + [os.path.join('data', '*.pkl')] + [os.path.join('data', '*.ecsv')]
return {'astroquery.vo.tests': paths_test}
|
#
# Bug: 62211
# Title: [ yaim-wms ] Enable Glue 2.0 publishing
# Link: https://savannah.cern.ch/bugs/?62211
#
#
import os
from lib.Exceptions import *
def run(utils):
bug='62211'
utils.log_info("Start regression test for bug %s"%(bug))
utils.log_info("Get the publication in glue1 format")
glue1=... |
#!/usr/bin/env python
__author__ = 'rgolla'
import commands
import random
import subprocess
import shutil
from scipy.stats import norm
import matplotlib.mlab as mlab
import matplotlib.pyplot as plt
import os
from sklearn import metrics
from matplotlib.backends.backend_pdf import PdfPages
import pylab as pl
import argp... |
###
### This file is part of Pyffle BBS.
###
### Pyffle BBS is free software: you can redistribute it and/or modify
### it under the terms of the GNU General Public License as published by
### the Free Software Foundation, either version 3 of the License, or
### (at your option) any later version.
###
##... |
#!/usr/bin/env python
import sys, array
import getopt
from ROOT import gROOT, TCanvas, TF1, TFile, gStyle, TFormula, TGraph, TGraphErrors, TH1D, TCutG, TH2D
def makeplots(files,path,name,c):
c.Clear()
color=1
for f in files:
print path
h=f.Get(path)
#h.Print()
h.SetLineColor(color)... |
import zipfile
import re
import time
namesuff = '.txt'
nothing = '90052'
order = [nothing]
# I would just import ch4.py, but there are differences between the two
# returns a string - either the nothing or text if a nothing isn't found
def findnothing():
global string
zipobject = zipfile.ZipFile('channel.zip', 'r')... |
from aiohttp import web
from ..app import app
from ..model.build import BUILD_STATES
@app.http_get("/api/buildstates")
@app.authenticated
async def get_buildstates(*_):
"""
Returns a list of all buildstates.
---
description: Returns a list of buildstates.
tags:
- BuildStates
produces... |
'''
Phan Le Son
mail: plson03@gmail.com
'''
import pyaudio
import numpy as np
import BF.Parameter as PAR
import sys
import time
import math
flgIsStop = False
idxFrame = 0
idxFrameLoad = 0
flgLoad = [True]*PAR.CNTBUF
CHANNELS = 10
CHUNK = PAR.N # PAR.m*PAR.N/CHANNELS
FORMAT = pyaudio.paInt24 # paInt8
RATE = PAR.fs ... |
from django.db import models
from django.core.urlresolvers import reverse
# Create your models here.
class company(models.Model):
name=models.CharField(max_length=30)
ceo=models.CharField(max_length=20)
city=models.CharField(max_length=20)
def get_absolute_url(self):
return reverse('detail',kwa... |
#!/usr/bin/env python
###############################################################################
## ##
## Copyright (c) Calix Networks, Inc. ##
## All rights reserved. ... |
#import matplotlib
#matplotlib.use('Agg')
import numpy as np
import glob
import string
import os
import sys
import matplotlib.pyplot as plt
from scipy.fftpack import fft,fftfreq, rfft
#from mpl_toolkits.basemap import Basemap, shiftgrid
from matplotlib.patches import Polygon
from matplotlib.colors import LogNorm
from c... |
from app import app, db
from flask import render_template, request, redirect, url_for, flash, jsonify, json, send_from_directory, make_response, abort
from flask_jwt import JWT, jwt_required, current_identity
from sqlalchemy.sql import text
from app.models import User, Wish, wishes
from bs4 import BeautifulSoup
from w... |
from character import Character
from catalogue import loot
class Mage(Character):
def __init__(self, name, current_room, health, focus, gold, atk, defense, description):
super(Mage, self).__init__(name, current_room, health, focus, gold, atk, defense, description)
self.special_attacks = []
... |
from .class_lists import ClassList
from .class_list_supply_item import ClassListSupplyItem
from .package_types import PackageType
from .supply_items import SupplyItem
from .supply_types import SupplyType
from .user_classes import UserClass |
import tkinter as tk
import tkinter.messagebox
import sqlite3
import os
import time
from tkinter import ttk
def menu_system():
def st_data():#學生資料頁面
def combo_change(event): #連動式下拉選單
st_level = st_level_combo.get()
if st_level:
comboclass["values"] = student... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.