text stringlengths 8 6.05M |
|---|
from django.apps import AppConfig
class OrdersConfig(AppConfig):
name = 'trymake.apps.orders'
|
A='!'+'"#$%&'+"'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~"
x = A.find(input())
y = A.find(input())
print(A[x:y+1]) |
# import libraries
import sys
# Storage
import pandas as pd
from sqlalchemy import create_engine
# NLP
import re
import nltk
from nltk.corpus import stopwords
from nltk.stem.wordnet import WordNetLemmatizer
from nltk.tokenize import word_tokenize
nltk.download('punkt')
nltk.download('stopwords')
nltk.download('wordn... |
def fib(n):
i=0
j=1
if n==1:
print("[0]")
elif n==2:
print("[0,1]")
else:
print("0")
print("1")
for c in range(n-2):
s=i+j
print(s)
i=j
j=s
x=int(input("enter the number of fib to generate"))
fib(... |
#!/usr/bin/env python3.7
# -*- coding: utf-8 -*-
"""
Created on Tue Apr 28 12:49:03 2020
@author: ejreidelbach
:DESCRIPTION: This script scrapes data from the results of the Eagle
Dynamics' 2020 F-18 roadmap survey for further analysis.
Actual survey link: https://docs.google.com/forms/d/e/1FAIpQLSfKuQ5... |
import os.path
import math
from os import path
allNames =[
"lizard",
"shiftHappens",
"erato",
"cubes",
"sponza",
"daviaRock",
"rungholt",
"breakfast",
"sanMiguel",
"amazonLumberyardInterior",
"amazonLumberyardExterior",
"amazonLumberyardCombinedExterior",
"gallery",
]
def fixNone(value):
#this converts... |
'''
summary
가장 멀리 떨어진 노드 개수 출력
params
vn=6
: 6개의 v
es=[[3, 6], [4, 3], [3, 2], [1, 3], [1, 2], [2, 4], [5, 2]]
: 각 es
output
3 : 1번 노드에서 가장 멀리 떨어진 v는 3개
strategy
한 v에서 여러 v로
무방향, 가중치X
bfs로 depth 기록하면서 가장 멀리 떨어진 노드 보면 될듯!
'''
from collections import deque
def solution(vn, es):
graph = [[] for _ in range(vn+1)... |
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from bs4 import BeautifulSoup as b
import time
import sys
username= #username
password= #password
chrome_browser = webdriv... |
import pickle
import sklearn
from sklearn import svm # this is an example of using SVM
from mnist import load_mnist
import matplotlib.pyplot as plt
import numpy as np
#fairtraintest return Training and Testing Arrays of size trainsize and testsize (x28x28)
#it selects example so as to have an equal distribution of eac... |
import subprocess
# Tasklist command
cmd_tasklist = ["tasklist"]
process = subprocess.Popen(cmd_tasklist, stdout=subprocess.PIPE)
pid_col = 1
name_col = 0
name_list = {}
# Invoking tasklist command
print "=> invoking tasklist command"
for line in process.stdout.readlines():
list = line.split(" ")
filtered = filter... |
import turtle
t = turtle.Turtle()
t.speed(10)
t.circle(100)
t.circle(50)
|
#!/usr/bin/env python
# coding: utf-8
# run testModel1 from CosmoTransitions
from test import testModel1
m = testModel1.model1()
m.findAllTransitions()
|
#!/usr/bin/env python
# encoding: utf-8
import os
import sys
import re
class Models() :
def __init__(self,path,models) :
self.path = path
self.models = models
class Api() :
def __init__(self,root,api) :
self.root = root
self.api = api
def static_content(self,fapi,api) :
... |
#!/usr/bin/env python
# encoding: utf-8
import os
from flask import Flask , request , url_for , send_from_directory
from werkzeug import secure
|
import random
lives = 9
words = ['shirt', 'human', 'fairy', 'teeth', 'otter', 'plane', 'eight', 'pizza', 'lives']
secret_word = random.choice(words)
clue = list('?????')
heart_symbol = u'\u2764'
guessed_word_correctly = False
def update_clue(guessed_letter, secret_word, clue):
index = 0
for char in secret_wor... |
import pygame
from pygame.sprite import Sprite
class Mine(Sprite):
def __init__(self, ai_settings, screen, ship):
super().__init__()
self.screen = screen
self.image = pygame.image.load('images/mine.png')
self.rect = self.image.get_rect()
self.rect.centerx = ship.rect.cente... |
from mongoengine import *
from datetime import datetime
from db import config
connect(config._MongoengineConnect)
class Item(EmbeddedDocument):
'''
流: 视频流,音乐流 句子的集合
'''
# belongsto_user = ReferenceField((Users), required=True,dbref=True)#,dbref=True
meta = {'allow_inheritance': True}
sentence_j... |
import time
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
class Amazon :
def __init__(self):
webOptions = webdriver.ChromeOptions()
webOptions.add_argume... |
import time
import tweepy
import os
import zlib
import qrcode
from pyzbar.pyzbar import decode
from PIL import Image
import base64
from encryption import AESCipher, load_keys
import pickle
import json
import subprocess
import requests
from io import BytesIO
from api_keys import api_keys
import sys
from sqlalchemy impor... |
import cv2
import numpy as np
img1 = cv2.imread('Groundtruthhere') ##replace with Original image here
img2 = cv2.imread('Sketchlocationhere') ## replace with the sketch here
vis = np.concatenate((img1, img2), axis=1)
cv2.imwrite('out.jpg', vis) ##mention the directory where you want the concatenated image to be s... |
#!/bin/python
import sys
n = int(raw_input().strip())
arr = map(int,raw_input().strip().split(' '))
negativeNumber = 0
positiveNumber = 0
zero = 0
for i in arr:
if i < 0:
negativeNumber+=1
elif i > 0:
positiveNumber+=1
else:
zero+=1
print format(positiveNumber/float(len(arr)),'.6... |
import logging
import numpy as np
import pandas as pd
import warnings
from numba import jit, uint64
from typing import Tuple, List
import attr
from attr.validators import instance_of
from itertools import chain
@attr.s
class TagPipeline:
"""
Pipeline to interpolate TAG lens pulses
:param pd.DataFrame pho... |
#One Away
import math
s1 = input().strip()
s2 = input().strip()
def checkEdit(s1 , s2):
if math.abs(len(s1) - len(s2)) > 1:
return False
long = s1 if len(s1) > len(s2) else s2
short = s1 if len(s1) < len(s2) else s2
idx1 = 0
idx2 = 0
found = 0... |
from django.shortcuts import render,redirect
from django.template import RequestContext
from .models import Chef_departement, Etudiant, Matiere, Professeur
from django.http import HttpResponse
from django.contrib.auth.decorators import login_required
# Create your views here.
@login_required(login_url='login')
def dep... |
#!/usr/bin.python
# -*- coding: utf-8 -*-
import os, sys, inspect
pfolder = os.path.realpath(os.path.abspath (os.path.join(os.path.split(inspect.getfile( inspect.currentframe() ))[0],"..")))
if pfolder not in sys.path:
sys.path.insert(0, pfolder)
reload(sys)
sys.setdefaultencoding('utf8')
from ConfigParser import Sa... |
names = ["Sherrod Brown",
"Maria Cantwell",
"Benjamin Cardin",
"Thomas Carper",
"Robert Casey",
"Dianne Feinstein",
"Amy Klobuchar",
"Robert Menendez",
"Bernard Sanders",
"Debbie Stabenow",
"Jon Tester",
"Sheldon Whitehouse",
"John Barrasso",
"Roger Wicker",
"Lamar Alexander",
"Susan Collins",
"John Cornyn",
"Richard D... |
# Importing the libraries
import tensorflow as tf
from keras.preprocessing.image import ImageDataGenerator
# Generating images in required format for the Training set
train_datagen = ImageDataGenerator(rescale = 1./255,
shear_range = 0.2,
zoom_range... |
import argparse
import logging
import os
parser = argparse.ArgumentParser(description='For Socket Connection')
parser.add_argument('--host', metavar='HOST', type=str, default='localhost', help='a string for a host address')
parser.add_argument('--port', metavar='PORT', type=int, default=9999, help='a integer for a por... |
from __future__ import print_function
from . import smile
def main():
print(smile()) |
# coding:utf-8
import time
from kivy.app import App
from kivy.uix.image import Image
from kivy.clock import Clock
from kivy.graphics.texture import Texture
from kivy.uix.boxlayout import BoxLayout
import cv2
import pybind_example
cascPath = "haarcascade_frontalface_default.xml"
faceCascade = cv2.CascadeClassifier(cv2.... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import argparse
import ctypes
import glob
import os
import re
import sys
from multiprocessing import Array
from multiprocessing import Process
from multiprocessing import Queue
from os.path import basename
from os.path import exists
import matplotlib.pyplot as plt
import ... |
import itertools
p = list(map("".join, itertools.permutations("123456789")))
for i in range(1000, 9999):
a = i * 1
b = i * 2
if str(a)+str(b) in p:
print(a, b) |
import os
import sys
import time
import argparse
import torch
import numpy as np
from torchtext import data
from torchtext import vocab
#from tensorboardX import SummaryWriter
import model
import TrainModel
import DatasetPreprocess
parser = argparse.ArgumentParser(description='TextCNN text classifier')
# Model hyper ... |
#!/usr/bin/python3
import sys
import os
import re
import math
opcode_table = {'add':['m', 1,'3', '18'],
'addf':['m', 1, '3', '58'],
'addr':['r', 2, '2', '90'],
'and':['m', 1,'3', '40'],
'clear':['r1', 1, '2', 'B4'],
'comp':['m',1,'3', '28... |
'''The MIT License (MIT)
Copyright (c) 2021, Demetrius Almada
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, me... |
from Data_Validator.schema_reader import load_schema
from Log_Writer.logger import App_Logger
import numpy as np
def verify_with_schema(data,schema_path):
log_writer=App_Logger()
try:
col_length, col_names, dtypes = load_schema(schema_path)
err=0
# validating column length
if d... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from django.shortcuts import *
from django.contrib import auth
from django.http import *
from django.core.mail import send_mail
from django.contrib.auth.models import User
from django.db import connection
from django.db.models import Count
from django.contrib.auth import lo... |
n=int(input())
#naive recursive sol
#complexity is o(2*n)
# def fibo(n):
# if n==1 or n==2:
# return 1
# else:
# return fibo(n-1)+fibo(n-2)
#o(n)
def fibo(n):
if n==1 or n==2:
return n
dp_arr=[0]*int(n+1)
dp_arr[0]=1
dp_arr[1]=1
for i in range(2,n):
dp_arr[i] ... |
class Solution:
def subtractProductAndSum(self, n: int) -> int:
####################
# Solution 1
# t = n
# list_t = []
# list_t.append(t%10)
# t = int((t - list_t[-1])/10)
# while(t > 0):
# list_t.append(t%10)
# t = int((t - list_t[-1... |
from rest_api.utils.base_blueprint import BaseBlueprint
from .controllers import CONTROLLERS
from .repositories import REPOSITORIES
from .urls import urls
class TaskBlueprint(BaseBlueprint):
_url_prefix = "/tasks"
_controllers = CONTROLLERS
_repositories = REPOSITORIES
_urls = urls
|
# -*- coding: utf-8 -*-
from flask import current_app
from werkzeug.security import generate_password_hash
from werkzeug.security import check_password_hash
from flask_login import UserMixin
from itsdangerous import (
TimedJSONWebSignatureSerializer as Serializer,
BadSignature,
SignatureExpired
)
from ... |
from django.db import models
from django.urls import reverse
class Quiz(models.Model):
name = models.CharField(verbose_name="Название теста", max_length=255)
users_passed = models.ManyToManyField(verbose_name="Пользователи прошедшие тест", to='auth.User', blank=True)
def get_absolute_url(self):... |
"""
Attack methods
"""
from .base import Attack
from .deepfool import DeepFoolAttack
from .gradientsign import FGSM
from .gradientsign import GradientSignAttack
from .iterator_gradientsign import IFGSM
from .iterator_gradientsign import IteratorGradientSignAttack
|
sum_value = 0
for num in range(1, 101):
sum_value = sum_value + num
print ("1부터 100까지 더한 값 =",sum_value)
sum_value = 0
for num in range(2, 101, 2):
sum_value += num # sum_value = sum_value + num
print ("1부터 100까지 값들 중에서 짝수만 더한 값 =",sum_value) |
class Solution(object):
def searchRange(self, nums, target):
"""
:type nums: List[int]
:type target: int
:rtype: List[int]
"""
left = 0
right = len(nums) - 1
def lower_bound(nums, target, left, right):
while left <= right:
m... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from .forismatic_quotes import get_quote
from .time_utils import get_time, get_date, get_weekday
from .battary_status import is_battery_low
from .greeting import get_greeting
|
import tensorflow as tf
# placeHolder 란
# 마치 데이터베이스의 PreapreStatement처럼 질의문 ? 를 생각하면 된다.
# 사용자가 입력한값을 질의문에 대응시키기 위하여 ?를 대시하듯이
# 어떤 수식에 대응시키기 위한 변수의 틀을 미리 만들어 두는개념이다
# 예를 들어 다음의 수식을 보자
# a = [1,2,3]
# b = a*2
# b는 정해진 배열[1,2,3] * 2만 할줄 안다 마약 어떤요소의 배열이라도 연산시키고자 한다
# 위와 같이 값을 구체화 하지 않고 다만, 3개짜리 배열이다. 라고 틀을 만들어두면 어떤요소의 배열이... |
from django.contrib import admin
from .models import CSgoUser, Gun
# Register your models here.
class CSgoUserAdmin(admin.ModelAdmin):
list_display = ('username', 'password',)
class GunAdmin(admin.ModelAdmin):
fieldsets = [
('枪名', {'fields': ['name']}),
('类别', {'fields': ['cate']}),
]
... |
import sys
products = [
['A', 3, 2],
['B', 4, 3],
['C', 1, 2],
['D', 2, 3],
['E', 3, 6]
]
products = [
['A', 3000000000, 2],
['B', 4000000000, 3],
['C', 1000000000, 2],
['D', 2000000000, 3],
['E', 3000000000, 6]
]
MAX_WEIGHT = 10
MAX_WEIGHT = 10000000000
def dfs():
... |
class Solution1:
def compress(self, chars):
"""
:type chars: List[str]
:rtype: int
"""
i = 1
j = 0
count = 1
res = []
while i < len(chars) + 1:
if i < len(chars) and chars[i] == chars[j]:
count += 1
i... |
from info.modules.index import index_blue
from flask import render_template, current_app, session, request, jsonify, template_rendered
from info.models import User, News
from info import constants, response_code
@index_blue.route('/news_list')
def news_list():
"""主页新闻展示"""
# 接受参数
cid = request.args.get('c... |
import re
def test_cleanupline(self):
# Failure message:
x = "Really? This can't be true! 5.5% is too much (trust me)"
s1 = cleanupLine(x)
s2 = re.sub("[^a-zA-Z0-9']",' ', x)
self.assertEquals(s1, s2)
def test_countWords(self):
# Failure message:
x = "Hello my Friend hello my other friend2 i rea... |
# -*- coding: utf-8 -*-
"""
Test the GenSchema API.
Created on Sun Jul 10 14:32:01 2016
@author: Aaron Beckett
"""
import pytest
from ctip import GenSchema
def test_construction():
"""Test GenSchema constructor."""
gen = GenSchema()
assert gen.name is None
assert gen.schema == {}
ge... |
from flask import Flask
from config import Config
from flask_sqlalchemy import SQLAlchemy
from flask_migrate import Migrate
from flask_bcrypt import Bcrypt
from flask_moment import Moment
from flask_login import LoginManager
from flask_mail import Mail
app = Flask(__name__)
app.config.from_object(Config)
db = SQLAlc... |
"""
The objective of this module is to average and integrate the variables of
interest and compute the terms in the kinetic and potential energy balance
equations, specifically for the forced plume experiment.
The main idea is to perform this operations without merging the subdmains that
are created from a simulation w... |
Your input
[1,3,5,4,7]
Output
3
Expected
3
Your input
[1,3,5,6,7]
Output
5
Expected
5
|
# -*- coding: utf-8 -*-
"""
Created on Sat Oct 28 18:29:53 2017
@author: amandaf
"""
import random, operator, matplotlib.pyplot
agents = []
# Set up random position in grid 100x100.
agents.append([random.randint(0,99),random.randint(0,99)])
print (agents)
# Random walk one step.
if random.random() <0.5:
agents[0][... |
"""Contains all the table definitions of the project."""
from django.db import models
from django.contrib.auth import get_user_model
# Create your models here.
# Need to figure out how to include the following
# Are you interested in serving as a mentor to students who identify as any of the following (check all tha... |
import spacy
import pickle
from fuzzywuzzy import fuzz #fuzz value to check similarity between two strings
import read_symbol
def get_list(sentence):
MIN_FUZZ_VALUE=55 #fuzz value to check similarity between two strings
nlp = spacy.load('en_core_web_sm') #pretrained model
company_name=read_symbol.get_comp... |
import numpy as np
import torch
from torch.utils.data import Dataset
from ..wrappers import *
from .. import grids
def scale_func_sigmoid(break_point=1.2, steepness=3.):
buf = np.exp(steepness*break_point)
c1 = 1./steepness*np.log(buf-2.)
c2 = (1.-buf)/(2.-buf)
target_scale = lambda x: c2 / (1. + np.... |
SCHEDULER_INTERVAL_IN_SECONDS = 1
SCHEDULER_MAX_SIMULTANEOUS_INSTANCES = 3
|
import torch
from .module import Module
class GroupNorm2D(Module):
r"""Applies Group Normalization over a mini-batch of inputs as described in
the paper `Group Normalization`_ .
.. math::
y = \frac{x - \mathrm{E}[x]}{ \sqrt{\mathrm{Var}[x]} + \epsilon} * \gamma + \beta
The mean and standard-de... |
# This file is part of Patsy
# Copyright (C) 2011-2012 Nathaniel Smith <njs@pobox.com>
# See file COPYING for license information.
# This file defines the main class for storing metadata about a model
# design. It also defines a 'value-added' design matrix type -- a subclass of
# ndarray that represents a design matri... |
class Solution(object):
def reverse(self, x):
"""
:type x: int
:rtype: int
"""
int_32_max = 2147483647
int_32_min = -int_32_max - 1
positive = 1 if x >= 0 else -1
x *= positive
result = 0
while x is not 0:
digit = x % 10
... |
from functools import reduce
from copy import deepcopy
def neighbours(piece, board, toS = '.'):
liberties = set()
for i in (1, 0), (0, 1), (-1, 0), (0, -1):
move = (i[0] + piece[0], i[1] + piece[1])
try:
if min(move) > -1 and board[move[0]][move[1]] == toS:
liberties.... |
# Generated by Django 3.1.4 on 2020-12-16 05:39
import datetime
import django.core.validators
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
... |
# -*- coding: UTF-8 -*-
import smtplib,traceback,os,sys,time,os.path,base64
import urllib,urllib2
import redis
class RedisServer:
def __init__(self,host='127.0.0.1',port=6379):
self.addr = (host,port)
self.cache = redis.StrictRedis(host,port)
def get(self,key):
return self.cache.get(key)
def set(self,key,... |
#-*- coding:utf8 -*-
import time
import datetime
import calendar
from celery.task import task
from celery.task.sets import subtask
from django.conf import settings
from shopback.fenxiao.models import PurchaseOrder,FenxiaoProduct,SubPurchaseOrder
from auth.apis.exceptions import UserFenxiaoUnuseException,TaobaoRequestEx... |
# Generated by Django 2.2 on 2020-12-23 09:31
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('app1', '0002_auto_20201221_2255'),
]
operations = [
migrations.AlterField(
model_name='comment',
name='user_comment_li... |
from django.contrib.auth.models import User
from django.db import models
from django.core.exceptions import ValidationError
# Our apps:
from utils import unique_slugify
class Group(models.Model):
"""
Users (below) may belong to a group.
"""
name = models.CharField(verbose_name='Group name',
... |
from django.db import models
# Create your models here.
class User(models.Model):
fname = models.CharField(max_length=264)
lname = models.CharField(max_length=264)
email = models.EmailField(max_length=264)
def __str__(self):
return self.fname+ ' ' + self.lname
|
import wavelet97lift as dwt
def png_cmp(s,s1):
im = dwt.Image.open(s)
im1 = dwt.Image.open(s1)
pix = im.load()
m = list(im.getdata())
m = [m[i:i+im.size[0]] for i in range(0, len(m), im.size[0])]
pix1 = im1.load()
m1 = list(im1.getdata())
m1 = [m1[i:i+im.size[0]] for i in range(0, len(m1), im1.size[0])]
fo... |
N = int( input())
A = list( map( int, input().split()))
S = [ -A[i] for i in range(N) if A[i] <= 0]
T = list( map( abs, A))
ans = sum(T)
if len(S)%2 != 0:
ans -= min(T)*2
print(ans)
|
"""Args to define training and optimizer hyperparameters"""
def add_args(parser):
parser.add_argument('--seed', help='Random seed', type=int, default=0)
|
import sys
BUFFER = [int(i) for i in '0' * 3000]
ip = 0 # stands for instruction pointer
# API
def inc_p():
global ip
global BUFFER
ip += 1
def dec_p():
global ip
global BUFFER
ip -= 1
def inc_b():
global ip
global BUFFER
BUFFER[ip] += 1
def dec_b():
global ip
global BUFFER
BUFFER[ip] -... |
# replace the following with your own before running the script
import datetime
# email details
fromaddr = # your gmail addres
pwd = # RISK OF PASSWORD BREACH! DON'T PUBLISH THIS!!!
toaddr = # your recepients
Cc = # if any cc's
host = 'smtp.gmail.com'
port = 587
# email content
today = str(datetime.date.today())
# ... |
# -*- coding: utf-8 -*-
# flake8: noqa
from __future__ import absolute_import, print_function, unicode_literals
from .shell import Shell |
import sys
import commander
import shlex
import utils
from logger import L
from gv import num_version, load_config_project
from time import sleep
def main(arguments):
# My code here
if len(arguments) > 1:
commander.main(args)
else:
utils.register_exit()
loop()
pass
def loop()... |
from subprocess import check_output
from mylcd import mylcd
from time import sleep
def get_hostname():
return check_output('hostname').decode().strip('\n')
def get_ips():
ip_data = check_output('ifconfig').decode().split()
ip_list = []
for item in ip_data:
if "addr:" in item:
... |
from fps import floating_point_system, graficar
def parametros(beta, t, L, U):
numbers, N, UFL, OFL = floating_point_system(beta, t, L, U)
print("La cantidad de numeros flotantes del sistema es: {0}. El numero mas pequeño que se puede representar(UFL) es: {1} y el numero mas grande que se puede representar(OFL... |
import pytest
from pystratis.nodes import BaseNode
from pystratis.api import APIError
from pystratis.api.rpc.responsemodels import *
@pytest.mark.integration_test
@pytest.mark.strax_integration_test
def test_call_by_name(strax_hot_node: BaseNode):
try:
response = strax_hot_node.rpc.call_by_name(command='g... |
from django.db import models
from django.contrib.auth.models import User
from django.contrib.contenttypes.fields import GenericForeignKey
from django.contrib.contenttypes.models import ContentType
from Users.models import UserInfo
from mptt.models import MPTTModel, TreeForeignKey
# Create your models here.
class Co... |
# this class is responsible for formatting the data requested as a string that can be used as a response by the chat bot
# each function here takes in the returned data of its corresponding data request function, as well as the full list of entities
# it returns a string that the bot should respond with
class Response... |
from flask import Flask
from flask import render_template
import fbchat
import base64
client = fbchat.Client("marikalee15@gmail.com",)
app = Flask(__name__)
@app.route("/")
def main():
return render_template('main.html')
@app.route("/button")
def messageMarika():
friends = client.getUsers("Marika Lee")
friends =... |
# -*- coding: utf-8 -*-
import os
import requests
import telebot
from flask import Flask, request
from data import TOKEN, bot, HEROKU_APP_NAME, format_kind
from markups import main_markup, back_markup, map_type_markup, geo_type_markup, toponym_markup, results_markup, \
request_markup
from mapAPI import map_api
from... |
# coding: utf-8
#__author__ = cmathx
import numpy
from theano import *
import theano.tensor as T
############function(parameters:dmatrix)################
#function1
x = T.dmatrix('x')
s = 1 / (1 + T.exp(-x))
logistic = function([x], s)
print logistic([[0, 1], [-1, -2]])
#function2
s2 = (1 + T.tanh(x / 2)) / 2
logi... |
import os
import requests
import json
import sys
import getpass
import hashlib
def baliho():
print '[+]FBI Tookit'
try:
token =open('token.txt','r').read()
r = requests.get('https://graph.facebook.com/me?/acces_token=' + token)
a = json.loads(r.text)
name = a['name']
n.append(a['name'])
p... |
#=========================================================================
# pisa_inst_xcel_test.py
#=========================================================================
import pytest
import random
import pisa_encoding
from pymtl import Bits
from PisaSim import PisaSim
from pisa_inst_test_utils import *
#---... |
from tkinter import *
def miles_to_km():
km=float(e1_value.get())/1.6
t1.insert(END,km)
window= Tk()
e1_value=StringVar()
e1=Entry(window,textvariable=e1_value)
e1.grid(row=0,column=1)
t1=Text(window,height=1,width=35)
t1.insert(END,"Km Values: ")
t1.grid(row=0,column=2)
b1=Button(window,text="Calculate Km",co... |
import argparse
import sys
import yaml
from .mlgen_code import code_generate
import os
import pkg_resources
import json
def main():
parser = argparse.ArgumentParser(description="Generate machine learning files in either python or jupyter notebook formats",formatter_class=argparse.ArgumentDefaultsHelpFormatter)
... |
# Set the version number for the current release of the XSTOOLs user scripts.
VERSION = '6.0.9' |
from __future__ import unicode_literals
VERSION = '0.1'
|
# -*- coding: utf-8 -*-
from odoo import models, fields, api
class ReceiptCashCheck(models.AbstractModel):
_name = 'report.raqmi_cheque.receipt_check_cash_payment'
@api.model
def _get_report_values(self, docids, data=None):
report_obj = self.env['ir.actions.report']
report = report_obj._... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
GUI для настройки rhvoice.
"""
import gi
gi.require_version('Gtk', '3.0')
from gi.repository import Gtk, Gio
import configparser
import os
from os.path import exists as path_exists
from os.path import expanduser
from shlex import quote
from rhvoice_tools import rhvoi... |
from onegov.core.utils import Bunch
from onegov.form import Form
from onegov.form.extensions import Extendable
from onegov.org.models import (
PersonLinkExtension, ContactExtension, AccessExtension, HoneyPotExtension
)
from uuid import UUID
def test_disable_extension():
class Topic(AccessExtension):
... |
###
# 这是为了更新https://ircre.org/research.html文件而写的代码
# 目的是从ircre.bib自动生成我们格式的research.html文件
#
###
import sys
import os
import bibtexparser
from bibtexparser.bibdatabase import BibDatabase
from bibtexparser.bparser import BibTexParser
from bibtexparser.bwriter import BibTexWriter
from datetime import datetime
curren... |
import sys
from collections import defaultdict
import matplotlib
from numpy import arange
import matplotlib.pyplot as plt
output_file = 'external.pdf'
title = 'Comparision to external systems'
maxval = 70
width_in = 7
height_in = 2
data_dir = 'eval/qa/output/final'
datasets = ['webquestions', 'trec', 'wikianswers']
s... |
import csv
import smtplib
from email.mime.text import MIMEText
from functions.utilities import variables as vrs
from functions.utilities import utils
from functions.utilities import directories as dr
from utilities import email_templates
from database import db_interface as db
def send_added_msgs(msg_dict, server):
... |
# __author__ = 'wangyazhou'
# -*-coding:utf-8-*-
from .drivers import Browser
import unittest
import logging
import time
import json
import os
'''
=====================说明======================
功能:自定义unittest框架,编写公用函数setup(),tearDown()
================================================
'''
class MyTest(unittest.TestCa... |
#!/usr/bin/env python
''' Analysis script for standard plots
'''
#
# Standard imports and batch mode
#
import ROOT, os
ROOT.gROOT.SetBatch(True)
import itertools
from math import sqrt, cos, sin, pi, acos, cosh
from RootTools.core.standard import *
from TopEFT.Tools.user import p... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.