text
stringlengths
2
999k
import logging import re import time from datetime import datetime from django.conf import settings from django.contrib.auth.models import User from django.db import models from django.utils.translation import ugettext as _ from django.utils.translation import ugettext_lazy as _lazy from timezone_field import TimeZone...
# DEFAULT ROLES class ROLE: ADMIN = "admin" HOST = "host" # docker class DOCKER: DEFAULT_REMOTE_PORT = 4243
def main(): f = open('../../oldgit/covid_19_articles.sentences', 'r') while True: sentence_num = f.readline() sentences = [] for rows in range(int(sentence_num)): sentence = f.readline() br = f.readline() #print(sentence) #print(br) sentenc...
# automatically generated by the FlatBuffers compiler, do not modify # namespace: tflite import flatbuffers class Pool2DOptions(object): __slots__ = ['_tab'] @classmethod def GetRootAsPool2DOptions(cls, buf, offset): n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) x =...
#!/usr/bin/env python3 r""" Define the tally_sheet class. """ import sys import collections import copy import re try: from robot.utils import DotDict except ImportError: pass import gen_print as gp class tally_sheet: r""" This class is the implementation of a tally sheet. The sheet can be viewe...
import sys sys.path.insert(1,"../../../") import h2o import os from tests import pyunit_utils from h2o.estimators.glm import H2OGeneralizedLinearEstimator as glm # checking pr_plot when we have cross-validation enabled. def glm_pr_plot_test(): print("Testing glm cross-validation with alpha array, default lambda v...
# Author: Kay Hartmann <kg.hartma@gmail.com> import numpy as np def normalize_data(x: np.ndarray) -> np.ndarray: x = x - x.mean() x = x / x.std() return x
# Copyright (c) 2020 Julian Bernhard, Klemens Esterle, Patrick Hart and # Tobias Kessler # # This work is licensed under the terms of the MIT license. # For a copy, see <https://opensource.org/licenses/MIT>. import numpy as np import logging from bark.viewer import Viewer from bark.geometry import * from bark.models.d...
# -------------------------------------------------------- # Faster R-CNN # Copyright (c) 2015 Microsoft # Licensed under The MIT License [see LICENSE for details] # Written by Ross Girshick and Sean Bell # -------------------------------------------------------- from config import IM_SCALE import numpy as np # Veri...
# Copyright (C) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See LICENSE in the project root for information. import sys if sys.version >= "3": basestring = str from synapse.ml.core.schema.Utils import * from synapse.ml.recommendation._SARModel import _SARModel @inherit_doc cl...
""" tkcode.app module contains the main application class """ import os import tkinter as tk # observable model import tkcode.model # application settings import tkcode.settings # core components from tkcode.commander import Commander # register commands by importing decorated functions import tkcode.commands # ui...
# Generated by Django 2.0.5 on 2018-08-10 12:21 from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('team', '0116_auto_20180803_1211'), ('team', '0116_auto_20180726_1655'), ] operations = [ ]
# -*- coding: utf-8 -*- from charguana.cjk import * from charguana.chinese import * from charguana.perluniprops import * from charguana.thai import * from charguana.viet import * cjk_charsets = {'chinese': han_utf8, 'zh': han_utf8, 'cn': han_utf8, 'japanese': jap_utf8, 'ja': jap_utf8, 'jp': jap_utf8, ...
import logging import os import tempfile import uuid from datetime import datetime from pathlib import Path from typing import Union logger = logging.getLogger(__name__) def initialize_logging( log_dir: str = None, log_name: str = "meerkat.log", format: str = "[%(asctime)s][%(levelname)s][%(name)s:%(line...
#------------------------------------------# # Maths with numpy: # # Simple functions like +, -, /, * # # Linear algebra # # Statistics # #------------------------------------------# import numpy as np a = np.array([1,2,3,4]) # +,...
import numpy as np from setuptools import setup from setuptools import find_packages # VERSION = '0.22.0' # AUTHORS = 'Matthew Bourque, Misty Cracraft, Joe Filippazzo, Bryan Hilbert, ' # AUTHORS += 'Graham Kanarek, Catherine Martlin, Johannes Sahlmann, Ben Sunnquist' # DESCRIPTION = 'The James Webb Space Telescope Q...
# MegEngine is Licensed under the Apache License, Version 2.0 (the "License") # # Copyright (c) 2014-2021 Megvii Inc. All rights reserved. # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT ARRANTIES OR CONDITIONS OF ANY ...
from flask import Flask from flask_sqlalchemy import SQLAlchemy from flask_bootstrap import Bootstrap from config import config_options from flask_login import LoginManager from flask_uploads import UploadSet, configure_uploads, IMAGES from flask_wtf import CsrfProtect from flask_mail import Mail db = SQLAlchemy() boo...
__all__ = ['app'] from flask import request, Flask, jsonify, redirect from src.BusinessCentralLayer.setting import ROUTE_API from src.BusinessViewLayer.myapp.apis import * app = Flask(__name__) # =========================================================== # Public Interface # ======================================...
import ast from django.contrib.auth import authenticate, login, logout from django.contrib.auth.forms import AuthenticationForm, PasswordResetForm from django.contrib.auth.mixins import LoginRequiredMixin from django.shortcuts import render, redirect from django.views.generic import TemplateView from django.views impo...
# 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 import * class Xclip(AutotoolsPackage): """xclip is a command line utility that is designed to run on any...
import unittest from cloudwanderer import URN from ..helpers import CloudWandererCalls, ExpectedCall, MultipleResourceScenario, NoMotoMock, SingleResourceScenario class TestVpnGateways(NoMotoMock, unittest.TestCase): vpn_gateway_payload = { "State": "available", "Type": "ipsec.1", "VpcA...
# Copyright (c) BioniDL@SUSTECH. All Rights Reserved """ This is a demo to run effcientnet trained on waste sorting dataset on a test image paper.png Please download the pretrained weights and put it under ./weight folder before run the code """ from efficientnet_predictor import efficientnet import cv2 import numpy a...
from google.appengine.ext import ndb from protorpc import messages from google.appengine.ext.ndb import msgprop from csvmodel import CsvModel class Stop(CsvModel): class LocationType(messages.Enum): STOP = 0 STATION = 1 class WheelchairBoarding(messages.Enum): UNKNOWN = 0 POSSI...
# Copyright (c) 2010 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. { 'variables': { }, 'target_defaults': { 'conditions': [ ['OS!="win"', { 'defines': [ # For talloc 'HAVE_VA_C...
"""Implement unmasked linear attention as a recurrent cross attention module to speed up autoregressive decoding.""" import torch from torch.nn import Module from ....attention_registry import RecurrentCrossAttentionRegistry, Optional, Int, \ Callable, EventDispatcherInstance from ....events import EventDispatche...
import json import os from collections import OrderedDict from utils import codelist, loadJsonFile def pickone(nlsjson, sKey, tKey): sKeyList = sKey.split(">") tKeyList = tKey.split(">") sValue = getSValue(nlsjson,sKeyList) setTValue(nlsjson, tKeyList, sValue) def getSValue(nlsjso...
from banco import Banco import random class Respostas(object): def inserirNovaResposta(self, respostas): banco = Banco() conn = banco.conexao.cursor() conn.execute(f""" INSERT INTO respostas (resposta) VALUES ('{respostas}') """) banco.conexao.com...
# Generated by Django 3.1 on 2020-08-10 09:09 from django.db import migrations, models class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( name='Employee', fields=[ ('id', models.IntegerFiel...
# import pytest # import pandas as pd # import numpy as np # import pkg_resources, os # from io import StringIO # from epic.scripts.overlaps.overlaps import (_compute_region_overlap, # _create_overlap_matrix_regions) # from epic.config.genomes import (create_genome_size_...
#!/usr/bin/env python # This file is part of the pycalver project # https://gitlab.com/mbarkhau/pycalver # # Copyright (c) 2019 Manuel Barkhau (mbarkhau@gmail.com) - MIT License # SPDX-License-Identifier: MIT """ CLI module for PyCalVer. Provided subcommands: show, test, init, bump """ import sys import typing as typ ...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # flatlib documentation build configuration file, created by # sphinx-quickstart on Mon Apr 13 18:08:41 2015. # # This file is execfile()d with the current directory set to its # containing dir. # # Note that not all possible configuration values are present in this # au...
import random random.seed(1) companies = [] combinations = {'Web Developer' : ['Computer Science', 'Software Engineering',], 'Marketing Intern' : ['Business', 'Finance', 'Economics'], 'Software Developer' : ['Computer Science', 'Software Engineering'], 'Assistant Nu...
""" Copyright (c) 2021 Heureka Group a.s. 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 a...
import uuid import py from rply import ParserGenerator, Token from rply.errors import ParserGeneratorError from .base import BaseTests class TestParserGenerator(BaseTests): def test_production_syntax_error(self): pg = ParserGenerator([]) with py.test.raises(ParserGeneratorError): pg...
# -------------------------------------------------------------------------- # 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 may cause incor...
# coding: utf-8 """ GMO Aozora Net Bank Open API <p>オープンAPI仕様書(PDF版)は下記リンクをご参照ください</p> <div> <div style='display:inline-block;'><a style='text-decoration:none; font-weight:bold; color:#00b8d4;' href='https://gmo-aozora.com/business/service/api-specification.html' target='_blank'>オープンAPI仕様書</a></div><div sty...
import datetime import collections from djangomockingbird import queryset_utils # queryset that returns mock class objects class MockBaseQueryset(object): CHAINABLE_METHODS = [ "filter", "exclude", "prefetch_related", "order_by", "reverse", "distinct", "all...
""" Test settings for ORM Blog project. - Used to run tests fast on the continuous integration server and locally """ from .base import * # noqa # DEBUG # ------------------------------------------------------------------------------ # Turn debug off so tests run faster DEBUG = False # This needs to be enabled if ...
from django.shortcuts import render , redirect from django.core.paginator import Paginator from django import forms from .models import Video from django.http import HttpResponse, HttpResponseRedirect class videoForm(forms.Form): uploader = forms.CharField() imgpath = forms.ImageField() uppath = forms.Fi...
# -*-: coding utf-8 -*- """ Notification definition from a YAML config. """ # pylint: disable=too-few-public-methods class NotificationDef: """ Notification definition from a YAML config. """ def __init__(self, name, action): """ Initialisation. :param name: the name of the notification. ...
from __future__ import unicode_literals from django.db import models from django.utils import timezone from django.db.models import Q class Room(models.Model): name = models.TextField() label = models.SlugField(unique=True) locked = models.BooleanField(default=False) owner = models.CharField(max_leng...
# Сделайте ветку по шаблону name-surname-01-hello # Добавьте в программу код, который выводит фразу "I'm done!" # Запушьте ветку
"""Function for recording and reporting deprecations. Notes ----- this file is copied (with minor modifications) from the Nibabel. https://github.com/nipy/nibabel. See COPYING file distributed along with the Nibabel package for the copyright and license terms. """ import functools import warnings import re from insp...
# Aula 21 - 12-12-2019 # Cliente..... # Crie uma classe cliente. # Use os seguintes atributos: codigo cliente(int), nome, idade(int), telefone, email, endereço # Use o seguinte atributo de estado: crédito em R$, saldo R$, # cliente_devedor(True/False) # O atributo cliente_devedor ...
# coding=utf-8 # *** WARNING: this file was generated by crd2pulumi. *** # *** 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 __all__ = [ '...
# ===-- utils.py ---------------------------------------------------------===# # # This source file is part of the Swift.org open source project # # Copyright (c) 2014 - 2021 Apple Inc. and the Swift project authors # Licensed under Apache License v2.0 with Runtime Library Exception # # See https:#swift.org/LICENSE.txt...
import torch import random import numpy as np from PIL import Image import math import torch.nn.functional as F def crop(vid, i, j, h, w): return vid[..., i:(i + h), j:(j + w)] def center_crop(vid, output_size): h, w = vid.shape[-2:] th, tw = output_size i = int(round((h - th) / 2.)) j = int(rou...
import tkinter from tkinter import * from tkinter import messagebox from TextModified import TextModified from DialogueData import Page from Content import Content # TODO Text box right click # TODO Text box copy paste _WRAP_WIDTH = 37 # From the game _WRAP_HEIGHT = 7 # From the game _BUTTON_WIDTH = 5 # Width of butt...
import os import time from random import random import datetime import tensorflow as tf from utils.input_helpers import InputHelper from siamese_network import SiameseNet from utils.modules import AdamWeightDecayOptimizer os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2' tf.flags.DEFINE_integer("embedding_dim", 64, "Dimensi...
# https://www.hackerrank.com/challenges/one-week-preparation-kit-tree-huffman-decoding/problem import queue as Queue cntr = 0 class Node: def __init__(self, freq, data): self.freq = freq self.data = data self.left = None self.right = None global cntr self._count = ...
# Generated by Django 3.2 on 2021-05-21 10:46 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('tweetes_app', '0001_initial'), ] operations = [ migrations.AddField( model_name='tweet', name='unique_id', ...
# first run /usr/lib/openoffice.org/program/soffice -silent -invisible -accept="socket,port=8100;urp;" from OOoLib import * import os cSourceFile = os.path.abspath('test.doc') cSourceURL = pathnameToUrl( cSourceFile ) cTargetFile = os.path.abspath('test.pdf') cTargetURL = pathnameToUrl( cTargetFile ) oDoc = openURL( cS...
from .metrics import RETRY_HANDLER_DROP from .metrics import RETRY_HANDLER_FORWARD from .metrics import RETRY_HANDLER_RAISE from .metrics import RETRY_POLICY from .metrics import RETRY_POLICY_TIME from abc import ABC from aiokafka.structs import ConsumerRecord from datetime import datetime from pydantic import BaseMode...
# Copyright (c) 2011 Intel Corporation # Copyright (c) 2011 OpenStack, 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/l...
# Generated by Django 3.2.8 on 2021-11-29 14:33 from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('student', '0020_thesorting'), ] operations = [ migrations.RemoveField( model_name='classroom', name='class_The_sorting', ...
#!/usr/bin/env python # encoding: utf-8 from werobot.session import SessionStorage from werobot.utils import json_loads, json_dumps from DjangoBlog.utils import cache class MemcacheStorage(SessionStorage): def __init__(self, prefix='ws_'): self.prefix = prefix self.cache = cache @property ...
# (C) Datadog, Inc. 2020-present # All rights reserved # Licensed under a 3-clause BSD style license (see LICENSE) from codecs import open # To use a consistent encoding from os import path from setuptools import setup HERE = path.dirname(path.abspath(__file__)) # Get version info with open(path.join(HERE, 'datadog...
# Advent of Code 2020 - Day 9 - Encoding Error - Part 2 # https://adventofcode.com/2020/day/9 import sys from day09_part1 import parse_input, find_invalid_number def find_contiguous_set(numbers, target): for start in range(0, len(numbers) - 2): for stop in range(start, len(numbers) - 1): candi...
from django.urls import path, include from rest_framework.routers import DefaultRouter from .viewsets import ( CountryViewSet, CategoryViewSet, ItemVariantViewSet, ReviewViewSet, ItemViewSet, ) router = DefaultRouter() router.register("country", CountryViewSet) router.register("itemvariant", ItemVa...
from contextlib import ContextDecorator from gcloudc.db.backends.datastore import caching class DisableCache(ContextDecorator): def __enter__(self): self.context = caching.get_context() self.context.context_enabled = False return self def __exit__(self, *args, **kwargs): self...
import pickle import pytest from pydantic import BaseModel class Model(BaseModel): a: float b: int = 10 def test_simple_construct(): m = Model.construct(dict(a=40, b=10), {'a', 'b'}) assert m.a == 40 assert m.b == 10 def test_construct_missing(): m = Model.construct(dict(a='not a float')...
import json import logging import re import time from json import JSONDecodeError from typing import Optional, Tuple, Dict, Any from requests import HTTPError, Response from importer import JSON from importer.functions import requests_get from importer.models import CachedObject logger = logging.getLogger(__name__)...
# Generated by Django 3.0.7 on 2020-07-03 18:21 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('websites', '0026_auto_20200630_2307'), ] operations = [ migrations.AlterField( model_name='websites', name='is_activ...
""" Django settings for mysite project. Generated by 'django-admin startproject' using Django 1.8.2. For more information on this file, see https://docs.djangoproject.com/en/1.8/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.8/ref/settings/ """ # Build paths...
import FWCore.ParameterSet.Config as cms from L1Trigger.TrackTrigger.TrackTrigger_cff import * from SimTracker.TrackTriggerAssociation.TrackTriggerAssociator_cff import * from L1Trigger.TrackerDTC.ProducerED_cff import * from L1Trigger.TrackFindingTracklet.L1HybridEmulationTracks_cff import * L1TrackTrigger=cms.Sequ...
import os from setuptools import setup with open(os.path.join(os.path.dirname(__file__), 'README.rst')) as readme: README = readme.read() # allow setup.py to be run from any path os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir))) PROJECT_NAME = 'payu' data_files = [] for dirpath, dirn...
# -*- coding: utf-8 -*- __version__ = "0.9.9" from .orm import Model, SoftDeletes, Collection, accessor, mutator, scope from .database_manager import DatabaseManager from .query.expression import QueryExpression from .schema import Schema from .pagination import Paginator, LengthAwarePaginator
from dataclasses import dataclass from bxcommon.models.serializeable_enum import SerializeableEnum class NodeEventType(SerializeableEnum): PEER_CONN_ERR = "PEER_CONN_ERR" PEER_CONN_ESTABLISHED = "PEER_CONN_ESTABLISHED" PEER_CONN_CLOSED = "PEER_CONN_CLOSED" ONLINE = "ONLINE" OFFLINE = "OFFLINE" ...
import sys from pathlib import Path import argparse import os import re import json from typing import Dict, Optional, Union, Tuple, cast import xml from xml.dom.minidom import parseString import pkg_resources from pyreball.constants import ( PATH_TO_CONFIG_LOCATION, DEFAULT_PATH_TO_CONFIG, STYLES_TEMPLAT...
import torch import torch.nn as nn import torch.nn.parallel import torch.optim import torch.utils.data import torchvision.models as models import torchwordemb from args import get_parser # ============================================================================= parser = get_parser() opts = parser.parse_args() # #...
#!/usr/bin/env python3 import os import sys import time import torch import logging import argparse import numpy as np import pandas as pd import seaborn as sns import os.path as osp import torch.nn as nn import torch.utils.data as data import torch.optim as optim import matplotlib.pyplot as plt import torch.backends....
import unittest import os from inspect import cleandoc from typing import Any, List from hstest.check_result import CheckResult from hstest.stage_test import StageTest from hstest.test_case import TestCase from hstest.test_run import TestRun class TestCurrTestCase(StageTest): tc_1 = None tc_2 = None def...
# This file is dual licensed under the terms of the Apache License, Version # 2.0, and the BSD License. See the LICENSE file in the root of this repository # for complete details. import binascii import os import struct import pytest from cryptography.hazmat.backends.interfaces import CipherBackend from cryptograph...
class DataPreparator: """A class used to wrap functions necessary for preparing data for transmission along the TCP sockets The TCP server will call the 'convert()' method that must return a bytes object of the correct format for transmission""" def __init__(self, data=None, encoding: str = 'utf-8'):...
"""Download""" import subprocess from src.helpers import logger LOG = logger.getLogger(__name__) def run(settings: dict): """Download""" sequences_file = settings['downloads']['sequences'] LOG.info(f"Downloading {sequences_file}") subprocess.run([ 'wget', '-q', sequences_file...
"""Realtime rate limiting tests.""" import sched import threading import time import pytest from pytest import approx from redbucket import (InMemoryRateLimiter, RedisScriptRateLimiter, RedisTransactionalRateLimiter, RateLimit, Zone) @pytest.fixture def in_memory_rate_limiter(): return I...
# Copyright (c) 2014 Hitachi Data Systems, 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 # # Unle...
"""Tests for batch_encoder.py.""" import os import unittest from bfv.batch_encoder import BatchEncoder from bfv.bfv_parameters import BFVParameters from util.plaintext import Plaintext from util.random_sample import sample_uniform TEST_DIRECTORY = os.path.dirname(__file__) class TestBatchEncoder(unittest.TestCase):...
import argparse import math import os import random import shutil import time from collections import OrderedDict from copy import deepcopy import numpy as np import torch.backends.cudnn as cudnn import torch.optim as optim from torch.optim.lr_scheduler import LambdaLR from torch.utils.data import DataLoader, RandomSa...
import asyncio import concurrent import logging from concurrent.futures.thread import ThreadPoolExecutor from pathlib import Path from typing import Callable, Dict, List, Optional, Set, Tuple from blspy import G1Element import flora.server.ws_connection as ws # lgtm [py/import-and-import-from] from flora.consensus.c...
import pytest import skil def test_experiment_serde(): exp = skil.Experiment(name='foo') exp.save('exp.json') recov = skil.Experiment.load('exp.json') assert recov.get_config() == exp.get_config() def test_experiment_serde_yaml(): exp = skil.Experiment(name='foo') exp.save('exp.yml', file_...
from django.conf.urls import url from . import views app_name = 'polls' urlpatterns = [ url(r'^$', views.IndexView.as_view(), name='index'), url(r'^(?P<pk>[0-9]+)/$', views.DetailView.as_view(), name='detail'), url(r'^(?P<pk>[0-9]+)/results/$', views.ResultsView.as_view(), name='results'), url(...
# -*- coding: utf-8 -*- ################################################ # # URL: # ===== # https://leetcode.com/problems/unique-binary-search-trees-ii/ # # DESC: # ===== # Given an integer n, generate all structurally unique BST's (binary search trees) that store values 1 ... n. # # Example: # Input: 3 # Output: # [ ...
""" WSGI config for cplugbackend project. It exposes the WSGI callable as a module-level variable named ``application``. For more information on this file, see https://docs.djangoproject.com/en/1.11/howto/deployment/wsgi/ """ import os from django.core.wsgi import get_wsgi_application os.environ.setdefault("DJANGO...
# Copyright (c) 2016 by Kaminario Technologies, Ltd. # 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 # #...
import asyncio import dataclasses import logging import multiprocessing from concurrent.futures.process import ProcessPoolExecutor from enum import Enum from typing import Any, Callable, Dict, List, Optional, Set, Tuple from stor.consensus.block_header_validation import validate_finished_header_block, validate_unfinis...
version = "0.117.0" import atexit import datetime import logging import os import random import signal import time from instabot import utils # from instabot.api.api import API from ..api import API from .state.bot_state import BotState from .state.bot_cache import BotCache from .bot_archive import archive, archive_...
# coding: utf-8 # Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved. # This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may c...
from .tqdm import stdout_to_tqdm from .image import crop_image, not_crop_but_resize from .image import color_jittering_, lighting_, normalize_ from .transforms import get_affine_transform, affine_transform, fliplr_joints
import numpy as np import cv2 import matplotlib.pyplot as plt from sklearn.cluster import Birch from iDetection import * ## Imagen Original PATH = "../data/JPEG/" image = cv2.imread(PATH+'IMG_2465.jpg') print('Tamaño original : ', image.shape) scale_percent = 50 width = int(image.shape[1] * scale_percent / 100) ...
# 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! *** # Export this package's modules as members: from .default_kms_key import * from .encryption_by_default import * from .get_default_kms_k...
##*** ##class Base: ## def methodBase(self): ## print("In base class") ##class child(Base): ## def methodchild(Base): ## print("In child class") ##c1=child() ##c1.methodBase() ##c1.methodchild() ##*** ##class Base: ## def ___init__(self): ## print('base') ##class child(Base): ## pass ...
""" A Cython plugin for coverage.py Requires the coverage package at least in version 4.0 (which added the plugin API). """ from __future__ import absolute_import import re import os.path import sys from collections import defaultdict from coverage.plugin import CoveragePlugin, FileTracer, FileReporter # requires ...
#TODO: Fill out with same behavior as run-model.js
"""Context parser that returns a dictionary from a key-value pair string. Takes list of key=value pair string and returns a dictionary where each pair becomes a dictionary element. Don't have spaces in your values unless your really mean it. "k1=v1 ' k2'=v2" will result in a context key name of ' k2' not 'k2'. So cl...
# coding: utf-8 from flask import Flask,request,session,g,redirect,url_for,Blueprint from flask import abort,render_template,flash from helpers import getAvatar #from .base import BaseHandler import os import time import cPickle import datetime import logging import werkzeug import optparse import numpy as np import ...
from load_anchors import AnchorList def find_primary_ds(al_filtered, num_top, alltop=False, run_until=10, shift=0, get_size=False): ht = {} max_keys = [0, ] max_cnts = [1,] for x, y in al_filtered.anchors(): d = x - y key = str(((d >> shift) << shift)) if key in ht: ...
# Copyright 2019, A10 Networks # # 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...
# -------------------------------------------------------- # Fast R-CNN # Copyright (c) 2015 Microsoft # Licensed under The MIT License [see LICENSE for details] # Written by Ross Girshick # -------------------------------------------------------- """Blob helper functions.""" import numpy as np import cv2 def im_lis...