text
stringlengths
8
6.05M
from typing import Optional import numpy as np import sklearn import sklearn.decomposition import sklearn.linear_model import sklearn.pipeline import sklearn.preprocessing import torch from fastprogress.fastprogress import force_console_behavior import mabe import mabe.config import mabe.features import mabe.model m...
from datetime import datetime from google.auth.transport import requests from vs_bim import speak, time def current_weather(): ow_url = "http://api.openweathermap.org/data/2.5/weather?" city = 'hanoi' if not city: pass api_key = "fe8d8c65cf345889139d8e545f57819a" call_url = ow_url + "app...
from django.shortcuts import render, redirect, get_object_or_404 from .models import Write, Comment from .forms import WriteForm, CommentForm from django.views.decorators.http import require_POST from django.contrib.auth.decorators import login_required import random # Create your views here. def index(request): ...
import pymongo _MongoengineConnect = 'mynihongo2' _MongoUrl = 'localhost' _Client = pymongo.MongoClient(_MongoUrl,27017) _Db = _Client[_MongoengineConnect]
#!/usr/bin/env python # -*- coding=utf8 -*- ####################### #用线程池来写同一个文件 ####################### #######多线程写文件####### import time import threading import logger import thread_pool def addNum(): global num #在每个线程中都获取这个全局变量 time.sleep(3) if lock.acquire(): #修改数据前枷锁 num -= 1 # print('...
from dictators.dictators_game import models def create_user(username: str, password_hash: str, password_salt: str, email_address: str) -> bool: username_match = models.User.objects.filter(username=username) email_match = models.User.objects.filter(email_address=...
import glob import os import ssl import argparse import urllib3 import json import logging import urllib.request import base64 import pandas as pd import numpy as np from pathlib import Path from datetime import datetime urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning) urllib3.disable_warnings(urlli...
from django.shortcuts import render from django.http import HttpResponse from django.views.generic import View from django.http import JsonResponse from django import forms from django.views.decorators.csrf import csrf_exempt from django.utils.decorators import method_decorator from report.models import * import json ...
import pandas as pd import json import sys from casos import casos_positivos, casos_fallecidos poblacion_sanmartin = 906777 positivos_sanmartin = list(casos_positivos[casos_positivos['DEPARTAMENTO'] == "SAN MARTIN"].shape)[0] positivos_hombres_sanmartin = list(casos_positivos[(casos_positivos['DEPARTAMENTO'] == "SAN M...
# Author : Mohammad Farhan Fahrezy # https://github.com/farhanfahrezy/ # Insert any number that larger than -1 number = int(input("Insert any positive integer = ")) factorial = 1 if number < 0: ...
from django.urls import path from . import views urlpatterns = [ path("", views.index, name="index"), path("login", views.login_view, name="login"), path("logout", views.logout_view, name="logout"), path("register", views.register, name="register"), path("new", views.create_new_listing, name="new"...
import random def divide(): """Add a dashed line to separate output.""" print("----------------------------------------") # Classes for Superhero Game class Ability: def __init__(self, name, attack_strength): """ Parameters: name (String) max_damage(Integer) """ ...
#!/usr/bin/env python3 import csv import time import subprocess from flask import Flask, render_template, send_file, abort, request, Markup #CONFIG AUTH_TOKEN={"key":"Vpnmanagertoken","value":"randomnumber"} CHECK_HEADER_TOKEN=False CHECK_HEADER_AUTH=False APP_ROOT="" HOST='127.0.0.1' PORT=5000 TRUSTED_PROXIES = ('1...
from selene.support import by from pteromyini.core.com.find_element import find_spaces, find_texts_in_element from pteromyini.core.com.space import space from pteromyini.lib.debug.profiler import ProfileTime def __remove_whitespace(texts: list): result = [] for t in texts: if t is None: ...
np.random.seed(123) #In [2]: ## NUMBER OF ASSETS n_assets = 4 ## NUMBER OF OBSERVATIONS n_obs = 1000 return_vec = np.random.randn(n_assets, n_obs) #In [3]: plt.plot(return_vec.T, alpha=.4); plt.xlabel('time') plt.ylabel('returns') plt.show() #In [4]: def rand_weights(n): ''' Produces n rando...
from telegraph import Telegraph import scrape from argparse import ArgumentParser parser = ArgumentParser(description="Script to give you allow you to easily read doujins as telegraph articles") parser.add_argument("-s", "--source", help="The digits of the doujin", type=int) args = parser.parse_args() if not args.sou...
from orun.urls import path, re_path from . import views app_name = 'admin' urlpatterns = [ path('web/', views.client.index), path('web/login/', views.client.login, name='login'), path('web/logout/', views.client.logout), path('web/login/authenticated/', views.client.is_authenticated, name='logged'), ...
#!/usr/bin/python #\file property.py #\brief Test of @property. #\author Akihiko Yamaguchi, info@akihikoy.net #\version 0.1 #\date Aug.20, 2015 ''' Refs. http://qiita.com/knzm/items/a8a0fead6e1706663c22 http://stackoverflow.com/questions/15458613/python-why-is-read-only-property-writable NOTE: - Each class t...
#!/usr/bin/env python # -*- coding: utf-8 -*- import argparse import datetime import getpass import sys import mysql.connector parser = argparse.ArgumentParser() parser.add_argument('-u', '--user', help='db user, default login user') parser.add_argument('--host', help='db host, default "127.0.0.1"') parser.add_argumen...
from abc import ABCMeta, abstractmethod class AbsSelectorTemperatura(metaclass=ABCMeta): @staticmethod @abstractmethod def obtener_selector(): pass
#!/usr/bin/env python # -*- coding: utf-8 -*- ''' @Time : 2018/9/11 下午3:23 @Author : fanyuexiang @Site : @File : test.py @Software: PyCharm @version: 1.0 @describe: 项目测试用例 ''' from dataformate import get_knn_data filepath = 'dataset/KNNData.txt' name = ['fly distance', 'play time', 'ice cream', 'like level'...
from myhdl import * for i in range(-127,128,1): x = intbv(i)[8:] print i, bin(x,8), x, x.signed()
import uniform from random def append_random_numbers(numbers_list, quantity): if quantity == 1: numbers_list = []
# Generated by Django 2.1.4 on 2019-01-11 15:56 from django.conf import settings from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('speciality', '0032_auto_20190111_1556'), ('orientation', '0002_auto_20190109_0221'), migrations.swappable_dependency...
import mastl._iohelp as io import tensorflow as tf import numpy as np import os import time import datetime import shutil def optimistic_restore(session, save_file, graph=tf.get_default_graph()): """ Adapted version of an answer by StackOverflow user Lior at https://stackoverflow.com/questions/47997203/...
#!/usr/bin/env python import codecs import datetime import dateutil.parser import dateutil.tz import json import mimetypes import os import re import platform import sys import shutil if sys.version_info[0] > 2: from urllib.parse import urlparse from urllib.parse import parse_qs else: from urlparse import...
import logging import time from apispec.exceptions import OpenAPIError from apispec.utils import validate_spec from flask_script import Command, Option from libtrustbridge.websub import repos from libtrustbridge.websub.processors import Processor from api import use_cases from api.docs import spec from api.repos impo...
../geometry.py
import argparse import os import sys import warnings import numpy as np import pandas as pd import torch import src.dataprocessing as dataproc import src.training as train_n2f import src.experimentutils as experutils import src.runutils as runutils import src.utils parser = argparse.ArgumentParser(description="Run t...
# coding: utf-8 #算法纯属乱搞T^T class Solution: # @return an integer def atoi(self, s): s = s.strip() begin, end = 0, len(s) if s == '': return 0 haveSign = False if s[0] in '+-': begin = 1 haveSign = True #是否有符号(+1, -2) for index in range(begin,len(s)): if not ('0' <= s[index] <= '9'): ...
i=input("Enter the Number"); if i%4==0: print ("Leap Year"); else: print ("Not Leap Year");
from kaa.reach import ReachSet from kaa.flowpipe import FlowPipePlotter from models.basic.basic import Basic import kaa.benchmark as Benchmark def test_plot_basic(): basic_mod = Basic() basic_reach = ReachSet(basic_mod) flowpipe = basic_reach.computeReachSet(10) FlowPipePlotter(flowpipe).plot2DProj(...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Sat May 9 18:35:57 2020 @author: TakahiroKurokawa """ from typing import Optional def increment( page_num:int, last:int, *, ignore_error:bool = False) ->Optional[int]: next_page = page_num + 1 if next_page <= last: ...
import arcpy arcpy.env.workspace = "M:/Programming/Practical1/Albertsurface" try: try: arcpy.ImportToolbox("M:/Programming/practical1/albertsurface/Models.tbx", "models") except arcpy.ExecuteError as e: print("Import toolbox error", e) if arcpy.Exists("int.shp"): arcpy.Delete_manageme...
from bson.objectid import ObjectId class PointOfInterest: def __init__(self, db): self.db = db self.collection = self.db['POI'] async def fetchPOIInfo(self, poi_id): query = {"_id": ObjectId(poi_id)} poi = await self.collection.find_one(query) return poi async def...
# Eksempel på tilordning av variabel navn = 'Joakim' print('Jeg heter', navn)
""" 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.db import models from trymake.apps.orders_management.models import Order from t...
N, K = map( int, input().split()) S = input() ans = S[:K-1] if S[K-1] == "A": ans += "a" elif S[K-1] == "B": ans += "b" else: ans += "c" ans += S[K:] print(ans)
# General imports from django.contrib import admin # Models import from . import models as comment_models class CommentInline(admin.TabularInline): model = comment_models.Comment extra = 1 @admin.register(comment_models.CommentField) class CommentFieldAdmin(admin.ModelAdmin): list_display = [ '...
# -*- coding: utf-8 -*- """ Created on Tue Dec 15 16:18:57 2020 @author: RAHIL """ from EuclidianExtended import EuclidianExtended as EExtended class MCipher: def __init__(self,k1,n): print("Using Multiplicative cipher") self.key1 = k1 #self.key2 = k2 self.mod = n self...
# %% import os import mne import matplotlib.pyplot as plt data_folder = '../MVPA_data_xdawn_v3' raw_data_folder = '../MVPA_data_xdawn_raw_v3' uid = 'MEG_S03-0' # %% epochs = mne.read_epochs(os.path.join(data_folder, f'{uid}-train-epo.fif')) raw_epochs = mne.read_epochs(os.path.join( raw_data_folder, f'{uid}-trai...
import os from glob import glob from setuptools import setup PACKAGE_NAME = 'squarbo_gazebo' setup( name=PACKAGE_NAME, version='1.0.0', package_dir={'': 'src'}, data_files=[ (os.path.join('share', PACKAGE_NAME), glob('launch/*.launch.py')), (os.path.join('share', PACKAGE_NAME), glob('w...
import numpy as np import random,copy,time import pygame as pg def weights_classifier(structure,chromosome): weights_list=[] for i in range(0,len(structure)-2): if i == 0: a=0 b=structure[i]*structure[i+1] else: a=b b=a+(structure[i]*structure[i+1...
import re files_path = "files/" """ Read phonemes """ f = open(files_path + 'phoneme_transcriptions.txt', 'r') lines = f.readlines() # chars = set() """ spliting test, train anf validation data """ test_lines = lines[2800:] lines = lines[:2800] val_lines = lines[:int(len(lines)/10)] train_lines = line...
#!/usr/bin/python3 def roman_to_int(roman_string): rom_num = {"I": 1, "V": 5, "X": 10, "L": 50, "C": 100, "D": 500, "M": 1000} value = 0 if type(roman_string) is not str or roman_string is None: return 0 if len(roman_string) == 1: return rom_num.get(roman_string) for i in range(len(r...
import bottle, api_functions import logging as log from json import dumps # needed to return a top level JSON array api_functions.set_up_logs() api = api_functions.API() @bottle.get('/programs') @bottle.get('/programs/<program_id>') def get_programs(program_id=None): if program_id is None: # must set con...
from unittest2 import TestCase import aux.logging as log class LoggingTest(TestCase): def test_start_logging(self): log.start() log.info("This is a info message.") log.debug("This is a debug message.") log.error("This is an error message.") log.warning("This is a warning ...
import requests import psycopg2 conn = psycopg2.connect(host="localhost", database="cartola_fc", user="postgres", password="postgres") print("Conectado ao banco") cur = conn.cursor() rowcount = cur.rowcount url = "https://api.cartolafc.globo.com/atletas/mercado" try: data = requests.get(url).json() ...
/Users/karshenglee/anaconda3/lib/python3.6/linecache.py
from meetingmaker import app import uuid import logging import CONFIG if __name__ == "__main__": # App is created above so that it will # exist whether this is 'main' or not # (e.g., if we are running in a CGI script) app.secret_key = str(uuid.uuid4()) app.debug=CONFIG.DEBUG app.logger.setLevel(logging...
def fname(): input(name)
from tools import gain, fini, strategie from strat import Strat from a_start import a_start import random import numpy as np def tournoi(strat, iterations, game): nbLignes = game.spriteBuilder.rowsize nbColonnes = game.spriteBuilder.colsize wallStates = [w.get_rowcol() for w in game.layers['obstacle']] ...
import os from behave import * from pteromyini.core.core import Core @given("skip regression") def step_impl(context): if 'regression' not in os.getenv('run_type', 'sanity'): Core.skip_next_step()
import re email = "shivani@datagrokr.com sam@company.com " pattern = "\w+@(\w+).com" ans = re.findall(pattern , email) print(ans)
#!/usr/bin/env python3 import sys from pprint import pprint def load_list(load_element): size = int(input()) res = [] for _ in range(size): res.append(load_element()) return res def save_list(l, save_element): print(len(l)) for element in l: save_element(element) class Teren: ...
#coding:utf-8 import dht_cs import time from define import THREAD_NUMBER, WORKING_TIME, BOOTSTRAP_NODES if __name__ == '__main__': thread_num = THREAD_NUMBER working_time = WORKING_TIME threads = [] for i in xrange(thread_num): i += 8000 thread = dht_cs.DHT(host='0, 0, 0, 0', port=i) ...
print('AGAIN checking')
__author__ = 'Aaron J Masino' import pandas as pd import numpy as np def missing_percents(df): d = {} denom = float(len(df)) for c in df.columns: d[c] = np.sum(pd.isnull(df[c]))/denom*100 return d # TODO # add an imputation method that generates a normal random sample based on the sample mean...
import numpy as np from grappa.utils import cartesian_product, sources_from_targets, eval_at_positions, number_geometries def kernel_estimation(kspace, mask=None, af=4, ny=3, lamda=1e-6): """GRAPPA kernel estimation Arguments: - kspace (ndarray): the undersampled k-space, zero-filled. Its shape ...
from random import randint print('Jogo do PAR ou ÍMPAR!!!') v=0 while True: jogador = int(input('Faça sua jogada: ')) computador = randint(0, 10) total = computador + jogador tipo = ' ' while tipo not in 'PI': tipo = str(input('Você quer par ou impar: ')).strip().upper()[0] print(f'V...
# módulo destinado a importar los tests import libreria as lib import unittest import os import preprocesamiento RESULT1 = {x for x in range(19)} RESULT2 = {0, 1, 4, 6, 8, 9, 10, 11, 14, 15, 17, 18} RESULT3 = {0, 1, 4, 6, 7, 8, 9, 10, 11, 14, 15, 17, 18} RESULT4 = {0} RESULT5 = {0, 1} RESULT6 = ['Musical', 'Comedia'...
from django import forms from .models import User class SignUpForm(forms.ModelForm): class Meta: model = User fields = [ "login", "email", "password", "first_name", "last_name", ] class SignInForm(forms.ModelForm): class Meta: model = User fields = [ "login", "password", ] class E...
from typing import Dict, Union MovieMapping = Dict[int, Dict[str, Union[str, int]]]
import numpy as np import matplotlib.pyplot as plt import datetime, os, csv g = 9.81 # Gravity rho = 1.2 # Density of air at sea level coeffDrag = 0.5 # Drag Coefficient initialVelocity = 10 # m/s initialAngle = np.radians(30) # degrees time = 40 # s tstep = 0.01 # time step # M80 FMJ Ball r = 0.00381 # m Bullet ra...
from random import randint print('It\'s quizzing time!!!') while True: num1 = randint(1, 10) num2 = randint(1, 10) summ_num = num1 + num2 quiz_quess = int(input(f'So today\'s question is...\nGive answer for this mathematical expression: {num1} + {num2}\nYour answer: ')) if quiz_quess == summ_num: ...
TIP_RATE = 0.15 SALES_TAX_RATE = 0.095 cost = float(input("Enter meal cost please:")) tip = cost * TIP_RATE tax = cost * SALES_TAX_RATE total = cost + tip + tax print("tip:",round( tip, 2)) print("tax:",round( tax, 2)) print("total:",round( total, 2)) TIP_RATE = 0.18 SALES_TAX_RATE = 0.095 cost = float(i...
FACEBOOK_APP_ID = "" FACEBOOK_APP_SECRET = "" import os from google.appengine.ext.webapp import template import json import time #verify user email from random import randint import urllib import urllib2 from google.appengine.ext import db from google.appengine.api import users,mail import webapp2 from webapp2_ext...
from django.db import models from django.contrib.auth.models import User from address.models import Address from law_firm.models import LawFirm, LawFirmRates from investigator.models import Investigator, InvestigatorRates from constance import config class Broker(models.Model): user = models.OneToOneField(User) ...
#!/usr/bin/python from Player import * from Board import * from Card import * from Unit import * from Effect import * from Const import * import math import logging BOARD_LENGTH = 19 BOARD_WIDTH = 5 DRAW_FREQUENCY = 2 UPKEEP_GOLD = 2 MAX_HAND_SIZE = 5 class Game: def __init__(self): self.players = {} ...
#!/usr/bin/env python # -*- coding: utf-8 -*- import sys import os import json def get_configs(): f = os.path.join(sys.path[0], 'oauth2py.json') if os.path.isfile(f): try: with open(f) as data: return json.load(data) except Exception as e: raise 'could ...
# Given a table of purchases by date, calculate the month-over-month percentage change in revenue. # The output should include the year-month date (YYYY-MM) and percentage change, rounded to the 2nd # decimal point, and sorted from the beginning of the year to the end of the year. # The percentage change column will ...
from django.shortcuts import render from django.http import * from .Cookie import * from .verify import * from .database.delete import * from .database.save import * from .database.search import user_of_cookie, user_of_username from .database import * from django.contrib.auth.forms import UserCreationForm from django.c...
import csv import sys reader = csv.DictReader(open("/Users/aashild/Documents/Python/CSV2HTML/concerts.csv")) f_html = open('/Users/aashild/Documents/Python/CSV2HTML/formatted.html',"w") for row in reader: f_html.write('<tr>') f_html.write('<td>' + row['År'] + '</td>') f_html.write('<td>' + row['Ko...
#!/usr/bin/python #\file slider2.py #\brief Slider with labels. #\author Akihiko Yamaguchi, info@akihikoy.net #\version 0.1 #\date Apr.14, 2021 import sys from PyQt4 import QtCore,QtGui def Print(*s): for ss in s: print ss, print '' class TSlider(QtGui.QWidget): def __init__(self): QtGui.QWidget....
import chainer import chainer.links as L import chainer.functions as F import numpy as np from enum import Enum linear_init = chainer.initializers.LeCunUniform() def seq_func(func, x, reconstruct_shape=True): """ Change implicitly function's target to ndim=3 Apply a given function for array of ndim 3, s...
import os import re import subprocess import numpy as np import pandas as pd import matplotlib.pyplot as plt from .helpers import determine_tag_value, figs_assert, initiate_figs, plot_helper_settings def get_lobster(bond=0, filepath='COHPCAR.lobster', ISPIN=None, plot=False, xlim=None, ylim=None, on_...
a=int(input("Enter any value:")) b=int(input("Enter any value:")) operator =(input("Enter any operator:")) #This function add two no. if operator=='+'or operator == "add": print(a+b) #This function sub two no. elif operator =='-'or operator == "substraction": print(a-b) #This function multiply two no. elif ...
#!/usr/bin/env python # -*- coding: utf-8 -*- import logging, ConfigParser, serial, sys from Tkinter import Tk from tkMessageBox import * logging.basicConfig(level=logging.DEBUG, format='%(asctime)s %(filename)s [line:%(lineno)d] %(levelname)s %(message)s', datafmt='%Y-%m-%d %H:%M:%S', filenam...
#!/usr/bin/python # Display movie on left and right viewport with arbitary inter-viewport delay. # # Copyright (C) 2010-2013 Huang Xin # # See LICENSE.TXT that came with this file. from __future__ import division import sys import random import pygame import numpy as np from StimControl.LightStim.Core import DefaultS...
import os import sys import json import argparse # this returns the same hash for hitboxes that are "functionally equivalent" # i.e. have the same post-hit effect and hit the same targets def hitboxHash(hitbox): fields = ["damage", "angle", "kbGrowth", "weightDepKb", "hitboxInteraction", "baseKb", "element...
import pandas as pd import csv import nltk import numpy as np from nltk.corpus import stopwords from nltk.stem import SnowballStemmer import re from sklearn.naive_bayes import GaussianNB from sklearn import preprocessing from sklearn.model_selection import train_test_split from sklearn import metrics from sklearn impor...
# from django.conf import settings from django.core import checks @checks.register def check_settings(app_configs, **kwargs): # temporary solution return []
import os # django imports import humanize import requests from django.contrib.auth.models import AnonymousUser from django.core.files import File as DjangoCoreFile from django.http import StreamingHttpResponse from folder.decorators import (allow_parent_root, check_id_parent_folder, che...
# coding: utf-8 def longest_common_subsequence(a, b): dp = [[0] * len(b) for i in range(len(a))] for i in range(len(a)): for j in range(len(b)): if a[i] == b[j]: dp[i][j] = dp[i - 1][j - 1] + 1 else: dp[i][j] = max(dp[i][j - 1], dp[i - 1][j]) ...
''' 10. Given a number line from -infinity to +infinity. You start at 0 and can go either to the left or to the right. The condition is that in i’th move, you take i steps. In the first move take 1 step, second move 2 steps and so on. Hint: 3 can be reached in 2 steps (0, 1) (1, 3...
from flask import Flask, render_template, request, session, redirect, url_for from authenticate import authenticate app = Flask(__name__) @app.route("/") @app.route("/home") def home(): return render_template("home.html") @app.route("/login", methods=["GET","POST"]) def login(): if request.method == "GET": ...
#! python3 # BENCH PRESS ONE REP MAX ''' Formula https://www.unm.edu/~rrobergs/478RMStrengthPrediction.pdf Bryzcki 1RM = weight / (1.0278 - (0.0278 * reps)) weight = 1RM * (1.0278 - (0.0278 * reps)) O'Connor 1RM = (0.025 * (weight * reps)) + weight Formula %1RM = 55.51 * e^(-0.0723 * reps) + 48.47 reps = (log(((1RM...
import os,random import tkinter as tk from PIL import Image, ImageTk from playsound import playsound TOPS = [str('tops/') + imgFile for imgFile in os.listdir('tops/')] BOTTOMS = [str('bottoms/') + imgFile for imgFile in os.listdir('bottoms/')] SHOES = [str('shoes/') + imgFile for imgFile in os.listdir('shoes/')] class...
class Persona(): def __init__(self, nombre,edad,lugarResidencia): self.__nombre=nombre; self.__edad=edad; self.__lugarResidencia=lugarResidencia def descripcion(self): print ("Nombre: ", self.__nombre, " Edad : ", self.__edad, "Residencia: ", self.__lugarResidencia) class Empl...
# coding: utf-8 # Copyright 2013 The Font Bakery Authors. All Rights Reserved. # # 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 re...
from django.contrib import admin from .models import Book, Category, DiscountCash, DiscountPercent # Register your models here. @admin.register(Category) class CategoryAdmin(admin.ModelAdmin): list_display = ('title',) #فیلدهایی که در پنل ادمین درخصوص مدل مورد نظر میخواهیم نشان دهد prepopulated_fields = {'sl...
class Deploy: def hello( str ): return 'Hello World: '+str;
import uuid from core import plugin, model from core.models import conduct, trigger, webui from plugins.viewonce.models import action class _viewonce(plugin._plugin): version = 0.1 def install(self): # Register models model.registerModel("viewonce","_viewonce","_document","plugins.viewonce.mo...
# -*- coding: utf-8 -*- import json import os class DworldMixin(object): plugin_slug = 'datakit-dworld' def get_auth_headers(self): return { 'Authorization': 'Bearer {0}'.format(self.configs['api_token']), 'Content-Type': 'application/json', } def get_project_path...
#!/usr/bin/env python # ---------------------------------------------------------------------------- # Copyright 2014 Nervana Systems 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 # # ...
from django.urls import path, include from rest_framework_nested import routers from .views import QuizViewSet quiz_router = routers.SimpleRouter() quiz_router.register('quiz', QuizViewSet, base_name='quiz') urlpatterns = [ path('', include(quiz_router.urls)), ]
print("Python Mathematical Operations") print("Addition") a=12 b=13 print( "The addition of 12 and 13 is "+ str(a+b) ) print("Subtraction") a=10 b=5 print("The subtraction of 10 and 5 is " + str(a-b)) print("Multiplication") a=10 b=5 print("The multiplication of 10 and 5 is " + str(a*b)) print("Multiplication") a=10 ...
import pyodbc cnxn = pyodbc.connect('DRIVER={SQL Server};' 'SERVER=DEVACCESSA-PC\LOGIDEV2016;' 'DATABASE=DATAKS_MC;' 'UID=sa;' 'PWD=Logi2131') #'Trusted_Connection=yes;') cursor = cnxn.cursor() cursor.execute...
#import sys #input = sys.stdin.readline def permute(X, Y): # X is permuted by Y ret = [0]*len(X) for i, x in enumerate(X): ret[i] = Y[x] return ret def main(): N, M, D = map(int,input().split()) A = list(map(int,input().split())) permutation = [i for i in range(N+1)] # ...
from flask import jsonify, redirect, g from models import db, User def create_user(**form_args): if not form_args['name'] or not form_args['email'] or not form_args['password']: raise Exception('Name, Email, and Password are required fields') if User.query.filter_by(email=form_args['email']).first() is not Non...