text
stringlengths
2
999k
# Here 's some new strange stuff, remember type it exactly days = "Mon Tue Wed Thu Fri Sat Sun" months = "Jan\nFeb\nMar\nApr\nMay\nJun\nJul\nAug" print "Here are the days :",days print "Here are the months:",months print """ There's something going on here. With the three double-quotes. We'll be able to type as much...
''' This code is released under MIT license ''' def code_to_char(code): code_char_mapping_string="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ" return code_char_mapping_string[code] def char_to_code(char): if len(char)==1: code_char_mapping_string="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ" retur...
import torch if __name__ == "__main__": a = torch.arange(15).reshape((3, 1, 5)) b = torch.arange(30).reshape((3, 2, 5)) print("a:\n", a) print() print("b:\n", b) print() # to trigger broadcasting mechanism, one of a or b is 1, and other axes size are equal print("a+b:\n", a + b)
import numpy as np import torch import torch.nn as nn import torch.nn.functional as F import torch.optim as optim from torch.optim.optimizer import Optimizer def policy_kl(p0_mu, p0_sigma, p1_mu, p1_sigma, reduce=True): c1 = torch.log(p1_sigma/p0_sigma + 1e-5) c2 = (p0_sigma**2 + (p1_mu - p0_mu)**2)/(2.0 * (p1...
from unittest.mock import patch, Mock from django.test import TestCase, override_settings from django.core.management import call_command from solo_rog_api.management.commands import populate_fake from solo_rog_api.models import ( User, Address, Part, SuppAdd, SubInventory, Locator, Document...
""" all filters and the data types of their input """ # used with get_mentions() in queries/groups and with filters in rules params = { "author": str, "xauthor": str, "exactAuthor": str, "xexactAuthor": str, "authorGroup": list, # user passes in a string which gets converted to a list of ids "x...
from pytest import approx from vyperdatum.points import * from vyperdatum.vdatum_validation import vdatum_answers gvc = VyperCore() data_folder = os.path.join(os.path.dirname(os.path.dirname(__file__)), 'data') vdatum_answer = vdatum_answers[gvc.vdatum.vdatum_version] def test_points_setup(): # these tests assu...
from datetime import timedelta def add_gigasecond(date): return date + timedelta(0, 10**9)
import sys sys.path.append('../src') import data_io, params, SIF_embedding # input wordfile = '/home/diego/DATA/NLP/vectors.txt' # word vector file, can be downloaded from GloVe website weightfile = '/home/diego/DATA/NLP/vocab.txt' # each line is a word and its frequency weightpara = 1e-3 # the parameter in the...
""" Dummy conftest.py for flask. If you don't know what this is for, just leave it empty. Read more about conftest.py under: - https://docs.pytest.org/en/stable/fixture.html - https://docs.pytest.org/en/stable/writing_plugins.html """ # import pytest
#!/usr/bin/env python # # Use the raw transactions API to spend goldbits received on particular addresses, # and send any change back to that same address. # # Example usage: # spendfrom.py # Lists available funds # spendfrom.py --from=ADDRESS --to=ADDRESS --amount=11.00 # # Assumes it will talk to a goldbitd or Gol...
from __future__ import absolute_import, division #makes KratosMultiphysics backward compatible with python 2.6 and 2.7 import time as timer import os import KratosMultiphysics as Kratos import KratosMultiphysics.ExternalSolversApplication import KratosMultiphysics.FluidDynamicsApplication import KratosMultiphysics.St...
import tensorflow as tf import analytic_functions import residuals def get_tensors_from_batch(X, y_pred, y_real, num_inputs, num_outputs, num_conditions, num_feval): """Given the minibatches, retrieve the tensors containing the original point, the points+-deltas and boundary conditions""" X_batches = [] y...
"""authentication URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/3.1/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') Clas...
# Copyright 2015 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 # Copyright 2021 The Uncertainty Baselines 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 ap...
"""RP To-Do entry point script.""" # rptodo/__main__.py # -*- coding: utf-8 -*- from __future__ import (division, absolute_import, print_function, unicode_literals) from rptodo import cli, __app_name__ def main(): cli.app(prog_name=__app_name__) if __name__ == '__main__': main()
from abc import ABCMeta, abstractmethod from collections import OrderedDict import torch import torch.distributed as dist import torch.nn as nn import torch.nn.functional as F from mmcv.runner import auto_fp16 from .. import builder class BaseRecognizer(nn.Module, metaclass=ABCMeta): """Base class for recognize...
import cudamat as cm import gpu_lock2 as gpu_lock import h5py import sys import os import numpy as np import matplotlib.pyplot as plt plt.ion() from time import sleep import pdb import datetime import time import config_pb2 from google.protobuf import text_format class Param(object): def __init__(self, w, config=Non...
from ber_public import cli def test_cli_template(): assert cli.cli() is None
# AUTOGENERATED! DO NOT EDIT! File to edit: 00_hagerstrand.ipynb (unless otherwise specified). __all__ = ['Diffusion', 'SimpleDiffusion', 'AdvancedDiffusion'] # Cell import sys from random import randint from random import uniform import numpy as np from scipy.spatial.distance import cdist from skimage import data, i...
"""Utilities for managing IMAP searches.""" import re from abc import abstractmethod, ABCMeta from datetime import datetime from typing import AnyStr, FrozenSet, Optional, Iterable from typing_extensions import Final from .exceptions import SearchNotAllowed from .interfaces.message import MessageInterface from .parsi...
#!/usr/bin/env python # # Electrum - lightweight Electrum client # Copyright (C) 2015 Thomas Voegtlin # # 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 withou...
import logging import os import shutil import regex from curation_utils.file_helper import get_storage_name from doc_curation.md import content_processor from doc_curation.md.file import MdFile from indic_transliteration import sanscript def ensure_ordinal_in_title(dir_path, transliteration_target=sanscript.DEVANAG...
from .particlefilter import ParticleFilter
from collections import defaultdict from typing import Any, Dict, List, Sequence from multiaddr import Multiaddr from libp2p.crypto.keys import KeyPair, PrivateKey, PublicKey from .id import ID from .peerdata import PeerData, PeerDataError from .peerinfo import PeerInfo from .peerstore_interface import IPeerStore ...
from dataclasses import dataclass, field from typing import Optional __NAMESPACE__ = "NISTSchema-SV-IV-atomic-integer-maxExclusive-5-NS" @dataclass class NistschemaSvIvAtomicIntegerMaxExclusive5: class Meta: name = "NISTSchema-SV-IV-atomic-integer-maxExclusive-5" namespace = "NISTSchema-SV-IV-ato...
import nuke import contextlib from avalon import api, io from pype.api import get_current_project_settings from pype.hosts.nuke.api.lib import ( get_imageio_input_colorspace ) @contextlib.contextmanager def preserve_trim(node): """Preserve the relative trim of the Loader tool. This tries to preserve the...
#!/usr/bin/env python3 """Runs `flake8`.""" import os import subprocess import sys WORKING_DIR = os.path.realpath(os.path.join(os.path.dirname(__file__), '../')) FLAKE8_COMMAND = [sys.executable, '-m', 'pytest', '-v', '--flake8', '-m', 'flake8'] def main(): """Main script function.""" os...
#!/usr/bin/env python """Main module.""" import re from .vorwahlen import vorwahlen def split(number): """Returns (prefix, area, number)""" nr_ = re.sub("[^0-9+]", "", number) if nr_.startswith("+49"): nr_ = nr_[3:] elif nr_.startswith("00"): nr_ = nr_[4:] # it COULD have bee...
# pylint: disable-msg=E1101,W0612 import operator import pytest from numpy import nan import numpy as np import pandas as pd from pandas import Series, DataFrame, bdate_range, Panel from pandas.errors import PerformanceWarning from pandas.core.indexes.datetimes import DatetimeIndex from pandas.tseries.offsets import...
# -*- coding: utf-8 -*- """ @author: abhilash """ import numpy as np import cv2 #get the saved video file as stream file_video_stream = cv2.VideoCapture('images/testing/video_sample.mp4') #create a while loop while (file_video_stream.isOpened): #get the current frame from video stream ret,c...
#recursive factorial def factorial(n): if (n == 0): return 1 else: return n * factorial(n - 1) #iterative factorial def factorial(n): total = 1 for i in range(1,n+1,1): total *= i return total #recursive greatest common divisor def gcd(a,b): if (b == 0): return ...
"""Tests for the ``utils`` module.""" from datetime import datetime from aiofacepy import ( get_application_access_token, get_extended_access_token, GraphAPI ) from mock import patch from nose.tools import ( assert_equal, assert_raises, with_setup ) mock_request = None patch = patch('requests...
# -*- coding: utf-8 -*- """ All of our extensions are initialized here. They are registered in app.py:register_extensions upon app creation """ from flask.ext.sqlalchemy import SQLAlchemy db = SQLAlchemy() from flask.ext.migrate import Migrate migrate = Migrate() from flask.ext.debugtoolbar import DebugToolbarExtensi...
""" Prediction of Users based on Tweet embeddings. """ import pickle import numpy as np from sklearn.linear_model import LogisticRegression from .models import User from .twitter import BASILICA def predict_user(user1_name, user2_name, tweet_text, cache=None): """Determine and return which user is more likely to s...
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2011 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Copyright 2011 Nebula, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # no...
""" Copyright 2020 The OneFlow Authors. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed...
from __future__ import unicode_literals import base64 import re import datetime from moto.core import BaseBackend, BaseModel from moto.core.exceptions import AWSError from moto.ec2 import ec2_backends from moto import settings from .utils import make_arn_for_certificate import cryptography.x509 import cryptography.h...
''' These transforms fix known bugs in the egosoft MD scripts. ''' import xml.etree.ElementTree as ET from .Support import XML_Find_Match, XML_Find_All_Matches, Make_Director_Shell from . import Support # TODO: move xml functions to another module. from ... import File_Manager ''' TODO: New Home (tc plots for ap) ...
from maingui import main main()
from django.urls import path from . import views from .views import CustomLoginView,RegisterPage from django.contrib.auth.views import LogoutView urlpatterns = [ path('login/', CustomLoginView.as_view(), name='login'), path('logout/', LogoutView.as_view(next_page='login'), name='logout'), path('register/'...
import re import typing import pytest from dagster import ( Any, DagsterInvalidConfigDefinitionError, DagsterInvalidConfigError, DagsterInvalidDefinitionError, Field, Float, Int, List, ModeDefinition, Noneable, Permissive, PipelineDefinition, ResourceDefinition, ...
import tensorflow as tf from openrec.legacy.modules.interactions import Interaction class NsLog(Interaction): def __init__( self, user, max_item, item=None, item_bias=None, p_item=None, p_item_bias=None, neg_num=5, n_item=None, ...
import tensorflow as tf from tensorflow.keras.layers import Input, Dense, BatchNormalization, Conv2D, MaxPool2D, GlobalMaxPool2D, Dropout from tensorflow.keras.optimizers import SGD from tensorflow.keras.models import Model from tensorflow.keras import layers, models from ai_config import * def new_model(): input...
""" Global attention takes a matrix and a query vector. It then computes a parameterized convex combination of the matrix based on the input query. H_1 H_2 H_3 ... H_n q q q q | | | | \ | | / ..... \ | / ...
#!/usr/bin/env python3 # Copyright (c) 2015-2017 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test bitcoind with different proxy configuration. Test plan: - Start supernodecoind's with different p...
import os SETTINGS = { "INFO": { "name": "Emotion", "info": "The image micro-service", "version": "1.0.0", }, "CASSANDRA": { "HOST": ["localhost", ], "KEYSPACE": "emotion", }, "BASE_URL": "http://localhost:5000", "UPLOAD_FOLDER": os.path.basename('uploa...
from django.apps import AppConfig class AbesitConfig(AppConfig): name = 'abesit'
import numpy as np import pandas as pd import matplotlib.pyplot as plt from get_data import MasterData from get_data import my_grid_search from sklearn.preprocessing import MinMaxScaler from sklearn.neural_network import MLPRegressor from sklearn.metrics import mean_squared_error md = MasterData('Boston') scaler = Mi...
from django.db import models from users.models import CustomUser from classes.models import Classroom from materials.models import Materials import os class ReadingTime(models.Model): id = models.AutoField(primary_key = True) classroom = models.ForeignKey(Classroom, on_delete = models.CASCADE) student = ...
# -*- coding: utf-8 -*- """ A module containing all code for working with Clipboard """ from collections import OrderedDict from nodeeditor.node_graphics_edge import QDMGraphicsEdge from nodeeditor.node_edge import Edge import keyboard DEBUG = False DEBUG_PASTING = False class SceneClipboard(): """ Class c...
# Copyright (c) 2018-2021 Patricio Cubillos. # bibmanager is open-source software under the MIT license (see LICENSE). __all__ = [ 'browse', ] import re import os from asyncio import Future, ensure_future import io from contextlib import redirect_stdout import textwrap import webbrowser from prompt_toolkit impo...
largura = 17 Altura = 12.0 print(largura // 2) print(largura/2.0) print(Altura/3) print(1 + 2 * 5)
""" Module for downloading ARM data. """ import argparse import json import sys import os try: from urllib.request import urlopen except ImportError: from urllib import urlopen def download_data(username, token, datastream, startdate, enddate, time=None, output=None): """ This tool ...
import project.functions as func class Calculator: def __init__(self): """Default calculator memory is set to 0""" self.memory = 0 def do_function(self, number, function): """This function passes the number in calculator memory as an argument in a given function. The other nu...
""" DataFrame 모듈 pandas DataFrame을 이용한 Data Wrapper, Query """ import functools import pandas as pd import numpy as np import warnings import sqlalchemy from collections import defaultdict from datetime import datetime from typing import List, Callable, Generator from daqm.data.data import Data from daqm.data.colu...
def say_name(): return 'module_one'
import networkx.algorithms.tests.test_covering import pytest from graphscope.experimental.nx.utils.compat import import_as_graphscope_nx import_as_graphscope_nx(networkx.algorithms.tests.test_covering, decorators=pytest.mark.usefixtures("graphscope_session"))
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import DataMigration from django.db import models class Migration(DataMigration): def forwards(self, orm): from drawquest.apps.drawquest_auth.models import User from drawquest.apps.drawquest_auth.details_models import Us...
import sys import os import json import importlib import logging import functools import click from botocore.config import Config as BotocoreConfig from botocore.session import Session from typing import Any, Optional, Dict, MutableMapping # noqa from chalice import __version__ as chalice_version from chalice.awscli...
# -*- coding: utf-8 -*- # Generated by Django 1.10 on 2016-08-06 13:44 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( name='Block', ...
# Register Adresses WHO_AM_I = 0x00 X_OFFS_USRH = 0x0C X_OFFS_USRL = 0x0D Y_OFFS_USRH = 0x0E Y_OFFS_USRL = 0x0F Z_OFFS_USRH = 0x10 Z_OFFS_USRL = 0x11 FIFO_EN = 0x12 AUX_VDDIO = 0x13 AUX_SLV_ADDR = 0x14 SMPLRT_DIV = 0x15 DLPF_FS = 0x16 INT_CFG = 0x17 ...
# Copyright 2013 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. """PeaceKeeper benchmark suite. Peacekeeper measures browser's performance by testing its JavaScript functionality. JavaScript is a widely used programming ...
# Copyright 2019 NeuroData (http://neurodata.io) # # 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...
# # Copyright (c) 2009-2015, Mendix bv # All Rights Reserved. # # http://www.mendix.com/ # import os import shutil import subprocess import socket import http.client from .log import logger try: import readline # allow - in filenames we're completing without messing up completion readli...
from random import randint import time computador = randint(0, 5) print('~^~' * 20) print('\033[1;44m Estou pensando em um número de 0 a 5. Tente descobrir qual é... \033[m') print('~^~' * 20) jogador = int(input('Em que número estou pensando? ')) print('\033[1;40mPROCESSANDO...') time.sleep(2) if jogador == computador...
#\\---- double backslash print("I am here for the double backslash\\\\")
# TensorFlow external dependencies that can be loaded in WORKSPACE files. load("//third_party/gpus:cuda_configure.bzl", "cuda_configure") load("//third_party/gpus:rocm_configure.bzl", "rocm_configure") load("//third_party/tensorrt:tensorrt_configure.bzl", "tensorrt_configure") load("//third_party/nccl:nccl_configure.b...
import warnings from typing import Dict, Union, Optional, List import pytorch_lightning as pl import torch.nn as nn import torch.optim as optim from torch.utils.data import DataLoader import nni from ...graph import Evaluator from ...serializer import serialize_cls __all__ = ['LightningModule', 'Trainer', 'DataLoad...
# coding: utf-8 from __future__ import unicode_literals import functools import itertools import operator import re from .common import InfoExtractor from ..compat import ( compat_HTTPError, compat_str, compat_urllib_request, ) from .openload import PhantomJSwrapper from ..utils import ( determine_ext...
""" Creation and extension of validators, with implementations for existing drafts. """ from collections.abc import Sequence from functools import lru_cache from urllib.parse import unquote, urldefrag, urljoin, urlsplit from urllib.request import urlopen from warnings import warn import contextlib import json import wa...
"""Flit's core machinery for building packages. This package provides a standard PEP 517 API to build packages using Flit. All the convenient development features live in the main 'flit' package. """ __version__ = '3.6.0'
import sys import numpy as np h, w = map(int, sys.stdin.readline().split()) s = np.array([list(sys.stdin.readline().rstrip()) for _ in range(h)], dtype='U') s = np.pad(s, 1) def main(): l = np.zeros((h+2, w+2), dtype=np.int64) r = np.zeros((h+2, w+2), dtype=np.int64) u = np.zeros((h+2, w+2), d...
"""stub action for replay """ from . import _actions as actions from .run import Action as BaseAction @actions.register class Action(BaseAction): # pylint: disable=too-many-instance-attributes """:replay""" KEGEX = r"""(?x) ^ (?P<replay>rep(?:lay)? (\s(?P<params_repl...
##Ratings for SRNDNA from psychopy import visual, core, event, gui, data, logging import csv import datetime import random import numpy import os import sys #parameters useFullScreen = True useDualScreen=1 DEBUG = False frame_rate=1 responseKeys=('1','2','3','z','enter','escape') #subject ID subjDlg=gui.Dlg(title=...
"""Manages state database used for checksum caching.""" import logging import os from abc import ABC, abstractmethod from dvc.fs.local import LocalFileSystem from dvc.hash_info import HashInfo from dvc.utils import relpath from dvc.utils.fs import get_inode, get_mtime_and_size, remove logger = logging.getLogger(__na...
from django.db import models # Create your models here. class Contact(models.Model): name = models.CharField(max_length=50) company = models.CharField(max_length=100, blank=True) phone = models.CharField(max_length=11) email = models.EmailField() message = models.TextField() ...
# -*- coding: utf-8 -*- from __future__ import absolute_import from __future__ import division from __future__ import print_function import tensorflow as tf def nms_calculate(boxes, scores, iou_threshold, max_output_size, name='non_maximal_suppression'): with tf.variable_scope(name): nms_index = tf.im...
"""Package configuration""" import os from setuptools import setup, find_packages VERSION = "2.4.1" README = """ pip-compile-multi ================= Compile multiple requirements files to lock dependency versions. Install ------- .. code-block:: shell pip install pip-compile-multi Run ---- .. code-block:...
import sys import pytest import subprocess from caproto.sync.client import read, write, subscribe, block from .conftest import dump_process_output def escape(pv_name, response): raise KeyboardInterrupt def fix_arg_prefixes(ioc, args): 'Add prefix to CLI argument pvnames where necessary' return [ioc.pvs...
import os from tempfile import mkdtemp basedir = os.path.abspath(os.path.dirname(__file__)) db_path = os.path.join(basedir, 'app', 'db') db_file = 'production.db' db_fullpath = os.path.join(db_path, db_file) SQLALCHEMY_DATABASE_URI = 'sqlite:///' + db_fullpath SQLALCHEMY_TRACK_MODIFICATIONS = False # to disable an...
import pymysql.cursors from model.group import Group from model.contact import Contact from model.contact_in_group import Contact_in_Group class DbFixture: def __init__(self, host, name, user, password): self.host = host self.name = name self.user = user self.password = password ...
# 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...
from pyspedas.erg.load import load def lepe(trange=['2017-04-04', '2017-04-05'], datatype='omniflux', level='l2', suffix='', get_support_data=False, varformat=None, varnames=[], downloadonly=False, notplot=False, no_update=False, una...
import numpy as np import matplotlib.pyplot as plt import matplotlib.patches as patches import pandas as pd import os data_list = [ 'fp16_notc', 'fp16_tc_nocor', 'fp32_notc', 'fp32_tc_nocor', 'fp32_tc_cor', 'mixed_tc_cor_emu', 'tf32_tc_nocor_emu', 'tf32_t...
from pymir.analytics.key_detection.musicnet.ml.note_sequence.base import random_forest import argparse import textwrap def compute(n_estimators=100): """ Base model of key detection for Musicnet metadata based in TF-IDF and Random Forest """ random_forest.compute(n_estimators=n_estimators) def ...
#!/usr/bin/env python # -*- coding:utf-8 -*- # author:owefsad # software: PyCharm # project: lingzhi-webapi from rest_framework import serializers from dongtai.models import User class UserSerializer(serializers.ModelSerializer): department = serializers.SerializerMethodField() talent = serializers.Serialize...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations import imagekit.models.fields import users.models class Migration(migrations.Migration): dependencies = [ ('users', '0001_initial'), ] operations = [ migrations.AlterField( ...
# This file is part of the Python aiocoap library project. # # Copyright (c) 2012-2014 Maciej Wasilak <http://sixpinetrees.blogspot.com/>, # 2013-2014 Christian Amsüss <c.amsuess@energyharvesting.at> # # aiocoap is free software, this file is published under the MIT license as # described in the accompany...
import glob import inspect import os import re import warnings from collections import namedtuple from stat import ST_CTIME import numpy as np from yt.data_objects.index_subobjects.grid_patch import AMRGridPatch from yt.data_objects.static_output import Dataset from yt.funcs import ensure_tuple, mylog, setdefaultattr...
#!/usr/bin/env python # -*- coding:utf-8 -*- """ @author: wangye @file: lesson1.py @time: 2020/08/25 @contact: wangye.hope@gmail.com @site: @software: PyCharm """ import pygame from pygame.locals import * if __name__ == '__main__': pygame.init() screen = pygame.display.set_mode((640, 480), RESIZABLE,...
# -*- coding: utf-8 -*- import time from .. import base from girder.exceptions import ValidationException from girder.models.notification import ProgressState from girder.models.setting import Setting from girder.models.token import Token from girder.models.user import User from girder.settings import SettingKey from...
# Copyright (c) Facebook, Inc. and its affiliates. """ The metrics module contains implementations of various metrics used commonly to understand how well our models are performing. For e.g. accuracy, vqa_accuracy, r@1 etc. For implementing your own metric, you need to follow these steps: 1. Create your own metric cl...
import unittest from federatedml.callbacks.validation_strategy import ValidationStrategy import numpy as np from federatedml.util import consts from federatedml.param.evaluation_param import EvaluateParam class TestValidationStrategy(unittest.TestCase): def setUp(self) -> None: self.role = 'guest' ...
""" Handlers for IPythonDirective's @doctest pseudo-decorator. The Sphinx extension that provides support for embedded IPython code provides a pseudo-decorator @doctest, which treats the input/output block as a doctest, raising a RuntimeError during doc generation if the actual output (after running the input) does no...
# Copyright (c) Facebook, Inc. and its affiliates. import os from typing import Optional import pkg_resources import torch from detectron2.checkpoint import DetectionCheckpointer from centermask.config import get_cfg from detectron2.modeling import build_model class _ModelZooUrls(object): """ Mapping from na...
#!/usr/bin/env python # # Copyright (c), 2016-2020, SISSA (International School for Advanced Studies). # All rights reserved. # This file is distributed under the terms of the MIT License. # See the file 'LICENSE' in the root directory of the present # distribution, or http://opensource.org/licenses/MIT. # # @author Da...
from hubcheck.pageobjects.basepagewidget import BasePageWidget from hubcheck.pageobjects.basepageelement import TextReadOnly import re class TicketListSearchForm(BasePageWidget): def __init__(self, owner, locatordict={}): super(TicketListSearchForm,self).__init__(owner,locatordict) # load hub's c...
# Generated by Django 3.0.7 on 2020-06-12 12:06 from django.db import migrations, models import django.utils.timezone class Migration(migrations.Migration): dependencies = [ ('reference', '0001_initial'), ] operations = [ migrations.AlterModelOptions( name='reference', ...