content
stringlengths
5
1.05M
"""empty message Revision ID: 11a35b448f83 Revises: 628a5438295c Create Date: 2020-03-14 16:35:13.564982 """ import sqlalchemy_utils from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = '11a35b448f83' down_revision = '628a5438295c' branch_labels = None depends_on = None...
# -*- coding: utf-8 -*- # # BitcoinLib - Python Cryptocurrency Library # BitGo Client # © 2017-2019 July - 1200 Web Development <http://1200wd.com/> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # published by ...
from collections import defaultdict class Event: """Event Class manage event and callbacks. """ __instance = None def __init__(self): if Event.__instance != None: raise Exception("This class is a singleton!") else: Event.__instance = self self.callback...
import numpy as np # input parameter ===================================================== #-- geometry lx = 1.0 ly = 1.0 nx = 50 ny = 50 dx = lx / nx dy = ly / ny ncell = nx * ny # condition ==================================================== #-- temperature temp = np.full(ncell+1, 300.0) #-- thermal conductivi...
# Generated by Django 3.1.4 on 2021-01-10 09:28 from django.db import migrations, models def link_transactions_categories(apps, schema_editor): Transaction = apps.get_model('system', 'Transaction') for transaction in Transaction.objects.all(): transaction.categories.add(transaction.category...
from __future__ import print_function, absolute_import, division #makes KratosMultiphysics backward compatible with python 2.6 and 2.7 import KratosMultiphysics def CreateSolverByParameters(model, solver_settings, parallelism): solver_type = solver_settings["solver_type"].GetString() if solver_type.startswit...
from django.db import models class AutoFieldsModel(models.Model): date_auto_now = models.DateField(auto_now=True, null=True) date_auto_now_add = models.DateField(auto_now_add=True, null=True) datetime_auto_now = models.DateTimeField(auto_now=True, null=True) datetime_auto_now_add = models.DateTimeFiel...
from django.db import models from django.contrib.auth.models import User import django.db.models.deletion class Mem(models.Model): banner = models.ImageField(null=True) # publisher = models.CharField(max_length=100) date_posted = models.DateField(auto_now_add=True) likes = models.ManyToManyField(User,blank=True,re...
import json from django.shortcuts import render from django.http import HttpResponse, HttpResponseRedirect, JsonResponse from django.contrib.auth import authenticate from django.contrib.auth.models import User from cart.models import Cart from orders.models import Order, LineItem from orders.views import output_order f...
#!/usr/bin/env python # -*- coding: utf-8 -*- import json from alipay.aop.api.constant.ParamConstants import * class ZhimaCreditEpDataRatingQueryModel(object): def __init__(self): self._biz_ext_param = None self._cert_name = None self._cert_no = None self._cert_type = None ...
""" What you will lean: - what is a for loop - how to iterate though lists using for loops Okay so we went over while loops. They work by doing stuff until the "while" condition is no longer True Now we have for loops. Let's your mom gives you a list of chorus to do. You have to finish them you don't get any cookies a...
import random import math import networkx as nx #Generates a generic graph with given number of nodes and density def generateGraph(N, DENSITY, debug=False): M = int((N * (N-1) / 2) * DENSITY) graph = [] n = m = 0 while n < N: graph.append(set()) n += 1 while m < M: n1 = ra...
import unittest from pyalink.alink import * class TestPinjiu(unittest.TestCase): def test_tokenizer(self): import numpy as np import pandas as pd data = np.array([ [0, 'That is an English Book!'], [1, 'Do you like math?'], [2, 'Have a good day!'] ...
import glob import os from collections import defaultdict, namedtuple, Counter from random import sample from sys import stderr import cv2 import torch from numpy.linalg import LinAlgError from torch.utils import data from tqdm import tqdm import csv_utils from postprocessing.visualizers.draw_roi import TileVisualize...
# Time: O(n) # Space: O(n) # # Implement a basic calculator to evaluate a simple expression string. # # The expression string may contain open ( and closing parentheses ), # the plus + or minus sign -, non-negative integers and empty spaces . # # You may assume that the given expression is always valid. # # Some examp...
""" This code conduct: 1. exclude a subset of data related to a certain illumination condition from an existing training set 2. keep a subset of data related to the same illumination condition from an existing test set ATTENTION: this code require to run prepare_data_split.py first Author: Yuliang Guo (33yuliangguo@g...
import discord import re from discord.ext import commands def assign_prefix(name, prefix): MAX_NICK_LEN = 32 if len(prefix) > MAX_NICK_LEN: raise ValueError("Nickname prefix should not be longer than the" "maximum nickname length") if len(prefix)+len(name) <= MAX_NICK...
import json import logging import os import sys from requests.exceptions import ConnectionError, HTTPError, Timeout import sentry_sdk from apscheduler.schedulers.blocking import BlockingScheduler from common_utils.percent_log_util import LogState, PercentLogHandler from controller.config import label_task as label_ta...
""" WSGI config for core project. It exposes the WSGI callable as a module-level variable named ``application``. For more information on this file, see https://docs.djangoproject.com/en/1.11/howto/deployment/wsgi/ """ import os from django.core.wsgi import get_wsgi_application os.environ.setdefault("DJANGO_SETTINGS...
import joblib import pymc3 as pm import pandas as pd import os import numpy as np from sklearn.linear_model import LinearRegression import arviz as az import ifeh_io as io # ====================================================================================================================== # PREAMBLE # The root dir...
import warnings import numpy as np from base import BasePreprocessor class ScikitLearnPreprocessor(BasePreprocessor): def __init__(self, preprocessor): BasePreprocessor.__init__(self) process_fn = getattr(preprocessor, 'fit', None) if process_fn is None or not callable(process_fn): ...
#!/usr/bin/env python import sys, os, random import sentgen from PIL import ImageStat from PIL import ImageFilter from pimage import PerlinImage from clamour import threshold from clamour import rorschach from clamour import camo from clamour import ribbons from clamour import verse pleasantries = ['Hail Eris...', ...
def test_all(setup_postgres, dp): dp.source.all() def test_get_range(setup_postgres, dp): dp.source.get_range("source_1_1") def test_from_parameter(setup_postgres, dp): dp.source.from_parameter("parameter_1") def test_from_project(setup_postgres, dp): dp.source.from_project("project_2")
import os import pathlib import time from platform import system from urllib.parse import quote from webbrowser import open import requests from pyautogui import click, hotkey, press, size, typewrite from pywhatkit.core.exceptions import InternetException WIDTH, HEIGHT = size() def check_number(number: str) -> boo...
from torch import nn def weight_init_normal(m): if isinstance(m, (nn.Linear, nn.Conv2d, nn.ConvTranspose2d)): nn.init.normal_(m.weight, 0, 0.02) elif isinstance(m, nn.BatchNorm2d): nn.init.normal_( m.weight, 1, 0.02) nn.init.constant_( m.bias, 0) def weight_init_uniform(m): if ...
import json import sys if __name__ == "__main__": if len(sys.argv) == 2: with open(sys.argv[1]) as f: print sys.argv[1] j = json.loads(f.read()) for cluster in j: if len(j[cluster]) < 20 and len(j[cluster]) > 3: print '-' * 75 ...
############################################################################## # register_weather_stations.py # https://github.com/DigiLog-N/DigiLog-N # Copyright 2020 Canvass Labs, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the Licens...
#this info is obtained from your Twitter Developer profile: consumer_key = “XxXXXXXXXXXXXXxxxxxXX” consumer_secret = “XxXXXXXXXXXXXXxxxxxXX” access_token = “XxXXXXXXXXXXXXxxxxxXX” access_token_secret = “XxXXXXXXXXXXXXxxxxxXX”
from collections import OrderedDict from . import BlockHeader, BlockBody from .. import Block, BlockSerializer as BaseBlockSerializer from ... import ExternalAddress, Signature, Hash32, TransactionSerializer class BlockSerializer(BaseBlockSerializer): version = BlockHeader.version BlockHeaderClass = BlockHead...
# uncompyle6 version 3.7.4 # Python bytecode 3.7 (3394) # Decompiled from: Python 3.7.9 (tags/v3.7.9:13c94747c7, Aug 17 2020, 18:58:18) [MSC v.1900 64 bit (AMD64)] # Embedded file name: T:\InGame\Gameplay\Scripts\Server\interactions\utils\clear_space_interaction.py # Compiled at: 2019-02-06 01:18:00 # Size of source mo...
# # 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 # ...
def create_table(*lists): PADDING = 2 column_sizes = [0 for e in lists[0]] for i in range(len(lists)): for j in range(len(lists[i])): if column_sizes[j] < len(str(lists[i][j])): column_sizes[j] = len(str(lists[i][j])) table = "" for lst in lists: for i i...
from .sampling import sample_gaussian_spd, generate_random_spd_matrix from .simulated import make_covariances, make_gaussian_blobs, make_outliers __all__ = ["sample_gaussian_spd", "generate_random_spd_matrix", "make_covariances", "make_gaussian_blobs", "make_outliers"]
import csv from spectramanipulator.parsers.generalparser import GeneralParser class CSVFileParser(GeneralParser): def __init__(self, filepath=None, str_data=None, delimiter=',', decimal_sep='.', remove_empty_entries=True, skip_col_num=0, general_import_spectra_name_from_filename=False, ...
""" Extracts data from csv files to be displayed on the website along with coefficients """ #import pygame import pandas __author__ = "Sara Ballantyne" __version__ = '0.0.1' def data_extraction(): """Pulls data from csv columns as needed for website to pass into javascript --> html >>> data_extraction() ...
"""Uses a Rotaty encoder to control an LED ring within a selenite crystal - Designed to be run from a Trinket M0""" import rotaryio import board import neopixel from time import sleep from digitalio import DigitalInOut, Direction, Pull import adafruit_fancyled.adafruit_fancyled as fancy import random #Initi...
from typing import List from collections import defaultdict class Solution: def groupAnagramsCount(self, strs: List[str]) -> List[List[str]]: ans = defaultdict(list) for s in strs: sig = [0] * 26 for c in s: sig[ord(c) - ord("a")] += 1 ans[tuple(...
#Faça um pgm q ajude um jogador da MEGA SENA a criar palpites. O pgm vai perguntar quantos jogos serão gerados e vai sortear 6 numeros entre 1 e 60 para cada jogo, cadastrando tudo em uma lista composta. from random import randint mega = list() jogo = list() num = 0 print('-=' * 16) print('GERADOR DE PALPITES DA MEGA S...
def acceptableString(string): if len(string) == 0: return "" stk = [string[0]] for idx in range(1, len(string)): ch = string[idx] if len(stk) and ch.islower() and stk[-1].isupper(): _ = stk.pop() elif len(stk) and ch.isupper() and stk[-1].islower(): _ ...
# -*- encoding: utf-8 -*- #class for FTP connection import socket import ftplib class FTPConnection: def __init__(self,url): #ftp connection with ftplib library self.url = url def ftpConnectionAnonymous(self): #check port 21 is open try: sock= socket.socket...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- __author__ = 'ipetrash' import time import win32clipboard from notifications import WindowsBalloonTip last_data = None while True: try: # Get clipboard data win32clipboard.OpenClipboard() try: data = win32clipboard.GetClipboard...
#!python3 # coding: utf-8 # Copyright (c) oatsu """ 連続音用歌詞すっぴんプラグイン """ from utaupy import utauplugin def main(plugin): """ "V CV" のCV部分はひらがなとカタカナとRのみ許可する """ # 許可する文字のリスト allowed_list = [chr(i) for i in range(12353, 12436)] + [chr(i) for i in range(12449, 12532 + 1)] + ['R'] ...
import tweepy def get_tweet_sentiment(city, query): auth = tweepy.OAuthHandler("sWHOzqDwM3UbT7XqQcKvR2wku", "t2OYKAbry0knI1VSaWLtOTsE18dqiE0yQdc6kwIFg5wj9TRJ8U") auth.set_access_token("810538727944704000-r5YCr88V4A86dUbJx0fl9I02sPRee86", "cWWmdGCuVrPjNQb3hI5dwijmb4Z7l3Us4yjGv8CsGJHx3") a...
# Generated by Django 2.1 on 2018-08-29 03:49 from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('firstapp', '0004_comment'), ] operations = [ migrations.DeleteModel( name='People', ), ]
# 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 the...
""" raven.utils.compat ~~~~~~~~~~~~~~~~~~ :copyright: (c) 2010-2012 by the Sentry Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ from __future__ import absolute_import try: from urllib.error import HTTPError except ImportError: from urllib2 import HTTPError # NOQA try...
from . import allrecipes from . import epicurious
#!/usr/bin/env python # Copyright 2012-13 Qtrac Ltd. All rights reserved. # This program or module is free software: you can redistribute it # and/or modify it under the terms of the GNU General Public License as # published by the Free Software Foundation, either version 3 of the # License, or (at your option) any lat...
from PyMieSim.Source import GaussianBeam import matplotlib.pyplot as plt from matplotlib.offsetbox import AnchoredText import numpy as np pi = np.pi Sampling=1000 beam = GaussianBeam(Wavelength = 0.6328e-6, NA = 0.142, Offset = [5e-6]*3) mList = np.arange(0,50) ...
# Lint as: python3 # Copyright 2020 The TensorFlow 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 ...
import torch import numpy as np from pyro.distributions import Uniform, Normal from idcovid19.models.base_model import BaseModel from idcovid19.utils.misc import memoize class Model2(BaseModel): """ Model 2 is a modification of SEIR model with path splitting into two and isolated patients. exposed -> ...
#!/bin/python3 from matplotlib import pyplot as plt from matplotlib import style from numpy import genfromtxt import sys import os.path sys.argv.pop(0) for arg in sys.argv: if os.path.isfile(arg): data = genfromtxt(arg,delimiter=',') plt.plot(data) plt.ylabel('value') plt.xlabel('...
""" Diecast Remote Raceway - DeviceIO DeviceIO is the interface to the physical input/output devices attached to the GPIO, excluding the LCD display which is managed separately. Author: Tom Quiggle tquiggle@gmail.com https://github.com/tquiggle/Die-Cast-Remote-Raceway Copyright (c) Thomas Quiggle. All rights reserve...
from aioclustermanager.service import Service from copy import deepcopy import json K8S_SERVICE = { "kind": "Service", "metadata": {"name": "", "namespace": "", "labels": {}}, "spec": {"ports": [], "selector": {}, "type": "ClusterIP"}, } class K8SService(Service): @property def id(self): ...
import sys import linecache import time import socket import traceback import thread import threading import Queue from idlelib import CallTips from idlelib import AutoComplete from idlelib import RemoteDebugger from idlelib import RemoteObjectBrowser from idlelib import StackViewer from idlelib import...
''' Copyright 2019 Łukasz Zalewski. 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 agre...
# Copyright (C) 2021 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # # This work is made available under the Nvidia Source Code License-NC. # To view a copy of this license, check out LICENSE.md import math from datetime import timedelta import torch import wandb from wandb import AlertLevel from torch.utils....
import configparser import tkinter as tk from contextlib import suppress from .front import Front # from .splash import Splash from . import SETTINGS, widget parser = configparser.ConfigParser() parser.read(SETTINGS) class App(tk.Tk): appconfig = parser['APP'] def __init__(self, *args, **kwds): su...
# Given an array of equal-length strings, check if it is possible to rearrange the strings # in such a way that after the rearrangement the strings at consecutive positions would # differ by exactly one character. # # Example # # For inputArray = ["aba", "bbb", "bab"], the output should be # stringsRearrangement(inputA...
from django.urls import path from . import views # urlpatterns = [ # path('', include('chalan.urls')) # ]
from model.training_models_generator import * from db_init.training_db_initializer import TrainingDbInitializerGenerator import random class WordMarkov: def __init__(self, db_path): self.db_path = db_path self.secure_random = random.SystemRandom() def generate_password(self, length): ...
__all__=('dumpttf',) def dumpttf(fn,fontName=None, verbose=0): '''dump out known glyphs from a ttf file''' import os if not os.path.isfile(fn): raise IOError('No such file "%s"' % fn) from reportlab.pdfbase.pdfmetrics import registerFont, stringWidth from reportlab.pdfbase.ttfonts import TTF...
import numpy as np import cv2 from scipy.special import expit as sigmoid def draw_boxes(img, bboxes_w_conf, color=(0, 0, 255), thick=2, draw_dot=False, radius=7): # Make a copy of the image draw_img = np.copy(img) # Iterate through the bounding boxes for bbox in bboxes_w_conf: # Draw a rectangl...
# File: salesforce_connector.py # # Copyright (c) 2017-2022 Splunk 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 ...
# -*- coding: utf-8 -*- from django.contrib import admin from django.contrib.auth.admin import UserAdmin from django.contrib.auth.models import User from .models import Profile admin.site.unregister(User) class ProfileInline(admin.StackedInline): model = Profile class UserProfile(UserAdmin): inlines = [P...
# # This file is part of LiteX. # # Copyright (c) 2018-2019 Florent Kermarrec <florent@enjoy-digital.fr> # SPDX-License-Identifier: BSD-2-Clause import os import sys import subprocess import shutil from migen.fhdl.structure import _Fragment from litex.build.generic_platform import * from litex.build import tools fro...
from .circuit import QCircuit from .noise import NoiseModel from .qpic import export_to from .compiler import CircuitCompiler as CircuitCompiler def compile_circuit(U, *args, **kwargs): # see CircuitCompiler documentation c = CircuitCompiler.standard_gate_set(*args, **kwargs) return c(U)
# RT - Captcha from typing import TypedDict, Literal, Union, Optional, Any, Tuple, DefaultDict, Dict from discord.ext import commands, tasks import discord from rtutil import DatabaseManager from rtlib import RT from aiohttp import ClientSession from aiomysql import Cursor from collections import defaultdict from ...
import base64 import inspect import sys import typing import flask from nasse import config, exceptions, models, request, timer, utils from nasse.response import Response, exception_to_response RECEIVERS_COUNT = 0 def retrieve_token(context: request.Request = None) -> str: """ Internal function to retrieve...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import os import pathlib # pathlib.Path('.'+'/files').mkdir(parents=True, exist_ok=True) name = '' with open('final.pdb') as file: for line in file: if line.startswith('MODEL'): name = line.split()[1] with open(name + '.pdb') as file2: ...
# напиши здесь код третьего экрана приложения bhjtelgvf
# Generated by Django 3.2.8 on 2021-11-23 09:14 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( name='Company', fields=[ ...
import randomium def main(): print(randomium.animal())
from UpdateThread import UpdateThread import os.path import time import json import logging import threading import serial import struct import base64 class SerialInterface: STX = int(2) # ASCII: Start of Text ETX = int(3) # ASCII: End of Text def __init__(self): self._readStarted...
from kivy.app import App from kivy.uix.widget import Widget from kivy.uix.textinput import TextInput from kivy.uix.boxlayout import BoxLayout from kivy.uix.button import Button from kivy.graphics import Color from kivy.uix.label import Label import os import certifi import time import downloader import password desi...
class Solution: def isSubsequence(self, s: str, t: str) -> bool: if not s: return True s_index = 0 t_index = 0 while t_index < len(t): if s[s_index] == t[t_index]: s_index += 1 if s_index == len(s): return ...
# http://www.codewars.com/kata/53934feec44762736c00044b/ a = str(123)
from .mc import *
import sys from unittest import TestCase from io import StringIO from zerver.lib.type_debug import print_types from typing import Any, Callable, Dict, Iterable, Tuple, TypeVar, List T = TypeVar('T') def add(x: Any=0, y: Any=0) -> Any: return x + y def to_dict(v: Iterable[Tuple[Any, Any]]=[]) -> Dict[Any, Any]:...
# # Copyright (c) 2021 salesforce.com, inc. # All rights reserved. # SPDX-License-Identifier: BSD-3-Clause # For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause # import logging from os.path import abspath, dirname, join import sys import unittest from merlion.u...
from collections import namedtuple, Counter import sys import math import string import itertools from enum import Enum import numpy as np import scipy.spatial.distance import sklearn.linear_model from sklearn.feature_extraction import DictVectorizer from pysrc import accuracy ParentTransformation = namedtuple('Paren...
#!/usr/bin/env python # Copyright 2014 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Generate a CL to roll a DEPS entry to the specified revision number and post it for review so that the CL will land automatically if...
#!/usr/bin/env python # vim:ts=4:sts=4:sw=4:et # # Author: Hari Sekhon # Date: 2016-01-07 22:57:18 +0000 (Thu, 07 Jan 2016) # # https://github.com/harisekhon/devops-python-tools # # License: see accompanying Hari Sekhon LICENSE file # # If you're using my code you're welcome to connect with me on LinkedIn and opt...
from PIL import Image from math import * d = { 0: ' ', 1: ' ', 2: ' ', 3: ' ', 4: '.', 5: '.', 6: '.', 7: '.', 8: '*', 9: '*', 10: '*', 11: '*', 12: '*', 13: 'A', 14: '8', 15: 'Ж', } def makebw(file): im = Image.open(file) ...
# -*- coding: utf-8 -*- """ Base definitions for models of programs. ** under construction ** """ from __future__ import print_function, division, absolute_import, unicode_literals EOLCOL = 50 class Node(object): """ Base class for model nodes, in charge of the rendering infrastructure. Rendering consi...
import re from converter.guides.tools import get_text_in_brackets from converter.markdown.text_as_paragraph import TextAsParagraph class Figure(TextAsParagraph): def __init__(self, latex_str, figure_num, chapter_num, detect_asset_ext, caret_token): super().__init__(latex_str, caret_token) self._...
#!/usr/bin/env python # -*- coding: utf-8 -*- import tempfile import pandas as pd import pytest from graphdot.dataset import METLIN_SMRT, AMES def test_metlin_smrt(): with tempfile.TemporaryDirectory() as tempd: smrt = METLIN_SMRT(local_filename=tempd + '/metlin.csv') assert isinstance(smrt, pd.Da...
# blowfish # Copyright (C) 2015 Jashandeep Sohi <jashandeep.s.sohi@gmail.com> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later v...
# -*- coding: utf-8 -*- # Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and contributors # For license information, please see license.txt from __future__ import unicode_literals import frappe from frappe import _ from frappe.desk.form import assign_to from frappe.utils.jinja import validate_template from dateutil...
import subprocess import requests import json from urllib.parse import urlparse import os import re from config import data as path from data.preprocess import transform_entity2json from data.insert import begin_insert_job, delete_index from app import db DOWNLOAD_PATH=path + '/downloads' github = 'github.com' # ...
# -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # source: oef_search.proto from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message from google.protobuf import reflection as _reflection from google.protobuf import symbol_database as _symbo...
import tensorflow as tf from tensorflow.keras.layers import Layer class SSGConv(Layer): """ Simple spectral graph convolution layer as in: [Simple Spectral Graph Convolution](https://openreview.net/forum?id=CYO5T-YjWZV) Pytorch implementation: https://github.com/allenhaozhu/SSGC ...
print("Welcome toe the tip calculator.") price = float(input("What was the total bill? $")) percentage = float(input("What percentage tip would you like to give? 10, 12, or 15? ")) how_many = int(input("How many people to split the bill? ")) price_with_tip = price * (1 + percentage / 100) price_per_person = "{:.2f}".fo...
#!/usr/bin/env python # -*- encoding: utf-8 -*- # LiJiejie my[at]lijiejie.com http://www.lijiejie.com import sys import urllib2 import cStringIO import urlparse import os import Queue import threading from lib.ds_store import DSStore class Scanner(object): def __init__(self, start_url): self.queue ...
import os import json import random from datetime import datetime from django.conf import settings JSON_TEMPLATE = '''{ "name": "", "email": "", "tel": "", "urls": [], "image": "", "summary": "", "skills": [{"key": "", "value": ""}], "experience": [ { "org": "", ...
from __future__ import absolute_import, division, print_function, unicode_literals import os import sys import ast import json import time import glob import atexit import shutil import signal import errno import argparse import numpy as np from builtins import range import AdaptivePELE from AdaptivePELE.constants impo...
__author__ = 'Dirk Dittert' from sensor_phy_drive import PegasusPhysicalDriveSensor from sensor_enclosure import PegasusEnclosureSensor
""" Copyright (c) 2018-2019 Intel 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 to i...
"""Authorization for Treadmill API. """ from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals import logging import decorator from treadmill import restclient _LOGGER = logging.getLogger(__name__) class AuthorizationEr...
from django.db.backends.postgresql.base import DatabaseWrapper from .introspection import SchemaDatabaseIntrospection # NOQA isort:skip from .schema import SchemaDatabaseSchemaEditor # NOQA isort:skip class DatabaseWrapper(DatabaseWrapper): SchemaEditorClass = SchemaDatabaseSchemaEditor def __init__(self,...