text
stringlengths
2
999k
import asyncio import string from abc import ABC from datetime import date, datetime from random import SystemRandom from typing import List, Optional import pytest from arango import ArangoClient from arango.database import StandardDatabase from arango.typings import Json from networkx import DiGraph, MultiDiGraph f...
from django.http import HttpResponse def index(request): return HttpResponse("Ola, mundo!")
# Copyright (C) 2013 Cisco Systems Inc. # All rights reserved #$Id: eor_utils.py,v 1.427 2013/06/24 23:56:03 venksrin Exp $ #ident $Source: /cvsroot/eor/systest/lib/eor_utils.py,v $ $Revision: 1.427 $ # Best Pratices for get() functions: # 1. Use class rex as much as possible for standard regular expressions # 2. Use...
Experiment(description='For debugging changepoints', data_dir='../data/debug/', max_depth=3, random_order=False, k=1, debug=False, local_computation=True, n_rand=1, sd=2, jitter_sd=0.1, max_jobs=300, ...
from django.contrib import admin from . import models # Register your models here. @admin.register(models.Image) class ImageAdmin(admin.ModelAdmin): list_display_link = ( 'location', 'caption', ) search_fields = ( 'location', 'caption', ) list_filter = ( 'loc...
#!/usr/bin/env python import threading import unittest import psycopg2 from psycopg2.extensions import ( ISOLATION_LEVEL_SERIALIZABLE, STATUS_BEGIN, STATUS_READY) import tests class TransactionTests(unittest.TestCase): def setUp(self): self.conn = psycopg2.connect(tests.dsn) self.conn.set_is...
#%% import traceback import threading import queue import cv2 import time from .cvtrace import PathManager, GcodeWriter class TracerWorker(threading.Thread): def __init__(self, parent): # Daemon but we'll still try to shut down nicely threading.Thread.__init__(self, daemon=True) self.inbox ...
# Copyright © 2017 Ondrej Martinsky, All rights reserved # http://github.com/omartinsky/pybor def assertRaisesMessage(exception_class, lambda_function, message_substring): try: lambda_function() except exception_class as ex: msg = ex.args[0] if message_substring not in msg: ...
# -*- coding: utf-8 -*- """ Utilities to enable exception reraising across the master commands """ from __future__ import absolute_import, print_function, unicode_literals # Import salt libs import salt.exceptions import salt.utils.event # Import 3rd-party libs from salt.ext.six.moves import builtins as exceptions ...
from flask import url_for import meowbot from meowbot.triggers import SimpleResponseCommand, trigger_registry, BaseCommand from meowbot.conditions import IsCommand from meowbot.context import CommandContext class Help(SimpleResponseCommand): condition = IsCommand(["help"]) help = "`help`: shows all commands...
# This code is part of Qiskit. # # (C) Copyright IBM 2021. # # This code is licensed under the Apache License, Version 2.0. You may # obtain a copy of this license in the LICENSE.txt file in the root directory # of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. # # Any modifications or derivative wo...
import os import torch import torch.utils.data as data from PIL import Image import tifffile as tiff import os import cv2 import numpy as np import os.path from typing import Any, Callable, cast, Dict, List, Optional, Tuple class VisionDataset(data.Dataset): _repr_indent = 4 def __init__( ...
from rest_framework.renderers import JSONRenderer class DatatablesRenderer(JSONRenderer): media_type = 'application/json' format = 'datatables' def render(self, data, accepted_media_type=None, renderer_context=None): """ Render `data` into JSON, returning a bytestring. """ ...
from components.sidebar import show_sidebar from pages.datasets import show_datasets from pages.home import show_home from pages.data_visualization import show_data_visualization from pages.species import show_species from utils.constants import NAV_HOME, NAV_DATA, NAV_VIZ, NAV_SPECIES import streamlit as st st.set_pa...
import urllib.request import urllib.error import urllib.parse import json from .market import Market class BtceUSD(Market): def __init__(self): super(BtceUSD, self).__init__("USD") # bitcoin central maximum call / day = 5000 # keep 2500 for other operations self.update_rate = 60 ...
import plotly.figure_factory as ff import pandas as pd import csv df=pd.read_csv("data.csv") fig=ff.create_distplot([df['Weight(Pounds)'].tolist()],['Weight'],show_hist=False) fig.show()
#!/usr/bin/env python """ loading of various data for VAMP project """ import os import numpy as np ### for loading images to numpy arrays with PIL from scipy import misc from calc.common import PIX_ERR def read_grey_image(filename): '''read single greyscale image''' mesg = None try: img = misc.imr...
from django.shortcuts import HttpResponse,render from django.db.models import Q from apps.common.func.LanguageFunc import * from apps.common.func.CommonFunc import * from apps.common.config import commonWebConfig from apps.config.services.http_confService import HttpConfService from apps.task.services.HTTP_taskService ...
from walt.common.thread import RPCThreadConnector from walt.common.apilink import AttrCallRunner, AttrCallAggregator class BlockingTasksManager(RPCThreadConnector): def session(self, requester): # we will receive: # service.<func>(rpc_context, <args...>) # and we must forward the call as: ...
import logging import os from collections import namedtuple from data_analysis_compare_sr_ud import extract_overlapping_data logger = logging.getLogger('filtering_ud_data') logging.basicConfig(level=logging.INFO) DataInfo = namedtuple('DataInfo', ['sc', 'ss', 'ud', 'out']) DATA_SPLITS = ['train', 'dev'] UD_DATASETS ...
import time import numpy as np import tensorflow as tf import metrics import modeling import optimization # Prepare and import BERT modules import sys import os # !test -d bert_repo || git clone https://github.com/nyu-dl/dl4marco-bert dl4marco-bert # if not 'dl4marco-berto' in sys.path: # sys.path += ['dl4marco-b...
import time import argparse import os import sys import pptk import numpy as np BASE_DIR = os.path.dirname(os.path.abspath(__file__)) ROOT_DIR = BASE_DIR sys.path.append(BASE_DIR) sys.path.append(os.path.join(ROOT_DIR, '../utils')) from commons import check_mkdir, force_mkdir parser = argparse.ArgumentParser() parser....
#!/usr/bin/env python from spt3g import core, dfmux import socket, argparse import numpy as np parser = argparse.ArgumentParser(description='Record dfmux data to a NetCDF file', prog='ledgerman') parser.add_argument('hardware_map', metavar='/path/to/hwm.yaml', help='Path to hardware map YAML file') parser.add_argumen...
# Copyright 2020 Division of Medical Image Computing, German Cancer Research Center (DKFZ), Heidelberg, Germany # # 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://w...
# coding: utf-8 import pprint import re import six from huaweicloudsdkcore.sdk_response import SdkResponse class ListSecretsResponse(SdkResponse): """ Attributes: openapi_types (dict): The key is attribute name and the value is attribute type. attribute_map (dict)...
#!/usr/bin/python # Copyright: (c) 2017, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type DOCUMENTATION = ''' --- module: cloudformation version_added: 1.0.0 short_descri...
from __future__ import absolute_import import os import sys import errno # from .osutils import mkdir_if_missing def mkdir_if_missing(dir_path): try: os.makedirs(dir_path) except OSError as e: if e.errno != errno.EEXIST: raise class Logger(object): def __init__(self, fpath=None...
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Proactive Learning documentation build configuration file, created by # sphinx-quickstart on Thu Jul 2 00:27:29 2015. # # This file is execfile()d with the current directory set to its # containing dir. # # Note that not all possible configuration values are present in...
from ...conversions import hex_to_bytes from ...set1.challenge1_2 import xor_bytes from ...set4.challenge28 import sha1_hash def hmac_sha1(key, message): block_size = 64 if len(key) > block_size: key = sha1_hash(message) # have to modify key because key might be too short after hashing if len...
### Import Libs import pandas import time from bs4 import BeautifulSoup from selenium import webdriver from selenium.webdriver.chrome.options import Options ### Importing from other files from Supermarket_Scraping.Parameters.supermarket_parameters import ( supermarket_parameters, supermarket_list, path_chr...
import abc import numpy as np import torch from torch import nn from torch.nn import functional as F import utils class ContinualLearner(nn.Module, metaclass=abc.ABCMeta): '''Abstract module to add continual learning capabilities to a classifier.''' def __init__(self): super().__init__() ...
# stdlib from typing import List from typing import Optional from typing import Type # third party from nacl.signing import VerifyKey # relative from ....abstract.node_service_interface import NodeServiceInterface from ..auth import service_auth from ..node_service import ImmediateNodeServiceWithReply from .peer_disc...
# coding: utf-8 """ Kubernetes No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) OpenAPI spec version: v1.11.1 Generated by: https://github.com/swagger-api/swagger-codegen.git """ from __future__ import absolute_import import os import sys i...
""" Run a virtual screen baseline: starting from an initial pool, we randomly sample the next point from the rest of the dataset, instead of synthesizing it from that pool. This simulates a situation of virtual screening and doesn't account for the cost of discovery of new compounds. """ import numpy as np from argpar...
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
# Copyright (C) 2019 The Raphielscape Company LLC. # # Licensed under the Raphielscape Public License, Version 1.d (the "License"); # you may not use this file except in compliance with the License. # """ Userbot help command """ import asyncio from userbot import bot, CMD_HELP from userbot.events import geezbot_cmd f...
from gcloud.storage.connection import Connection from gcloud.credentials import get_credentials from gcloud import storage from gevent.local import local from httplib2 import Http def connect(creds): """Construct a connection value to Google Storage API The credentials are retrieved using get_credentials th...
import pandas as pd import numpy as np import click import sys from .runner import PyProphetLearner, PyProphetWeightApplier from .ipf import infer_peptidoforms from .levels_contexts import infer_peptides, infer_proteins, infer_genes, subsample_osw, reduce_osw, merge_osw, backpropagate_oswr from .export import export_t...
import torch import torch.nn as nn import torch.nn.functional as F def diff(x, dim=-1): """ Inverse of x.cumsum(dim=dim). Compute differences between subsequent elements of the tensor. Only works on dims -1 and -2. Args: x (tensor): Input of arbitrary shape Returns: diff (tens...
# -*- coding:utf-8 -*- import requests import random from wencai.core.cookies import WencaiCookie class Session(requests.Session): headers = { "Accept": "application/json,text/javascript,*/*;q=0.01", "Accept-Encoding": "gzip, deflate", "Accept-Language": "zh-CN,zh;q=0.8", 'Connecti...
# ============================================================================ # FILE: buffer.py # AUTHOR: Shougo Matsushita <Shougo.Matsu at gmail.com> # License: MIT license # ============================================================================ from deoplete.source.base import Base from deoplete.util import ...
# coding: utf-8 # Copyright (c) 2016, 2022, Oracle and/or its affiliates. All rights reserved. # This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may c...
# coding: utf-8 from __future__ import absolute_import # import KafkaClient from huaweicloudsdkkafka.v2.kafka_client import KafkaClient from huaweicloudsdkkafka.v2.kafka_async_client import KafkaAsyncClient # import models into sdk package from huaweicloudsdkkafka.v2.model.access_policy_entity import AccessPolicyEnti...
#%% from tensorflow.examples.tutorials.mnist import input_data import tensorflow as tf from keras.datasets import mnist from tensorflow.examples.tutorials.mnist import input_data import keras #%% tf.reset_default_graph() def dataset(): return mnist.load_data() (X_train,y_train), (X_test, y_test) = dataset() ...
"""Tries to access all OpenEO job endpoints - A initial version of 'integration tests' for the jobs service.. To run them quiete some services need to be running - at least the gateway, RabbitMQ, the jobs, files and processes service and the complete Airflow setup including webserver, scheduler, postgres, RabbitMQ and...
#!/usr/bin/env python # -*- coding: utf-8 -*- import json from alipay.aop.api.constant.ParamConstants import * class AlipayEcoSignFlowCancelModel(object): def __init__(self): self._flow_id = None self._revoke_reason = None @property def flow_id(self): return self._flow_id @...
# Copyright 2017 The Chromium OS Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """cros tryjob: Schedule a tryjob.""" from __future__ import print_function import json import os import time from chromite.lib import constants from c...
# coding: spec from photons_control.colour import ColourParser, make_hsbks import pytest describe "make_hsbks": @pytest.fixture() def colors(self): return [ ["red", 10], ["blue", 3], ["hue:78 brightness:0.5", 5], ["#234455", 2], [[100], 1],...
import _plotly_utils.basevalidators class DtickrangeValidator(_plotly_utils.basevalidators.InfoArrayValidator): def __init__( self, plotly_name='dtickrange', parent_name='contourcarpet.colorbar.tickformatstop', **kwargs ): super(DtickrangeValidator, self).__init__( ...
from setuptools import find_packages, setup setup( name='src', packages=find_packages(), version='0.1.0', description='test how can use cookie', author='Ahmed Fouad', license='', )
# coding=utf-8 # Copyright 2018 The HuggingFace Inc. team. # Copyright (c) 2018, NVIDIA CORPORATION. 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.a...
"""A scene suitable for usage with :class:`.SampleSpace`.""" __all__ = ["SampleSpaceScene"] from ..animation.animation import Animation from ..animation.transform import MoveToTarget from ..animation.transform import Transform from ..animation.update import UpdateFromFunc from ..constants import * from ..scene.scene...
# BenchExec is a framework for reliable benchmarking. # This file is part of BenchExec. # # Copyright (C) 2007-2015 Dirk Beyer # 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 Lic...
from yangvoodoo import Cache, Common, Errors, Types class Context: def __init__(self, module, data_access_layer, yang_schema, yang_ctx, log=None): self.module = module self.schema = yang_schema self.schemactx = yang_ctx self.dal = data_access_layer self.schemacache = Cache....
import os import numpy as np import torch import torchvision from torch import nn, optim from torch.utils.data.sampler import SequentialSampler, SubsetRandomSampler from common import train, test, save_state, save_data, draw_line_graph, draw_multi_lines_graph # model class MnistClassifierMSELoss(nn.Modu...
import logging import time import os import psycopg2 log = logging.getLogger(__name__) class LoadTest(object): def __init__(self, gun): self.gun = gun self.host = 'web' def case1(self, missile): dt = str(time.time()) conn = psycopg2.connect(dbname='goby_test', user='postgres'...
# Copyright 2016 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 applicable ...
from numpy import loadtxt,arctan,pi,arange,array, asarray, linspace, zeros from matplotlib.pyplot import plot from .utils import snip,convolve import xml.etree.ElementTree as et from scipy.interpolate import interp1d from .calibration import Calibration class Spectra(): def __init__(self): self.calibratio...
from __future__ import absolute_import from Qshop.celery import app @app.task def add(x,y): return x+y import json import requests from Qshop.settings import DING_URL @app.task def sendDing(content="定时任务执行",to="15037609692"): headers = { "Content-Type": "application/json", "Charset": "utf-8"...
from django.db import models from ckeditor_uploader.fields import RichTextUploadingField # Create your models here. # 标签 class Tag(models.Model): tags = models.CharField(max_length=10) class Meta: verbose_name_plural = '标签' def __str__(self): return self.tags # 首页大图 clas...
import sys def run(code): codes = code.split(' ') ret = "" for code in codes: length = len(code) char = chr(length) ret += char return ret if __name__ == "__main__": if len(sys.argv) > 1: if sys.argv[1].endswith(".e"): file = sys.argv[1] ...
from django.core.management.base import BaseCommand, CommandError from conference import models from conference import utils from collections import defaultdict from optparse import make_option class Command(BaseCommand): option_list = BaseCommand.option_list + ( make_option('--missing-vote', ...
# Copyright 2014 The Oppia 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 applicable ...
# Generated by Django 2.0.5 on 2018-07-15 16:06 from django.db import migrations from django.db.models import OuterRef, Subquery import django_countries.fields def update_country_from_airport(apps, schema_editor): Person = apps.get_model('workshops', 'Person') Airport = apps.get_model('workshops', 'Airport')...
#### NOTICE: THIS FILE IS AUTOGENERATED #### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY #### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES from swgpy.object import * def create(kernel): result = Tangible() result.template = "object/tangible/wearables/ithorian/shared_ith_pants_s05.iff" result.attribute_templ...
# qubit number=3 # total number=10 import numpy as np from qiskit import QuantumCircuit, execute, Aer, QuantumRegister, ClassicalRegister, transpile, BasicAer, IBMQ import networkx as nx from qiskit.visualization import plot_histogram from typing import * from pprint import pprint from math import log2 from collectio...
#!/usr/bin/env python """ 1a. As you have done in previous classes, create a Python file named "my_devices.py". In this file, define the connection information for: 'cisco3', 'arista1', 'arista2', and 'srx2'. This file should contain all the necessary information to create a Netmiko connection. Use getpass() for ...
from pymongo import MongoClient from igraph import Graph mc = MongoClient() db = mc.test CLO_PATH_PARSE = 'answer/%s/closeness.txt' DEG_PATH_PARSE = 'answer/%s/degree.txt' def write_answer_into_mongo(graph_name): collection = db[graph_name] collection.drop() graph = Graph.Read_Ncol('data/'+graph_name+'....
from multipledispatch import dispatch from utils.DomainUtils import DomainUtils class UserDto: @dispatch(str, str) def __init__(self, username, password) -> None: self._id = -1, self._first_name = None, self._last_name = None, self._username = username, self._password =...
"""Miscellaneous internal PyJanitor helper functions.""" import functools import os import sys import warnings from itertools import chain, product from typing import Callable, Dict, List, Optional, Pattern, Tuple, Union import numpy as np import pandas as pd from pandas.api.types import CategoricalDtype from .error...
import matplotlib.pyplot as plt from sklearn import cluster from sklearn import datasets # 加载iris数据 iris = datasets.load_iris() data = iris['data'] # 学习→生成簇 model = cluster.KMeans(n_clusters=3) model.fit(data) # 取得学习结果的标签 labels = model.labels_ ### 图表的绘制 MARKERS = ["o", "^" , "*" , "v", "+", "x"...
from tkinter import * from weather_display import * root = Tk() frame = CustomFrame("Weather Display", row = 0, column= 0) frame.make_widgets() root.geometry("550x250") root.mainloop()
#!/usr/bin/env python3 # # Copyright (c) 2021 Roberto Riggio # # 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 applicabl...
from resource_management import * from airflow_base import AirflowBase from resource_management.core.exceptions import ExecutionFailed import subprocess class AirflowServer(AirflowBase): def install(self, env): import params env.set_params(params) self.install_airflow(env) print("I...
import config import models import tensorflow as tf import numpy as np con = config.Config() #Input training files from benchmarks/FB15K/ folder. con.set_in_path("./benchmarks/FB15K/") #True: Input test files from the same folder. con.set_test_link_prediction(True) con.set_test_triple_classification(True) con.set_log...
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated by Microsoft (R) AutoRest Code Generator. # Changes ...
"""Kaggle Challenge module - Models"""
from django.conf.urls import url, include from . import views urlpatterns = [ # urls for school requests - user side url(r"^$", views.admin_homepage, name="adminhome"), url(r"^login/$", views.admin_login, name="admin_login"), url(r"^settings/$", views.admin_settings, name="admin_settings"), url(r"^...
# -*- coding: utf-8 -*- # Generated by Django 1.11.3 on 2017-08-15 20:26 from __future__ import unicode_literals from django.conf import settings import django.core.validators from django.db import migrations, models import django.db.models.deletion import django_extensions.db.fields class Migration(migrations.Migra...
''' Trie class will be built with a list of words It will be used for searching an autocompleting words ''' class TrieNode: def __init__(self): # children is a dictionary from next character to the next trie node self.children = {} self.data = None @staticmethod def insert(node, w...
from nanome._internal._structure._complex import _Complex from nanome._internal import _PluginInstance from nanome._internal._network import PluginNetwork from nanome._internal._network._commands._callbacks import _Messages from nanome.util import Matrix, Logs from .io import ComplexIO from . import Base class Comple...
import unittest import pathlib import tempfile import shutil class MosgalTestCase(unittest.TestCase): def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) self.tests_files_directory = pathlib.Path(pathlib.Path(__file__).parent, 'tests_files') self.temporary_directory = ...
import psutil import os, sys def get_process_memory(): process = psutil.Process(os.getpid()) mem_info = process.memory_info() return mem_info.rss/1024/1024 print(get_process_memory()/1024/1024)
import torch import torchvision import torch.nn as nn import torch.distributed as dist import torchvision.transforms as transforms from apex import amp from datetime import datetime from apex.parallel import DistributedDataParallel as DDP from model import ConvNet def train(gpu, args): rank = args.nr * args.gpus...
# Copyright 2017 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...
# coding: utf-8 from hashlib import sha1 from lxml import etree, objectify from pprint import pformat from unicodedata import normalize from urllib import urlencode import datetime import logging import time import urllib2 import urlparse from odoo import api, fields, models, _ from odoo.addons.payment.models.paymen...
#!/usr/bin/python """Module for syncing Adobe AD groups with the Adobe Management Portal. Usage: adobe_sync.py [--dummy] [--debug] --dummy: Sets the testOnly flag when talking to the API, commands will not really be executed. --debug: Very verbose output! """ import json import logging import sys import time fro...
#!/usr/bin/env python from setuptools import find_packages, setup with open('requirements.txt') as f: required = f.read().splitlines() setup( name='mathml-to-image-service', version='1.0', description='MathML to Image converter', author='', author_email='', url='https://github.com/rudigie...
import base64 import fnmatch import glob import json import os import re import shutil import stat import subprocess import urllib.parse import warnings from datetime import datetime, timedelta from distutils.util import strtobool from packaging.version import Version from pathlib import Path from typing import Tuple,...
# -*- coding: utf-8 -*- """ Handler for the git pull command. Copyright: 2020 by Clemens Rabe <clemens.rabe@clemensrabe.de> All rights reserved. This file is part of gitcache (https://github.com/seeraven/gitcache) and is released under the "BSD 3-Clause License". Please see the ``LICENSE`` file t...
#!/usr/bin/env python3 from json.decoder import JSONDecodeError import os import re import sys import argparse import json import zipfile import threading import subprocess import itertools import configparser import time import uuid from collections import OrderedDict import paramiko import pandas as pd from common ...
from flask import Flask, request import sqlalchemy import sqlalchemy.orm app = Flask(__name__) engine = sqlalchemy.create_engine(...) Base = sqlalchemy.orm.declarative_base() class User(Base): __tablename__ = "users" id = sqlalchemy.Column(sqlalchemy.Integer, primary_key=True) username = sqlalchemy.Colu...
from threading import Thread class Async_function( Thread ): def __init__(self, func, args = 0 ): Thread.__init__(self) self.func = func self.args = args self.retr = 0 def run( self ): self.retr = self.func( self.args ) def return_val(self): retu...
''' Created on 24.10.2019 @author: JM ''' from PyTrinamic.ic.TMC2041.TMC2041_register import TMC2041_register from PyTrinamic.ic.TMC2041.TMC2041_register_variant import TMC2041_register_variant from PyTrinamic.ic.TMC2041.TMC2041_fields import TMC2041_fields from PyTrinamic.helpers import TMC_helpers class TMC2041():...
# -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # source: proto/lib/zksk/nizk.proto """Generated protocol buffer code.""" # third party from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message from google.protobuf import reflection as _refl...
from lng_abstract_tag import AbstractTag class lng_element_tag(AbstractTag): def __init__(self, app, **args): if args.has_key("fields"): AbstractTag.__init__(self, app, "lng_element_tag", args["fields"]) else: AbstractTag.__init__(self, app, "lng_element_tag", args) from dbobj.dbobj import dbTa...
# -*- coding: utf-8 -*- import os.path BASE_DIR = os.path.dirname(os.path.dirname(__file__)) #根据环境定义数据库连接参数 mysql_name = 'z_db' mysql_user = 'root' mysql_pass = '888888' mysql_host = '' mysql_host_s = '' mysql_port = '' DEBUG = True TEMPLATE_DEBUG = True ALLOWED_HOSTS = [] ADMINS = ()...
# lint-amnesty, pylint: disable=missing-module-docstring import csv from logging import getLogger from django import forms from django.conf.urls import url from django.contrib import admin, messages from django.contrib.auth import get_user_model from django.http import HttpResponseRedirect from django.shortcuts import...
#!/usr/local/bin/python3 # -*- coding: utf-8 -*- from tornado import gen # import sys # import os # sys.path.append(os.path.abspath('/data/stock/libs')) import libs.stock_web_dic as stock_web_dic import web.base as webBase import logging import re # 获得页面数据。 class GetEditorHtmlHandler(webBase.BaseHandler): @gen.c...
# This files contains your custom actions which can be used to run # custom Python code. # # See this guide on how to implement these action: # https://rasa.com/docs/rasa/core/actions/#custom-actions/ # This is a simple example for a custom action which utters "Hello World!" from typing import Any, Text, Dict, List ...