content
stringlengths
5
1.05M
# -*- coding: utf-8 -*- from __future__ import unicode_literals import hashlib import os from datetime import timedelta import numpy from PIL import Image, ImageDraw, ImageFont from crequest.middleware import CrequestMiddleware from django.conf import settings from django.contrib.auth.models import User from django....
from rest_framework.routers import DefaultRouter from app.api import views router = DefaultRouter(trailing_slash=False) router.register("users", views.UserViewSet, basename="user") urlpatterns = router.urls
# Generated by Django 2.2.17 on 2020-12-22 19:06 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('battles', '0002_auto_20201222_1644'), ] operations = [ migrations.AddField( model_name='battle', name='created_at',...
for testcase in range(int(input())): n = int(input()) dict = {} comb = 1 m = (10**9)+7 for x in input().split(): no = int(x) try: dict[no] = dict[no] + 1 except: dict[no] = 1 dict = list(dict.items()) dict.sort(key=lambda x: x[0], reverse=Tru...
"""This is a file for processing the data in the abdomenCT-1k dataset. Essentially the masks are in a .nii.gz format, and there is 1 mask for the whole CT scan. The mask is then processed and converted into a numpy array corresponding to each image in the CT scan. The numpy array follows the standard semantic segmenta...
#!/usr/bin/python3 ''' Copyright [02/2019] Vaclav Alt, [email protected] ''' import pandas as pd import sqlite3 as sq import csv import configparser, os, time, sys from datetime import datetime from math import isnan from shutil import copyfile from optmgr import OptMaster class SvodMaster: def __init_...
#!/usr/bin/env python import yaml from tabulate import tabulate from IPython import get_ipython from IPython.core.display import display, HTML def load_config(yamlfile): """load yaml to a dict""" with open(yamlfile, 'r') as stream: _dict = yaml.safe_load(stream) return _dic...
import re from time import perf_counter from unittest.mock import patch import pytest from stixcore.data.test import test_data from stixcore.idb.manager import IDBManager from stixcore.io.fits.processors import FitsL0Processor, FitsL1Processor from stixcore.io.soc.manager import SOCPacketFile from stixcore.products.l...
import socket def get_open_ports(target, port_range, verbose = False): open_ports = [] try: ip_addr = socket.gethostbyname(target) except: if target.replace('.', '').isnumeric(): return "Error: Invalid IP address" else: return "Error: Invalid hostname" try: hostname = socket.getho...
from __future__ import absolute_import, division, print_function, unicode_literals import logging import time from acc_utils.attrdict import AttrDict from acc_utils.errors import * from acc_utils.model_utils import * from config import cfg from generic_op import * class Stats(): def __init__(self): self...
# -*- coding: UTF-8 -*- # # ======================================================================= # # Copyright (C) 2018, Hisilicon Technologies Co., Ltd. All Rights Reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions ...
# -*- coding: utf-8 -*- # # 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 #...
"""Main module.""" import inspect import typing from datetime import date, datetime, time import graphene BASIC_TYPE_MAPPINGS = { str: graphene.String, int: graphene.Int, bool: graphene.Boolean, float: graphene.Float, date: graphene.Date, datetime: graphene.DateTime, time: graphene.Time, }...
import pytest import mock from elasticsearch_metrics import exceptions from elasticsearch_metrics.management.commands.check_metrics import Command from elasticsearch_metrics.registry import registry @pytest.fixture() def mock_check_index_template(): with mock.patch( "elasticsearch_metrics.metrics.Metric....
from django.conf.urls import url from .views import Home urlpatterns = [ url(r'^$', Home.as_view(), name='home'), ]
from flask import Flask, request, jsonify, send_from_directory from Models.hardware import Hardware from auth import Auth, User from database import init_db from Models.project import ProjectSchema, Project from auth import check_auth from os import environ from bson.objectid import ObjectId from dotenv import load_dot...
# -*- coding: utf-8 -*- """ @brief test log(time=4s) """ import os import unittest import numpy import pandas from pyquickhelper.pycode import ExtTestCase from pandas_streaming.df import dataframe_hash_columns class TestDataFrameHelpers(ExtTestCase): def test_hash_columns(self): df = pandas.DataFram...
import setuptools import mazikeen.version with open("README.rst", "r", encoding="utf-8") as fh: long_description = fh.read() with open("LICENSE", "r", encoding="utf-8") as fh: LICENSE = fh.read() setuptools.setup( name="mazikeen", version=mazikeen.version.__version__, author="Neaga Septimiu",...
""" 2.7 – Removendo caracteres em branco de nomes: Armazene o nome de uma pessoa e inclua alguns caracteres em branco no início e no final do nome. Lembre-se de usar cada combinação de caracteres, "\t" e "\n", pelo menos uma vez. """ nome = " \t Francisco \n" print(nome) # Usando lstrip() print(nome.rstrip()) # Usa...
from Prepocessing_word_char import Preprocess def main(input_dir: str, output_dir: str): preprocess = Preprocess() # Lines segmenting lines = preprocess.segment_all(input_dir) # Words segmenting words = preprocess.crop_word_from_line(lines) # Characters segmenting chars = preprocess.crop_...
import os from . import BaseCommand from ..i18n import _ class Command(BaseCommand): name = os.path.splitext(os.path.basename(__file__))[0] description = _('a complete list of group name aliases') quiet_fields = { 'aliasName': _('alias name'), 'groupName': _('group name'), } de...
from datetime import datetime, timedelta, time from typing import List, Dict, Any, Union, Set import firebase_admin from firebase_admin import firestore from google.cloud.firestore_v1 import Query from google.cloud.firestore_v1.document import DocumentSnapshot max_date = datetime(9999, 12, 30, 12, 0, 0) DailysData =...
result = first(lambda: "second")
import pytest import numpy as np from dltranz.data_load.iterable_processing.id_filter import IdFilter def get_data(id_type): return [{'client_id': id_type(i)} for i in range(1, 10)] def test_int(): i_filter = IdFilter('client_id', [1, 5, 9]) data = i_filter(get_data(int)) data = [x['client_id'] for...
from django.apps import AppConfig class AddressbookConfig(AppConfig): name = 'AddressBook'
""" Otter Service tornado server """ import os import json import yaml import hashlib import jwt import tornado.options import queries import stdio_proxy from io import BytesIO from datetime import datetime from binascii import hexlify from tornado.httpserver import HTTPServer from tornado.web import Application, Req...
# Generated by Django 3.1.3 on 2020-11-12 16:20 import ckeditor_uploader.fields from django.db import migrations, models class Migration(migrations.Migration): initial = True dependencies = [] operations = [ migrations.CreateModel( name="Event", fields=[ ...
from setuptools import setup setup( name = 'gym-nats', packages = ['gym_nats'], version = '0.1.2', license='MIT', description='OpenAI Gym environment interfacing with NATS.io', long_description = 'Implements an OpenAI gym environment using NATS.io. Using this environment, a reinforceme...
#!/usr/bin/env python3 import collections import os import json import unicodedata import sys import sqlite3 import re import operator VERSION = 1 MAX_RESULTS = 20 INDEX_FILE_NAME = os.path.expanduser( '~/Library/Caches/unicode_names.{0}.cache'.format( '.'.join(map(str, sys.version_info)) ) ) STOPW...
'''Server that echoes data back until there is no more.''' import sys, socket size, host, port = 1024, '', int(sys.argv[1]) s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s.bind((host, port)) s.listen(True) conn, addr = s.accept() print 'Connected by', addr result = '' while True: data = conn.recv(size) ...
import cv2 import numpy as np from matplotlib import pyplot as plt BLUE = [255,0,0] img1 = cv2.imread('image.png') replicate = cv2.copyMakeBorder(img1,10,10,10,10,cv2.BORDER_REPLICATE) reflect = cv2.copyMakeBorder(img1,10,10,10,10,cv2.BORDER_REFLECT) reflect101 = cv2.copyMakeBorder(img1,10,10,10,10,cv2.BORDER_RE...
import pandas as pd import numpy as np from sklearn import preprocessing from sklearn.preprocessing import StandardScaler import pickle cols = """ duration, protocol_type, service, flag, src_bytes, dst_bytes, land, wrong_fragment, urgent, hot, num_failed_logins, logged_in, num_compromised, root_shell, su_attempted...
#!/usr/bin/python # Simple demo of of the PCA9685 PWM servo/LED controller library. # This will move channel 0 from min to max position repeatedly. # Author: Tony DiCola # License: Public Domain from __future__ import division import time import sys import Adafruit_PCA9685# Import the PCA9685 module. import Adafruit_P...
from distutils.core import setup setup( name = 'config', version = "VERSION", packages = [''], )
from typing import Any import pytest from hw.vadim_maletski.func6 import level_06 from .common import azaza from .common import validate_data from .common import validate_errors happy_data = [ # noqa: ECE001 pytest.param(arg, expected, id=name) for name, (arg, expected) in { "empty-1": ("", {}), ...
import json import os import sys import time from queue import Queue, Empty from threading import Thread, Event import tensorflow as tf # Script used to evaluate the MaskRCNN ablation experiment # Requires https://github.com/matterport/Mask_RCNN if os.name == 'nt': COCO_MODEL_PATH = os.path.join('D:/Skola/PhD/co...
import iterm2 import os from datetime import datetime FILE = "/tmp/.pomoout" async def main(connection): component = iterm2.StatusBarComponent( short_description="Pomo Timer", detailed_description="Displays the contents of your pomo timer.", knobs=[], exemplar="🔥25m", upd...
import json from pathlib import Path def parse_config(parser, config_path, root=Path('config')): _config_path = root/config_path with open(_config_path) as f: configs = json.load(f) for k, v in configs.items(): if type(v) == dict: parser.set_defaults(**v) else: ...
from django_fortumo.settings.base import * FORTUMO_SECRET = 'bad54c617b3a51230ac7cc3da398855e' SECRET_KEY = '0_6iq7a%wez2ibbrt07#g&hj1v#pnt9)!^0t)sk3vy72)p%87@'
from keras.preprocessing.sequence import pad_sequences from keras.utils import to_categorical from sklearn.model_selection import train_test_split import os import dataFormat import filterData as fd import numpy as np import keras import wget import zipfile class Config(): def __init__(self, load=True): if...
from model.mapping.order import Order from model.dao.dao import DAO from model.dao.dao_error_handler import dao_error_handler from model.mapping.product import Product class OrderDAO(DAO): """ Order Mapping DAO """ # Get a specific order by its id @dao_error_handler def get(self, id): return ...
import pygame import sys import os import ftb_functions as fft from pygame.sprite import Sprite class Player(): """储存球员信息的类""" def __init__(self,screen): """储存一些基本信息""" self.screen = screen self.location = os.path.dirname(os.path.abspath(__file__)) + os.sep+'images'+os.sep+'player-s.pn...
from datetime import datetime from bamboo.lib.datetools import recognize_dates from bamboo.lib.schema_builder import DATETIME, SIMPLETYPE, Schema from bamboo.tests.test_base import TestBase class TestDatetools(TestBase): def setUp(self): TestBase.setUp(self) self.dframe = self.get_data('good_eat...
class Solution(object): def findSecretWord(self, wordlist, master): def pair_matches(a, b): # count the number of matching characters return sum(c1 == c2 for c1, c2 in zip(a, b)) def most_overlap_word(): counts = [[0 for _ in range(26)] for _ in range(6)] # co...
s = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyz_{}" def _l(idx, s): return s[idx:] + s[:idx] def decrypt(ct, k1, k2): s = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyz_{}" t = [[_l((i + j) % len(s), s) for j in range(len(s))] for i in range(len(s))] i1 = 0 i...
import re from os import listdir from os.path import join from django.test import TestCase from funfactory.manage import path class MigrationTests(TestCase): """Sanity checks for the SQL migration scripts.""" @staticmethod def _migrations_path(): """Return the absolute path to the migration scr...
# this is auto-generated by swagger-marshmallow-codegen from __future__ import annotations from marshmallow import ( Schema, fields, INCLUDE, ) import re from marshmallow.validate import Regexp from ._lazy import _usePet class Owner(Schema): id = fields.String(required=True, description='ObjectId', va...
class MinStack: def __init__(self): self.A = [] self.M = [] def push(self, x): self.A.append(x) M = self.M M.append( x if not M else min(x,M[-1]) ) def pop(self): self.A.pop() self.M.pop() def top(self): return self.A[-1] def getMin(se...
# Generated by Django 3.0.8 on 2020-07-18 05:54 import django.core.validators from django.db import migrations, models import django.utils.timezone import users.manager class Migration(migrations.Migration): initial = True dependencies = [ ('auth', '0011_update_proxy_permissions'), ] opera...
STATUS = {}
from keras.models import Sequential from keras.models import Model from keras.layers import Input from keras.layers import Dense from keras.layers import Flatten from keras.layers import Dropout from keras.layers import LSTM from keras.layers import Lambda from keras.layers.convolutional import Conv1D from keras.layers...
from django.contrib import admin from daterange_filter.filter import DateRangeFilter class Inline(admin.TabularInline): extra = 0 ordering = ['-created_date', 'name',] readonly_fields = ['created_date', 'last_update_date',] class ModelAdmin(admin.ModelAdmin): list_display = ('name', 'member', 'crea...
from django.http import JsonResponse from django.db.models import Avg, Count, Func from ..models import Movie, Rating, Comment def new_movie(request): if request.method != 'POST': pass # get movie id and title id = request.POST.get('id', '') title = request.POST.get('title', '') # save n...
import tensorflow as tf from tensorflow.python.tools import freeze_graph from tensorflow.tools.graph_transforms import TransformGraph import argparse def load_graph(checkpoint_path, mb, seq_len): init_all_op = tf.initialize_all_variables() graph2 = tf.Graph() with graph2.as_default(): with tf.Sessi...
Note: the data item is a tuple. 1) "Domain DS" For calculating the Domain: list(index: data_item) -> set(possible_values) Domain - -> For each data_item -> the set of possibilites of values 2) "Source List" For calculating alpha and p(C_wdv=1): 2d-List: list - -> DataItems/Sources as index -> se...
# -*- coding: utf-8 -*- """Function to increase the tracking column in a workflow.""" from typing import Dict, Optional from django.contrib.auth import get_user_model from django.core import signing from django.utils.translation import ugettext from ontask import models from ontask.dataops import sql class Execute...
# ****************************************************************************** # Copyright 2017-2018 Intel Corporation # # 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.apa...
""" Simulate strategic voters for point voter model. Types ----- Compromising ************ Voter insincerely ranks/rates an alternative higher in the hope of getting it elected. 1. Run honest election, determine top two candidates. 2. Throw maximum support behind preferred top candidate. Burying ********** Insin...
# -*- coding: utf-8 -*- # Python3.4* from Bot.Game import Piece class Parser: def __init__(self, game): self._game = game self._playerNames = [] def parse(self, line): parts = line.split() if parts[0] == 'settings': self.set(parts[1:]) eli...
import tensorflow as tf import os import pandas as pd import nltk import numpy as np from parametrs import * import time from collections import Counter import re def get_trainable_variables_num(): total_parameters = 0 for variable in tf.trainable_variables(): # shape is an array of tf.Dimension ...
import numpy as np from rlscore.utilities.reader import read_sparse from rlscore.utilities.cross_validation import map_ids def print_stats(): X_train = read_sparse("train_2000_x.txt") Y_train = np.loadtxt("train_2000_y.txt") ids = np.loadtxt("train_2000_qids.txt", dtype=int) folds = map_ids(ids) ...
''' The base Controller API Provides the BaseController class for subclassing. @author: carny ''' import logging from datetime import datetime import time from pylons import session from cyberweb import model from cyberweb.model import JobState from cyberweb.model.meta import Session log = logging.getLogger(...
import scipy as sp from scipy.optimize import minimize import time class SupportVectorMachine(object): def __init__(self, name="svm", debug=False): self.name = name self.training_data = None self.testing_data = None self.GramMatrix = None self.IsSet_GramMatrix = False ...
# OpenWeatherMap API Key weather_api_key = "" # Google API Key g_key = ""
import numpy as np import random class Genetic: def natural_selection(self, population): fitness_sum = sum([c.fitness for c in population]) selection_probes = [c.fitness / fitness_sum for c in population] parent = population[np.random.choice(len(population), p=selection_probes)] re...
# Copyright (C) 2020 GreenWaves Technologies, SAS # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # published by the Free Software Foundation, either version 3 of the # License, or (at your option) any later version. # This progr...
""" .. module: lemur.authorizations.models :platform: unix :copyright: (c) 2018 by Netflix Inc., see AUTHORS for more :license: Apache, see LICENSE for more details. .. moduleauthor:: Netflix Secops <[email protected]> """ from sqlalchemy import Column, Integer, String from sqlalchemy_utils import JSONType...
# Generated by Django 3.0.5 on 2020-05-20 00:43 from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('responder', '0002_responder_location'), ('reporter', '0015_auto_20200520_0035'), ] operations = [ migrations.RenameModel( old_na...
from aiohttp import web async def json(data, status=200, headers=None): response = web.json_response(data, status=status, headers=headers, content_type='application/json') return response async def raw_json(data, status=200, headers=None): response = web.Response(text=data, status=status, headers=header...
### This program has been is the manifestation of inspiration in some sense ### print("Welcome to \'GUESS WHAT?!\', version 1.1\n") guess = int(input("Please enter your \'GUESS WHAT?!\' value: ")) if(guess%2 == 0): print("\nEven Steven") else: print("\nOdd Nod")
import random # |> # #=====================================# # | Python Browser Compatibility Layer \ # \ Copyright 2016 © Sebastian Silva | # #====================================# # | <sebastian@fue...
#!/usr/bin/env python # # pytrader.py # # # Project page # https://github.com/jmkangkr/pyTrader # # To clone the project # git clone https://github.com/jmkangkr/pyTrader.git # # Please send bugs to # Jaemin Ka...
# -*- coding: utf-8 -*- # Copyright 2016 Mirantis, 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 requi...
# Generated by Django 3.0.5 on 2020-05-21 14:58 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('messdiener', '0010_auto_20200415_1445'), ] operations = [ migrations.CreateModel( name='Plan', ...
import torch import torch.nn as nn from torch.autograd import Variable import numpy as np inds = torch.LongTensor([0, -1, -2, -3, 1, 0, 3, -2, 2, -3, 0, 1, 3, 2, -1, 0]).view(4, 4) def hamilton_product(q1, q2): q_size = q1.size() # q1 = q1.view(-1, 4) # q2 = q2.view(-1, 4) q1_q2_prods = [] for i in range(4):...
import pandas as pd def __read_excel_file(filepath: str) -> pd.DataFrame: return pd.read_excel(filepath, index_col=None, header=None) def __remove_first_n_rows_from_df(df: pd.DataFrame, num_rows: int) -> pd.DataFrame: return df.iloc[num_rows:] def __get_col(df: pd.DataFrame, colNum: int): return df.iloc[...
import itertools import random import re import gspread import gspread.utils as utils from .test import I18N_STR, GspreadTest class WorksheetTest(GspreadTest): """Test for gspread.Worksheet.""" def setUp(self): super().setUp() self.spreadsheet = self.gc.open(self.get_temporary_spreadsheet_...
from sys import version_info if version_info[0] == 2: from urllib import quote, quote_plus, unquote, urlencode from urlparse import parse_qs, parse_qsl, urljoin, urlparse, urlunparse, ParseResult else: from urllib.parse import ( parse_qs, parse_qsl, quote, quote_plus, ...
# -*- coding: utf-8 -*- from django.contrib import admin from app_metrics.models import ( Metric, MetricSet, MetricItem, MetricDay, MetricWeek, MetricMonth, MetricYear, ) class MetricAdmin(admin.ModelAdmin): list_display = ("__str__", "slug", "num") list_filter = ["metric__name"] ...
from sklearn.datasets import make_classification from featureband.feature_band import FeatureBand from featureband.util.metrics_util import load_clf FINAL_CLASSIFIER = "knn" # ["knn", "logistic", "decision_tree"] selected_num = 10 x, y = make_classification(n_samples=10000, n_features=20, n_informative=10, ...
default_app_config = 'tg_utils.health_check.checks.phantomjs.apps.HealthCheckConfig'
from docx import Document from typing import List from .IngestorInterface import IngestorInterface from .QuoteModel import QuoteModel class DocxIngestor(IngestorInterface): """ A class that inherits from IngestorInterface and creates a list of quotes. ... Attributes ---------- path : str ...
retention_time_pipeline_parameters = { "model_params": {"seq_length": 30}, "data_params": { "seq_length": 30, }, "trained_model_path": "../pretrained_models/retention_time/example_rtmodel/", "trained_model_zipfile_name": "rtmodel.zip", "trained_model_stats": [0.0, 1.0], } retention_time...
import pytest from models.domain.resource_template import ResourceTemplate, ResourceType from models.schemas.workspace_template import WorkspaceTemplateInCreate @pytest.fixture def input_workspace_template(): return WorkspaceTemplateInCreate( name="my-tre-workspace", version="0.0.1", curr...
from sqlalchemy import Column, Integer, ForeignKey, UniqueConstraint, func, text, DECIMAL from sqlalchemy.dialects.mysql import JSON, TIMESTAMP, VARCHAR, TEXT, TINYINT from sqlalchemy.ext.declarative import declarative_base Base = declarative_base() created_at_default = func.current_timestamp() updated_at_default = fu...
# Copyright 2017 Google 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, ...
#!/usr/bin/env python3 import collections import itertools import json import random import tempfile import time import unittest import docker import mock from arvados_docker import cleaner MAX_DOCKER_ID = (16 ** 64) - 1 def MockDockerId(): return '{:064x}'.format(random.randint(0, MAX_DOCKER_ID)) def MockC...
import dash import dash_core_components as dcc import dash_html_components as html import pickle import subprocess from py_files import make_plots from py_files import data_prep_stack_barplots as prep import pandas as pd import plotly.express as px import plotly.graph_objects as go from qiime2.plugins import feature_...
__all__ = ['DesignerSandbox', ] from kivy.clock import Clock from kivy.lang import Builder from kivy.uix.sandbox import Sandbox, sandbox class DesignerSandbox(Sandbox): '''DesignerSandbox is subclass of :class:`~kivy.uix.sandbox.Sandbox` for use with Kivy Designer. It emits on_getting_exeption event ...
from optimModels.model.kineticModel import load_kinetic_model from optimModels.simulation.run import kinetic_simulation from optimModels.optimization.evaluation_functions import build_evaluation_function from optimModels.optimization.run import kinetic_strain_optim, cbm_strain_optim, gecko_strain_optim
from __future__ import absolute_import from __future__ import division from __future__ import print_function import io import json import os import xml.etree.ElementTree as ET from PIL import Image from collections import namedtuple import pandas as pd import tensorflow as tf from sklearn.model_selection import train...
# dataset distribution is specified by a distribution file containing samples import bpy import math import sys import os print(sys.path) import numpy as np import random import struct from numpy.linalg import inv from math import * import mathutils def camPosToQuaternion(cx, cy, cz): camDist = math.sqrt(cx * cx +...
from strongr.schedulerdomain.model import VmState from strongr.schedulerdomain.query import RequestScheduledJobs, RequestFinishedJobs, RequestJobInfo, FindNodeWithAvailableResources, RequestResourcesRequired, RequestVmsByState from strongr.core.exception import InvalidParameterException import re class QueryFactory:...
import os from pathlib import Path os.environ['PATH'] = str((Path(__file__).parent.parent.parent / "lib").resolve()) + os.pathsep + os.environ['PATH']
""" Configure a --skip-agent command line argument for py.test that skips agent- dependent tests. """ import pytest def pytest_addoption(parser): parser.addoption( "--skip-agent", action="store_true", help="run agent integration tests" ) def pytest_configure(config): config.addinivalue_line( ...
#!/usr/bin/env python # -*- coding: utf-8 -*- import json from alipay.aop.api.constant.ParamConstants import * from alipay.aop.api.domain.BusinessTime import BusinessTime class ServiceBusinessHours(object): def __init__(self): self._business_date = None self._business_time = None @property ...
#!/usr/bin/env python3 # -*- coding=utf-8 -*- import os, sys, argparse import math import numpy as np from tqdm import tqdm import torch import torch.nn as nn import torch.optim as optim import torch.utils.data as data from torch.utils.tensorboard import SummaryWriter from data import * from utils.augmentations impor...
def neighbord_analysis(x_as, column = 0): """ Given an array xas this function compute the distance between the elements the mean distance and the variance Author: Michele Monti Args: x_as: the name of the list or data set that you want: Kwargs: column: is the column of the data set that you need to ana...
# -*- coding: utf-8 -*- from ...register import Registry from ..aws_resources import AwsResourceSearcher class AwsResourceSearcherRegistry(Registry): def get_key(self, obj): """ :type obj: AwsResourceSearcher :rtype: str """ return obj.id aws_res_sr_registry = AwsResourc...
#!/usr/bin/env python # -*- coding: utf-8 -*- # https://funmatu.wordpress.com/2017/06/01/pyautogui%EF%BC%9Fpywinauto%EF%BC%9F/ import os import time import numpy as np import cv2 if (os.name == 'nt'): import win32gui import win32api import win32ui import win32con from PIL import Image class wi...