text
stringlengths
1
927k
# -*- coding: utf-8 -*- # dict_conv.py (Python3 script) import sys ENC_UTF16_BE = 1 ENC_UTF16_LE = 2 def add_char(enc, s, c): if enc == ENC_UTF16_BE: s += "\\x00" s += c if enc == ENC_UTF16_LE: s += "\\x00" return s def conv(enc, s): n = len(s) r = "" i = 0 while i < n: c = s[i] i...
"""Calculate expected CLs values with hypothesis tests.""" from __future__ import annotations __all__ = ("hypotest",) from functools import partial import jax.numpy as jnp import pyhf from chex import Array from jax import jit from ..mle import fit, fixed_poi_fit @partial(jit, static_argnames=["model", "return_ml...
from zope.interface import Attribute from zope.interface import Interface from zope.interface import implements class IIndexEvent(Interface): """ An lower level event involving the index """ class IIndexUpdate(Interface): """ An low level event involving the index """ class IPackag...
from __future__ import print_function import time import unittest from flexp.flow.parallel import parallelize def add_two(x): return x + 2 class TestParallel(unittest.TestCase): def test_parallel(self): count = 50 data = range(0, count) start = time.clock() res = list(par...
## Basic Python libraries import os from PIL import Image ## Deep learning and array processing libraries import numpy as np import torch import torch.nn.functional as F import torchvision import torchvision.transforms as transforms ## Inner-project imports from model import EncoderCNN, DecoderRNN ##### Code begi...
from .cdevice import CDevice, CObject, CSubObject, CValue # noqa: F401
import logging from subprocess import Popen, PIPE, STDOUT from lib.parse.sen_ascii_parse import SenAsciiParse class SenBinParse: def __init__(self): self.ascii_parser = SenAsciiParse() def parse_packet(self, packet, with_header=True): if len(packet) < 10: return length = ...
import os import sys ############## # NOTE: You will need to build boost # On windows, use the following command from the visual studio command # prompt (after running boostrap.bat) # # bjam --build-dir=c:\boost --build-type=complete --toolset=msvc-9.0 address-model=64 architecture=x86 --with-system ############## cu...
# -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # source: google/ads/googleads_v4/proto/enums/mobile_app_vendor.proto import sys _b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) from google.protobuf import descriptor as _descriptor from google.protobuf impor...
# generate_from_lm.py """ Load a trained language model and generate text Example usage: PYTHONPATH=. python generate_from_lm.py \ --init="Although the food" --tau=0.5 \ --sample_method=gumbel --g_eps=1e-5 \ --load_model='checkpoints/lm/mlstm/hotel/batch_size_64/lm_e9_2.93.pt' \ --dataset='hotel' --cpu=1 --sample_met...
# # Copyright (c) 2013-2016 Wind River Systems, Inc. # # SPDX-License-Identifier: Apache-2.0 # # vim: tabstop=4 shiftwidth=4 softtabstop=4 # coding=utf-8 # from sysinv.db import api as db_api from sysinv.objects import base from sysinv.objects import utils def _get_interface_name_list(field, db_object): ifnames...
# emacs: -*- mode: python; py-indent-offset: 4; tab-width: 4; indent-tabs-mode: nil -*- # ex: set sts=4 ts=4 sw=4 noet: # ## ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ## # # See COPYING file distributed along with the datalad package for the # copyright and license terms. # # ## ### ##...
# -*- coding: utf-8 -*- ''' Management of PostgreSQL extensions (e.g.: postgis) =================================================== The postgres_extensions module is used to create and manage Postgres extensions. .. code-block:: yaml adminpack: postgres_extension.present ''' # Import Python libs import lo...
# Copyright (c) Facebook, Inc. and its affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. """ Wrapper around various loggers and progress bars (e.g., tqdm). """ from collections import OrderedDict from contextlib import contextmana...
from django.contrib import admin from django.urls import path, include from rest_framework import routers router = routers.DefaultRouter() urlpatterns = [ path('', include(router.urls)), path('api-auth/', include('rest_framework.urls')), path('admin/', admin.site.urls), path('api/', include('truck.urls...
import numpy as np import networkx as nx import scipy.sparse as sp from sklearn import preprocessing from sklearn.utils.extmath import randomized_svd from multiprocessing import Pool from tqdm import tqdm import time from cogdl.utils import alias_draw, alias_setup from .. import BaseModel class NetSMF(BaseModel): ...
from wtforms import MultipleFileField, SelectField, StringField from wtforms.validators import InputRequired from CTFd.forms import BaseForm from CTFd.forms.fields import SubmitField class ChallengeSearchForm(BaseForm): field = SelectField( "Search Field", choices=[ ("name", "Name"), ...
from staicoin.util.ints import uint32, uint64 # 1 stai coin = 1,000,000,000 = 1 billion mojo. _mojo_per_staicoin = 1000000000 _blocks_per_year = 1681920 # 32 * 6 * 24 * 365 def calculate_pool_reward(height: uint32) -> uint64: """ Returns the pool reward at a certain block height. The pool earns 4/5 of the r...
# Copyright 2015 Red Hat, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
# Generated by Django 2.2.6 on 2019-10-06 13:51 from django.conf import settings from django.db import migrations, models import django.db.models.deletion import django_countries.fields class Migration(migrations.Migration): initial = True dependencies = [ migrations.swappable_dependency(settings.A...
import logging import os import pathlib from datetime import timedelta from pathlib import Path from typing import List from warnings import warn import pydantic import pytest from pydantic.color import Color from teamcity import is_running_under_teamcity import geolib.models.dsettlement.loads as loads import geolib....
""" # Setup script for index based on Richard Sharpe's List of Identifications """ #-------------------------------------------------------------------------------- import math from django.template import Context, loader from django.http import HttpResponse,Http404,HttpResponseRedirect from djan...
from django.core.urlresolvers import reverse from django.conf import settings from django.db import models class List(models.Model): owner = models.ForeignKey(settings.AUTH_USER_MODEL, blank=True, null=True) shared_with = models.ManyToManyField( settings.AUTH_USER_MODEL, related_name='shared_lists' ...
import sublime, sublime_plugin import os, webbrowser, shlex, json, collections def ionicv1_ask_custom_path(project_path, type): sublime.active_window().show_input_panel("Ionic v1 CLI custom path", "ionic", lambda ionicv1_custom_path: ionicv1_prepare_project(project_path, ionicv1_custom_path) if type == "create_new...
from socket import socket, AF_INET, SOCK_DGRAM, inet_aton, inet_ntoa import time sockets = {} network = ('127.0.0.1', 12345) def bytes_to_addr(bytes): return inet_ntoa(bytes[:4]), int.from_bytes(bytes[4:8], 'big') def addr_to_bytes(addr): return inet_aton(addr[0]) + addr[1].to_bytes(4, 'big') def get_sen...
from django.core.mail import EmailMultiAlternatives from django.template.loader import render_to_string from typing import List def send_email( *, from_email: str = "Evan <evan@ugent.be>", to: List[str], subject: str, template: str, context_data: dict ): text_content = render_to_string(template, context_data)...
# Generated by Django 3.2.3 on 2021-05-19 19:52 from django.conf import settings from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ('posts', '0004_alter_comm...
#!/usr/bin/env python3 # Copyright (c) 2015-2016 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. from test_framework.test_framework import BitcoinTestFramework from test_framework.util import * from tes...
# Copyright (c) 2020, SAS Institute Inc., Cary, NC, USA. All Rights Reserved. # SPDX-License-Identifier: Apache-2.0 import sys sys.path.append('..') import mmAuthorization import requests import json viya_host = "localhost" port = ":8080" host_url="http://" + viya_host + port destination_url = host_url + "/modelPubl...
""" http://matplotlib.org/examples/api/radar_chart.html Example of creating a radar chart (a.k.a. a spider or star chart) [1]_. Although this example allows a frame of either 'circle' or 'polygon', polygon frames don't have proper gridlines (the lines are circles instead of polygons). It's possible to get a polygon g...
from smlb import ( params, Data, Features, TabularData, ) from smlb.feature_selection.selector_protocol_sklearn import SelectorProtocolSklearn class FeatureSelectorSklearn(Features): """Base class for feature selection strategies that use one of scikit-learn's feature selection methods. This ...
# Copyright 2021 The NetKet 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 ...
import os import seaborn as sns import pandas as pd import matplotlib.pyplot as plt df=pd.read_csv('../data1.csv') df=df.values #time series vs reservoir levels(ft) graph sns.set_style('darkgrid') plt.plot(df[:,0],df[:,1],label="") plt.plot(df[:,0],df[:,2]) plt.xlabel('Time Series') plt.ylabel('Reservoir Levels(ft)') ...
# -*- coding: utf-8 -*- """ The MIT License (MIT) Copyright (c) 2015-2020 Rapptz 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 u...
from random import choice from string import ascii_uppercase, ascii_lowercase, digits from tests.unit.dataactcore.factories.staging import AwardFinancialFactory, AwardProcurementFactory from tests.unit.dataactvalidator.utils import number_of_errors, query_columns _FILE = 'c23_award_financial_1' def test_column_head...
# https://huggingface.co/vumichien/wav2vec2-large-xlsr-japanese import torch import torchaudio import librosa from datasets import load_dataset import MeCab from transformers import Wav2Vec2ForCTC, Wav2Vec2Processor import re # config wakati = MeCab.Tagger("-Owakati") chars_to_ignore_regex = '[\\\\\\\\\\\\\\\\\\\\\\\...
def zigzagTraversal(root): queue = [root] # initialize queue to root node result = [] while queue: # iterate through loop while queue is not empty arr = [] # levelSize prevents us from looping pasts current level in queue levelSize = len(queue) for _ in range(levelSize): # these two lines ...
import xml.etree.ElementTree as ET import os from os import listdir, getcwd from os.path import join import argparse import cv2 classes = [] def convert_annotation(image, args): if args.anno_dir: anno_file = join(args.anno_dir, image.split('.')[0]) + '.xml' if not os.path.isfile(anno_file): ...
# Generated by Django 3.1.7 on 2021-11-05 14:44 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('translation_management_tool', '0005_auto_20211105_1418'), ] operations = [ migrations.AlterField( model_name='language', ...
# -*- coding: utf-8 -*- # Define here the models for your scraped items # # See documentation in: # https://doc.scrapy.org/en/latest/topics/items.html import scrapy # class AddressItem(scrapy.Item): # # define the fields for your item here like: # # name = scrapy.Field() # pass class AddressItem(scrapy...
# 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...
#!/usr/bin/env python from __future__ import (absolute_import, division, print_function, unicode_literals) import doctest import unittest from . import graphemecluster from .db import iter_grapheme_cluster_break_tests from .test import implement...
import ast import os import shlex import re from os.path import join, dirname, isdir, exists import pytest from pytest_cases.common_mini_six import string_types # Make the list of all tests that we will have to execute (each in an independent pytest runner) THIS_DIR = dirname(__file__) tests_raw_folder = join(THIS_D...
from mc2p import MC2PClient as MC2PClientPython __title__ = 'MyChoice2Pay Django' __version__ = '0.1.3' __author__ = 'MyChoice2Pay' __license__ = 'BSD 2-Clause' __copyright__ = 'Copyright 2017 MyChoice2Pay' # Version synonym VERSION = __version__ # Header encoding (see RFC5987) HTTP_HEADER_ENCODING = 'iso-8859-1' ...
# 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...
import os import pickle import collections import numpy as np import pandas as pd import matplotlib.pyplot as plt from IPython import embed colors={ 'BOHB-PC-DARTS': 'darkorange', 'BOHB-DARTS': 'dodgerblue', 'BOHB-GDAS' : 'forestgreen', 'RE': 'crimson', 'RS': 'darkorchid', 'RL': ...
import pandas as pd import numpy as np import xlwings as xw from PolicyAnalysis import cptj as cj """ โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€” ไปฅไธ‹ๆ˜ฏไฝฟ็”จ re ๆฃ€็ดข+ DFC ๆ˜ ๅฐ„็š„ๆ•ฐๆฎๅค„็†ๅ†™ๆณ• โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€” """ class businesses_re: def __init__(self, Data, userdict): self.Data = Data self.userdict = userdict data = Data.co...
# Generated by Django 2.2.8 on 2020-05-22 20:23 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ ('management', '0001_initial'), ('accounts', '0001_initial'), ('auth', '0011_update_proxy_...
from hash_map import HashMap from asserts.asserts import assert_ def test_hash_map(): hash_map = HashMap(2) # Test HashMap get and put key = "abcde" value = "ramiz" hash_map.put(key, value) output = hash_map.get(key) assert_(value, output) # Test size assert_(1, hash_map.size()) ...
""" ################################################################################################## # Copyright Info : Copyright (c) Davar Lab @ Hikvision Research Institute. All rights reserved. # Filename : __init__.py # Abstract : # Current Version: 1.0.0 # Date : 2021-05-01 ###...
from front.tree.home.api.route import register_api_route from front.tree.home.api.airports.route import register_api_airports_route from front.tree.home.api.airports.airport.route import register_api_airport_route from front.tree.home.api.cities.route import register_api_cities_route from front.tree.home.api.cities.c...
#!/usr/bin/env python import os import web import requests import json from config import CONFIG_FILE, DEBUG, SENSU_API_URI, SENSU_API_USER, SENSU_API_PASS, load_config, validate_api_key # SHA2 urls = ( '/', 'Index', '/results/([A-Fa-f0-9]{64})', 'CheckCollector' ) api_config = load_config(CONFIG_FILE) c...
import time from M4i6622 import * from Functions.functions import * #4 functions to be used def f0(x): return sin(x)#sin_for_time(60000000, 40000000, 20000,10000, x) def f1(x): return sin(x) def f2(x): return sin(x,f=1000) def f3(x): return x t0 = time.perf_counter() M4i = M4i6622(channelNum...
import group_frequency_oracle as freq import linecache import random def query_on_adult_dim2(oraclePath,oracleInterval,queryPath,trueOraclePath,aggregation="count"): # adult_2 equal 5 and 7 queriesStr=linecache.getline(queryPath,1) queries=eval(queriesStr) answer=[0]*500 trueOracleStr=linecache.ge...
# -*- coding: utf8 -*- import httplib import md5 as imd5 import base64 import time import re METADATA_PREFIX = 'x-upyun-meta-' DL = '/' def md5(src): m1 = imd5.new() m1.update(src) dest1 = m1.hexdigest() return dest1 def md5file(fobj): m = imd5.new() while True: d = fobj.read...
from copy import deepcopy from random import sample, choice from BucketLib.bucket import Bucket from cb_tools.cb_cli import CbCli from couchbase_helper.documentgenerator import doc_generator from couchbase_helper.durability_helper import BucketDurability from epengine.durability_base import BucketDurabilityBase from e...
import html2markdown as h2m import urllib.request import re from sys import argv, exit if __name__ == '__main__': if len(argv) not in (2, 3): exit(1) day = argv[1] if int(day) not in range(1, 24): exit(1) destinationFilePath = argv[2] url = "https://adventofcode.com/2020/day/" + day r...
# -*- coding: utf-8 -*- from __future__ import absolute_import from __future__ import division, print_function, unicode_literals from ...utils import cached_property from ..._compat import to_unicode, to_string, unicode_compatible @unicode_compatible class Sentence(object): __slots__ = ("_text", "_cached_proper...
from django.urls import path from .api import * from knox import views as knox_views urlpatterns = [ #domain.dn/api/v1/register/ | POST path('register/' , SignUpAPI.as_view() , name='register'), #domain.dn/api/v1/register/ | POST path('login/' , SignInAPI.as_view() , name='login'), #domain.dn/ap...
from simphony.library import siepic from simphony.netlist import Subcircuit def ring_double_siepic( wg_width=0.5, gap=0.2, length_x=4, bend_radius=5, length_y=2, coupler=siepic.ebeam_dc_halfring_straight, straight=siepic.ebeam_wg_integral_1550, terminator=siepic.ebeam_terminator_te1550...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ @Author: Yue Wang @Contact: yuewangx@mit.edu @File: data.py @Time: 2018/10/13 6:21 PM Modified by @Author: An Tao @Contact: ta19@mails.tsinghua.edu.cn @Time: 2020/2/27 9:32 PM """ import os import sys import glob import h5py import numpy as np import torch from torc...
# third party import numpy as np import pytest from sklearn.linear_model import LogisticRegression # syft absolute import syft as sy from syft.experimental_flags import flags sy.load("sklearn") sy.load("numpy") @pytest.mark.vendor(lib="sklearn") @pytest.mark.parametrize("arrow_backend", [True, False]) def test_logi...
from django.http import HttpResponse, HttpResponseRedirect from django.shortcuts import get_object_or_404, render from django.urls import reverse from django.template import loader from django.contrib import messages from django.views import generic from django.views.generic.base import TemplateView from django.utils i...
from thenewboston_node.business_logic.blockchain.file_blockchain import FileBlockchain from thenewboston_node.business_logic.models import ( AccountState, Block, Node, NodeDeclarationSignedChangeRequest, PrimaryValidatorSchedule, PrimaryValidatorScheduleSignedChangeRequest ) from thenewboston_node.business_logi...
#!/usr/bin/env python3 from torch.testing._internal.distributed import ddp_under_dist_autograd_test from torch.testing._internal.common_utils import ( run_tests, ) class TestDdpUnderDistAutogradWrapper(ddp_under_dist_autograd_test.TestDdpUnderDistAutograd): pass class TestDdpComparison(ddp_under_dist_autogra...
# import tensorflow as tf import numpy as np import math import sys import os import tensorflow.compat.v1 as tf import tensorflow as tf2 BASE_DIR = os.path.dirname(os.path.abspath(__file__)) sys.path.append(BASE_DIR) sys.path.append(os.path.join(BASE_DIR, '../utils')) import tf_util from transform_nets import input_tr...
# pylint: disable=redefined-outer-name import itertools import json import math import time import flask import numpy as np import pandas as pd import psutil # noqa # pylint: disable=unused-import import pytest from bentoml.adapters import DataframeInput from bentoml.adapters.dataframe_input import read_dataframes_...
#!/usr/bin/env python3 # Copyright Verizon Media. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. import sys import json json_file = sys.argv[1] with open(json_file, 'r') as f: data = json.load(f) for doc in data: vespa_doc = { 'put': 'id:covid-19:doc::%s' % doc['id'...
# Copyright 2017 SrMouraSilva # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing,...
# BOJ 1,2,3 ๋”ํ•˜๊ธฐ 9095 T = int(input()) # ํ…Œ์ŠคํŠธ ์ผ€์ด์Šค์˜ ๊ฐœ์ˆ˜ T๊ฐ€ ์ฃผ์–ด์ง sum_list = [] for i in range(T): n = int(input()) sum_list.append(n) def oneTwoThreeSum(n): if n == 1: return 1 if n == 2: return 2 if n == 3: return 4 else: return oneTwoThreeSum(n-3) + oneTwoThreeSum(...
from dateutil import parser import preprocessor as p def timestamp_to_date(timestamp): """ Conver a twitter timestamp to a datetime object :param timestamp: a string represent the timestamp :return: a datetime object """ return parser.parse(timestamp) def day_diff(timestamp1, timestamp2)...
# coding: utf-8 """ Engine api Engine APIs # noqa: E501 OpenAPI spec version: 1.0.6 Generated by: https://github.com/swagger-api/swagger-codegen.git """ import pprint import re # noqa: F401 import six class DestinationType(object): """NOTE: This class is auto generated by the swagger co...
from .crawl_by_cat_url import crawl_by_cat_url from .crawl_by_search import crawl_by_search from .crawl_by_shop_url import crawl_by_shop_url from .crawl_cat_list import crawl_cat_list
from __future__ import print_function import sys def errprinter(*args): logger(*args) def logger(*args): print(*args, file=sys.stderr) sys.stderr.flush()
# 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. # # Credits to Hitalo-Sama and FTG Modules from datetime import datetime from emoji import emojize from math import sqrt...
#----------------------------------------------------------------------- #Copyright 2019 Centrum Wiskunde & Informatica, Amsterdam # #Author: Daniel M. Pelt #Contact: D.M.Pelt@cwi.nl #Website: http://dmpelt.github.io/msdnet/ #License: MIT # #This file is part of MSDNet, a Python implementation of the #Mixed-Scale Dense...
import requests import json from errors import BotException import logging logger = logging.getLogger(__name__) class Github(object): def __init__(self, repo_slug: str): """ Args: repo_slug: The slug (user/repo_name) of the github repository """ # TODO: Add support fo...
from django.contrib import admin from ctfweb.models import * admin.site.register(Game) admin.site.register(Category) admin.site.register(Challenge) admin.site.register(Hint) admin.site.register(Competitor) admin.site.register(Solved) admin.site.register(RegCodes)
#!/usr/bin/env python # # otatool is used to perform ota-level operations - flashing ota partition # erasing ota partition and switching ota partition # # Copyright 2018 Espressif Systems (Shanghai) PTE LTD # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in complia...
# -*- coding:utf-8 -*- # /usr/bin/env python """ Date: 2019/10/20 10:57 Desc: """
# # Copyright (c) 2021, 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.apache.org/licenses/LICENSE-2.0 # # Unless required by appl...
# 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 ...
from graphene import relay, ObjectType from graphene_django import DjangoObjectType from graphene_django.filter import DjangoFilterConnectionField from .models import Colaborador class ColaboradorNode(DjangoObjectType): class Meta: model = Colaborador filter_fields = '__all__' interfaces ...
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import unicode_literals from __future__ import absolute_import from core_backend import context from core_backend.service import handler from core_backend.libs.exception import Error from server.domain.models import WechatshopUser import re import time im...
""" RobotX Listener. Integrate with Test Case Management System, such as, test-run creating. result re-write. Author: Xin Gao <fdumpling@gmail.com> """ import re from robotx.core.nitrateclient import TCMS class TCMSListener(object): """ integrate with Test Case Management System, such as, test-run cre...
import pytest import pathlib import sys import requests import io import zipfile import tempfile import pandas as pd import os HERE = pathlib.Path(__file__).resolve().parent # insert at 1, 0 is the script path (or '' in REPL) # temporary hack until package is published and we can inherit from there: sys.path.inser...
# Copyright 2011 Justin Santa Barbara # Copyright 2012 OpenStack Foundation # 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/l...
import csv import os # ==================== # Default variables: default_avg_cnt = 10 default_exc_thr = 0.02 default_low_wvl = 300 default_hig_wvl = 1014 default_delimit = '\t' default_exc_fin = True # ==================== def welcome(): # Print a welcome screen and ask for user input. Check if input is valid. ...
##################################################################### # ADOBE CONFIDENTIAL # ___________________ # # Copyright 2017 Adobe # All Rights Reserved. # # NOTICE: All information contained herein is, and remains # the property of Adobe and its suppliers, if any. The intellectual # and technical concepts co...
""" :mod:`neo.io` provides classes for reading and/or writing electrophysiological data files. Note that if the package dependency is not satisfied for one io, it does not raise an error but a warning. :attr:`neo.io.iolist` provides a list of successfully imported io classes. Functions: .. autofunction:: neo.io.get...
from Bio import SeqIO import pandas as pd import sys import os # Put error and out into the log file sys.stderr = sys.stdout = open(snakemake.log[0], "w") ########################################################### ########################################################### # List that will contains all the contigs ...
import math import os from math import log10 # noinspection PyPackageRequirements import cv2 import numpy as np from scipy.ndimage import distance_transform_edt import config_main from Utils.log_handler import log_setup_info_to_console, log_error_to_console, log_benchmark_info_to_console from Benchmarking.Util.image_p...
import os import sys import dataflow as df import numpy as np class LTRLoader(df.DataFlow): """ Data loader. Combines a dataset and a sampler, and provides single- or multi-process iterators over the dataset. Note: an additional option stack_dim is available to select along which dimensi...
# Test the module type import unittest import weakref from test.support import gc_collect from test.support import import_helper from test.support.script_helper import assert_python_ok import sys ModuleType = type(sys) class FullLoader: @classmethod def module_repr(cls, m): return "<module '{}' (craft...
#!/usr/bin/env python import socket import urllib.parse from datetime import datetime import requests import requests.exceptions as reqexc import sqlalchemy.exc as sqlexc from tsa import stdoutn from tsa.lib import html from tsa.models import Endpoint, create_session from tsa import logging logger = logging.getLogger...
# -*- coding: utf-8 -*- """ Description : Common routines for models in PyTorch. Author : xxm """ __all__ = ['round_channels', 'Identity', 'Swish', 'HSigmoid', 'HSwish', 'get_activation_layer', 'conv1x1', 'conv3x3', 'depthwise_conv3x3', 'ConvBlock', 'conv1x1_block', 'conv3x3_block', 'conv7x7...
from __future__ import print_function from __future__ import division from __future__ import absolute_import import os.path from crds import reftypes HERE = os.path.dirname(__file__) or "." TYPES = reftypes.from_package_file(__file__) INSTRUMENTS = TYPES.instruments EXTENSIONS = TYPES.extensions TEXT_DESCR = TYPES...
# coding=utf-8 # Copyright 2022 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/LICENSE-2.0 # # Unless required by appl...
def getVocabDict(reverse=False): """ Function to read in the supplied vocab list text file into a dictionary. Dictionary key is the stemmed word, value is the index in the text file If "reverse", the keys and values are switched. """ vocab_dict = {} with open("../data/emails/vocab.txt") as f...
# Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under th...