content
stringlengths
5
1.05M
from enum import Enum # 抽象类型 class AbstractType(object): def __init__(self, name): self.name = name self.original_typedef = None def complete_name(self): pass def accept_printer(self, printer): pass def accept_visitor(self, visitor): raise Exception('This type...
from typing import Optional # Definition for singly-linked list. class ListNode: def __init__(self, val=0, next=None): self.val = val self.next = next class Solution: # Time complexity: O(n) # Space complexity: O(n) # Recursive approach def reverseList(self, head: Optional[ListNode...
############################################################################ # # AVI CONFIDENTIAL # __________________ # # [2013] - [2018] Avi Networks Incorporated # All Rights Reserved. # # NOTICE: All information contained herein is, and remains the property # of Avi Networks Incorporated and its suppliers, if any. ...
import re from flask import Flask, render_template, redirect, abort from flask.ext.bootstrap import Bootstrap from flask.ext.wtf import Form, TextField, ValidationError app = Flask(__name__) app.config['BOOTSTRAP_USE_MINIFIED'] = True app.config['BOOTSTRAP_USE_CDN'] = True app.config['BOOTSTRAP_FONTAWESOME'] = True...
# -*- coding: utf-8 -*- """ Created on Fri Dec 6 09:37:42 2019 @author: Rashid Haffadi """ import numpy as np from functools import partial # Activations acts = ["relu", "sigmoid", "softmax", "tanh", "leaky_relu", "selu", "elu"] def get_act(index, *args, **kwargs): if index==0: return relu elif i...
"""Authentication middleware""" from django.shortcuts import redirect from django.utils.http import urlquote from social_core.exceptions import SocialAuthBaseException from social_django.middleware import SocialAuthExceptionMiddleware class SocialAuthExceptionRedirectMiddleware(SocialAuthExceptionMiddleware): ""...
__all__ = [ "__title__", "__summary__", "__uri__", "__version__", "__author__", "__email__", "__license__", "__copyright__", ] __title__ = "proxlib" __summary__ = "Prox-operator library for optimization" __uri__ = "https://github.com/UW-AMO/proxlib" __version__ = "0.0.1" __author__ = "Peng Zheng" __email__ =...
def name_shuffler(name: str) -> str: return ' '.join(reversed(name.split()))
class Solution: def minNumberOfSemesters(self, n: int, dependencies: List[List[int]], k: int) -> int: def compute_depth(u): if depths[u] == -1: depths[u] = 0 for v in graph[u]: depths[u] = max(depths[u], 1 + compute_depth(v)) return depths[...
from matplotlib import pyplot as plt import tensorflow_addons as tfa import tensorflow as tf import numpy as np import unittest import os from dataset_creation.image_transformations.data_augmentation import get_random_params, tf_augment_image def get_image_directory(): return os.path.abspath( os.path....
import argparse from io import open import random import time import os.path as osp from pathlib import Path import numpy as np from ruamel.yaml import YAML from easydict import EasyDict as edict import torch import torch.nn as nn from torch import optim import torch.nn.functional as F from torch.utils.data import Da...
# -*- coding: utf-8 -*- __all__ = [ 'extend_docs' ] try: from inspect import cleandoc from pyment.docstring import DocString def extend_docs(orig_func, translate=False): """Decorator to extend the docstring with the docstring of the given function. :param orig_func: function to get d...
import click from .zotero import zotero from .markdown import markdown @click.group() def sync(): """ Collection of Sync commands for various services """ pass sync.add_command(zotero) sync.add_command(markdown)
# Generated by Django 3.2.7 on 2021-09-26 12:01 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('servicesApp', '0002_alter_service_service_title'), ] operations = [ migrations.AddField( model_name='service', name=...
# MODULE: Typerig / Proxy / Font (Objects) # ----------------------------------------------------------- # (C) Vassil Kateliev, 2017-2020 (http://www.kateliev.com) # (C) Karandash Type Foundry (http://www.karandash.eu) #------------------------------------------------------------ # www.typerig.com # No warranties. ...
import numpy as np DATA = 'hpatches' DEBUG = (0==1) WS_DIR = '/home/ws/' WEIGHT_DIR = '%s/meta/weights/'%WS_DIR NEW_SIZE = (640,480) GLOBAL_TIME = True MIN_MATCH_COUNT = 10 # min num of descriptor matching for H estimation BATCH_SIZE = 1 MOVING_AVERAGE_DECAY = 0.9999 SCALE_NUM = 5 THRESH_OVERLAP = 5 THRESH_DE...
from django.shortcuts import render, redirect from django.views.generic import CreateView, UpdateView, DeleteView, ListView, DetailView from django.urls import reverse_lazy from django.contrib.auth import get_user_model from .models import Comment from products.models import Book from .forms import CommentForm from dir...
dashboard_html = """<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>Sauna status</title> <style> body {{ background-color: rgba(114, 254, 149, 0.38); }} h1 {{color: blue;}} .content {{ border-radius: 25px; border: 1px solid black; background-color: white; width: 80%; margin-left: a...
from __future__ import print_function from skimage.feature import peak_local_max from skimage.morphology import watershed from scipy import ndimage import numpy as np import matplotlib.pyplot as plt from flask import Flask, render_template, url_for, redirect, request, flash, request from scipy.spatial import distance a...
#!/usr/bin/env python3 class AstPrinter: def print(self, expr): return expr.accept(self) def parenthesize(self, name, *exprs): strg = "(" + name for expr in exprs: strg += " " + expr.accept(self) strg += ")" return strg def visitBinaryExpr(self, expr...
import pathlib import pandas as pd import pytest import settings from local.dividends import comony_ru def test_dividends(monkeypatch, tmpdir): data_path = pathlib.Path(tmpdir.mkdir("conomy")) monkeypatch.setattr(settings, 'DATA_PATH', data_path) df = comony_ru.dividends_conomy('CHMF') assert isinst...
from typing import List from sqlalchemy.orm import Session from models.schemas import Cve from .exceptions import CveInfoInfoAlreadyExistError, CveInfoNotFoundError from models.models import CveInfo from models.schemas import CreateAndUpdateCve def get_all_cves(session: Session, limit: int, offset: int) -> List[CveIn...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- if __name__ == '__main__': n = int(input("Введите число: ")) r = [] if n >= 1001: print('Число больше 1000') h = ["сто", "двести", "триста", "четыреста", "пятьсот", "шестьсот", "семьсот", "восемьсот", "девятьсот"] o = ["один", "два", "три", "...
# Generated by Django 2.0.3 on 2018-04-04 09:51 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('Registration', '0003_candidate_reward'), ] operations = [ migrations.AddField( model_name='voter', name='flag', ...
from gekitchensdk.erd.converters.abstract import ErdReadWriteConverter, ErdReadOnlyConverter from gekitchensdk.erd.erd_codes import ErdCodeType def erd_decode_int(value: str) -> int: """Decode an integer value sent as a hex encoded string.""" return int(value, 16) def erd_encode_int(value: any, length: int = 2...
import unittest import cq_examples.Ex101_InterpPlate as ex class TestExample101(unittest.TestCase): def test_Ex101(self): # Import and validate plate_0 = ex.plate_0 plate_1 = ex.plate_1 plate_2 = ex.plate_2 plate_3 = ex.plate_3 plate_4 = ex.plate_4 self.asser...
""" # Copyright 2022 Red Hat # # 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...
from __future__ import unicode_literals from django.apps import AppConfig class FilesystemConfig(AppConfig): name = 'filesystem'
from __future__ import print_function, absolute_import, division #makes KratosMultiphysics backward compatible with python 2.6 and 2.7 # importing the Kratos Library from KratosMultiphysics import * from KratosMultiphysics.LagrangianMPMApplication import * from materials import * class ConstitutiveLawUtility: # ...
from collections import namedtuple import sys import gym # Algorithms RES_FLDS = ['sample', 'vectorized', 'uses_gpu'] RES_FLDS_DOC = '''\n sample has signature (env, policy, num_episodes, seed) where num_episodes is the number of trajectories to sample, and seed is used to sample deterministically. It returns a list ...
#!/usr/bin/env python from pymongo import MongoClient import json, ast import time as time_mod from bokeh.plotting import figure, output_file, show from bokeh.models import LinearAxis, Range1d import numpy as np client = MongoClient('localhost', 27017) db = client.DB-NAME # SET THIS WITH YOUR DATABASE N...
from setuptools import setup, find_packages with open("README.md", "r") as fh: long_description = fh.read() setup(name='Multiple smi', version='2.0.3', url='https://github.com/ClementPinard/multiple-smi', license='MIT', author='Clément Pinard', author_email='clempinard@gmail.com', ...
# coding=utf-8 # from .helpers import disconnect_client # from .helpers import get_connections # from .shadowsocks import Keys from .shadowsocks import ShadowSocks
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Простой скрипт, автоматически обновляющий резюме на hh.ru Для автоматического обновления - создайте задачу в `crontab`. """ import requests from secrets import URL, HEADER, RESPONSE_STATUS def main(): """Функция c основной логикой.""" req = requests.post(UR...
# # Copyright (c) 2013-present, Anoop Kunchukuttan # All rights reserved. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. # #Program for detokenizing Indian language input # # @author Anoop Kunchukuttan # import strin...
import datetime from collections import OrderedDict from django.conf import settings from django.core.exceptions import PermissionDenied from django.core.paginator import InvalidPage from django.shortcuts import get_object_or_404, redirect from django.urls import reverse from django.utils.translation import ngettext f...
# -*- coding: utf-8 -*- """ Created on Fri Jun 19 08:28:34 2020 @author: Marcin """ from math import fmod from src.globals import * from timeit import default_timer as timer from time import sleep from collections import deque import warnings import pandas as pd from tqdm import tqdm # warnings.warn("Warning....
letter = ''' Dear {salutation} {name}, Thank you for your letter. We are sorry that our {product} {verbed} in your {room}. Please note that it should never be used in a {room}, especially near any {animals}. Send us your reciept and {amount} for shipping and handling. We will send you another {product} that, in our t...
# coding: utf-8 __version__ = '0.1.2' from .decorator import scheduledTask
from django.contrib import admin from .models import Notification_Student # Register your models here. admin.site.register(Notification_Student)
class Design: def __init__(self,style,objects): self.style = style self.objects = objects self.furniture = 0 self.place = 'place' def __str__(self): return (f'Stil kvartiry - {self.style}, Predmety neobhodimosti - {self.objects}, ' f'Mebel - {self.furniture...
from django.db import migrations def operation_document_file_filename_copy(apps, schema_editor): cursor_main = schema_editor.connection.cursor() cursor_document_file = schema_editor.connection.cursor() query_document_file = ''' UPDATE {documents_documentfile} SET {filename} = %s WHERE {documents_...
"""Some utility functions for commands (e.g., for cmdline handling).""" # Authors: Yaroslav Halchenko <debian@onerussian.com> # Stefan Appelhoff <stefan.appelhoff@mailbox.org> # # License: BSD (3-clause) import glob import importlib import os import os.path as op from optparse import OptionParser import sys ...
#!/usr/bin/python from socket import * from django.core.management import BaseCommand class BroadcastListener(BaseCommand): def handle(self, *args, **options): cs = socket(AF_INET, SOCK_DGRAM) cs.bind(('192.168.8.120', 988)) while True: data, address = cs.recvfrom(1024) ...
import socket import struct import textwrap PROTOCOLS = {1: 'ICMP', 2: 'IGMP', 6: 'TCP', 9: 'IGP', 17: 'UDP'} BUF = 65535 def textwrapping(prefix, string, size=80): size -= len(prefix) if isinstance(string, bytes): string = ''.join(r'\x{:02x}'.format(byte) for byte in string) if size % 2: size -= 1 return '...
from floodsystem.geo import stations_by_distance from floodsystem.stationdata import build_station_list def run(): stations = build_station_list() lists = stations_by_distance(stations, (52.2053, 0.1218)) print("the closest 10 stations are") print(lists[:10]) print("the farther 10 stations are") ...
""" Twisted PythonCard PbEchoClient """ from PythonCard import model, twistedModel from twisted.cred.credentials import UsernamePassword from twisted.spread import pb from twisted.internet import reactor from PythonCard.templates.dialogs.loginDialog import loginDialog class DefinedError(pb.Error): pass class Ec...
import os def write_additional_table_file(table_folder): # get all the file names in the table folder file_names = os.listdir(table_folder) file_names.sort() # make sure we have the default table default_name = 'default.csv' if default_name not in file_names: raise RuntimeError("Did n...
import pandas as pd diction = {"A": 1, "B": 2, "C": 3, "D": 4} df = pd.DataFrame(diction) print(df) print('this is an edit')
import sys sys.path.append('build') import AvTrajectoryPlanner as av import time scenario_file = "benchmark/speed_test_scenario.txt" with open(scenario_file) as file: envFileStr = file.read() planner = av.Planner() planner.loadFromJson(envFileStr) start = time.time() # run your code for i in range(100): v...
#!/usr/bin/env python3 # Copyright 2022 The IREE Authors # # Licensed under the Apache License v2.0 with LLVM Exceptions. # See https://llvm.org/LICENSE.txt for license information. # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception import unittest from common.common_arguments import build_common_argument_pars...
import unittest from escore_python.observers import MockDataStoreObserver, TestCaseObservable class DsToDsTest(unittest.TestCase, TestCaseObservable): def setUp(self): observers = [MockDataStoreObserver()] super(DsToDsTest, self).set_up_observers(observers) def test_execute(self): f...
# third party imports from rest_framework import serializers # covid_app imports from src.covid_project.covid_app.api.v1.serializers.region_serializer import RegionSerializer class EstimatorSerializer(serializers.Serializer): region = RegionSerializer() periodType = serializers.CharField(max_length=50000) ...
''' Class that gathers informations from XmlDictConfig class This class will parse all informations stacked up in XmlDictConfig instance and will create a file based of it. ''' import xml.etree.ElementTree as ET import errno import os.path try: from builder.xml_converter import XmlDictConfig from builder.conf...
from flask import Flask,request,url_for,g,render_template from sqlalchemy import create_engine import csv import os import pandas as pd mysql_uri = 'mysql://root:2080kk757@localhost:3306/echart_data?charset=utf8' engine = create_engine(mysql_uri) with engine.connect() as conn, conn.begin(): data = pd.read_sql_tab...
# -*- coding: utf-8 -*- import requests import json from lxml import etree class Crawl(object): headers = {'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/49.0.2623.221 Safari/537.36 SE 2.X MetaSr 1.0'} def get_price(self, item_id_inner): url = 'https...
from execution.executeSentence import executeSentence from execution.AST.sentence import * from execution.AST.expression import * def up(): print(1) def SALES_TAX(SUBTOTAL: float) ->float: t0=23 t1=5 t2=t0*t1 t3=6 t4=2 t5=t3/t4 t6=t2+t5 TOTAL:float=t6 print(1)
# Copyright 2018 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 required by applica...
''' Count number of declines with uncertain dates. ''' import os import pandas as pd import numpy as np input_path="output/cohort.pickle" output_path="output/cohort_pickle_checks.csv" backend = os.getenv("OPENSAFELY_BACKEND", "expectations") cohort = pd.read_pickle(input_path) cohort = cohort.loc[pd.notnull(cohort...
r""" Finite dimensional semisimple algebras with basis """ from __future__ import absolute_import #***************************************************************************** # Copyright (C) 2011-2015 Nicolas M. Thiery <nthiery at users.sf.net> # 2014-2015 Aladin Virmaux <aladin.virmaux at u-psud.fr> ...
import copy import multiprocessing import re import requests import setproctitle import time from shakenfist.config import config from shakenfist.daemons import daemon from shakenfist import db from shakenfist import exceptions from shakenfist.images import Image from shakenfist import logutil from shakenfist import n...
# -*- coding=utf-8 -*- import argparse import buildplug import shutil import utils import os import logging import glob import sys import cmdrunner __hostunityprojpath = r"..\..\HostUnityProj" config = "debug" def create(args): """ create a project by plugs config """ try: ...
from app.common.util import formatDatetime from app.models.model import Entry, Feed, db from feedparser import parse as feed_parse from flask_apscheduler import APScheduler from app.common.util import get_tags scheduler = APScheduler() @scheduler.task('interval', id='title', minutes=10, misfire_grace_time=900) def f...
import torch.nn as nn class CNN(nn.Module): def __init__(self): super(CNN, self).__init__() self.layer = nn.Sequential( nn.Conv2d(1,16,5), nn.ReLU(), nn.Conv2d(16,32,5), nn.ReLU(), nn.MaxPool2d(2,2), nn.Conv2d(32,64,5...
import numpy as np import torch import torch.nn.functional as F from xnas.core.timer import Timer from xnas.search_space.cellbased_DARTS_cnn import DartsCNN from xnas.search_space.cellbased_NASBench201_cnn import NASBench201CNN def basic_darts_cnn_test(): # dartscnn test time_ = Timer() print("Testing da...
from abc import ABC class EYELink(ABC): """Type hint for eye-link device.""" pass
from traitlets.config.configurable import SingletonConfigurable, Configurable import traitlets import atexit import logging from jetbot import AStar import sys class RobotAStar(SingletonConfigurable): a_star = AStar() def __init__(self, *args, **kwargs): super(RobotAStar, self).__init__(*args, **kwarg...
from unittest import TestCase from mock import mock from ..tf_generic_log import TFGenericLog class TestTFGenericLog(TestCase): def setUp(self): self.tf_generic_log = TFGenericLog([ '192.168.1.10 - - [13/Sep/2006:07:01:53 -0700] foo bar baz', '192.168.1.20 - - [28/Jul/2006:10:27...
import re from os import listdir from os.path import join, getsize import numpy as np import torch from torch.utils.data import Dataset, DataLoader from zstandard import ZstdDecompressor import config class Collate(object): alphabet_to_num = {'a': 0, 'b': 1, 'c': 2, 'd': 3, 'e': 4, 'f': 5, 'g': 6, 'h': 7, 'i': ...
from coza.objects import Context, Result from coza.api import BacktestApi from coza.errors import InputValueValidException from coza.utils import now from coza.logger import logger from datetime import datetime, timedelta from copy import deepcopy import pandas as pd import sys import os import time class BacktestCo...
# Enter your code here. Read input from STDIN. Print output to STDOUT from collections import* d={} for i in range(int(input())): word=input() if word in d: d[word]+=1 else: d[word]=1 print(len(d)) print(*d.values())
import requests import logging import weibo from config import tuling_apiUrl, tuling_key, weibo_username, weibo_password, robot_tuling, robot_xiaoice logger = logging.getLogger('MyItChatDemo.robot') weibo_instance = None def get_reply_msg(info, userid): raise NotImplementedError() def get_reply_from_tuling(inf...
# Copyright 2021 chris # See LICENSE file for licensing details. # # Learn more about testing at: https://juju.is/docs/sdk/testing import unittest import unittest.mock as mock from charm import KingfisherCharm from ops.model import ( BlockedStatus, MaintenanceStatus, ) from ops.testing import Harness class ...
#! /usr/bin/env python2.7 # -*- coding: utf-8 -*- # new version of Bruno Cuconato's script # changes made by Leonel F. de Alencar import codecs import re from ConvertDELAF import EndsInNasalDiphthong def parse_entry(e): [f,ts] = e.split("\t") parts = ts.split("+") return (f,parts[0],parts[1:]) def enrich_...
import logging import matplotlib.axes import matplotlib.pyplot as plt import numpy as np from scipy.interpolate import interp1d import alf.io from brainbox.core import Bunch import ibllib.io.spikeglx as spikeglx from ibllib.misc import log2session_static from ibllib.io.extractors.ephys_fpga import _get_sync_fronts, g...
#!/usr/bin/env python # -*- coding: utf-8 -*- import generateLaunch, logger, os, sys cf_logger = logger.get_logger(__name__) # debug(), info(), warning(), error(), exception(), critical() LAUNCH_FOLDER = "../launch" LAUNCH_FILE = "crazy_game.launch" LAUNCH_PATH = "{}/{}".format(LAUNCH_FOLDER, LAUNCH_FILE) INVENTORY_FI...
# -*- coding: utf-8 -*- from PyQt4 import QtSql from DB.BaseDBRoutine import CDatabaseRoutine from DB.Database import CDatabase from DB.MySQLRoutine import CMySqlRoutineMap from DB.Tools import CSqlExpression from Utils.Exceptions import CDatabaseException from Utils.Forcing import forceRef class CMySqlDatabase(CDat...
"""Circle model""" #django from django.db import models #utilities from cride.utils.models import CRideModel class Circle(CRideModel): """Circle model A circle is a private group where rides are offered and taken by its members. To join a circle a user must receive an unique invitation code from an...
# -*- coding: utf-8 -*- import six class Broker(object): def __init__(self, observable_class): """ Parameters ---------- observable_class : clare.common.event_driven.Observable """ self._observable_class = observable_class self._topics_index = dict() ...
from concurrent.futures import TimeoutError from google.cloud import pubsub_v1 from mementos import MementoMetaclass from utils import get_logger logger = get_logger(__name__) class Subscription(metaclass=MementoMetaclass): def __init__(self, config): self.project_id = config.application.project_id ...
from collections import defaultdict class Graph: def __init__(self): self.graph = defaultdict(list) def addEdge(self, u, v): self.graph[u].append(v) self.graph[v].append(u) def printGraph(self): for i in self.graph.keys(): print(i, '->', ' -> '.join([str(j) fo...
import subprocess subprocess.run(["ls -l ~; sleep 4"], shell=True) print('lalal')
# Copyright 2021 Universität Tübingen, DKFZ and EMBL for the German Human Genome-Phenome Archive (GHGA) # # 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 # # https://www.apache.org/licenses...
from django.conf import settings UPLOAD = getattr(settings, 'UPLOAD', { 'collection_model': 'upload.Collection', 'media_root': settings.MEDIA_ROOT, 'downsize_to': (1024, 768), 'fill_transparent': (255, 255, 255), # Use False to keep PNG aplha })
import sys import json import csv COCO_ANN_PATH = 'datasets/coco/annotations/instances_val2017.json' OID_ANN_PATH = 'datasets/oid/annotations/openimages_challenge_2019_val_v2_expanded.json' OBJECTS365_ANN_PATH = 'datasets/objects365/annotations/objects365_val.json' MAPILLARY_ANN_PATH = 'datasets/mapillary/annot...
import os from aiogram import Bot, Dispatcher from aiogram.contrib.fsm_storage.files import PickleStorage import dotenv # Load dotenv dotenv.load_dotenv() bot = Bot(token=os.getenv("API_TOKEN")) storage = PickleStorage("db.pickle") dp = Dispatcher(bot, storage=storage)
#!/usr/bin/env python # coding: utf-8 # # Tarea #2 # # Estudiante: Heiner Romero Leiva # ### Importacion de paquetes # In[1]: import os import pandas as pd import numpy as np import matplotlib.pyplot as plt from sklearn.model_selection import train_test_split from sklearn.naive_bayes import GaussianNB from sklea...
#!/usr/bin/env python3 from app.main import app
from setuptools import setup setup( name='py-certgenerator', version='1', packages=['py-certgenerator'], url='https://the-cyber-squad.com', license='MIT ', author='will', author_email='will@theapiguys.com', description='Generates SSL x509 certificates' )
from urldl import download from pycallisto import fitsfile callisto_archives = 'http://soleil80.cs.technik.fhnw.ch/' \ 'solarradio/data/2002-20yy_Callisto/' filelist = [ "BLEN7M_20110216_133009_24.fit.gz", "BLEN7M_20110216_134510_24.fit.gz", "BLEN7M_20110216_140011_24.fit.gz", "BLEN7M_2011...
from . import parsing
#----------------------------------------------------------------------------- # Copyright (c) 2012 - 2022, Anaconda, Inc., and Bokeh Contributors. # All rights reserved. # # The full license is in the file LICENSE.txt, distributed with this software. #-------------------------------------------------------------------...
from django.utils.translation import ugettext_lazy as _ __all__ = ( 'MERCHANT_TYPES', 'DEFAULT_MERCHANT_TYPE', 'DEFAULT_PARTS_COUNT', 'CREATED', 'SUCCESS', 'CANCELED', 'FAIL', 'CLIENT_WAIT', 'OTP_WAITING', 'PP_CREATION', 'LOCKED', 'STATE_CHOICES', 'LOG_CHOICES' ) M...
import numpy as np from PIL import Image from radiomics import featureextractor import sys import nipy import SimpleITK as sitk radiomics_parameter_path = r'C:\projects\pyradiomics\examples\exampleSettings\Params.yaml' extractor = featureextractor.RadiomicsFeaturesExtractor(radiomics_parameter_path) extractor.disableA...
def add_variable_to_context(request): if request.COOKIES.get('uuid') is not None: return { 'uuid': request.COOKIES.get('uuid') } else: return { 'uuid': '000' }
from django.conf.urls import url from .views import ( ExpenseCreateView, ExpenseListView, ExpenseUpdateView, ExpenseDeleteView, ) urlpatterns = [ url(r'^$', ExpenseListView.as_view(), name='list'), url(r'^create/$', ExpenseCreateView.as_view(), name='create'), url(r'^update/(?P<pk>\d+)/$', Expe...
import subprocess import sys import os def run_web_app( url: str, width: int = 800, height: int = 600, min_size: tuple = (800, 600) ): cmd_py = ["import webview"] cmd_py += [ f"window = webview.create_window(" f"'TINerator', url='{url}', width={width}, " f"height={height}, min_size...
from django.db import models # Create your models here. from django.db import models COUNTRIES = ( ('uk', 'UK'), ('us', 'USA'), ('in', 'India'), ) LABELS = ( ('0', 'NEGATIVE'), ('1', 'POSITIVE'), ('2', 'NEUTRAL'), ) class Report(models.Model): goodness = models.CharField(...
from moceansdk.modules.command.template import wa_template_basic class WaTextTemplate(wa_template_basic.WaTemplateBasic): def type(self): return 'text'
# -*- coding: utf-8 -*- """ Created on Sun Sep 8 14:27:49 2019 @author: positiveoutlier A digital root is the recursive sum of all the digits in a number. Given n, take the sum of the digits of n. If the resulting value has more than one digit, continue reducing in this way until a single-digit number is produced. T...