text stringlengths 38 1.54M |
|---|
import pandas as pd
import numpy as np
school_id_list = [{'name': 'John', 'job': "teacher", 'age': 40},
{'name': 'Nate', 'job': "teacher", 'age': 35},
{'name': 'Yuna', 'job': "teacher", 'age': 37},
{'name': 'Abraham', 'job': "student", 'age': 10},
... |
student={'name':'john','age':25,'courses':['math','CompSci']}
print(student)
# use value by key
print(student['name'])
print(student['courses'][1])
# if any key does not exist than it gives error so use the get way
print(student.get('courses','not found'))
# add new key value in dict
student['mobile_mumber'] = '555-... |
import sys
import re
from node import *
value = open(sys.argv[1]) #opening a file
disp=[]
for wall in value:
disp.append(re.split(",",re.sub(r"\n", "",wall )))
arr=[]
arg=disp[0]
loc = ""
for row in disp:
loc = ""
if row[-1] is'1':
iterator = 0
loc += ... |
# Copyright 2019 Google Inc.
#
# 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, ... |
import socket
remoteip = "misc.chal.csaw.io"
remoteport = 8000
def sock(remoteip, remoteport):
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect((remoteip, remoteport))
return s, s.makefile('rw', bufsize=0)
def read_until(f, delim='\n'):
data = ''
while not data.endswith(delim):
... |
# Generated by Django 3.2 on 2021-05-02 17:40
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
("app", "0008_alter_person_managers"),
("app", "0008_rename_plataform_offer_platform"),
]
operations = []
|
#
# SPDX-FileCopyrightText: Copyright (c) 1993-2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
#
# 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... |
# Generated by Django 2.2 on 2020-02-10 11:35
import DjangoUeditor.models
import datetime
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
na... |
from tkinter import *
from frameworkGUI import GUI
import subprocess
import threading
def data_collection():
subprocess.call("pythonw.exe dataCollector.py", shell=False)
def gui():
root = Tk()
gui = GUI(root)
gui.show_app_buttons()
gui.run_applications('Home')
root.mainloop()
# this thre... |
import sys
class colCount:
"""Module used to get the col count"""
def getColCnt(self,filename):
try:
filename=filename+".txt"
#print "Step5.1: Obtain the col count data:"+filename
fin = open(filename, "r")
... |
from django.utils.translation import ugettext_lazy as _
from django.db import models
from cms.models import CMSPlugin
from os.path import join
from django.conf import settings
from cmsplugin_news_remote.utils import update_cache
# Create your models here.
class LatestNewsRemotePlugin(CMSPlugin):
# code is partly borrow... |
from django.contrib import admin
# Register your models here.
from .models import ChatRoom, ChatMessage
admin.site.register(ChatRoom)
admin.site.register(ChatMessage)
|
"""Utility functions for running nested cross-validation of sampling methods
"""
# Authors: Lyubomir Danov <->
# License: -
import pandas
import pytest
from sklearn.datasets import load_breast_cancer
from sklearn.ensemble import RandomForestClassifier
from sklearn.metrics import accuracy_score, f1_score, make_scorer
... |
from django import forms
from django.contrib.auth.models import User
from Jetbrain.user.models import Profile
class SignUp(forms.ModelForm):
username = forms.CharField(widget=forms.TextInput(attrs={'placeholder': 'Username'}), label='')
first_name = forms.CharField(widget=forms.TextInput(attrs={'placeholder':... |
import sqlite3, os, sys, time, traceback, random, signal
import numpy as np
DB_DIR = "/var/log/rampart/db/"
DATABASE = "stat.db"
WAL = False
RULE_LIFE_SPAN = 30
RULE_EXPIRY_TIME = 10
def getlocaltime():
return time.strftime("%Y-%m-%d %H:%M:%S", time.localtime())
def signal_term_handler(sig, frame):
global co... |
# coding = utf-8
# @time : 2019/6/30 6:41 PM
# @author : alchemistlee
# @fileName: filter_long_tk.py
# @abstract:
if __name__ == '__main__':
input_zh = '/root/workspace/translate_data/my_corpus_v6.zh-cut.processed6-bpe-v6-2-.test'
input_en = '/root/workspace/translate_data/my_corpus_v6.en.tok.processed6-... |
from flask import (Flask,
make_response,
redirect,
render_template,
request,
Blueprint,
abort)
from ..settings import settings, backend
from .utils import StaticFilesFlask
import os
import math
import url... |
from django.urls import path
from . import views
urlpatterns = [
path('', views.view_wishlist, name='view_wishlist'),
path('add_to_wishlist/<car_id>/', views.add_to_wishlist,
name='add_to_wishlist'),
path('remove_wishlist_item/<car_id>/', views.remove_wishlist_item,
name='remove_wishlist_... |
from unittest import TestCase
import create_graph as cg
class TestCreate_graph(TestCase):
def send_msg(self, channel, msg):
print("TECHIO> message --channel \"{}\" \"{}\"".format(channel, msg))
def success(self):
print("TECHIO> success true")
def fail(self):
print("TECHIO> succ... |
# coding=utf-8
'''
Fetch FMI open data using "fmiopendata"-library
https://github.com/pnuu/fmiopendata
pip install fmiopendata
numpy, requests, pandas, datetime, math, matplotlib, pathlib, os
Configured for 1.9. - 30.6. (~possibility for snow in ground) !
'''
from createPaths import createPaths
from splitWinters imp... |
import numpy as np
import maps
# ------------------------------
# Obsolete, delete soon (04/24/2014
# def qe_cov_fill_helper( qe1, qe2, cfft, f1, f2, switch_12=False, switch_34=False, conj_12=False, conj_34=False ):
# lx, ly = cfft.get_lxly()
# l = np.sqrt(lx**2 + ly**2)
# psi = np.arctan2(lx, -ly... |
import os
from datetime import datetime
def get_current_time():
"""
Reads current time rom system and returns it as a string.
Returns:
str: string of current time in format %H:%M:%S.
"""
return datetime.now().strftime('%H:%M:%S')
def make_datetime_str(time_str):
"""
Gets the current date and chang... |
"""
Collect basic features about the user that can be used to predict attributes.
features collected: # of incoming/outgoing, workday/nonworkday, weekend/weekday calls
Stores features in a csv file with the user id + features
"""
import csv, collections, pickle, os, time
from datetime import datetime
c... |
import games.interfaces
import random
class heuristics_c4(games.interfaces.Heuristics):
def generate_score(self, game_state: games.interfaces.InterfaceGames2Player):
if self.check_victory(game_state):
return self.check_victory(game_state)
else:
score_horizontal = self.check_... |
#!/usr/bin/env python
"""
usage is
score [vcmfh] <answer> <key> <sensemap>
-v (or --verbose)
verbose -- print out every entry
-c (or --coarse)
coarse grained scoring
-m (or --mixed)
mixed grain scoring
-f (or --fine)
fine grain scoring (default)
-h (or --help)
print out this ... |
#!/usr/bin/env python3
import unittest
import numpy as np
import numpy.testing as npt
import math
import functions as F
class Test1DFunctions(unittest.TestCase):
#scalar tests
def test_ApproxJacobian1(self):
slope = 3.0
# Yes, you can define a function inside a function/method. And
... |
import inspect
import logging
from slack_bolt.kwargs_injection.utils import build_required_kwargs
from slack_bolt.request.request import BoltRequest
from slack_bolt.response.response import BoltResponse
from plugins.shared_links import shared_links
from include.herald import herald
from slack_bolt.context import Bolt... |
import gymnasium as gym
from stable_baselines3 import DQN
from stable_baselines3.common.vec_env import VecVideoRecorder, DummyVecEnv
import highway_env
def train_env():
env = gym.make('highway-fast-v0')
env.configure({
"observation": {
"type": "GrayscaleObservation",
"observat... |
import urllib
import re
url=raw_input("enter url:")
f=urllib.urlopen(url)
d=f.read()
a=re.compile('<img.*src="(.*\.jpg)"')
n=re.findall(a,d)
b=open("link1.txt","w")
for i in n:
b.write(url+i+"\n")
b.close() |
#! /usr/bin/env python
# -*- coding=utf8 -*-
"""
ref:
https://stackoverflow.com/questions/45719176/how-to-display-runtime-statistics-in-tensorboard-using-estimator-api-in-a-distri
"""
import tensorflow as tf
from tensorflow.python.training.session_run_hook import SessionRunHook
from tensorflow.python.training.session... |
from django.urls import path
from .views import processes_list,process,join_process
urlpatterns = [
path('',processes_list),
path('<int:pk>',process),
path('<int:pk>/join',join_process)
]
|
#!/usr/bin/python
import random
import sys
count = 0
while count < 1000:
x=random.randint(1,100)
j=random.randint(1,200)
op = ["+", "-", "*"]
op_num = random.randint(1,3)
data = ""
solve = 0
solve = x + j
data = ("what is %d + %d\n" % (x , j))
r = input(data)
if int(r) == sol... |
from main import count_animals
def test_count_animals(benchmark):
assert benchmark(count_animals, "I see 3 zebras, 5 lions and 6 giraffes.") == 14, 'Live from the Savannah'
assert benchmark(count_animals, "Mom, 3 rhinoceros and 6 snakes come to us!") == 9
assert benchmark(count_animals, "I do not see any ... |
#!/usr/bin/env
# -*- coding: utf-8 -*-
username = "user ID"
password = "password"
season = "season ID"
fakulta = "faculty ID"
studium = "studium ID"
# Set the time when the scripts should fire
time_hours = 17
time_minutes = 0
time_seconds = 0
time_microseconds = 0
|
# Using readlines()
file = open('input-2.txt', 'r')
lines = file.readlines()
horizontal_pos = 0
depth = 0
for line in lines:
direction, amount = line.split(" ")
if direction == "forward":
horizontal_pos += int(amount)
elif direction == "up":
depth -= int(amount)
elif direction == "down":
depth += int(amount... |
import sys
import pytest
from pytest import mark
from osbrain import run_agent
from osbrain import run_logger
from osbrain import run_nameserver
from osbrain.helper import sync_agent_logger
skip_windows = mark.skipif(sys.platform == 'win32',
reason='Not supported on windows')
skip_windows_... |
# Feito por: Cacatua
# Criado em: 19/05/2021
# Atualizado em: 21/06/2021
"""
Descrição:
Script para ver a quantidade de membros no servidor e mandar uma
mensagem de bom dia dizendo esta quantidade com o horário.
Como Utilizar:
Deixe o Discord aberto no chat e ele pegará e digitará a mesnagem
automaticam... |
# 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
# distributed under t... |
from django.conf.urls import url
from django.urls import path
from . import views
urlpatterns = [
path("register/",views.register_event,name="register_event"),
path("calendar/",views.CalendarView.as_view(),name="calendar"),
path("event_list/",views.event_list,name="viewEvent"),
path("event_edit/<in... |
from django.contrib import admin
from django.urls import path,include
from .views import (home_page,
register,
logout_request,
login_request,
list_exercises,
exercise,
add_exercise,
... |
import os
files = ['1_requests.py',
'2_session.py',
'3_async1.py',
'5_async3.py',
'6_action1.py',
'7_action2.py']
for _ in range(100):
for file in files:
print(f'\nStarting script {file}')
os.system(f'python3 {file}')
print(f'Ending script {file... |
from django.http import request
from django.views import View
from django.shortcuts import render, redirect
from django.contrib.auth.models import User
from django.shortcuts import render
from django.views import generic
from boto3.session import Session
from datetime import date, datetime
from .models import Article
... |
pkg_pip = {
'mako': {},
# this needs to be installed, but pip does not state, that it is so use unless instead
'setuptools': {
'unless': 'pip list | grep setuptools',
},
}
if node.has_bundle('apt'):
files['/etc/apt/sources.list.d/hashicorp.list'] = {
'content': 'deb [arch=amd64] ht... |
"""
Implementation of a RBF kernel PCA for dimensionality reduction using SciPy and NumPy helper functions
"""
from scipy.spatial.distance import pdist, squareform
from scipy import exp
from scipy.linalg import eigh
import numpy as np
def rbf_kernel_pca(x, gamma, n_components):
"""
RBF Kernel PCA implementat... |
from logic import convert_to_csv
# create test variables
input_folder = 'test/downloader_input'
# input_folder = 'test/input/klhs_shino'
output_folder = 'test/ui_output'
output_file = 'test.csv'
# call function
convert_to_csv(input_folder, output_folder, output_file)
|
lst1=["Apple","Banana","Orange","Tomato","Mango"]
i=0
# for i in range(i,len(lst1)):
# print(lst1[i])
# i=i+1
for i in lst1:
print(i)
else:
print("This is inside of false")
print(len(lst1))
# print(lst1[1]) |
#!/usr/bin/python
# coding:utf-8
# change log list
# 20170209 shaoning (__main__) command line parse method changed
import sys
import commands
import re
import time
import datetime
import OptParser
def usage():
print """Help(-h|--help)for icfs-admin-log:
Usage:
>> icfs-admin-log ---- --download ---- --config -... |
import os
import simpleaudio as sa
import time
class SOUND:
def onRead(self):
f = os.path.join(os.path.dirname(__file__), "read.wav")
wave_obj = sa.WaveObject.from_wave_file(f)
play_obj = wave_obj.play()
#play_obj.wait_done()
def onFalse(self):
pass
def onError(self):
pass
if __name__ == '__main__... |
N, M, C = map(int, input().split())
B_lst = list(map(int, input().split()))
lst = list()
count = 0
for i in range(N):
lst.append(list(map(int, input().split())))
for e1 in lst:
summation = 0
for i, e2 in enumerate(e1):
summation += B_lst[i] * e2
summation += C
if summation > 0:
count... |
from django.conf.urls import url
from core.api.routers import PostHackedRouter
from . import views
router = PostHackedRouter()
router.include_root_view = False
# reverse('api:word-list'), reverse('api:word-detail', kwargs={'pk': 1})
router.register(r'word', views.WordViewSet, base_name='word')
router.register(r'skint... |
A = False
B = False
C = True
a = (not A or not B) and not C
b = (not A or not B) and (A or B)
c = A and B or A and C or not C
print("a)",a)
print("б)",b)
print("c)",c)
|
import itertools
import numpy as np
import matplotlib
matplotlib.use('TkAgg')
import matplotlib.pyplot as plt
import pandas as pd
from sklearn import svm, datasets
from sklearn.model_selection import train_test_split
from sklearn.metrics import confusion_matrix
from sklearn.preprocessing import StandardScaler
from skle... |
# Generated by Django 2.2.9 on 2020-02-14 09:57
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('transportation', '0009_auto_20200214_0807'),
]
operations = [
migrations.AlterField(
model_name... |
# coding: utf-8
# 自分の得意な言語で
# Let's チャレンジ!!
a, n = map(int, input().split())
print(a*n)
|
#!/usr/bin/python
import argparse
import os
import sys
class WordFrequencyCount:
def __init__(self, memoryUsageInMegabytes, inputfilename, outputfilename):
self.inputFileName = inputfilename
self.outputFileName = outputfilename
self.maxMemoryUsage = memoryUsageInMegabytes * 1024 * 1024
self.wordArray = []
d... |
#write a function called "partition"
#This function accepts a list and a callback function which assumes returns tru or false
#The function should iterate over each element in the list and invoke the callback function at each iteration
# the result should be a list made of two list, [truthy or falsey] list
list = [... |
#!/usr/bin/env python3
import boto3
from datetime import datetime
class R53:
def __init__(self):
self.client = boto3.client('route53')
@staticmethod
def __get_domain_from_fqdn(fqdn):
fqdn_as_list = fqdn.split('.')
del fqdn_as_list[0]
domain = '.'.join(fqdn_as_list)
... |
from solver import *
class SolverDFS(UninformedSolver):
def __init__(self, gameMaster, victoryCondition):
super().__init__(gameMaster, victoryCondition)
def solveOneStep(self):
"""
Go to the next state that has not been explored. If a
game state leads to more than one unexplor... |
def solution(record):
answer=[]
userDict=dict()
charLog=[]
for info in record:
infoLst=info.split('')
if infoLst[0]=='Enter':
if infoLst[1] not in userDict.keys():
userDict[infoLst[1]]=infoLst[2]
else:
userDict[infoLst[1]]=infoLst[2... |
import numpy as np
import matplotlib.pyplot as plt
import pickle
import os
# directory
current_dir = os.path.dirname(os.path.abspath(__file__))
categories = {0:'airplane', 1:'automobile', 2:'bird', 3:'cat', 4:'deer',
5:'dog', 6:'frog', 7:'horse', 8:'ship', 9:'truck'}
def unpickle(data_batc... |
from flask import Flask, render_template, request
from arbitrage_algos import ArbitrageAlgorithms
from visualization import GraphVisualization
from forex_scraper import ForexScraper
"""
This is the main class that runs the web-app.
"""
app = Flask(__name__)
@app.route('/')
def index():
"""
Method that returns... |
hours = input('Enter hours: ')
rate = input('Enter rate: ')
try:
hours = int(hours)
rate = float(rate)
except:
print('Please enter a numeric value.')
quit()
if(hours > 40):
rate = rate * 1.5
salary = hours * rate
print(round(salary,2))
|
import tensorflow as tf
import tflearn
import cPickle
import numpy as np
import sys
import os
import argparse
from sklearn import metrics
# os.environ["CUDA_VISIBLE_DEVICES"]="9"
def unpickle(fid):
with open(fid, 'rb') as fo:
data = cPickle.load(fo)
return data
def bottleneck_layer(x, filters, scope,... |
import numpy as np
import investor.predict
from investor.predict.numerics import roi_window, roi
class SlidingWindow:
def __init__(self, win, target, lag):
'''
Sliding window prediction.
For an n-dimensional time series we extract windows
of a certain size at each time and take t... |
import pygame
from Shape import Shape
class Board:
# создание поля
def __init__(self):
self.width = 500
self.height = 800
self.board = [[0] * self.width for _ in range(self.height)]
# значения по умолчанию
self.left = 10
self.top = 10
self.cell_size = 50... |
""" Helper functions for the Access Control Queuing problem
This script contains object definitions and herlper functions for the Access Control
Queuing problem, which are useful for the q-learning implementation.
This file should be imported as a module and contains the following functions:
* get_action - retu... |
import pygame # import pygame module
pygame.init() # initialize all of pygame's submodules
screen = pygame.display.set_mode((400, 400)) # create a surface called 'screen' and give it a size of 400x400
running = True # used to control while loop
"""Setup for working with text"""
my_font = pygame.fon... |
from django.shortcuts import render
# Create your views here.
def home(request):
context={}
if request.method=='POST':
answer=eval(request.POST["nameC"])
context={"answer": answer}
return render(request, 'index.html', context) |
# -*- coding: utf-8 -*-
"""Top-level package for Log Aggregator Server."""
__author__ = """Trumble0921"""
__email__ = 'joonyeolsim@gmail.com'
__version__ = '0.2.1'
|
# -*- coding:utf8 -*-
from mock import Mock
from collections import defaultdict
try:
# python 2.6
from unittest2 import TestCase, SkipTest
except ImportError:
from unittest import TestCase, SkipTest
from nos import Client
class DummyTransport(object):
def __init__(self, responses=None, **kwargs):
... |
# getting input from user and pars it to the integer
your_weight = input("Enter your Weight in kg: ")
print(type(your_weight))
# to parse value of variable, we have to put it in seperate line or put it equal new variable
int_weight_parser = int(your_weight)
print(type(int_weight_parser))
# formatted String
first_... |
# Numerical Methods II, Courant Institute, NYU, spring 2018
# http://www.math.nyu.edu/faculty/goodman/teaching/NumericalMethodsII2018/index.html
# written by Jonathan Goodman (instructor)
# see class notes Part 2 for more discussion
# Illustrate Fourier interpolation ...
# ... and how the Python FFT works ...
# ... |
#####################################################################################
# Name : codestrs_final.py #
# Date : Dec 4, 2016 #
# Description : Solution to updating the Flappy Bike game u... |
import sys
from solution import Solution
# from classes import ?
class TestSuite:
def run(self):
self.test001()
def test001(self):
print "test 001"
s = " the sky is blue "
r = Solution().reverseWords(s)
print " inpu... |
from odoo import models, fields, api
class accouting_customer(models.Model):
_inherit = 'hr.expense.sheet'
# def _check_user_ap(self):
# user_id = self.env['res.users'].browse(self._uid)
# if user_id:
# if user_id.login == 'ap_manager':
# return True
# e... |
from api.base_model import db
class Business(db.Model):
__tablename__ = 'business'
id = db.Column(db.Integer, primary_key=True)
businessname = db.Column(db.String(50), unique=True)
description = db.Column(db.String(50), nullable=False)
category = db.Column(db.String(50), nullable=False)
locati... |
# queue.py
# by James Fulford
# for Joyful Love
# implements needed functions from Buffer API
import utilities
from utilities import get_when
from utilities import dtformat
import buffpy
class Queue(utilities.SaveLoad):
"""
Represents a single buffer.
.name() returns a pretty string
Que... |
import random
from django import template
from django.utils.safestring import mark_safe
from common.data.greetings import DUMB_GREETINGS
from common.markdown.markdown import markdown_email
register = template.Library()
@register.filter(is_safe=True)
def email_markdown(text):
return mark_safe(markdown_email(tex... |
import os
import pathlib
import pandas as pd
def compute_speedup_over_rocksdb(results):
"""
Given a dataframe with the raw results (LLSM and RocksDB), removes all
RocksDB rows and replaces them with a new column "speedup_over_rocksdb".
"""
llsm = results[results["db"] == "llsm"]
rocksdb = res... |
L = ['Michael', 'Sarah', 'Tracy', 'Bob', 'Jack']
print(L[0:3])
#如果第一个索引是0可以省略
print(L[:3])
print(L[-2:])
print(L[-2:-1])
L = list(range(100))
print(L[:10])
print(L[-10:])
print(L[10:20])
print(L[:10:2])#前十个,每两个取一个
print(L[::5])#所有数每五个取一个
#tuple也是一种list,唯一区别是tuple不可变。因此,tuple也可以用切片操作,只是操作的结果仍是tuple
t = (0,1,2,3,... |
# -*- coding: utf-8 -*-
# Copyright 2009-2019 Yelp and Contributors
#
# 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 appli... |
import os
import scipy.io.wavfile as wav
from python_speech_features import mfcc
import numpy as np
input_dir = r"C:\Users\a7825\Desktop\工作空间\语音数据\ogvc_16\M2\A\wav_16"
output_dir = r"C:\Users\a7825\Desktop\工作空间\语音数据\ogvc_16\M2\A\mfcc_13"
if __name__ == "__main__":
for ad_file in os.listdir(input_dir):
... |
from django.shortcuts import render
import pyautogui, sys
import pyscreeze
import os
import os, sys, stat
import shutil
from pathlib import Path
class Desktop(object):
def __init__(self):
self.switch = False
self.username = username = os.getlogin()
#print(os.path.join(os.environ["HOMEPATH... |
# Population Class | Genetic Algorithm
from random import randint
from random import choice
class Population:
class Member:
def __init__(self, lifespan=50, write_dna=True):
self.lifespan = lifespan
self.fitness = 0
self.directions = ["U", "D", "L", "R"]
if ... |
#!/usr/bin/env python
#_*_ coding:utf-8 _*_
'''
Created on 2018年3月23日
@author: yangxu
'''
from django.core.paginator import Paginator
def page(obj,pagenum,datarow):
pagelist = []
pagedict = {'pagecount':None,'pagenum':None,'itemcount':None,'pagedata':None}
for item in obj:
pagelist.ap... |
from functions import *
from exerciseData import *
from personalData import *
from email_functions import *
from exerciseList import *
from email_functions import *
import os
import sys
import subprocess
from functools import reduce
curWeek, weekSets = findWeekSets()
from exerciseData import warmups
# make a fu... |
#coding:utf-8
from flask import request, jsonify
from app.models.clients import Usuario
from app import app
from app import db
from app.controllers.clients import ControllerClients
@app.route('/usuario/cadastrar', methods=['POST'])
def cadastrar():
try:
data = request.get_json()
controller = ControllerClients()
... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon Oct 23 21:02:12 2017
@author: enriqueareyan
"""
import basic_plots
import marketmaker_plots
import deviation_graphs
import markov_chain
for number_of_games in [100, 200, 400]:
print('[Plotting for number of games = ', number_of_games, ']')
bas... |
import asyncio
async def tick():
print('Tick')
await asyncio.sleep(1)
print('Tock')
async def main():
await asyncio.gather(tick(), tick(), tick())
for taks in asyncio.all_tasks():
print(taks, end='\n')
if __name__ == '__main__':
coroutine = main()
# print(coroutine)
# async... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""Validates and parses SPF amd DMARC DNS records"""
import logging
from collections import OrderedDict
from re import compile, IGNORECASE
import json
from csv import DictWriter
from argparse import ArgumentParser
import os
from time import sleep
import socket
import smt... |
import numpy as np
obstacles = np.loadtxt("obstacles - first.csv", delimiter=',')
#print (obstacles)
start_distr = -0.5
end_distr = 0.5
start_x = -0.5
start_y = -0.5
goal_x = 0.5
goal_y = 0.5
k_nn = 3
nodes = np.array([[1,-0.5,-0.5,np.sqrt((goal_x-start_x)**2 + (goal_y-start_y)**2)]])
sample_x = np.random.unifor... |
# alligator
import re
from util import hook
# dub_url = "http://tubedubber.com/#%s:%s:0:100:0:%s:1"
dub_url = "http://www.youdubber.com/index.php?video={}&audio={}&audio_start=0"
whale_url = "http://www.youtube.com/watch?v=ZS_6-IwMPjM"
cow_url = "http://www.youtube.com/watch?v=lXKDu6cdXLI"
lawn_url = "http://www.youtu... |
from django.contrib.auth.models import User
from django.contrib.auth.forms import UserCreationForm
# from .models import Profile
class UserRegisterForm(UserCreationForm):
# default: required = True
class Meta:
model = User
# now we know that when we'll do form.save() we'll save it t... |
import FWCore.ParameterSet.Config as cms
from ..modules.ecalRecHit_cfi import *
ecalRecHitNoTPTask = cms.Task(
ecalRecHit
)
|
# -*- coding: utf-8 -*-
"""
824. Goat Latin
@link https://leetcode.com/problems/goat-latin/
"""
class Solution:
def toGoatLatin(self, S: str) -> str:
s_list = S.split(' ')
result = ''
for i in range(0, len(s_list)):
temp = ''
if s_list[i].lower().startswith('a') or ... |
# Generated by Django 3.0.7 on 2020-07-16 09:03
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('rfqsite', '0012_forecast_aeqfc'),
]
operations = [
migrations.RenameField(
model_name='part_costing',
old_name='nre_amortizi... |
#I pledge on my honor that I have not given or received
# any unauthorized assistance on this project.
# William Sentosatio UID 114545749
# Project 1 CMSC421
import math, racetrack
import sys
# borrowing heuristics'
infinity = float('inf') # alternatively, we could import math.inf
# global variables
g_fline = Fa... |
#!/usr/bin/env python3
import sys
print('= data from cmd_2 to stdout=', file=sys.stdout)
print('- data from cmd_2 to stderr-', file=sys.stderr)
|
"""
public static TreeNode mirrorTree1(TreeNode root)
{
if(root==null)
return null;
//对左右孩子镜像处理
TreeNode left=mirrorTree1(root.left);
TreeNode right=mirrorTree1(root.right);
//对当前节点进行镜像处理。
root.left=right;
root.right=left;
return root;
... |
import uuid
from django.db import models
from applications.base.model_mixins import UserTenantModel
from applications.feed.models import Feed, Item
class Subscription(UserTenantModel, models.Model):
id = models.UUIDField(
primary_key=True,
default=uuid.uuid4,
editable=False
)
fee... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.