content
stringlengths
5
1.05M
from datetime import datetime from flask import Flask, request from flask_restful import Resource, Api from sqlalchemy import create_engine from flask_jsonpify import jsonify from flask_cors import CORS db_connect = create_engine('sqlite:///database/enterprise.db') app = Flask(__name__) api = Api(app) cor_app = CORS(a...
# test try-else-finally statement passed = 0 # base case try: print(1) except: passed = 0 print(2) else: print(3) finally: passed = 1 print(4) # basic case that should skip else try: print(1) raise Exception passed = 0 except: print(2) else: passed = 0 print(3) finally: ...
from typing import List import gym import numpy as np from gym import spaces class SwitchingWrapper(gym.Wrapper): def __init__(self, env: gym.Env, env_index: int): super().__init__(env) self.env_index = env_index def reset(self, **kwargs): return self.env.reset(**kwargs) def ste...
class InsufficientConfiguration(ValueError): """The action can't be performed due to missing configuration.""" class WalletFileLocked(ValueError): """The wallet file is locked by another process.""" class ConfigurationError(ValueError): """A configuration parameter is incorrect.""" def __init__(self...
import abc import numpy as np import mxnet as mx from mxnet import nd from mxnet import gluon from typing import Union from .distributions import BaseDistribution from common import util ZERO = nd.array([0.]) ONE = nd.array([1.]) class BaseBernoulli(BaseDistribution, metaclass=abc.ABCMeta): @property def is_re...
import DonkeySimple.DS as ds import os, json, imp, getpass from DonkeySimple.DS.ds_creator import create_ds from DonkeySimple.DS import KnownError def get_status(path): """ Prints the current state of the site. """ _chdir(path) def print_list(title, values, indent = 2): print '%s%s:' % (' '...
import numpy as np import six from scipy import optimize import chainer from chainer import cuda, Function, gradient_check, Variable from chainer import optimizers, serializers, utils from chainer import Link, Chain, ChainList import chainer.functions as F import chainer.links as L def train(x_train, t_train, epoch, ...
# # Copyright (c) 2015-2016, Yanzi Networks AB. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # 1. Redistributions of source code must retain the above copyright # notice, this list of co...
import os import types import numpy as np import torch class BaseParams(object): def __init__(self): self.set_params() self.compute_helper_params() def set_params(self): self.standardize_data = False self.model_type = None self.log_to_file = True self.dtype = ...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Fri Apr 14 22:09:55 2017 @author: mussie """ from pandas_datareader import data import matplotlib.pyplot as plt import pandas as pd def main(): tickers = ['AAPL','MSFT','^GSPC'] data_source = 'yahoo' start_date = '2000-01-01' en...
from openrobotics.robomath import * class StewartRobot(object): def __init__(self, param: list) -> None: """ 构造Stewart机器人 Parameters ---------- param: list [ 静平台半径, 动平台半径, 静铰点偏角, 动铰点偏角 ] """ super().__init__() assert len(param) == 4, "参数的...
import pytest from rest_framework.authentication import exceptions from supportal.app.authentication_backend import CognitoJWTAuthentication, validate_jwt from supportal.app.models import APIKey from supportal.tests import utils CLIENT_ID = "1234abcdef" @pytest.fixture def api_key(superuser): return APIKey.obje...
# -*- coding: utf-8 -*- # Generated by Django 1.10 on 2016-09-05 20:58 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('registration', '0002_auto_20160904_0750'), ] operations = [ migrations.AddFie...
# -*- coding: utf-8 -*- from .utils import name_parser_factory class Enum(object): """ Enum """ def __init__( self, plugin_name, package, template_env, pb_enum, enum_docs, parent_struct=None): self._plugin_name = name...
import os import torch try: from apex import amp amp.register_float_function(torch, 'matmul') except ImportError: print('No apex for fp16...') # combine image with origin images def image_combine(source, target, mask): res = source * (1 - mask) + target * mask # [b,3,h,w] return res def load...
from time import time timer_length = input( "How many minutes and seconds, enter as minutes seconds, enter 0 if no time in that section, do not use commas: ").split() timer_length = list(map(float, timer_length)) def conv_seconds(minutes) -> float: return minutes * 60 total_seconds = conv_seconds(timer_le...
import matplotlib.pyplot as plt import numpy as np import pyvista as pv sst = pv.read("pdata_xy_sst_t0.vtk") cmap = "fire" # colorcet (perceptually accurate) color maps sargs = dict( shadow=True, n_labels=5, italic=False, fmt="%.1f", font_family="cour...
""" Common signal metrics routines ============================== ssd sd """ __all__ = ['sdd', 'sd'] from .norms import ssd from .norms import sd
""" QuickUnion is a lazy approach. *Limitations:* - Trees can get too tall - Find too expensive (could be N array accesses) """ class QuickUnion: """ data[i] is parent of i. Root of i is id[id[...id[i]...]] """ def __init__(self, n): """ Initializing list of size n where value is same as index ...
import csv import sys import os from PIL import Image def main(): name_of_script = sys.argv[0] # should be setup_ground_truth.py kaggle_folder = sys.argv[1].strip() with open(f'{kaggle_folder}/written_name_test.csv', mode='r') as csv_file: csv_reader = csv.reader(csv_file, delimiter=',...
import nltk import os from nltk import word_tokenize from nltk.stem.lancaster import LancasterStemmer import numpy import tflearn import tensorflow as tf import random import json import pickle with open("intents.json") as file: data = json.load(file) words = [] labels = [] docs_x = [] docs_y = [] for intent ...
""" ************************************************ * fileName: optim.py * desc: optimizers * author: mingdeng_cao * date: 2021/12/06 15:24 * last revised: None ************************************************ """ from torch.optim import Adam, SGD, AdamW from .build import OPTIMIZER_REGISTRY # Register the optimiz...
# from collections import defaultdict from django.shortcuts import redirect from django.contrib.auth.decorators import ( permission_required, user_passes_test, login_required, REDIRECT_FIELD_NAME ) from django.core.context_processors import csrf from django.forms import ModelChoiceField, IntegerField f...
class Vertex: def __init__(self,id): self.attributes = {} self.attributes['id'] = id def __str__(self): return str(self.attributes) def new_copy(self): return Vertex(self.attributes['id']) def set(self,key,value): self.attributes[ke...
#Written for Python 3.4.2 data = [line.rstrip('\n') for line in open("input.txt")] blacklist = ["ab", "cd", "pq", "xy"] vowels = ['a', 'e', 'i', 'o', 'u'] def contains(string, samples): for sample in samples: if string.find(sample) > -1: return True return False def isNicePart1(string): ...
import threading class loop(threading.Thread): def __init__(self, motor, encoder, pid): threading.Thread.__init__(self) self._encoder = encoder self._motor = motor self._pid = pid self.sp = 0 self.pv = 0 self._stop_requested = threading.Event() sel...
##!/usr/bin/env python3 # By Paulo Natel # Jan/2021 # pnatel@live.com # Check README.md for more information # Importing required libraries from pathlib import Path import os.path import shutil import random import logging import datetime import csv # Running as standalone or part of the application if __name__ == ...
""" :author: Thomas Delaet <thomas@delaet.org> """ from __future__ import annotations import json import struct from velbusaio.command_registry import register_command from velbusaio.message import Message COMMAND_CODE = 0xFB CHANNEL_NORMAL = 0x00 CHANNEL_INHIBITED = 0x01 CHANNEL_FORCED_ON = 0x02 CHANNEL_DISABLE...
import json states_list = ["Alabama","Alaska","Arizona","Arkansas","California","Colorado", "Connecticut","Delaware","Florida","Georgia","Hawaii","Idaho","Illinois", "Indiana","Iowa","Kansas","Kentucky","Louisiana","Maine","Maryland", "Massachusetts","Michigan","Minnesota","Mississippi","Missouri","Montana", ...
import sys import tkinter as tk import tkinter.ttk as ttk from tkinter.constants import * import Proyect_support import os import pyautogui as robot import time import webbrowser def meet_por_web(page): webbrowser.open(page) entrar_reunion=965,539 aceptar=1065,225 def abrir(pos,click=1): ...
#! /usr/bin/env python # # Copyright (C) 2007-2009 Cournapeau David <cournape@gmail.com> # 2010 Fabian Pedregosa <fabian.pedregosa@inria.fr> # 2014 Gael Varoquaux # 2014-2016 Sergei Lebedev <superbobry@gmail.com> """Hidden Markov Models in Python with scikit-learn like API""" ...
#!/usr/bin/env python3.5 import defparser import sys import argparse import blifparser import utils import datetime import extractrc from spefstruct import SPEF from defstruct import DEF from modtypes import Unit from libstruct import LIB from lefstruct import LEF def get_parsers(): """docstring for get_parsers"""...
# Uncomment for Challenge #7 import datetime import random from redis.client import Redis from redisolar.dao.base import RateLimiterDaoBase from redisolar.dao.redis.base import RedisDaoBase from redisolar.dao.redis.key_schema import KeySchema # Uncomment for Challenge #7 from redisolar.dao.base import RateLimitExceede...
""" This is a python script to add users to groups in a Weblogic Domain that uses the embedded LDAP. The script needs to connect to a running Weblogic Admin Server. This script requires a comma-separated-values (csv) file containing the users you wish to add the groups, in the following format: groupname, username...
# -*- coding: utf-8 -*- # # Copyright 2018-2021 BigML # # 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 ...
import daft with daft.PGM() as pgm: pgm.add_node( daft.Node( "d", "D", 0, 0, plot_params=dict(fc="white"), fontsize=17, offset=(0, -1), label_params=dict(fontweight="bold"), ) ) pgm.render() ...
# -*- coding:utf-8 -*- from mako import runtime, filters, cache UNDEFINED = runtime.UNDEFINED STOP_RENDERING = runtime.STOP_RENDERING __M_dict_builtin = dict __M_locals_builtin = locals _magic_number = 10 _modified_time = 1443802885.3088007 _enable_loop = True _template_filename = '/usr/local/lib/python3.4/dist-package...
from aiohttp import web async def handle(request): name = request.match_info.get('name', "Anonymous") text = "Hello, " + name return web.Response(text=text) app = web.Application() app.add_routes([web.get('/', handle), web.get('/{name}', handle)]) if __name__ == '__main__': web.run_ap...
# -*- coding: utf-8 -*- # Generated by Django 1.11.4 on 2018-09-21 10:17 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('data', '0067_attachmentrequest_timestamp'), ] operations = [ migrations.Add...
import os import tensorflow as tf import sonnet as snt from luminoth.datasets.exceptions import InvalidDataDirectory class BaseDataset(snt.AbstractModule): def __init__(self, config, **kwargs): super(BaseDataset, self).__init__(**kwargs) self._dataset_dir = config.dataset.dir self._num_ep...
from django.http import HttpResponse, HttpResponseRedirect, HttpResponseNotFound, JsonResponse from django.shortcuts import render from .ady_API import * from .secrets import secrets import json # Fixed variables value = 1500 currency = "EUR" # Default views - Redirect to the next page def index(request): return ...
from bs4 import BeautifulSoup from selenium import webdriver from time import sleep import os from datetime import * from pathlib import Path from openpyxl.workbook.workbook import Workbook from openpyxl import load_workbook from openpyxl.styles import Font from openpyxl.utils import get_column_letter # Here change a...
from flask import Flask from flask import render_template import os import json import time import urllib2 app = Flask(__name__) def get_weather(): url = "http://api.openweathermap.org/data/2.5/forecast/daily?q=London&cnt=10&mode=json&units=metric" response = urllib2.urlopen(url).read() return response @...
import numpy as np from datetime import datetime, timedelta import matplotlib.dates as mdates import matplotlib.pyplot as plt import sys from tools_TC202010 import read_score def main( top='', stime=datetime(2020, 9, 1, 0 ), etime=datetime(2020, 9, 1, 0) ): time = stime while time < etime: data_ = ...
from PIL import Image from utils import http from utils.endpoint import Endpoint, setup from utils.perspective import convert_fit, skew @setup class SquidwardsTV(Endpoint): def generate(self, kwargs): image_url = kwargs['image'] base = Image.open(self.get_asset('squidwardstv.bmp')) white ...
import time import refresh # def GetPageFloderNow(driver,k,p1,p2): # b = 0 # while b == 0: # try: # time.sleep(1) # page_floder_now = int(driver.find_element_by_xpath( # "/html/body/div[1]/div/div[2]/div[2]/div[2]/div[3]/div[2]/div/ul").find_element_by...
from collections import defaultdict import os import time import random import torch import torch.nn as nn #import model_lstm as mn import model as mn import numpy as np import argparse from vocab import Vocab def get_args(): parser = argparse.ArgumentParser() parser.add_argument("--train", type=str, default=...
import coloredlogs from colorama import Fore, Style from datetime import datetime, timezone import logging import verboselogs import getpass import json import os import praw from pprint import pprint import re from saveddit.submission_downloader import SubmissionDownloader from saveddit.subreddit_downloader import Sub...
dias=int(input('dias alugados ')) km=float(input('quantidade de Km rodados ')) diasn = dias*60 kmm = km *0.15 print('um carro alugado por {} dias e rodado {}km devera pagar {:.2f} Reais'.format(dias,km,diasn+kmm))
from django.apps import AppConfig class CompassWebsiteAppConfig(AppConfig): default_auto_field = "django.db.models.BigAutoField" name = "compass_website_app"
import fsaexporter.utils as utils from fsaexporter.ds.page import DeclarationPage BASE_DECLARATION_PAYLOAD = {"size": 100, "page": 0, "filter": {"status": [], "idDeclType": [], "idCertObjectType": [], "idProductType": [], "idGroupRU": [], "idGroupEEU":...
#!/usr/bin/env python # -*- coding: utf-8 -*- from bowtie import cache from bowtie.control import DropDown, Slider from bowtie.control import Button, Switch, Number from bowtie.visual import Plotly import numpy as np import pandas as pd import plotlywrapper as pw from sklearn import manifold from sklearn.neighbors ...
# limits.py import numpy as np class PTLimits(object): """The Pressure Transducer Limits determine when 'Safe' mode breaks. Attributes ---------- pt : pressure transducers [8] a : pressure transducer PT-PR-110 b : pressure transducer PT-OX-120 c : pressure transduce...
"""Pryvate blueprints."""
def get_first_name(): return "Fred" def get_last_name(): return "McFredface" def get_full_name(): return "Fred McFredface"
"""Sort of like numpy.dtype, but with support for torch and python types. Flexible/Shaped/Structured types, like `('void', 10)`, `('int', [2, 3])`, `[('field1', type1), ('field2, type2)]`, etc. are not accepted. Only basic types are. For the generic types 'int' and 'float`, we follow numpy's and python's convention a...
import pandas as pd import re import json json_df = pd.read_json("./planet_booty_songs.json") filter_words = ["verse 1", "verse 2", "verse 3", "verse 4", "verse 5", "chorus", "intro", "outro", "bridge", "refrain", "pre chorus", ""] # print(json_df) counter = 0 for index,row in json_df.iterrows(): song = row[0] ...
# coding=utf-8 class FakePlayer(object): def __init__(self): self.storage = {} def get_setting(self, key, var_type="str"): if var_type not in ("str", "int", "float", "bool", "list"): raise ValueError("Unknown setting type") if var_type == "int": value = int(se...
class CliAction(object): def __init__(self, name, description, options=None): self.name = name self.description = description self.options = options def __str__(self): string = ' - {name}: {desc}'.format(name=self.name, desc=self.description) if self.options is not None:...
#!/usr/bin/env python3 import os import sys import gzip import json import time import optparse import importlib from importlib import machinery from multiprocessing import Pool sys.path.append(os.path.dirname(os.path.abspath(__file__))+'/../../') from fp_constants import * fingerprinter = None app_families_file ...
"""elgato package."""
# -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # source: google/cloud/datastore_admin_v1/proto/index.proto """Generated protocol buffer code.""" from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message from google.protobuf import reflectio...
# Copyright (c) 2016 Huawei Technologies India Pvt.Limited. # 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-...
import json import os HOME_DIR = os.environ.get('HAT_HOME') or "/etc/hive-attention-tokens" CONFIG_FIELDS = [ 'witness_name', 'signing_key', 'public_signing_key', 'ssl_cert', 'ssl_key', 'server_port', 'server_host', 'db_username', 'db_password' ] class Config: # TODO: split witness_config from serve...
from Jumpscale import j class {{shorturl}}_model(j.baseclasses.threebot_actor): def _init(self, **kwargs): #get bcdb from package self.bcdb = self.package.bcdb self.model = self.bcdb.model_get(url="{{model.schema.url}}") @j.baseclasses.actor_method def new(self,schema_out=None, u...
from options import option_namespaces, option_subjects from options.cache import FREQUENT_CACHE_TTL from options.option import NAMESPACE_DB_OPTION_MARKER, Option, OptionStores from options.types import CONF_TYPES AUTH_AZURE_ENABLED = '{}{}{}'.format(option_namespaces.AUTH_AZURE, NA...
from django.conf import settings from djwailer.core.models import LivewhaleEvents, LivewhaleNews import sys, datetime TAGS = { 498:['News & Notices',[]], 499:['Lectures & Presentations',[]], 500:['Arts & Performances',[]], 477:['Kudos',[]], 501:['Faculty News',[]], 502:['Student News',[]], ...
# -*- coding: utf-8 -*- import unittest from thaianalysisrule import parser, word_seg_parser class TestParserSent(unittest.TestCase): def test_parser(self): self.assertIsNotNone(parser(["ผม","เดิน"])) def test_word_seg_parser(self):\ self.assertIsNotNone(word_seg_parser("ผมเดิน"))
#!python def linear_search(array, item): """return the first index of item in array or None if item is not found""" # implement linear_search_iterative and linear_search_recursive below, then # change this to call your implementation to verify it passes all tests return linear_search_iterative(array, i...
import numpy as np import matplotlib.pyplot as plt from typing import List, Tuple, Dict, Any from sklearn.model_selection import train_test_split from nndiy import Sequential from nndiy.layer import Linear from nndiy.utils import one_hot YELLOW = "\033[93m" GREEN = "\033[92m" RED = "\033[91m" ENDC = "\033[0m" class...
from tests.system.action.base import BaseActionTestCase class ChatMessageUpdate(BaseActionTestCase): def test_update_correct(self) -> None: self.set_models( { "meeting/1": {"is_active_in_organization_id": 1}, "chat_message/2": { "user_id": 1,...
#!/usr/bin/python from __future__ import (absolute_import, division, print_function) # Copyright 2019 Fortinet, Inc. # # 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 Lic...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Test trajectory #1 ================== Create some example audio files with a trajectory in it. """ import os import numpy as np import pandas as pd import yaml ## % # Make the required source files for the simulated audio mic_geometry = np.array([[0, 0, 0],...
#!/usr/bin/env python3 from nlptools.text.tokenizer import Segment_Rest cfg = {'TOKENIZER':'http://127.0.0.1:8000/api/tokenize/'} t = Segment_Rest(cfg) #text = 'Change syntax themes, default project pages, and more in preferences.\n hello world' text = "今天天气好不错啊" print(t.seg(text))
#!/usr/bin/env python # # https://github.com/dbrandt/rerun # # A simple script that tries to recreate an approximate docker run # command from the metadata of a running container. It's not complete # and it's not tested in very many situations. If you want to extend it, # please do. I'll accept any pull request within ...
#!/user/bin/python # -*- coding: utf-8 -*- """osica_conejo.py""" def osico_canibal(caballero): # Las variables pueden ser todas las que se quieran if caballero == "Antares": print "A Antares no!" else: print "El osico asesina a Sir "+caballero osico_canibal("Ángel") osico_canibal("Fergu") osico_canibal("Antare...
#!/usr/bin/env python """ @author Jesse Haviland """ import numpy as np import roboticstoolbox as rp from spatialmath import SE3 from spatialmath import base class RobotPlot(): def __init__( self, robot, env, readonly, display=True, jointaxes=True, jointlabels=False, eeframe=True, shadow...
__version__ = "0.0.3" EXTENSION_NAME = "flask-jwt-persistency" class JWTPersistency(object): """Wrapper class that integrates JWT Persistency Flask application. To use it, instantiate with an application: from flask import Flask from flask_jwt_extended import JWTManager from flask_sq...
# Copyright 2013 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. """Common helper module for working with Chrome's processes and windows.""" import logging import os import psutil import re import win32gui import win32pro...
#!/usr/bin/env python """ A module to manipulate files on EOS or on the local file system. Intended to have the same interface as castortools.py. """ from __future__ import print_function import sys import os import re import shutil import io import zlib import subprocess def splitPFN(pfn): """Split the PFN in to ...
# -*- coding: utf-8 -*- # # Copyright © Spyder Project Contributors # Licensed under the terms of the MIT License # (see spyder/__init__.py for details) """Find/Replace widget""" # pylint: disable=C0103 # pylint: disable=R0903 # pylint: disable=R0911 # pylint: disable=R0201 # Standard library imports i...
# uncompyle6 version 2.9.10 # Python bytecode 2.7 (62211) # Decompiled from: Python 3.6.0b2 (default, Oct 11 2016, 05:27:10) # [GCC 6.2.0 20161005] # Embedded file name: __init__.py import dsz import dsz.cmd import dsz.data import dsz.lp class Throttle(dsz.data.Task): def __init__(self, cmd=None): dsz.da...
n=int(input(('Digite um número para ver sua tabuada: '))) print('A tabuada do {} é: '.format(n)) for c in range (1,11): print('{} x {} = {} '.format(n,c,n*c))
from 101703088-topsis.topsis import Topsis
# Generated by Django 2.1.11 on 2020-04-08 01:10 from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('files', '0014_add_dbGaP_type'), ] operations = [ migrations.AlterModelOptions( name='devdownloadtoken', options={'permissio...
"""Preprocess the Artist Workshop environment map The environment map is available for download from https://hdrihaven.com/files/hdris/artist_workshop_8k.hdr """ from __future__ import print_function from utils import cmgen SRC_FILENAME = "artist_workshop_8k.hdr" DST_DIRECTORY = "../assets/workshop" DST_LOOKUP_...
import pymc3 as pm import numpy as np import theano def solve_single_gp(lengthscales, X0, samples, noise=1.0e-3): cov = pm.gp.cov.ExpQuad(len(lengthscales), ls=lengthscales) K = cov(X0.T) K_noise = K + pm.gp.cov.WhiteNoise(noise)(X0.T) L = np.linalg.cholesky(K_noise.eval()) alpha = np.linalg.solve...
""" Standard process. Uniquely associated to a CIM_ComputerSystem and a parent CIM_Process. """ import os import sys import psutil import rdflib from rdflib.namespace import RDF import logging import lib_uris import lib_common import lib_util from lib_properties import pc import lib_properties from lib_psutil import ...
""" Aircraft layout business logic """ import sqlalchemy as db from sqlalchemy.orm import joinedload from sqlalchemy.exc import IntegrityError, NoResultFound from .seat_allocations import allocate_available_seats, copy_seat_allocations, get_current_seat_allocations, \ remove_seats from ..model import Session, Airc...
from tqdm import tqdm_notebook import pandas as pd import numpy as np def _get_path_to_src(end_node, parents_dict): output = [] src = end_node while src != -1: output.append(src) src = parents_dict[src] return list(reversed(output)) def find_cycles(edges, molecule_name, max_depth): ...
""" Utilities for sending email messages through SMTP. :author: Sana Development Team :version: 2.0 """ import urllib import logging from django.conf import settings from django.core.mail import send_mail __all__ = ["send_review_notification",] #TODO These should be saved as settings or a global config table link =...
# Generated by Django 2.1.7 on 2020-03-12 21:52 from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('api', '0006_user_approved'), ] operations = [ migrations.AlterModelOptions( name='comment', options={'ordering': ['-updated'...
""" -------------------------------------------------------------------------------------------------------------------- This program creates 2D light effects onto a pygame surface/image (32 bit PNG file encoded with alpha channels transparency). The files radial4.png, RadialTrapezoid, RadialWarning are controlling...
# -*- coding:utf-8 -*- ''' @Author: LiamTTT @Project: TCTPreprocess.py @File: slide_reader.py @Date: 2021/9/10 @Time: 10:22 @Desc: read slides ''' import os import openslide import numpy as np from loguru import logger from collections import Iterable from openslide import OpenSlide from thirdparty.slide...
""" See http://pbpython.com/pandas-google-forms-part1.html for more details and explanation of how to create the SECRETS_FILE Purpose of this example is to pull google sheet data into a pandas DataFrame. """ from __future__ import print_function import gspread from oauth2client.client import SignedJwtAssertionCredent...
from django.shortcuts import render , redirect from django.contrib.auth import authenticate, login, logout from django.contrib import messages from django.contrib.auth.decorators import login_required from . import forms from . import models def login_index(request): if request.user.is_authenticated: return r...
from __future__ import annotations RECIPE_FILE = 'recipes.cptk.yaml' PROJECT_FILE = '.cptk/project.cptk.yaml' LAST_FILE = '.cptk/stayaway/last.cptk.txt' MOVE_FILE = '.cptk/moves.cptk.txt' MOVE_FILE_SEPERATOR = '::' MOVE_SAFES = ['./', '**/.cptk/**'] LAST_FILE_SEPERATOR = '::' INPUT_FILE_SUFFIX = '.in' OUTPUT_FILE_S...
# ---------------------------------------------------------------------------- # # Stackmetric IO - Copyright ©️ 2022 All Rights Reserved. # # ---------------------------------------------------------------------------- # def run(): from nltk.tokenize import word_tokenize, sent_tokenize impor...
from rest_framework import generics from circuits.models import Provider, CircuitType, Circuit from circuits.filters import CircuitFilter from . import serializers class ProviderListView(generics.ListAPIView): """ List all providers """ queryset = Provider.objects.all() serializer_class = serial...
# # Copyright The NOMAD Authors. # # This file is part of NOMAD. # See https://nomad-lab.eu for further info. # # 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/lic...