text stringlengths 8 6.05M |
|---|
def vvod_dannyh():
s = []
for i in range(4):
b = []
print("Введите данные ", i + 1, " списка")
for row in range(4):
print("Вводи ", row + 1, " элемент ", i + 1, " списка ")
b.append(input())
s.append(b)
return s
def raschet(list):
maximum = 0
m... |
__author__ = "Theo Satloff"
__email__ = "theo@satloff.com"
from Clearbit import Clearbit
|
# %% Importing
# System -----------------------------------------
import os
import sys
import json
import pickle
from pprint import pprint
from collections import defaultdict
# Computing --------------------------------------
# numpy
import numpy as np
# sklearn
from sklearn import metrics
# Plotting ---------------... |
from pkg_resources import resource_filename
RU_MORPH_DEFAULT_MODEL_CONFIG = resource_filename(__name__, "models/model_config.yaml")
RU_MORPH_DEFAULT_MODEL_WEIGHTS = resource_filename(__name__, "models/model_weights.h5")
RU_MORPH_GRAMMEMES_DICT = resource_filename(__name__, "models/gram_input.json")
RU_MORPH_GRAMMEMES_... |
# -----------------
# import modules
# -----------------
import requests
import pandas as pd
import json
import datetime as dt
import os
import time
from pycoingecko import CoinGeckoAPI
from telethon.sync import TelegramClient
from telethon.tl.functions.messages import (GetHistoryRequest)
from telethon.tl.types impo... |
class Solution(object):
def isPossible(self, nums):
"""
:type nums: List[int]
:rtype: bool
"""
# Basic idea is to imitate the allocation. There are breakpoints (diff>1) that separates bags.
# For each bag (represented by counts), check if it is possible by just splitt... |
#Name:PRADEEP RAVICHANDRAN
#CSE 6331-Cloud Computing
import os
from flask import Flask, render_template, request
import sqlite3 as sql
import pandas as pd
import random
import time
import redis
import sqlite3, csv, base64
application = Flask(__name__)
con=sqlite3.connect('eq.db')
#creating cursor to perform database... |
import keras as K
from keras import layers, models
def Model(inputShape, numOfClass):
# 2D convolution layer 1
self.add(layers.Conv2D(32, kernel_size = (3, 3),
activation = 'relu',
input_shape = inputShape))
self.add(layers.Conv2D(32, ke... |
import eqparser
import copyTree
import equalTree
def dist(root):
if root == None:
return root
if root.leaf == '=':
return 0
if root.leaf == '*':
if root.children[0].leaf == '+' or root.children[0].leaf == '-':
if root.children[0].children[0].leaf !=0 and root.children[0].children[1].leaf!=0:
newTree ... |
from django.test import TestCase
from .views import fibonacci
class FibonacciTestCase(TestCase):
def test_fibonacci(self):
self.assertEquals(fibonacci(6), 8)
self.assertEquals(fibonacci(0), 0)
self.assertEquals(fibonacci(1), 1)
self.assertEquals(fibonacci(10), 55)
|
/Users/Di/anaconda/lib/python2.7/abc.py |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'ui_tilelayer.ui'
#
# Created by: PyQt4 UI code generator 4.11.4
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
try:
_fromUtf8 = QtCore.QString.fromUtf8
except AttributeError:
def _fromUtf8(... |
import numpy as np
from random import randint as rd
def calcMean(data):
return sum(data) / len(data)
def calcSTD(data):
mean = calcMean(data)
squareDeviation = []
for item in data:
squareDeviation.append((item - mean) ** 2)
variance = sum(squareDeviation) / len(data)
STD = variance ** 0.5
... |
from django import forms
from .models import Create_Post
class Create_PostForm(forms.ModelForm):
class Meta:
model = Create_Post
exclude = ['view_count', 'like_set', 'author']
|
import timeit
class ClassifierBaseClass:
def __init__(self, **kwargs):
self.trained = False
def train(self, xtrain, ytrain):
self.setClassifer()
start_train = timeit.default_timer()
self.classifier.fit(xtrain, ytrain)
stop_train = timeit.default_timer()
self... |
n = int(input("Enter number n: "))
m = int(input("Enter number m: "))
while n <= m:
tempNumber = n
sumOfDigits = 0
while tempNumber > 0:
sumOfDigits += tempNumber % 10
tempNumber //= 10
print("Sum of digits of {} = {}".format(n, sumOfDigits))
n += 1 |
import os
class CampaignCreater:
def __init__(self, session, solution_version):
self.personalize = session.client('personalize')
self.solution_version = solution_version
self.name = os.environ.get('CAMPAIGN_NAME')
def exec(self):
return self.personalize.create_campaign(
... |
"""
Name: 循环获取瀑布流网址的id参数
Author: Jia_qiu Wang(王佳秋)
Data: Jan, 2017
function:
"""
import time
import re
from html.parser import HTMLParser
class ParseTimeFlowData:
# 类的公有参数
# list_all_next_cursor = []
"""构造函数"""
def __init__(self, filename, source):
self.filename = filename
self.sour... |
# -*- coding: utf-8 -*-
"""
Created on Sun Jan 6 15:17:50 2019
@author: gillespie.evan@gmail.com
Simple Linear Regression Salary Data
Simple Linear Regression y = b0 + b1*x1 #nums are subscript
y is the dependent variable (DV) what are we looking for?
x1 is the dependent variable (IV) our data to make predictions
... |
from Pages.ContentPages.BasePage import Page
from selenium.webdriver.common.by import By
import time, pytest
from magic_box.find_elements import find_element
from selenium.webdriver.support.ui import Select
class WebformCT(Page):
def __init__(self, driver):
self.driver = driver
super().__init__(dr... |
from nmt.evaluation.configuration import TransformerModelConfig
from nmt.evaluation.evaluator import Evaluator |
#!/usr/bin/env <a href="http://lib.csdn.net/base/python" class='replace_word' title="Python知识库" target='_blank' style='color:#df3434; font-weight:bold;'>Python</a>
# coding=utf-8
import urllib
import http.cookiejar
import re
import socket
class OpenUrl:
def __init__(self):
self.result = ""
def openpa... |
import sys
import ROOT
import numpy as np
import matplotlib.pyplot as plt
from scipy.interpolate import UnivariateSpline
def main():
# Load data.
df = ROOT.TFile('../modeling-1/ds_test.root', 'update')
tree = df.Get('t')
# Set batch mode.
ROOT.gROOT.SetBatch(0)
# Create the canvas and set th... |
import decimal
from collections import OrderedDict
from decimal import Decimal
from functools import partial
from onegov.core.security import Private
from onegov.form import merge_forms
from onegov.org import OrgApp, _
from onegov.org.forms import DateRangeForm, ExportForm
from onegov.org.layout import PaymentCollectio... |
import numpy as np
from scipy.optimize import minimize
import open3d
from loadOBJ import loadOBJ
from method import *
from PreProcess import PreProcess
import figure2 as F
E_list = []
#####最適化する関数#################################################
###epsilon, alphaは調整が必要
def func(p, X, Y, Z, normals, fig, epsilon=0.7,... |
from typing import NamedTuple
from enum import Enum, Flag, auto
class Mode(Flag):
"""Enum of program running modes."""
Signature = auto()
Application = auto()
Mode.__module__ = "pyteal"
OpType = NamedTuple('OpType', [('value', str), ('mode', Mode), ('min_version', int)])
class Op(Enum):
"""Enum... |
# Parameters, Unpacking, Variables
from sys import argv
# read the WYSS section for how to run this
# this is a kind of unpacking. Instead of keeping all variable names in argv
# we are assigning them to different variables
script, first, second, third = argv
# script is the name of this script; ex13.py
# first, sec... |
"""Calendar is a dictionary like Python object that can render itself as VCAL
files according to rfc2445.
These are the defined components.
"""
from datetime import datetime, timedelta
from icalendar.caselessdict import CaselessDict
from icalendar.parser import Contentline
from icalendar.parser import Contentlines
fro... |
from pyspark import SparkContext, SparkConf
import sys
import pandas as pd
import numpy as np
from pyspark.mllib.regression import LabeledPoint
from pyspark.mllib.tree import DecisionTree
if len(sys.argv) < 2:
print 'requires second parameter as training file'
sys.exit(0)
conf = SparkConf().setMaster("mesos://meso... |
import tensorflow.keras.backend as K
from tensorflow.keras.models import Model
from tensorflow.keras.layers import Input, Dense, Flatten, Dropout, BatchNormalization
from tensorflow.keras.layers import Conv2D, SeparableConv2D, MaxPool2D, Activation
from tensorflow.keras.optimizers import Adam
from tensorflow.keras.prep... |
"""
Asteroid destroyer para Micro:bit - Destrua todos os asteroides o mais rápido possível.
Inicialmente será exibido um rosto feliz, para iniciar precione ou o botão A ou B.
Botão A - para iniciar no modo fácil (toda tela será usada para mostrar os próximos asteroides)
Botão B - para iniciar no modo Difícil (a... |
from flask import render_template, flash, redirect, url_for
from flask_app import app
from webapp.forms import LoginForm
from webapp.forms import FeedForm
from webapp.call_function import call_function
from flask import Flask, request, render_template
import requests
import os
from generator.generate import generate_tw... |
from django.conf.urls import patterns, url
from . import views as notice
urlpatterns = patterns('',
url(r'^read-notice/$',
notice.read_notice,
name='read_notice'
),
) |
#__author: "Jing Xu"
#date: 2018/1/19
import os
# ----------------------------------------------------------------------
# print(os.getcwd())
# print(os.curdir)
# print(os.pardir)
# os.chdir(r'D:\\')
# # os.makedirs('abc\\alex')
# os.removedirs('abc\\alex') #只能删除空文件夹
# -----------------------------------------------... |
set1 = {1,2,3,5,"Print",5.3, 1, 2,3}
set1 = list(set1)
print(set1) |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Date : 2017-11-22 11:36:28
# @作者 : "jym"
# @说明 :
# @Version : $Id$
import tornado.ioloop
import tornado.web
import tornado.autoreload
import Queue
from config import master_ip
from db.WenShuCourtDB_Mongo import WenshucoutMongoDb
import db_tasks
import tcelery
im... |
#!/usr/bin/env python
from GENIutils import *
def main():
dirList = []
resultsList = []
trafficList = []
finalBreakTime = 0
convergenceTime = 0
endNodeNamingSyntax = getConfigInfo("RSTP Utilities", "endNodeName")
if(len(sys.argv) != 2):
sys.exit("Incorrect Number of Arguments given... |
from py_pipe.pipe import Pipe
influxdb_token = "UzWGrd7DzTahaedkk1PwblSOZlz28wlT-HIoLUnlzEOI0AAu1qtTT9EVnVgLH_Ti6ToYERDCojKLvE3z5p608w=="
influxdb_org = "infosys"
infuxdb_bucket = "surveillance"
influxdb_url = "http://localhost:8086"
crowd_count_video = "./data/videos/crowd7.mp4"
vehicle_detection_video = 'video2.mp4... |
from faker import Faker
import random
import json
fake = Faker()
with open("data.json", "r") as file:
data = json.load(file)
Id = 0
for chair in data["chairs"]:
for teach in chair["teachers"]:
teach["id"] = Id
Id += 1
with open("data.json", "w") as file:
json.dump(data,... |
from django import forms
from .models import ComplaintForm, Invoice
class DocumentForm(forms.ModelForm):
class Meta:
model = ComplaintForm
fields = '__all__'
class InvoiceForm(forms.Form):
FORMAT_CHOICES = (
('pdf', 'PDF'),
('docx', 'MS Word'),
('html', 'HTML'),
)... |
#!/usr/bin/env python
#/*******************************************************************************
#* Copyright (c) 2018 Elhay Rauper
#* All rights reserved.
#*
#* Redistribution and use in source and binary forms, with or without
#* modification, are permitted (subject to the limitations in the disclaimer
#* bel... |
from collections import namedtuple
import re
handlers = list()
preprocessors = list()
skipped_handlers = list()
#Datatype class
class Message(namedtuple('Message', 'msgtype, submsgtype, time, restofline, orig_line')):
pass
#Function decorator, will add function to the skipped_handlers list
def handles_skipped(even... |
from contextlib import contextmanager
from os import chdir
from pathlib import Path
from typing import Generator, Union
# Replicated from equium.common.fs (so we have no dependencies on internal libraries)
@contextmanager
def cd(path: Union[str, Path]) -> Generator[None, None, None]:
"""Unix-like cd as a context ... |
"""
Plot and save images
"""
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
import os.path
import numpy as np
import cv2
def bgr2rgb(img):
# OpenCV's BGR to RGB
rgb = np.copy(img)
rgb[..., 0], rgb[..., 2] = img[..., 2], img[..., 0]
return rgb
def check_do_plot(func):
def inner(self, *args... |
#!/usr/bin/env python
import os
import sys
import subprocess
from distutils.core import setup, Command
try: # Python 3.x
from distutils.command.build_py import build_py_2to3 as build_py
except ImportError: # Python 2.x
from distutils.command.build_py import build_py
class PyTest(Command):
user_optio... |
from __future__ import print_function
import numpy as np
import h5py
import json
import math
import os
import tensorflow as tf
from tensorflow.python.framework import tensor_util
from hls4ml.model import HLSModel
from hls4ml.model.optimizer import optimize_model
MAXMULT = 4096
class TFDataReader:
def __init__(se... |
from GizmoTransformImpl import * |
person = {'name': 'John', 'age': 26}
sentence = 'My name is ' + person['name'] + ' and I am ' + str(person['age']) + ' years old.'
print(sentence)
sentence1 = 'My name is {} and I am {} years old'.format(person['name'], person['age'])
print(sentence1)
sentence1 = 'My name is {1} and I am {0} years old'.format(person... |
#!/usr/bin/env python3
#
# Convert a test specification to command-line options
#
import pscheduler
from validate import spec_is_valid
from validate import MAX_SCHEMA
try:
spec = pscheduler.json_load(exit_on_error=True, max_schema=MAX_SCHEMA)
except ValueError as ex:
pscheduler.fail(str(ex))
valid, message ... |
from django.contrib.auth.models import AbstractUser
from django.db import models
class User(AbstractUser):
last_order = models.ForeignKey(
"Order", on_delete=models.CASCADE, null=True, blank=True, related_name="+"
)
class Product(models.Model):
user = models.ForeignKey(
User, on_delete=m... |
from __future__ import division
from collections import namedtuple
import numpy as np
import torch
Experience = namedtuple("Experience", field_names=["state", "action", "reward", "next_state", "not_done"])
device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu")
class SegmentTree():
def __init__(se... |
# Copyright 2017 NEC Corporation
#
# 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 t... |
# coding: utf-8
class Solution:
# @param s, a string
# @return an integer
def lengthOfLastWord(self, s):
l = s.strip().split(' ')
return len(l[-1]) |
class Solution:
def arrangeCoins(self, n: int) -> int:
lo, hi = 0, n
while lo <= hi:
mid = (lo + hi) >> 1
cost = (mid + 1) * mid // 2
if cost == n:
return mid
elif cost < n:
lo = mid
else:
hi ... |
import tkinter as tk
from PIL import Image
import cv2
class Application(tk.Frame):
img_gramado_22 = 'Gramado_22k.jpg'
img_gramado_72 = 'Gramado_72k.jpg'
img_space_187 = 'Space_187k.jpg'
img_space_46 = 'Space_46k.jpg'
img_underwater_53 = 'Underwater_53k.jpg'
curr_img = None
... |
import sys
import random
from .address import Address
__all__ = [
'NameServers',
]
class RandMixIn:
def get(self):
if not self.data: return
return random.choice(self.data)
def success(self, item):
pass
def fail(self, item):
pass
if sys.version_info > (3, 6):
clas... |
# Generated by Django 2.0.5 on 2018-05-20 11:09
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('jobs', '0002_job_link'),
]
operations = [
migrations.AlterField(
model_name='job',
name='link',
field=mo... |
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... |
""" Solution for simple logistic regression model for MNIST
with placeholder
MNIST dataset: yann.lecun.com/exdb/mnist/
Created by Chip Huyen (huyenn@cs.stanford.edu)
CS20: "TensorFlow for Deep Learning Research"
cs20.stanford.edu
Lecture 03
"""
import os
os.environ['TF_CPP_MIN_LOG_LEVEL']='2'
import numpy as np
import... |
#!/usr/bin/python3.4
# coding: utf8
import sys,os,subprocess
def listdir_fullpath(d):
return [os.path.join(d, f) for f in os.listdir(d)]
print(d,f)
folders2averages=sys.argv[1:]
for f in folders2averages:
images=listdir_fullpath(f)
subprocess.call(["convert"]+images+["-average",f+"average.pn... |
from django.core.management.base import BaseCommand
from course_selection.models import Meeting
class Command(BaseCommand):
def handle(self, *args, **options):
all_meetings = Meeting.objects.all()
for meeting in all_meetings:
# trim days into the first 10 chars
meeting.da... |
# encoding: utf-8
from ..templates.admin.uploadfiles import uploadfilestemplate
from collections import defaultdict
import json
import os
class UploadFiles:
__dispatch__ = 'resource'
__resource__ = 'uploadfiles'
def __init__(self, context, name, *arg, **args):
self._ctx = context
self.que... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# @Author: thuzhf
# @Date: 2016-04-20 19:48:52
# @Email: thuzhf@gmail.com
# @Last Modified by: thuzhf
# @Last Modified time: 2016-04-22 14:54:23
import sys,os,re,json,gzip,math,time,datetime,random
import functools,itertools,requests,copy,pprint
import multiprocessin... |
"""
从词霸中获取每日一句,带英文。
http://open.iciba.com/dsapi
"""
import requests
from common import (is_json)
__all__ = ['get_iciba_info']
def get_iciba_info():
print('获取格言信息(双语)...')
try:
req = requests.get('http://open.iciba.com/dsapi')
if req.status_code == 200 and is_json(req):
... |
print("WELCOME TO GUESS THE NUMBER")
print("="*27)
n=15
g=0
while(n==15):
if (g<4):
g=g+1
i=int(input("Guess the number"))
print("This was attempt number",g,",",5-g,"remaining")
if (i<n):
print("Try a greater number")
elif (i>n):
print("T... |
##
# 2019 Mieszko Mazurek <mimaz@gmx.com>
##
from dxfwrite import DXFEngine as dxf
import math
PI = math.acos(0) * 2
class Vector:
def __init__(self, x, y):
self.x = x
self.y = y
def __hash__(self):
return hash(self.x + 1000000 + self.y)
def __eq__(self, other):
return... |
#version 1.3
#transfer from perl to python
import re, sys, urllib2
import libxml2
import hashlib
from datetime import date
from datetime import date
import random, time
sys.path.append('/home/zuofeng/projects/platform/bminfo/bminfo/scripts')
import ground as gd
from ppMapDB import ppMapMySQL
pp = ppMapMySQL('bminfo'... |
import time
import json
import datetime
from . import db
from .exceptions import ActivityError
import werkzeug.http
from werkzeug.security import generate_password_hash, check_password_hash
from itsdangerous import TimedJSONWebSignatureSerializer as Serializer
from flask import current_app, jsonify, request
from functo... |
from django.db import models
class Song(models.Model):
name = models.CharField(max_length=255, blank=False)
image = models.CharField(max_length=255, blank=True)
singer = models.CharField(max_length=255, blank=True)
genre = models.CharField(max_length=255, blank=True)
class Meta:
verbose_na... |
m=int(input())
n=int(input())
k=int(input())
if k>m*n:
print('NO')
elif k%m==0:
print('YES')
elif k%n==0:
print('YES')
else:
print('NO') |
from manimlib.imports import *
## Functions
def divergence(vector_func, dt=1e-7):
def result(point):
value = vector_func(point)
return sum([
(vector_func(point + dt * RIGHT) - value)[i] / dt
for i, vect in enumerate([RIGHT, UP, OUT])
])
return result
def two_d_c... |
# -*- coding: utf-8 -*-
#!/usr/bin/env python3
import sys
import os
import pwd
import indexing
import math
from datetime import datetime
import collections
import cfc_tools
def main():
if len(sys.argv) != 3:
print('alefrise 2016 - Alef Recumeração de informação [Search Engine]')
print(' Uso: p... |
l = []
i = 0
l_divisible7 = []
while len(l) != 100:
l.append(i + 1)
if not l[i] % 7 and l[i] % 5:
l_divisible7.append(l[i])
i += 1
print(l_divisible7)
|
# coding: utf-8
"""
LoRa App Server REST API
For more information about the usage of the LoRa App Server (REST) API, see [https://docs.loraserver.io/lora-app-server/api/](https://docs.loraserver.io/lora-app-server/api/). # noqa: E501
OpenAPI spec version: 1.0.0
Generated by: https://github.co... |
# Generated by Django 3.1.6 on 2021-07-05 12:01
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('cabroozadmin', '0022_driverdetails'),
]
operations = [
migrations.RenameField(
model_name='driverdetails',
old_name='status'... |
MONGODB_URL = "mongodb://localhost:27017/"
PORT = 5005
IS_DEBUG = False
UPLOAD_FILE_DIRNAME = 'uploads'
|
# coding: utf-8
from me.tool import Data
import numpy as np
import operator
from math import log
import treePlotter
import pickle
def getDataAndLabel(fileName):
data = Data.getDataFromFile(fileName)
ndata = np.array(data)
labels = (ndata[:,30:]).T
result = ndata[:,:30]
return result,labels[0]
def ... |
"""Given preorder traversal of a binary search tree, construct the BST."""
class PreorderPos:
data = None
index = None
class Node(object):
def __init__(self, key, left=None, right=None):
self.key = key
self.left = left
self.right = right
@classmethod
def from_preorder(cls,... |
"""ConversationEvent base class and subclasses.
These classes are wrappers for hangouts_pb2.Event instances. Parsing is done
through property methods, which prefer logging warnings to raising exceptions.
"""
import logging
from hangups import parsers, message_parser, user, hangouts_pb2
logger = logging.getLogger(__... |
'''
This module will be used to generate plots
Author: Daniel Newman
2016-12-13 - cleaned up compare_responses() function
2017-01-30 - Added capability to automatically remove illegal windows characters from file names
'''
import matplotlib as mpl
from matplotlib import pyplot as plt
import os
import numpy as np
im... |
#!/usr/bin/env python
# This python use super for test.
__metaclass__=type
class Bird:
def __init__(self):
self.hungry=True
def eat(self):
if self.hungry:
print('Ahhh....')
self.hungry=False
else:
print('No,thanks!')
class SongBird(Bird):
def __ini... |
#!/usr/bin/python
from PyQt4.QtGui import (QMainWindow, QApplication, QTreeWidgetItem)
from PyQt4 import QtCore, QtGui
import sys
from gui.mainwindow import Ui_MainWindow
import datetime
from helpers.helpers import TaskItem
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy import Column, Integer, ... |
from xmind.tests import logging_configuration as lc
from xmind.core.position import PositionElement
from xmind.tests import base
from unittest.mock import patch
from xmind.core.const import TAG_POSITION, ATTR_X, ATTR_Y
class TestPositionElement(base.Base):
"""Test class for PositionElement class"""
def getLo... |
import re
original_text = """"a1 asdkjjflewjrkjhwkejhqkjr
b3 asdlkfhwkejhrkjwehkjrhwjr
3k fqkwjehrkjwhrkjwqherkjwqhr
5j qkjwehrkjewqhrkjewqjherewkq
k4 qwjkerhkjwqehrjkewqhrkjqw
9p wqjerhkjweqherkjwehrjkewqh
u9 jhdjhrkjwherkjhwqekrehwjkr
"""
p = re.compile("[a-z][0-9]")
m = p.match(original_text) # 매칭이 된다. #대소문자 구분 중요ㅍ... |
openweather_api = '7b70bf3314ed64799900c0b315a53df2'
maps_places_api ='eotpicYMnWHOwiNYfxZAfi8vMOizbSdE'
news_api_key = '567ed6fb99a84bdd934e0910adb37ebd'
|
import numpy
import math
from keras.utils import Sequence
class LNDbSequence(Sequence):
def __init__(self,inputs,outputs,batchSize):
# author Rebecca Hisey
self.inputs = numpy.array([x[0] for x in inputs])
self.targets = numpy.array([x[0] for x in outputs])
self.batchSize = batchSiz... |
# -*- coding: utf-8 -*-
__author__ = """WebLion <support@weblion.psu.edu>"""
__docformat__ = 'plaintext'
from AccessControl import ClassSecurityInfo
from Products.Archetypes.atapi import *
from archetypes.referencebrowserwidget.widget import ReferenceBrowserWidget
from Products.CMFCore.permissions import View
from Pr... |
import pygame
from config import Options
class Progressbar(object):
def __init__(self, x, y, width, height, percentage,
bgcolor, border_color, label):
self.width = width
self.height = height
self.x = x
self.y = y
self.rect = pygame.Rect(x, y, width, height... |
import argparse
from . import config
parser = argparse.ArgumentParser()
parser.add_argument("envType", type=str)
parser.add_argument("envName", type=str)
parser.add_argument("action", type=str)
parser.add_argument("-lr","--learning_rate", type=float, default=0.00025)
parser.add_argument("-e","--epsilon", type = float,... |
import numpy as np
import time
import copy
import functools
import queue
import multiprocessing
import threading
############################################
############################################
def calculate_mean_prediction_error(env, action_sequence, models, data_statistics):
model = models[0]
# ... |
# -*- coding: utf-8 -*-
"""
Created on Fri Aug 3 00:10:15 2018
@author: YQ
"""
import cv2
import argparse
import numpy as np
ap = argparse.ArgumentParser()
ap.add_argument("-s", "--stego_image", required=True,
help="path to stego image")
ap.add_argument("-r", "--recover_image", required=True,
... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models
# Create your models here.
class Materia(models.Model):
id = models.CharField(max_length=50, primary_key=True)
nombre = models.CharField(max_length=50)
intensidad = models.PositiveIntegerField()
#returna el nomb... |
peso = float (input('digite seu peso:KG'))
altura =float (input('digite sua altura:METROS'))
imc = peso/altura**2
print('o seu IMC é {:.1f}:'.format(imc))
if imc <=18.5:
print('você está abaixo do peso')
elif imc>25:
print('você está acima do peso')
else: print('Você está no peso adequado,Parabéns!')... |
# Copyright (c) 2016
#
# 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, software
#... |
import time
from threading import Semaphore, Thread
class Lightswitch(object):
def __init__(self):
self.count = 0
self.mutex = Semaphore(1)
def lock(self, semaphore):
self.mutex.acquire()
try:
self.count += 1
if self.count == 1:
# first o... |
#!/usr/bin/env python
# encoding: utf-8
"""
sim_games.py
Created by Jakub Konka on 2011-05-21.
Copyright (c) 2011 University of Strathclyde. All rights reserved.
"""
from __future__ import division
import sys
import os
import numpy as np
def test_strict_dominance(matrix):
row_set = set(tuple(row) for row in matrix)... |
import sys
sys.stdin=open("input.txt", "r")
# 2048 (Easy)
import copy
def printPretty(board):
for i in range(N):
print(board[i])
def moveUp(board):
newboard = copy.deepcopy(board)
for r in range(1, N):
for c in range(N):
nowR = r
if newboard[r][c] != 0:
... |
"""
Author: Sidhin S Thomas (sidhin@trymake.com)
Copyright (c) 2017 Sibibia Technologies Pvt Ltd
All Rights Reserved
Unauthorized copying of this file, via any medium is strictly prohibited
Proprietary and confidential
"""
from django.contrib.auth.decorators import login_required
from django.contrib.auth.models im... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
import os
from os.path import isfile, isdir, join
import sys
reload(sys)
sys.setdefaultencoding('utf-8')
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2'
fileDir = os.path.dirname(os.path.realpath(__file__))
sys.path.append(os.path.join(fileDir, "..", ".."))
import numpy as np
import ... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
operations = [
migrations.Create... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.