text
stringlengths
2
999k
from flask import Blueprint blog = Blueprint('blog', __name__) from . import views
# coding: utf-8 from enum import Enum from six import string_types, iteritems from bitmovin_api_sdk.common.poscheck import poscheck_model class S3SignatureVersion(Enum): V2 = "S3_V2" V4 = "S3_V4"
#!/usr/bin/env python # # # Regenerate files in example_conf import argparse import getpass from cork import Cork from datetime import datetime def get_username_and_password(non_interactive): if non_interactive: return 'admin', 'admin', 'admin' user = input("Username [%s]: " % getpass.getuser()) i...
from .transform import Transform from .fourier import FourierTransform from .spatial_transform import SpatialTransform from .intensity_transform import IntensityTransform # Generic from .lambda_transform import Lambda # Augmentation from .augmentation.composition import OneOf from .augmentation.composition import Com...
# Copyright (c) 2009-2014 Upi Tamminen <desaster@gmail.com> # See the COPYRIGHT file for more information """ This module contains ... """ from __future__ import division, absolute_import import os from zope.interface import implementer import twisted from twisted.python import log from twisted.python.compat impor...
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2013, Big Switch Networks, 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...
""" Unittests for make_polygon_pngs.py """ import os import shutil import tempfile import unittest from polygoggles.make_polygon_pngs import make_collection class Test_make_collection(unittest.TestCase): def setUp(self): self.temp_collection_dir = tempfile.mkdtemp() def tearDown(self): shu...
""" Configures and sets up the workflow REST endpoints """ import os import logging import sys import json import cherrypy class logging_filter(logging.Filter): """ A simple filter for ignoring spammy, low-level logging events in the app """ def filter(self, record): return record.module != '...
from direct.directnotify import DirectNotifyGlobal from direct.distributed.DistributedObjectAI import DistributedObjectAI from direct.distributed.ClockDelta import * from direct.fsm.FSM import FSM from otp.otpbase.OTPLocalizerEnglish import EmoteFuncDict class DistributedResistanceEmoteMgrAI(DistributedObjectAI, FSM):...
import contextlib import click # noinspection PyCompatibility import dbm import logging import requests import time from .stacksampler import DEFAULT_HOST, DEFAULT_PORT DEFAULT_STACKCOLLECTOR_DATA_DIR = '/var/cb/data/stackcollector/db' DEFAULT_SLEEP_INTERVAL = 600 _logger = logging.getLogger(__name__) @contextlib....
# coding=utf-8 # Copyright 2014 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import absolute_import, division, print_function, unicode_literals import re from builtins import bytes, object, str from pants.option.errors import ParseE...
from math import sqrt x1=int(input("enter x1: ")) x2=int(input("enter x2: ")) y1=int(input("enter y1: ")) y2=int(input("enter y2: ")) distance = ((((x2-x1)**2) + ((y2-y1)**2))) print('Distance between the points is: ', sqrt(distance))
'''[*args] Recall from iterable packing a, b, c = (10, 2O, 30) -> A = 10 B = 20 C = 30 Something similar happens when positional arguments are passed to a function: def func1(a, b, c): # CODE func1(10, 20, 30) -> a = 10 b = 20 c = 30 Recall also: a, b, *c = 10, 20, 'a', 'b' -> a=10 ...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # Copyright 2020 Alibaba Group Holding 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...
# Copyright 2020 The Magenta Authors. # # 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 ...
import functools import inspect import sys from collections import OrderedDict import numba import numpy as np import torch def get_pos_to_kw_map(func): pos_to_kw = {} fsig = inspect.signature(func) pos = 0 for name, info in fsig.parameters.items(): if info.kind is info.POSITIONAL_OR_KEYWORD:...
#!/usr/bin/python import pygame, sys, pygame.mixer, os from pygame.locals import * from time import sleep, time import bluetooth as bt dirpath = os.path.dirname(os.path.realpath(__file__)) timestart = time() speedfactor = 0.6 speedlimit = 70 turnspeedlimit = 60 ################### Connection ########################...
from ghassemi7.settings import * # Quick-start development settings - unsuitable for production # See https://docs.djangoproject.com/en/3.2/howto/deployment/checklist/ # SECURITY WARNING: keep the secret key used in production secret! SECRET_KEY = 'django-insecure-$gp^_#+my6pip#*62lhu#n@#vij^vdb1tfb*x+==1k%6h*euiq' #...
""" sentry.filters ~~~~~~~~~~~~~~ :copyright: (c) 2010 by the Sentry Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ # Widget api is pretty ugly from __future__ import absolute_import from django.conf import settings as django_settings from django.utils.datastructures import Sort...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('jobs', 'install_default_group'), ] operations = [ migrations.AlterField( model_name='tag', name='key...
import pytest import sys import simpleplugins as plugins from simpleplugins import Plugin, PluginManager @pytest.fixture(scope="module") def module(): return plugins.import_module_from_file(sys.modules[__name__]) class TemplatePlugin(Plugin): def __init__(self, template_name, **kwargs): super(Templa...
from typing import Protocol class Logger(Protocol): # pragma: no cover """ Interface for logger object provided by LoggingModule. """ def debug(self, message: str) -> None: ... def info(self, message: str) -> None: ... def warning(self, message: str) -> None: ... ...
#!C:\Users\Matias\PycharmProjects\visual-analyser\venv\Scripts\python.exe # EASY-INSTALL-ENTRY-SCRIPT: 'pip==19.0.3','console_scripts','pip' __requires__ = 'pip==19.0.3' import re import sys from pkg_resources import load_entry_point if __name__ == '__main__': sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', s...
# coding=utf-8 # Copyright 2020 The HuggingFace Datasets Authors and the TensorFlow Datasets Authors. # # 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/LI...
#!/usr/bin/python3 # -*- coding: utf-8 -*- import urllib.parse import urllib.request import re from bs4 import BeautifulSoup user_agent = r'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/44.0.2403.157 Safari/537.36' def get_wiki(title): headers = { 'User-Agent': user_agent } ...
'''(Binary Search Special Trick Unknown length [M]): Given a sorted array whose length is not known, perform binary search for a target T. Do the search in O(log(n)) time.''' def binarySearchOverRange(arr, T, low, high): while low <= high: mid = low + (high - low) // 2 if arr[mid] == T: ...
############################################################################### # # The MIT License (MIT) # # Copyright (c) Tavendo GmbH # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software with...
# -*- coding: UTF-8 -*- app_env = 'local' # 数据库配置开始 ###local### # 环境_dbnum_type local_db_host = '127.0.0.1' local_db_user = 'root' local_db_passwd = 'Ace__7' local_db_db = 'collect' local_db_charset = 'utf8' ###dev### dev_db_host = 'rdsfgn76t366iqux8bs3.mysql.rds.aliyuncs.com' dev_db_user = 'app_admin' dev_db_passw...
# Copyright 2020 Google LLC # # 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/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
rsa_mod_size = 1024 # 1024 bit, roughly 80 bits of security block_size = 2**19 # 512 kB block, current max k = block_size // 32 r = 0x73eda753299d7d483339d80809a1d80553bda402fffe5bfeffffffff00000001 # BLS curve order import gmpy2 from timeit import default_timer as timer ran = gmpy2.random_state() prime_size = rsa_mo...
from __future__ import absolute_import from __future__ import division from __future__ import print_function import os import time import numpy as np import tensorflow as tf import model from data_reader import load_data, DataReader, FasttextModel, DataReaderFastText, TestDataReader, load_test_data import pandas as pd...
import fastapi import uvicorn from fastapi.middleware.cors import CORSMiddleware from api import router app = fastapi.FastAPI() app.include_router(router) app.add_middleware( CORSMiddleware, allow_origins=["http://localhost:4200"], allow_credentials=True, allow_methods=["*"], allow_headers=["*"], ...
# This Python file uses the following encoding: utf-8 """autogenerated by genpy from carla_msgs/CarlaCollisionEvent.msg. Do not edit.""" import sys python3 = True if sys.hexversion > 0x03000000 else False import genpy import struct import geometry_msgs.msg import protocol.std_msgs.msg as std_msgs class CarlaCollision...
# -*- coding: utf-8 -*- """ Created on Fri Jan 11 18:11:02 2013 @author: ash """ from __future__ import absolute_import, division, print_function import scipy as sp import evoMPS.matmul as mm import evoMPS.tdvp_common as tc import unittest def make_E_noop(A, B): res = sp.zeros((A.shape[1]**2, A.shape[2]**2), dty...
from __future__ import division import argparse import os import time import torch.distributed as dist import torch import torch.nn as nn import torch.backends.cudnn as cudnn from torch.utils.data.distributed import DistributedSampler import torchvision.transforms as transforms from torch.utils.data import DataLoader i...
from collections import Iterable from mathsat import msat_term, msat_env from mathsat import msat_make_true, msat_make_false from mathsat import msat_make_constant, msat_declare_function from mathsat import msat_get_rational_type from mathsat import msat_make_and as _msat_make_and from mathsat import msat_make_or as _...
"""Base Tuner class.""" from abc import ABC, abstractmethod from skopt.space import Categorical, Integer, Real class Tuner(ABC): """Base Tuner class. Tuners implement different strategies for sampling from a search space. They're used in EvalML to search the space of pipeline hyperparameters. Args: ...
# coding: utf-8 """ Argo Server API You can get examples of requests and responses by using the CLI with `--gloglevel=9`, e.g. `argo list --gloglevel=9` # noqa: E501 The version of the OpenAPI document: v2.11.8 Generated by: https://openapi-generator.tech """ import pprint import re # noqa: F401 ...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # Copyright 2020 Alibaba Group Holding 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...
import unittest import pystache from examples.nested_context import NestedContext from examples.complex_view import ComplexView from examples.lambdas import Lambdas from examples.template_partial import TemplatePartial from examples.simple import Simple class TestSimple(unittest.TestCase): def test_simple_ren...
""" This module contains the Tensorflow implementation of models used for the Counterfactual with Reinforcement Learning experiments for both data modalities (image and tabular). """ import tensorflow as tf import tensorflow.keras as keras from typing import List class MNISTClassifier(keras.Model): """ MNIST...
import pickle import datetime import pytest import six import uuid from pyrsistent import ( PRecord, field, InvariantException, ny, pset, PSet, CheckedPVector, PTypeError, pset_field, pvector_field, pmap_field, pmap, PMap, pvector, PVector, v, m) class ARecord(PRecord): x = field(type=(int, float)) ...
from mojo.roboFont import OpenWindow from guideTool.defaults import GuideToolDefaultsWindowController OpenWindow(GuideToolDefaultsWindowController)
from django.core.paginator import Paginator, PageNotAnInteger,EmptyPage class cPaginator(Paginator): def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) def page(self, number): try: pages = super().page(number) except PageNotAnInteger: ...
# These functions need to be implemented class CidrMaskConvert: def cidr_to_mask(self, val): return val def mask_to_cidr(self, val): return val class IpValidate: def ipv4_validation(self, val): return True
# -*- coding: utf-8 -*- from ccxt.base.exchange import Exchange import hashlib from ccxt.base.errors import ExchangeError class btcx (Exchange): def describe(self): return self.deep_extend(super(btcx, self).describe(), { 'id': 'btcx', 'name': 'BTCX', 'countries': ['IS...
from flask import Flask from flask_bootstrap import Bootstrap from config import config_options from flask_sqlalchemy import SQLAlchemy from flask_login import LoginManager from flask_uploads import UploadSet,configure_uploads,IMAGES from flask_mail import Mail # Instance of LoginManger and using its methods login_ma...
# -*- coding: utf-8 -*- """ Copyright (C) 2015, MuChu Hsu Contributed by Muchu Hsu (muchu1983@gmail.com) This file is part of BSD license <https://opensource.org/licenses/BSD-3-Clause> """ import os import datetime import json import logging import re from cameo.utility import Utility from cameo.externaldb import Exte...
import logging import numpy as np from tracker.Siamese_utils.infer_utils import convert_bbox_format, Rectangle from tracker.Siamese_utils.misc_utils import get_center class TargetState(object): """Represent the target state.""" def __init__(self, bbox, search_pos, scale_idx, his_feature, original_search_center, ...
import json from django.test import TestCase from backend.tests.helpers import login, create_festival, create_user, create_concert from backend.tests.helpers import create_client class ReadConcertInfoTests(TestCase): def test_no_client_name_provided(self): """ read_concert_info() is to return "C...
default_path = "../src/" service_path = "../src/service/" import sys sys.path.insert(0, default_path) sys.path.insert(0, service_path) import unittest from db_access import RedisDBOnDocker class Test_RedisDBOnDocker(unittest.TestCase): def __init__(self, *args, **kwords): unittest.TestCase.__init__(...
# 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...
import re import json # need to fix this to accommodate recursion depth limit/error # if not, then go through the pain staking of a class.to_json() structure? ugh class JSONDataEncoder(json.JSONEncoder): def default(self, obj): if isinstance(obj, (list, dict, str, unicode, int, float, bool, type(None))): ...
"""distutils.file_util Utility functions for operating on single files. """ __revision__ = "$Id$" import os from distutils.errors import DistutilsFileError from distutils import log # for generating verbose output in 'copy_file()' _copy_action = {None: 'copying', 'hard': 'hard linking',...
# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) import sys from spack import * class Apex(CMakePackage): """Autonomic Performance Environment for eXascale (APEX)."...
# -*- coding: utf-8 -*- import json import re import scrapy from locations.items import GeojsonPointItem from locations.hours import OpeningHours from datetime import datetime DAYS_NAME = { "Monday": "Mo", "Tuesday": "Tu", "Wednesday": "We", "Thursday": "Th", "Friday": "Fr", "Saturday": "Sa",...
# -*- coding: utf-8 -*- """User models.""" import datetime as dt from flask_login import UserMixin from teqila.database import Column, Model, SurrogatePK, db, reference_col, relationship from teqila.extensions import bcrypt class Role(SurrogatePK, Model): """A role for a user.""" __tablename__ = 'roles' ...
# -*- coding: utf-8 -*- #!/usr/bin/env python # # Copyright 2015-2020 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 requi...
from monopyly import * import collections import itertools import platform import random import sys import time LOGGING = False AUCTIONS_INFO = False ASSERTING = False def ASSERT(condition, msg): if ASSERTING and not condition: Log('ASSERT: %s' % str(msg)) def DEBUG(msg): if LOGGING and...
# Copyright 2013 OpenStack Foundation # # 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 os from options.test_options import TestOptions from data import create_dataset from models import create_model from util.visualizer import save_images from util import html if __name__ == '__main__': opt = TestOptions().parse() # get test options # hard-code some parameters for test opt.num_threa...
import csv def create_astronaut_database_tables(): '''Creates nationalities_psql.csv, astronauts_psql.csv, ''' astronaut_ids = set() nationalities = {} missions = {} nationality_id = 1 mission_id = 1 with open('Astronaut database.csv') as csvfile, open('../output/astronauts_psql.csv', ...
from __future__ import print_function, division import textwrap import numpy as np from ..utils import listify, angstrom_to_bohr, header_line from ..core.writable import Writable from .sorting import input_variable_blocks from .variable import InputVariable from .structures import structure_to_abivars __all__ = ['Abi...
# Copyright (c) Chris Choy (chrischoy@ai.stanford.edu). # # Permission is hereby granted, free of charge, to any person obtaining a copy of # this software and associated documentation files (the "Software"), to deal in # the Software without restriction, including without limitation the rights to # use, copy, modify, ...
from testcase import CeleryWorkerTestCase from tasks import multiply from random import randrange import celery import time class WorkerRunsTestCase(CeleryWorkerTestCase): def test_single_task(self): """ This test requires celery to be running to succeed """ a = randrange(1,10) ...
# -*- coding: utf-8 -*- """Replace the default ``flask shell`` command with a similar one running PTPython.""" from __future__ import absolute_import, division, print_function from setuptools import setup URL = 'https://github.com/jacquerie/flask-shell-ptpython' readme = open('README.rst').read() setup_requires ...
############################################################################### # # Tests for XlsxWriter. # # SPDX-License-Identifier: BSD-2-Clause # Copyright (c), 2013-2021, John McNamara, jmcnamara@cpan.org # from ..excel_comparison_test import ExcelComparisonTest from ...workbook import Workbook class TestCompar...
""" _______ __ _______ __ __ __ | _ .----.-----.--.--.--.--| | _ | |_.----|__| |--.-----. |. 1___| _| _ | | | | _ | 1___| _| _| | <| -__| |. |___|__| |_____|________|_____|____ |____|__| |__|__|__|_____| |: 1 | |: 1 | |::.. ...
""" WSGI config for skaterblog 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 from mezzanine.utils.conf import...
#!/usr/bin/env python3 #This example shows how to use the follow me plugin import asyncio from mavsdk import System from mavsdk.follow_me import (Config, FollowMeError, TargetLocation) default_height = 8.0 #in Meters follow_distance = 2.0 #in Meters, this is the distance that the drone will remain away from Target w...
import os.path as osp import mmcv import numpy as np from mmcv.parallel import DataContainer as DC from torch.utils.data import Dataset from .transforms import (ImageTransform, BboxTransform, MaskTransform, Numpy2Tensor) from .utils import to_tensor, random_scale from .extra_aug import ExtraA...
import pygame, sys, math class Meatball(pygame.sprite.Sprite): def __init__(self, pos=[0,0], size=None): pygame.sprite.Sprite.__init__(self, self.containers) self.image = pygame.image.load("rsc/ball/regular.png") if size: self.image = pygame.transform.scale(self.image, [size,siz...
from mythril.laser.ethereum.svm import LaserEVM from mythril.laser.ethereum.state import Account from mythril.disassembler.disassembly import Disassembly from mythril.laser.ethereum.transaction.concolic import execute_message_call from datetime import datetime from mythril.laser.ethereum.util import get_concrete_int im...
# MIT License # # Copyright (c) 2021 MiscellaneousStuff # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modif...
import serial import RPi.GPIO as GPIO class Distance(): def __init__(self): #GPIO.setmode(GPIO.BOARD) GPIO.setwarnings(False) self.Dist_Total = 200 self.ser = serial.Serial('/dev/ttyAMA0', 115200, timeout=1) # ser.write(0x42) self.ser.write(bytes(b'B')) #...
#!/usr/bin/env python from setuptools import setup setup( name='python-binance-aio', version='0.0.4', packages=['aiobinance'], description='Asynchronous Binance REST API python implementation', url='https://github.com/BlockHub/python-binance-aio', author='Karel Kubat', license='MIT', au...
""" Functions used for distorting images for training """ # Import the necessary libraries import numpy as np import torch from scipy.ndimage.filters import gaussian_filter from PIL import Image # Import the necessary source codes from Preprocessing.utils import dct_2d from Preprocessing.utils import idct_2d fro...
# Copyright 2016-2019 Dirk Thomas # Licensed under the Apache License, Version 2.0 import argparse from collections import OrderedDict import os from pathlib import Path import sys FORMAT_STR_COMMENT_LINE = '# {comment}' FORMAT_STR_SET_ENV_VAR = 'export {name}="{value}"' FORMAT_STR_USE_ENV_VAR = '${name}' FORMAT_STR...
from __future__ import unicode_literals from celery import Celery from celery_tasktigger.decorator import tigger_task app = Celery('example', backend='amqp', broker='amqp://127.0.0.1:5672//') # upgrade celery 4.0 app.conf.update( result_backend='amqp', result_expires=18000, # 5 hours. ) # celery -A exam...
passports = [] with open("C:\\Privat\\advent_of_code20\\puzzle4\\input1.txt") as f: empty = False passport = "" for line in f: if line.strip() == "": empty = True else: empty = False if empty: passports.append(passport.replace('\n', ' ').strip())...
# coding=utf-8 # Copyright 2018 The Google AI Language Team Authors, The HugginFace Inc. team and University of Washington. # # 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....
__version__ = '0.4.0-rc.1' import sys import os _INFO_PRINT_ENABLE = False # check if __array_function__ methods is enabled in numpy # os.environ["NUMPY_EXPERIMENTAL_ARRAY_FUNCTION"] = "1" _NUMPY_EXPERIMENTAL_ARRAY_FUNCTION_AUTOENABLE = True if "NUMPY_EXPERIMENTAL_ARRAY_FUNCTION" in os.environ.keys(): _NUMPY_EXP...
############################################################################################################################################################################### # ex3 - Faça um programa que verifique se a letra digitada é "F" ou "M". Conforme a letra escrever: F - feminimo, M - masculino, Sexo invalido....
# This file is part of Indico. # Copyright (C) 2002 - 2020 CERN # # Indico is free software; you can redistribute it and/or # modify it under the terms of the MIT License; see the # LICENSE file for more details. from __future__ import unicode_literals from datetime import time from flask import request from wtforms...
import base64 import copy import gzip import json import random from typing import Dict, List, Optional, Tuple from katrain.core.constants import ( ANALYSIS_FORMAT_VERSION, PROGRAM_NAME, REPORT_DT, SGF_INTERNAL_COMMENTS_MARKER, SGF_SEPARATOR_MARKER, VERSION, PRIORITY_DEFAULT, ADDITIONAL...
''' MIT License Copyright (c) 2017 Grok Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribu...
#!/usr/bin/python3 #-*-coding:utf-8-*- # Made With ❤️ By sohaib import requests,mechanize,bs4,sys,os,subprocess,uuid,random,time,re,base64,concurrent.futures,json,ipaddress from random import randint from concurrent.futures import ThreadPoolExecutor as ThreadPool from datetime import date from datetime import datetim...
from datetime import datetime from quantitativetrader.event import Event, EventEngine from quantitativetrader.trader.engine import MainEngine from quantitativetrader.trader.ui import QtCore, QtWidgets from quantitativetrader.trader.event import EVENT_CONTRACT from ..engine import ( APP_NAME, EVENT_RECORDER_LO...
# # Microchip Peripheral I/O # # Joshua Henderson <joshua.henderson@microchip.com> # Copyright (C) 2017 Microchip Technology Inc. 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 Li...
# Generated by Django 3.2.8 on 2021-11-23 14:55 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('fuzzbuzz_app1', '0001_initial'), ] operations = [ migrations.CreateModel( name='Congestion_points_SH', fields=[ ...
def gen_mutants(): import tensorflow as tf import pandas import numpy as np DATAFILE_TRAIN = 'mock_kaggle_edit_train.csv' DATAFILE_VALIDATE = 'mock_kaggle_edit_...
# -*- coding: utf-8 -*- # Copyright 2014-2016 OpenMarket Ltd # # 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 applicab...
# Happy Hour Challenges import random people = ["Mattan", "Chris", "that person you forgot to text back", "Kanye West", "Samuel L. Jackson", "Kosta"] random_bar = random.choice(bars) random_person_one = random.choice(people) random_person_two = random.choice(people) ...
# coding=utf-8 # *** WARNING: this file was generated by the Pulumi SDK Generator. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** import warnings import pulumi import pulumi.runtime from typing import Any, Mapping, Optional, Sequence, Union from ... import _utilities, _tables from...
#! /usr/bin/env python2 import xlrd def readXlsx(fn): bk = xlrd.open_workbook(fn) sht = bk.sheet_by_index(0) for i in range(1, sht.nrows): line = sht.row_values(i) print line if __name__ == "__main__": readXlsx('test.xlsx')
# orm/persistence.py # Copyright (C) 2005-2020 the SQLAlchemy authors and contributors # <see AUTHORS file> # # This module is part of SQLAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php """private module containing functions used to emit INSERT, UPDATE and DELETE sta...
import os import json import glob import copy import importlib import torch import numpy as np from datasets import loaders # from model_defs import add_feature_subsample, remove_feature_subsample from model_defs import convert_conv2d_dense, save_checkpoint, load_checkpoint_to_mlpany # Helper function to find a file...
# Copyright (c) 2002-2011 IronPort Systems and Cisco Systems # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, mo...
import numpy as np import torch from pytorch_bcnn.models import UNet, BayesianUNet from pytorch_bcnn.links import MCSampler def main(): device='cuda' out = 'model.pth' predictor = BayesianUNet(ndim=2, in_channels=1, nlayer=3, out_channels=10) # NOTE: minimal model model = MCSampler(predictor, mc_iter...
# 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...