text
stringlengths
1
927k
#### 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_belt_s03.iff" result.attribute_templa...
import termformat from unittest import TestCase class UtilsTestCase(TestCase): def test_is_valid_atom(self): self.assertTrue(termformat.is_atom(":foo")) self.assertTrue(termformat.is_atom(u":foo")) self.assertTrue(termformat.is_atom(":Bar")) def test_is_invalid_atom(self): self.assertFalse(termf...
import glob import time import cv2 from scipy.spatial import distance import math from foregroundExtraction import readyFrame, frameDifferencing, morphologicalOperations, natural_sort from ballDetection import filterSize, drawRectangle startTimeReadingFrames = time.time() # Location of dataset filenames = glob.glob("D...
import requests import json import re from bs4 import BeautifulSoup def search_content(query): search = "https://www.youtube.com/results?search_query=" text = query text = list(text.split(" ")) search_query = f"{search}{'+'.join(str(x) for x in text)}" source = requests.get(search_query).text ...
import sys import glob from Bio.SeqIO.FastaIO import SimpleFastaParser from Bio import pairwise2 def merge_into_consensus(consensus, incoming, overlap_length): # if first segment, no overlapping needs to be done if consensus == "": return incoming or_con = consensus[-overlap_length:] or_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 agreed to in writing, software # distributed under the Li...
from unittest import mock import pytest import torch from tests import DATASETS_PATH @pytest.mark.parametrize('cli_args', [ f"--data_dir {DATASETS_PATH} --max_epochs 1 --max_steps 3 --fast_dev_run --batch_size 2" ]) def test_cli_run_self_supervised_amdim(cli_args): """Test running CLI for an example with de...
"""Bytecode analysing utils. Originally added for using in smart step into.""" import dis import inspect from collections import namedtuple from _pydevd_bundle.pydevd_constants import IS_PY3K, IS_CPYTHON __all__ = ["get_smart_step_into_candidates"] _LOAD_OPNAMES = { 'LOAD_BUILD_CLASS', 'LOAD_CONST', 'LOA...
import os basedir = os.path.abspath(os.path.dirname(__file__)) class Config(object): SECRET_KEY = os.environ.get('heatz') or 'you-will-never-guess' SQLALCHEMY_DATABASE_URI = 'postgresql://postgres:myhome@localhost/theology_library' SQLALCHEMY_TRACK_MODIFICATIONS = False
# -*- coding: utf-8 -*- from django.db import models from apps.accounts.models.choices import Platform from apps.accounts.models.managers.phone_device import PhoneDeviceManager from django.utils.translation import ugettext_lazy as _ from apps.contrib.models.mixins import UUIDPrimaryKeyModelMixin, TimeStampedModelM...
def adder(y): def addsome(x): return x +y return addsome add1 = adder(1) add2 = adder(2)
# Configuration file for the Sphinx documentation builder. # # This file only contains a selection of the most common options. For a full # list see the documentation: # https://www.sphinx-doc.org/en/master/usage/configuration.html # -- Path setup -------------------------------------------------------------- # If ex...
from django.conf import settings import requests def get_headers(access_token): """ Build the headers for each authorised request """ return { 'Authorization': 'Bearer %s' % access_token, 'Content-Type': 'application/json', 'Accept': 'application/json' } def get_user_with...
# # 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...
from django.db import models from django.contrib.auth.models import User from cloudinary.models import CloudinaryField # Create your models here. class Profile(models.Model): user = models.OneToOneField(User, on_delete=models.CASCADE) profile_photo = CloudinaryField('image') bio = models.TextField(max_leng...
# 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...
#! /usr/bin/python # Copyright 2016 Google 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 License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appl...
"""Tests suite for `duty`.""" from pathlib import Path TESTS_DIR = Path(__file__).parent TMP_DIR = TESTS_DIR / "tmp" FIXTURES_DIR = TESTS_DIR / "fixtures"
# 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, distribute, sublicense, and/or # sell...
from typing import TYPE_CHECKING, Any import marshmallow from marshmallow import fields, post_load, post_dump import prefect from prefect.serialization import schedule_compat from prefect.utilities.serialization import ( DateTimeTZ, ObjectSchema, OneOfSchema, StatefulFunctionReference, to_qualifie...
# Authors: Pierre Ablin <pierre.ablin@inria.fr> # Alexandre Gramfort <alexandre.gramfort@inria.fr> # Jean-Francois Cardoso <cardoso@iap.fr> # # License: BSD (3-clause) import numbers import numpy as np def permute(A, scale=True): '''Get a permutation to diagonalize and scale a matrix Param...
import argparse import asyncio import pathlib import requests import socket from typing import Dict, TypedDict, Union """ Type Descriptions -*- any not listed are imported from modules -*- DiscoveryData: Cache-Control: str ST: str USN: str Ext: str Server: str LOCATION: str device-gr...
from setuptools import setup setup(name='docker_python_flask', version='1.0.0', description='A playground for Docker with Python and Flask.', author='Roberto Achar', author_email='robertoachar@gmail.com', packages=['docker_python_flask'], entry_points={ 'console_scripts': ...
import numpy as np import librosa from scipy import signal import fnmatch import os def preemphasis(x, coeff=0.97): return signal.lfilter([1, -coeff], [1], x) def inv_preemphasis(x, coeff=0.97): return signal.lfilter([1], [1, -coeff], x) def griffin_lim(stft_matrix_, n_fft, ...
""" 410. Split Array Largest Sum Hard Given an array nums which consists of non-negative integers and an integer m, you can split the array into m non-empty continuous subarrays. Write an algorithm to minimize the largest sum among these m subarrays. Example 1: Input: nums = [7,2,5,10,8], m = 2 Output: 18 Expla...
# Copyright 2020 Google LLC 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 law or ag...
import asyncio from typing import List import pytest from cactus.consensus.block_rewards import calculate_base_farmer_reward, calculate_pool_reward from cactus.full_node.mempool_manager import MempoolManager from cactus.simulator.simulator_protocol import FarmNewBlockProtocol from cactus.types.blockchain_format.coin ...
import urllib import json from bs4 import BeautifulSoup from flask import Flask statDims = { "Blocks Mined": "blocks_mined", "Time Between Blocks": "time_between_blocks", "Bitcoins Mined": "bitcoins_mined", "Total Transaction Fees": "total_transaction_fees", "No. of Transactions": "num_transactions", "Total Output Vol...
from awsio.python.lib.io.s3.s3dataset import S3Dataset from torch.utils.data import DataLoader url_list = ['s3://image-data-bucket/train/n01440764/n01440764_10026.JPEG', 's3://image-data-bucket/train/n01440764/n01440764_10027.JPEG', 's3://image-data-bucket/train/n01440764/n01440764_10029.JPEG'] dataset = S3Dataset(...
import operator import uuid from unittest import mock from django import forms from django.core import serializers from django.core.exceptions import ValidationError from django.core.serializers.json import DjangoJSONEncoder from django.db import ( DataError, IntegrityError, NotSupportedError, OperationalError, co...
# 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...
# -*- coding: utf-8 -*- """ TencentBlueKing is pleased to support the open source community by making 蓝鲸智云-用户管理(Bk-User) available. Copyright (C) 2017-2021 THL A29 Limited, a Tencent company. All rights reserved. Licensed under the MIT License (the "License"); you may not use this file except in compliance with the Lic...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models import django.core.validators class Migration(migrations.Migration): dependencies = [ ('main', '0010_auto_20151229_1717'), ] operations = [ migrations.AlterField( model_n...
from datetime import date from onegov.core.elements import Link from onegov.core.security import Public, Private from onegov.form import FieldDependency, WTFormsClassBuilder, move_fields from onegov.org.views.files import view_get_image_collection from onegov.winterthur import WinterthurApp, _ from onegov.winterthur.co...
import os import sys IDX = int(sys.argv[1]) os.environ['THEANO_FLAGS'] = f'base_compiledir="theano/p{IDX}"' import tqdm as tqd import itertools as itr import numpy as nmp import pandas as pnd import sklearn.metrics as mtr import scipy.special as scp import pymc3 as pmc import clonosGP as cln ## def run_model(prio...
import sys from Mojo.ServerHelpers import RunServer modname = globals()['__name__'] thisModule = sys.modules[modname] RunServer.init_run_server(thisModule)
# Copyright (c) 2003-2016 CORE Security Technologies # # This software is provided under under a slightly modified version # of the Apache Software License. See the accompanying LICENSE file # for more information. # # Author: Alberto Solino (@agsolino) # # Description: # # Wrapper class for SMB1/2/3 so it's transparen...
from rtamt.operation.abstract_operation import AbstractOperation class NotOperation(AbstractOperation): def __init__(self): self.input = [] def update(self, *args, **kargs): out = [] input_list = args[0] for in_sample in input_list: out_time = in_sample[0] ...
# Copyright 2018 Davide Spadini # # 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...
#!/usr/bin/env python3 # -*- coding:utf-8 -*- """ Loki module for medicalHistory Input: inputSTR str, utterance str, args str[], resultDICT dict Output: resultDICT dict """ DEBUG_medicalHistory = True userDefinedDICT = {"bodypart": ["毛", "腋...
from celery import Celery # TODO 用 Redis 或者 RabbitMQ 代替 SQLite celery_app = Celery( broker="sqla+sqlite:///instance/celery_broker.db", backend="db+sqlite:///instance/celery_backend.db", ) celery_app.config_from_object("celery_app.celeryconfig")
# -*- coding: utf-8 -*- from rest_framework.exceptions import ValidationError from rest_framework.filters import BaseFilterBackend from rest_framework.pagination import LimitOffsetPagination from rest_framework.views import APIView from rest_search.schemas import get_form_schema_operation_parameters class SearchFil...
from pdb import set_trace as T import ray import pickle import time from forge.blade.core import realm from forge.trinity.timed import Timed, runtime, waittime #Agent logic class Sword(Timed): '''A simple Core level interface for generic, persistent, and asynchronous computation over a colocated Neural MMO ...
# Copyright 2018, Kay Hayen, mailto:kay.hayen@gmail.com # # Python test originally created or extracted from other peoples work. The # parts from me are licensed as below. It is at least Free Software where # it's copied from other people. In these cases, that will normally be # indicated. # # L...
# -*- coding: utf-8 -*- import cv2 import time # cascade_path = "./haarcascades/haarcascade_frontalface_default.xml" cascade_path = "/var/opencv/haarcascades/haarcascade_frontalface_default.xml" class FaceDetector(object): facerect = None refreshRate = 0.1 # sec lastRefreshed = 0.0 # sec @classmethod...
""" Copyright 2008, 2009 Free Software Foundation, Inc. This file is part of GNU Radio GNU Radio Companion is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any ...
import json preConf = {'removeID' : '_A_'} try: with open(os.path.join('processlib', 'pre.json')) as configdata: preConf = json.load(configdata) except: print('no config file, defaulting preprocess') def removeUnwanted(Filelist): #remove unwated csv from file list #print(Filelist) newFi...
import os from decimal import Decimal as D from io import BytesIO from oscar.templatetags.currency_filters import currency from reportlab.lib import enums from reportlab.lib.pagesizes import A4 from reportlab.platypus import BaseDocTemplate, PageTemplate, Frame, Paragraph, Spacer, Table, TableStyle, ListFlowable, \ ...
import torch import nucls_model.torchvision_detection_utils.transforms as tvdt ISCUDA = torch.cuda.is_available() def tensor_isin(arr1, arr2): r""" Compares a tensor element-wise with a list of possible values. See :func:`torch.isin` Source: https://github.com/pytorch/pytorch/pull/26144 """ res...
from datetime import date from dateutil import parser from six import itervalues from .utils import DslBase, _make_dsl_class, ObjectBase, AttrDict, AttrList from .exceptions import ValidationException __all__ = ['construct_field', 'Object', 'Nested', 'Date', 'String', 'Float', 'Double', 'Byte', 'Short', 'Integer'...
"""app URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/2.0/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: path('', views.home, name='home') Class-based vie...
import json import channels.layers from asgiref.sync import async_to_sync from django.conf import settings from django.core.paginator import Paginator from django.http import HttpResponseRedirect from django.shortcuts import render, get_object_or_404 from django.urls import reverse, reverse_lazy from django.views.gene...
#!/usr/bin/env python3 import json import requests import os from datetime import datetime # TODO The port should not be hard-coded, it should be determined through some sort of Daudit config DAUDIT_PORT = 3000 DAUDIT_URL = "http://127.0.0.1:%d/daudit/jobs" % DAUDIT_PORT CONFIG_PATH = 'config.json' def main(): ...
# %% import torch import math from UnarySim.kernel.exp import expN1 from UnarySim.stream.gen import RNG, SourceGen, BSGen from UnarySim.metric.metric import ProgError import matplotlib.pyplot as plt import time import math import numpy as np # %% def exp_comb_test(bw=8, mode="unipolar", rng="Sobol"): device =...
import torch import torch.nn as nn import torch.nn.functional as F import torch import torch.nn as nn import math import time # class REBNCONVs(nn.Module): # def __init__(self,in_ch=3,out_ch=3,dirate=1): # super(REBNCONVs,self).__init__() # self.conv_s1 = nn.Conv2d(in_ch,out_ch,3,padding=1*dirate,...
# Copyright (C) 2019-2021, TomTom (http://tomtom.com). # # 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 o...
from uuid import uuid4 from rest_framework import generics, status from rest_framework.response import Response from rest_framework.decorators import api_view from datachimp.models.project import Project from datachimp.models.membership import Membership from datachimp.serializers.project import ProjectSerializer c...
from flask import Flask, render_template, request, jsonify, redirect from flask import send_file import pandas as pd import json import os.path from os import path import datetime ##additional imports with open('./data/users.json') as json_data: users = json.load(json_data) app = Flask(__name__) ####func...
"""Example NumPy style docstrings. This module demonstrates documentation as specified by the `NumPy Documentation HOWTO`_. Docstrings may extend over multiple lines. Sections are created with a section header followed by an underline of equal length. Example ------- Examples can be given using either the ``Example``...
"""Compute a Pade approximation for the principle branch of the Lambert W function around 0 and compare it to various other approximations. """ import numpy as np try: import mpmath # type: ignore[import] import matplotlib.pyplot as plt except ImportError: pass def lambertw_pade(): derivs = [mpmath...
# 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 ...
import asyncio import time from pathlib import Path from typing import Callable, List, Tuple from blspy import AugSchemeMPL, G2Element, G1Element from covid.consensus.pot_iterations import calculate_iterations_quality, calculate_sp_interval_iters from covid.harvester.harvester import Harvester from covid.plotting.uti...
from __future__ import absolute_import, unicode_literals from django.core.urlresolvers import reverse from django.shortcuts import get_object_or_404, redirect, render from django.utils.translation import ugettext as _ from django.views.decorators.vary import vary_on_headers from wagtail.utils.pagination import pagina...
#returns the equivalent letter output from neural network output node number def get_letter(netnumber): if netnumber == 0: return "0" if netnumber == 1: return "1" if netnumber == 2: return "2" if netnumber == 3: return "3" if netnumber == 4: return "4" if netnumber == 5: return "5" if netnumber ==...
from django.contrib.auth.forms import UserCreationForm from django.contrib.auth.models import User from django import forms class RegisterUserForm(UserCreationForm): class Meta: model = User fields = ['username', 'email', 'password1', 'password2'] username = forms.CharField(required=...
from vision.ssd.vgg_ssd import create_vgg_ssd, create_vgg_ssd_predictor from vision.ssd.mobilenetv1_ssd import create_mobilenetv1_ssd, create_mobilenetv1_ssd_predictor from vision.ssd.mobilenetv1_ssd_lite import create_mobilenetv1_ssd_lite, create_mobilenetv1_ssd_lite_predictor from vision.ssd.squeezenet_ssd_lite impor...
# @Title: K 个一组翻转链表 (Reverse Nodes in k-Group) # @Author: 18015528893 # @Date: 2021-02-19 22:23:56 # @Runtime: 48 ms # @Memory: 15.6 MB # Definition for singly-linked list. # class ListNode: # def __init__(self, val=0, next=None): # self.val = val # self.next = next class Solution: def reverseK...
# -*- coding:utf-8 -*- # 导入需要的包 import paddle import numpy as np from paddle.nn import Conv2D, MaxPool2D, Linear, Dropout import paddle.nn.functional as F # 定义 LeNet 网络结构 class LeNet(paddle.nn.Layer): def __init__(self, num_classes=1): super(LeNet, self).__init__() # 创建卷积和池化层块,每个卷积层使用Sigmoid激活函数,...
#!/usr/bin python # -*- coding: utf-8 -*- """ This file is part of the pyquaternion python module Author: Kieran Wynn Website: https://github.com/KieranWynn/pyquaternion Documentation: http://kieranwynn.github.io/pyquaternion/ Version: 1.0.0 License: The MIT License (MIT) Copyright (c...
# Time: O(m * n) # Space: O(m + n) class Solution(object): def findLonelyPixel(self, picture): """ :type picture: List[List[str]] :rtype: int """ rows, cols = [0] * len(picture), [0] * len(picture[0]) for i in range(len(picture)): for j in range(len(pic...
import glob import numpy as np from lib.CrossSectionFunctions import GetWaveNumbers, BinModel import matplotlib.pyplot as plt import os import itertools import time import multiprocessing as mp #parse the parameters.ini which contains the information Data = [f.split(":") for f in open("CrossSectionParams/Parameters.in...
import datetime import json import os from datetime import timedelta import pandas as pd import pytz import requests import yaml from xbos import get_client from xbos.services import mdal from xbos.services.hod import HodClient # TODO add energy data acquisition # TODO FIX DAYLIGHT TIME CHANGE PROBLEMS # util funct...
"""Bokeh Violinplot.""" import bokeh.plotting as bkp from bokeh.layouts import gridplot from bokeh.models.annotations import Title import numpy as np from ....stats import hpd from ....stats.stats_utils import histogram from ...kdeplot import _fast_kde from ...plot_utils import get_bins, make_label, _create_axes_grid ...
#!/usr/bin/python # -*- coding: UTF-8 -*- """ 使用自建的接口识别来自网络的验证码 需要配置参数: remote_url = "https://www.xxxxxxx.com/getImg" 验证码链接地址 rec_times = 1 识别的次数 """ import datetime import requests from io import BytesIO import time import json import os def recognize_captcha(test_path, save_path, image_suffix): image_...
import time import argparse import numpy as np import sys import os from tensorflow.examples.tutorials.mnist import input_data import he_seal_client FLAGS = None def test_mnist_cnn(FLAGS): mnist = input_data.read_data_sets(FLAGS.data_dir, one_hot=True) batch_size = FLAGS.batch_size x_test_batch = mnist....
# 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...
# Copyright 2018 HTCondor Team, Computer Sciences Department, # University of Wisconsin-Madison, WI. # # 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/LICE...
from django.conf.urls import url from froide.helper import api_router from .views import ( index, campaign_page, CampaignPageListView, CampaignPageEditView, AssignCampaignPageTeamView, CampaignPageEmbedView, CampaignPageUpdateEmbedView, redirect_to_make_request, CampaignStatistics ) from .api_views im...
# -*- coding: utf-8 -*- """ @author: Yunpeng Liu """ input_file = r"~\input.txt" with open(input_file, 'r') as f: input_data = [] for line in f: input_data.append(int(line)) #input_data = input_data[:10] print(input_data) class Heap(object): def __init__(self, array = []): ...
# coding=utf-8 # Copyright 2018 The Google AI Team 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 applicabl...
from storm.variables import Variable from spans import * __all__ = [ "RangeVariable", "IntRangeVariable", "FloatRangeVariable", "DateRangeVariable", "DateTimeRangeVariable" ] class RangeVariable(Variable): """ Extension of standard variable class to handle conversion to and from Psycopg2 ...
# Copyright 2012 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 l...
import random from ev import Object from src.utils import utils from prettytable import PrettyTable class Item(Object): """ This is a default item object. This object is used as base for all items in the game: armor, weapons, rings, trinkets, potions etc. You get the idea """ def at_object_...
def set_updated_at(resource_name, updates, original): print resource_name print updates print original
# [h] transform all open fonts import hTools2.dialogs.all_fonts.actions reload(hTools2.dialogs.all_fonts.actions) hTools2.dialogs.all_fonts.actions.actionsDialog()
from kingfisher_scrapy.spiders.digiwhist_base import DigiwhistBase class DigiwhistSloveniaRepublic(DigiwhistBase): name = 'digiwhist_slovenia' start_urls = ['https://opentender.eu/data/files/SI_ocds_data.json.tar.gz']
from pytos.securechange.xml_objects.restapi.step.initialize import * from pytos.securechange.xml_objects.restapi.step.step import AbsNetwork, AbsService, Binding logger = logging.getLogger(XML_LOGGER_NAME) class Analysis_Result(XML_Object_Base): IMPLEMENTED = "implemented" NOT_AVAILABLE = "not available" ...
import os import sys from shutil import rmtree from setuptools import setup, find_packages exclude = ["forms_builder/example_project/dev.db", "forms_builder/example_project/local_settings.py"] exclude = dict([(e, None) for e in exclude]) for e in exclude: if e.endswith(".py"): try: ...
#!/usr/bin/python import json import logging import sfx_collectd_utilities as sfx import urllib2 import urllib_ssl_handler import couchdb_metrics import base64 import six try: import collectd except ImportError: try: import dummy_collectd as collectd except ImportError: pass # Plugin name...
#!/usr/bin/env python import os import sys if __name__ == '__main__': if not os.environ.get('DJANGO_SETTINGS_MODULE'): os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'ImageQ.settings.local_settings') try: from django.core.management import execute_from_command_line except ImportError as e...
""" Quantilization functions and related stuff """ import numpy as np from pandas._libs import Timedelta, Timestamp from pandas._libs.lib import infer_dtype from pandas.core.dtypes.common import ( DT64NS_DTYPE, ensure_int64, is_bool_dtype, is_categorical_dtype, is_datetime64_dtype, is_datetime...
"""Tests for the Ambiclimate config flow.""" import ambiclimate from homeassistant import data_entry_flow from homeassistant.components.ambiclimate import config_flow from homeassistant.const import CONF_CLIENT_ID, CONF_CLIENT_SECRET from homeassistant.setup import async_setup_component from homeassistant.util import ...
# -*- coding: utf-8 -*- import unittest class GlobalStatistic: "Расчет данных для отображения статистики пользователю" def __init__(self): self.stat_en_ru = [] self.stat_ru_en = [] def _calc_stat(self, word, stat_info): en_word, transcription, ru_word = word.get_show_info() ...
# qubit number=3 # total number=13 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...
# -*- coding: utf-8 -*- """setup.py.""" import setuptools def read_file(fname): """Read file and return the its content.""" with open(fname, "r") as f: return f.read() def get_attr(fname, attr): """Read file and return specific "attribute" content.""" lines = read_file(fname) for line ...
# Copyright (C) 2018-2021 Intel Corporation # SPDX-License-Identifier: Apache-2.0 import logging as log from openvino.tools.mo.front.common.partial_infer.utils import int64_array from openvino.tools.mo.front.common.replacement import FrontReplacementOp from openvino.tools.mo.front.tf.extractors.utils import tf_dtype_...
# Copyright (c) 2017-2018 {Flair Inc.} WESLEY PENG # # 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 agre...
# Copyright 2019 The TensorFlow Probability 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 o...
# Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. # SPDX-License-Identifier: Apache-2.0 """ This Lambda is responsible for receiving and storing CloudWatch events originating from Media Services. This Lambda must be installed into each region where Media Services are created. """ import datetim...
# Copyright The PyTorch Lightning team. # # 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 i...