text
stringlengths
2
999k
from django import forms from django.contrib import admin, messages from django.contrib.admin.helpers import ActionForm from base.admin import ImportExportTimeStampedAdmin from .aws_utils import ( delete_workers, restart_workers, scale_workers, start_workers, stop_workers, ) from .admin_filters ...
from fid import fid from kid import kid_kid, kid_is if __name__ == "__main__": from optparse import OptionParser parser = OptionParser() parser.add_option("-m", "--metric", dest="metric", default="all", help="Set batch size to use for InceptionV3 network", type=s...
import sys import os sys.path.append(os.getcwd()) import torch from training_structures.Contrastive_Learning import train, test from fusions.common_fusions import Concat from datasets.imdb.get_data import get_dataloader from unimodals.common_models import MLP, VGG16, MaxOut_MLP, Linear traindata, validdata, testdata...
# # This source file is part of the EdgeDB open source project. # # Copyright 2008-present MagicStack Inc. and the EdgeDB 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...
"""Library for exceptions in RTSPtoWebRTC Client.""" class ClientError(Exception): """Exception communicating with the server.""" class ResponseError(ClientError): """Exception after receiving a response from the server."""
import numpy as np from .div1D import div1D from scipy.sparse import spdiags def div1DNonUniform(k, ticks, dx=1.): """Computes a m+2 by m+1 one-dimensional non-uniform mimetic divergence operator Arguments: k (int): Order of accuracy ticks (:obj:`ndarray`): Edges' ticks e.g. [0 0.1 0.15 0....
{ "targets": [ { "target_name": "hx711", "sources": [ "source/binding.cpp", "source/hx711.cpp" ], "include_dirs": [ "<!@(node -p \"require('node-addon-api').include\")", "./headers" ], "defines": ["NAPI_DISABLE_CPP_EXCEPTIONS"], "conditio...
"""Support for KNX/IP weather station.""" from xknx.devices import Weather as XknxWeather from homeassistant.components.weather import WeatherEntity from homeassistant.const import TEMP_CELSIUS from .const import DOMAIN from .knx_entity import KnxEntity async def async_setup_platform(hass, config, async_add_entiti...
# Copyright (c) 2015-2019 The Switch Authors. All rights reserved. # Licensed under the Apache License, Version 2.0, which is in the LICENSE file. """ Defines model components to describe transmission dispatch for the Switch model. """ from pyomo.environ import * dependencies = 'switch_model.timescales', 'switch_mod...
# organize imports import cv2 import numpy as np from pygame import mixer # color to detect - drum stick lower = [17, 15, 100] upper = [80, 76, 220] # initialize mixer mixer.init() # region coordinates k_top, k_bottom, k_right, k_left = 180, 280, 540, 640 h_top, h_bottom, h_right, h_left = 140, 240, 300, 400 s_top, ...
from flask import Flask, request, jsonify, render_template import pickle app = Flask(__name__) model = pickle.load(open('nlp.pkl', 'rb')) @app.route('/') def home(): return render_template('index.html') @app.route('/predict',methods=['POST']) def predict(): ''' For rendering results on HTML GUI '''...
#!/usr/bin/env python # # Copyright (c) 2001 - 2016 The SCons Foundation # # 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 us...
# coding=utf-8 ''' Created on 2016-10-26 @author: Jennifer Project:读取mysql数据库的数据,转为json格式 ''' import json import pymysql #import pymysql # baidulocalower(30.667580,104.072539) # baidulocalhigh(30.678855,104.085511) # gaodelocallower(30.6614534471,104.0660738426) # gaodelocalhigh(30.6730225889,104.0789416320) def TableT...
# fmt: off """ A version module managed by the invoke-release task See also tasks.py """ from __future__ import unicode_literals __version_info__ = (0, 2, 0) __version__ = '-'.join(filter(None, ['.'.join(map(str, __version_info__[:3])), (__version_info__[3:] or [None])[0]])) # fmt: on
"""There are some discrepancies between the fna and faa files. What are they?""" import numpy from fasta import FASTA names = ['2236446587', '2236446227', '2236446226', '2236446115', '2236446114', '2236445762', '2236446248', '2236446050', '2236446154', '2236446074', '2236445702', '2236446303', '2236446345', '22364466...
#!/usr/bin/env python import sys import time import os.path import datetime import logging from operator import attrgetter from functools import partial import click from click_datetime import Datetime from finam import (Exporter, Timeframe, Market, FinamExport...
############################################################################### # # Tests for XlsxWriter. # # SPDX-License-Identifier: BSD-2-Clause # Copyright (c), 2013-2022, John McNamara, jmcnamara@cpan.org # from ..excel_comparison_test import ExcelComparisonTest from ...workbook import Workbook class TestCompar...
from dataclasses import dataclass @dataclass class MotorState: position: float = None velocity: float = None torque: float = None temperature: float = None position_goal: float = None
from django.conf import settings from django.conf.urls import include, url from django.urls import include, path from django.conf.urls.static import static from django.contrib import admin from django.views.generic import TemplateView from django.views import defaults as default_views from django.views.static import se...
# 890. Find and Replace Pattern class Solution: def findAndReplacePattern2(self, words, pattern: str): ans = [] for w in words: d = {} flag = True if len(w) == len(pattern): for i in range(len(w)): if w[i] in d and d[w[i]] != pa...
# -*- coding: utf-8 -*- from __future__ import print_function import os import sys from setuptools import setup, find_packages if __name__ == '__main__': print('Sopel does not correctly load modules installed with setup.py ' 'directly. Please use "pip install .", or add {}/sopel_modules to ' '...
# pylint: disable=too-many-lines # 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) AutoRe...
# coding=utf-8 """ Filename: good_solution Author: xilepeng Date: 2020/4/9 Description: """ from typing import List class Solution: @staticmethod def removeDuplicates(nums: List[int]) -> int: """ 思路和我一样,只是写得更精简一些。不过还是要学习哒~ """ if not nums: return 0 ...
TRANSFER_CREATED_TEST_DATA = { "created": 1348360173, "data": { "object": { "amount": 455, "currency": "usd", "date": 1348876800, "description": None, "id": "tr_XXXXXXXXXXXX", "object": "transfer", "other_transfers": [],...
# -*- coding: utf-8 -*- # Generated by Django 1.11.9 on 2018-01-28 07:20 from __future__ import unicode_literals from django.conf import settings from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('images', '0004_auto_201801...
from urllib.parse import urlparse, parse_qs import requests import datetime import scrapy class PeraturanSpider(scrapy.Spider): name = 'peraturan_wide' allowed_domains = ['peraturan.go.id'] custom_settings = { 'FEED_URI': f"export/peraturan_wide_{datetime.date.today()}", 'FEED_FORMAT': 'j...
#!/usr/bin/env python3 # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. """Video models.""" import torch import torch.nn as nn import utils.weight_init_helper as init_helper from models.batchnorm_helper import get_norm from . import head_helper, resnet_helper, stem_helper from .build import M...
import uuid from fastapi import status # # INVALID TESTS # def test_get_invalid_uuid(client_valid_access_token): get = client_valid_access_token.get("/api/event/source/1") assert get.status_code == status.HTTP_422_UNPROCESSABLE_ENTITY def test_get_nonexistent_uuid(client_valid_access_token): get = cl...
size = int(input()) array = [int(i) for i in input().split()] for i in range(1, size): temp = array[i] index = i - 1 while index >=0 and temp < array[index]: array[index + 1] = array[index] index -= 1 array[index + 1] = temp print(' '.join([str(i) for i in array]))
# 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 -*- """ GPML hyper parameter treatment. Provide iterator, getter and setter. Created: Mon Jan 13 11:01:19 2014 by Hannes Nickisch, Philips Research Hamburg. Modified: $Id: hyper.py 1263 2013-12-13 13:36:13Z hn $ """ __version__ = "$Id: hyper.py 913 2013-08-15 12:54:33Z hn $" import nump...
# -*- coding: utf-8 -*- # 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law o...
import logging from django.contrib.auth import get_user_model from django.shortcuts import redirect from django.urls import reverse, reverse_lazy from django.views.generic import UpdateView from django.contrib.auth.mixins import LoginRequiredMixin from rest_framework import permissions from rest_framework import view...
import numpy as np from phimal_utilities.data import Dataset from phimal_utilities.data.diffusion import DiffusionGaussian from phimal_utilities.data.burgers import BurgersDelta, BurgersCos, BurgersSawtooth from phimal_utilities.data.kdv import KdVSoliton x = np.linspace(-5, 5, 1000) t = np.linspace(0.0, 2.0, 100) x_...
from __future__ import division import numpy as np import matplotlib import scipy.integrate as sint import matplotlib.pyplot as plt import math import constants q = constants.cgs_constants['q'] c = constants.cgs_constants['c'] m_e = constants.cgs_constants['m_e'] m_p = constants.cgs_constants['m_p'] def compute_s...
# # Copyright (c) 2019 ISP RAS (http://www.ispras.ru) # Ivannikov Institute for System Programming of the Russian Academy of Sciences # # 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 # # h...
# Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserve. # # 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...
from uuid import uuid4 from django.contrib.contenttypes.models import ContentType from django.db import models from django.utils.functional import cached_property from django.utils.translation import gettext_lazy as _ from .mixins import MPAwareModel treebeard = True try: from treebeard.mp_tree import MP_Node e...
import numpy as np from keras.applications.inception_v3 import InceptionV3, decode_predictions def predict(image): model = InceptionV3() pred = model.predict(image) decoded_predictions = decode_predictions(pred, top=10) response = 'InceptionV3 predictions: ' + str(decoded_predictions[0][0:5]) p...
EMAIL_DOMAINS = [ '10minute-email.com', '10minutemail.co.uk', 'probl.info', 'fakemailgenerator.com', 'drdrb.net', 'armyspy.com', 'cuvox.de', 'dayrep.com', 'spam4.me' 'einrot.com', 'maildrop.cc', 'fleckens.hu', 'gustr.com', 'grr.la', 'jourrapide.com', 'rhyt...
import tables import nptdms import numpy as np import os from ecogdata.util import mkdir_p, Bunch import ecogdata.filt.time as ft import ecogdata.devices.electrode_pinouts as epins import ecogdata.parallel.sharedmem as shm from ecogdata.parallel.split_methods import filtfilt from ..units import convert_dyn_range, conv...
import pytest from ospweb.users.models import User from ospweb.users.tests.factories import UserFactory @pytest.fixture(autouse=True) def media_storage(settings, tmpdir): settings.MEDIA_ROOT = tmpdir.strpath @pytest.fixture def user() -> User: return UserFactory()
import json import os, subprocess, time, signal import gym from gym import error, spaces from gym import utils from gym.utils import seeding from pyrosetta.teaching import * from pyrosetta import init, pose_from_pdb, pose_from_sequence from pyrosetta.toolbox import cleanATOM from pyrosetta.rosetta.core.id import AtomID...
# -*- coding: utf-8 -*- import tensorflow as tf # 嵌入矩阵的维度 EMBED_DIM = 32 USER_ID_COUNT = 6041 GENDER_COUNT = 2 AGE_COUNT = 7 JOB_COUNT = 21 MOVIE_ID_COUNT = 3953 MOVIE_GENRES_COUNT = 18 MOVIE_TITLE_WORDS_COUNT = 5217 BATCH_SIZE = 256 LSTM_UNIT_NUM = 128 # 用户特征网络核心代码 def user_feature_network(user_id, user_gender...
class Infinite_memory(list): def __init__(self,*args): list.__init__(self,*args) def __getitem__(self, index): if index>=len(self): for _ in range((index-len(self))+1): self.append(0) return super().__getitem__(index) def __setitem__(self, key, value): ...
from __future__ import division from __future__ import print_function from __future__ import absolute_import from __future__ import unicode_literals import os import sys import argparse import numpy as np import pandas as pd from sklearn import linear_model, preprocessing, cluster import matplotlib.pyplot as plt im...
# -*- coding: utf-8 -*- # ------------------------------------------------------------------------------ # # Copyright 2018-2019 Fetch.AI Limited # # 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 ...
import autoarray as aa import numpy as np from autoarray.mock.mock import MockPixelizationGrid, MockRegMapper class TestRegularizationinstance: def test__regularization_matrix__compare_to_regularization_util(self): pixel_neighbors = np.array( [ [1, 3, 7, 2], ...
# Copyright 2018 Timothy M. Shead # # 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 writi...
# -*- coding: utf-8 -*- # Copyright (c) 2015, Metalcraft and contributors # For license information, please see license.txt from __future__ import unicode_literals import frappe from frappe.model.document import Document class QAP(Document): pass
"""Burn functionality.""" import datetime import pytest from ethereum.tester import TransactionFailed from web3.contract import Contract @pytest.fixture def token(chain, team_multisig): args = [ team_multisig, "Token", "TKN", 1000000, 0, int((datetime.datetime(2017...
from enum import Enum import re import secrets from app.config import oapi, nlp no_clone_replies = ['No clone Found.', 'E be like say clone no dey.', 'The tweet looks original.', 'Error 404: Clone not found.', 'No copies yet.', 'Nothing in sight.', 'I couldn\'t find clones.', ...
from typing import Dict from botocore.paginate import Paginator class DescribeSchedule(Paginator): def paginate(self, ChannelId: str, PaginationConfig: Dict = None) -> Dict: """ Creates an iterator that will paginate through responses from :py:meth:`MediaLive.Client.describe_schedule`. See...
# -*- coding: utf-8 -*- # Generated by Django 1.11.4 on 2018-01-25 07:18 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('landing', '0006_lead'), ] operations = [ migrations.AddField( m...
import math import numpy import scipy import glob import sys import os.path from scipy.spatial import distance #filename = str(kmer) + "_mercount_relative.txt" #files = [] #filename="4_mercount_relative.txt" #files=glob.glob("*filename") kmer=6 #[dist[:] for x in [[foo] * len(files)] * len(files)] #dist = [[[1 f...
# -*- coding: utf-8 -*- from .context import bot from bot.strategy import circle if __name__ == '__main__': bot.strategy.circle.test()
r""" Subcrystals These are the crystals that are subsets of a larger ambient crystal. AUTHORS: - Travis Scrimshaw (2013-10-16): Initial implementation """ #***************************************************************************** # Copyright (C) 2013 Travis Scrimshaw <tscrim at ucdavis.edu> # # Distribut...
import configparser import sys from datetime import datetime import requests from requests.auth import HTTPBasicAuth def help(): print('1.) configure something useful in application.properties \n' '2.) call with prometheusChamp <QUERY> <STARTISOTIME> <ENDISOTIME> <STEPINSECONDS>\n' ' exampl...
#!/usr/bin/env python3 # Copyright (c) 2019-2020 The Wazzle Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test label RPCs. RPCs tested are: - getaddressesbylabel - listaddressgroupings - setlabel "...
# -*- coding: utf-8 -*- ''' Routines to set up a minion ''' # Import python libs from __future__ import absolute_import, print_function, with_statement, unicode_literals import functools import os import sys import copy import time import types import signal import random import logging import threading import tracebac...
from xevo import evo import numpy as np import time import random from trivmute import * class trivmutetraj(trivmute): """trivmute, but for traj applications""" def __init__(s,forget=0): s.initial() s.forget=forget def generation(s)->None: os=s.q.strength() n=s.q.mutat...
from delphin_6_automation.database_interactions import mongo_setup from delphin_6_automation.database_interactions.auth import auth_dict from delphin_6_automation.database_interactions.db_templates import sample_entry, delphin_entry __author__ = "Christian Kongsgaard" __license__ = 'MIT' # ---------------------------...
import argparse import csv import sys from functools import partial import tensorflow as tf import tensorflow_text as text import yaml from ..configs import DataConfig, get_model_config from ..data import delta_accelerate, load_audio_file from ..models import LAS, DeepSpeech2 from ..search import DeepSpeechSearcher, ...
"""EML type utils This module works directly with EML XML objects in the lxml.etree domain, and so can be used without having an `rid`. """ import csv import datetime import enum import logging import re import dex.exc # This module should not require cache access and so, should not import `dex.eml_cache` # or `dex....
# Generated by Django 2.2.4 on 2019-09-02 18:43 from django.db import migrations class Migration(migrations.Migration): dependencies = [ ("bikesharing", "0011_auto_20190911_1936"), ] operations = [ migrations.AlterModelOptions( name="location", options={"get_latest_by": "rep...
import django_heroku import dj_database_url from meridien.settings.base import * # Static files STATIC_ROOT = 'static' # Security DEBUG = False SECRET_KEY = os.getenv('MERIDIEN_SECRET_KEY') # Database # https://docs.djangoproject.com/en/3.0/ref/settings/#databases DATABASES = dict() DATABASES['default'] = dj_da...
# Copyright (c) OpenMMLab. All rights reserved. import os import os.path as osp import platform import shutil import time import warnings import torch import mmcv from mmcv.runner.base_runner import BaseRunner from mmcv.runner.epoch_based_runner import EpochBasedRunner from mmcv.runner.builder import RUNNERS from mmc...
# encoding: utf-8 from sqlalchemy.orm import relation from sqlalchemy import types, Column, Table, ForeignKey, and_, UniqueConstraint from ckan.model import ( core, meta, types as _types, domain_object, vocabulary, extension as _extension, ) import ckan # this import is needed import ckan.mod...
# Copyright 2018 Yahoo Inc. # Licensed under the terms of the Apache 2.0 license. # Please see LICENSE file in the project root for terms. # Distributed MNIST on grid based on TensorFlow MNIST example from __future__ import absolute_import from __future__ import division from __future__ import nested_scopes from __fu...
from fastapi import APIRouter, Header, Query, Depends from application.controllers.courses_controller import * from application.controllers.users_controller import * from application.controllers.payments_controller import * from application.services.auth import auth_service from typing import Optional router = APIRout...
from __future__ import absolute_import, division, print_function, with_statement import os import sys import traceback from tornado.escape import utf8, native_str, to_unicode from tornado.template import Template, DictLoader, ParseError, Loader from tornado.test.util import unittest from tornado.util import u, Object...
""" # ex:ts=4:sw=4:sts=4:et # -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- # WSGI config for Toaster project. This module contains the WSGI application used by Django's development server and any production WSGI deployments. It should expose a module-level variable named ``application``. Django's ``r...
import os def limpar_tela(): os.system('cls' if os.name == 'nt' else 'clear')
import pygtrie import json import pickle category = json.load( open( "dumps/category.json", "r" ) ) trie = pygtrie.CharTrie() catMap = dict() idx = int(0) for data in category: description = data["description"] for word in description.split(): word = word.lower() trie[word] = True if c...
import logging import numpy as np import ray.ray_constants as ray_constants logger = logging.getLogger(__name__) class RayParams: """A class used to store the parameters used by Ray. Attributes: redis_address (str): The address of the Redis server to connect to. If this address is not ...
""" Runner script for visualisation. This can perform graphing of the neighbours with edge width in proportion to the attention coeffs, entropy histograms for the dist of attention weights, and then also plotting the normalised weights as a histogram. """ import argparse from torch_geometric.data import DataLoader fro...
import typing as t import os import requests import pandas as pd def assert_pvwatts_ready(): assert os.environ.get('PVWATTS_API_KEY') is not None, 'Missing PVWATTS_API_KEY envvar! Set it as envvar or into ' \ 'os.environ["PVWATTS_API_KEY"]!' def v6_1_kw...
# -*- coding: utf-8 -*- import os import time import numpy as np import matplotlib.pyplot as plt import matplotlib.animation as animation from PIL import Image VERSION = "1.1.4" def pull_screenshot(): os.system('adb shell screencap -p /sdcard/autojump.png') os.system('adb pull /sdcard/autojump.png .') def ju...
from __future__ import absolute_import from __future__ import print_function from __future__ import unicode_literals import codecs import json import logging import mimetypes import os import re import time import zipfile from collections import OrderedDict import html5lib from cheroot import wsgi from django.conf im...
import numpy as np import mne from warnings import warn from sarna.utils import group, _invert_selection, _transfer_selection_to_raw # from numba import jit def dB(x): return 10 * np.log10(x) # - [ ] add detrending (1 + x + 1/x) or FOOOF cooperation def transform_spectrum(spectrum, dB=False, normalize=False, de...
#!/usr/bin/env python3 # test_get_exclusions.py """ Test the glob/wildcard functions in xlattice/util.py """ import time import unittest from xlutil import get_exclusions, make_ex_re from rnglib import SimpleRNG class TestGetExclusions(unittest.TestCase): """ Test the glob/wildcard functions in xlattice/util.p...
# -*- coding: utf-8 -*- """best one.ipynb Automatically generated by Colaboratory. Original file is located at https://colab.research.google.com/drive/1be2MmgS_huYhmgc0tKhXGWBddmri8ClC """ import keras from keras.models import Sequential from keras.layers import Dense from keras.utils.np_utils import to_categori...
# Copyright 2013-2022 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) from spack.package import * class Capnproto(AutotoolsPackage): """Cap'n Proto is an insanely fast data interchange ...
# # This file is part of pyasn1-alt-modules software. # # Created by Russ Housley with assistance from asn1ate v.0.6.0. # Modified by Russ Housley to update the S/MIME Capabilities map. # Modified by Russ Housley to include the opentypemap manager. # # Copyright (c) 2019-2022, Vigil Security, LLC # License: http://vigi...
############################################################################## # # Copyright (c) 2015-2018 by The University of Queensland # http://www.uq.edu.au # # Primary Business: Queensland, Australia # Licensed under the Apache License, version 2.0 # http://www.apache.org/licenses/LICENSE-2.0 # # Development unt...
# -*- coding: utf-8 -*- """ TencentBlueKing is pleased to support the open source community by making 蓝鲸智云-节点管理(BlueKing-BK-NODEMAN) 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 ...
# -*- coding: utf-8 -*- from __future__ import absolute_import, print_function, unicode_literals from cms.sitemaps import CMSSitemap from django.conf import settings from django.conf.urls import include, url from django.contrib import admin from django.contrib.sitemaps.views import sitemap from django.contrib.staticfi...
#!/usr/bin/env python # Globally average the variance of CMIP5/AMIP mean-diurnal-cycle precipitation from a given month and range of years. # Square the standard deviatios before averaging over area, and then take the square root. This is the correct order of # operations to get the fraction of total variance, per Cov...
import copy import itertools import multiprocessing import pickle import threading import time from unittest.mock import Mock # NOQA from unittest.mock import patch import uuid import _pytest.capture import joblib import pandas as pd import pytest import optuna from optuna.testing.storage import StorageSupplier from...
#!/usr/bin/env python # encoding: utf-8 from __future__ import print_function """ hghooks """ import logging import os.path.join as pathjoin log = logging.getLogger('hghooks') def http_request(method="GET", url=None, body=None, headers=None, userna...
""" This file defines the common pytest fixtures used in current directory. """ from contextlib import contextmanager import json import pytest import subprocess import ray from ray.tests.cluster_utils import Cluster @pytest.fixture def shutdown_only(): yield None # The code after the yield will run as tear...
# read and write json files #pip3 install langdetect from pyspark.sql import SparkSession from pyspark.sql.functions import * from langdetect import detect from pyspark.sql.types import * import json spark = SparkSession.Builder().appName("json").master("local[2]").getOrCreate() sc = spark.sparkContext #data = jso...
# coding=utf-8 # *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** # *** 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, overload from .. import...
#!/usr/bin/python3 #-*-coding:utf-8-*- #$File: dataset.py #$Date: Sat May 7 10:59:24 2016 #$Author: Like Ma <milkpku[at]gmail[dot]com> import copy import random import numpy as np OUT_TYPE = np.float32 class Dataset(object): def __init__(self, path, _type): if _type == 'train': self.__file...
# coding: utf-8 """ Kubernetes No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 The version of the OpenAPI document: release-1.24 Generated by: https://openapi-generator.tech """ import pprint import re # noqa: F401 import si...
# # Collective Knowledge (individual environment - setup) # # See CK LICENSE.txt for licensing details # See CK COPYRIGHT.txt for copyright details # # Developer: Grigori Fursin, Grigori.Fursin@cTuning.org, http://fursin.net # import os ############################################################################## # ...
import os.path from mitmproxy import exceptions from mitmproxy import flowfilter from mitmproxy import io class FileStreamer: def __init__(self): self.stream = None self.active_flows = set() # type: Set[flow.Flow] def start_stream_to_path(self, path, mode, flt): path = os.path.expan...
EXPECTED_DAILY_RESOURCE_GENERATE_SAMPLES_QUERIES = """delimiter // DROP PROCEDURE IF EXISTS get_daily_samples; CREATE PROCEDURE get_daily_samples ( IN id INT, OUT entry0 FLOAT, OUT entry1 FLOAT, OUT entry2 FLOAT, OUT entry3 FLOAT, OUT entry4 FLOAT, OUT entry5 FLOAT, OUT entry6 ...
import numpy as np import pandas as pd # Test data download requirements: import requests import os URL_DATA = "https://raw.githubusercontent.com/open2c/cooltools/pileup-update/datasets/external_test_files.tsv" def assign_supports(features, supports, labels=False, suffix=""): """ Assign support regions to a ...
import random import sys import numpy as np import math import matplotlib.pyplot as plt import pandas as pd import matplotlib.dates as mdate from NormalizationUtils import * def generate_workload_by_point_dataset(input_path, output_path, lon_width, lat_width, time_width, sample_rate = 0.2): """ ge...