text
stringlengths
28
881k
from pathlib import PathNEWLINENEWLINEimport pytestNEWLINENEWLINEnplg = pytest.importorskip("ome_types._napari_plugin")NEWLINENEWLINEDATA = Path(__file__).parent / "data"NEWLINENEWLINENEWLINE@pytest.mark.parametrize("fname", DATA.iterdir(), ids=lambda x: x.stem)NEWLINEdef test_widget(fname, qtbot):NEWLINE if fname.s...
# -*- coding: utf-8 -*-NEWLINEfrom __future__ import unicode_literalsNEWLINENEWLINEfrom django.db import migrations, modelsNEWLINENEWLINEimport wagtail.core.fieldsNEWLINENEWLINENEWLINEclass Migration(migrations.Migration):NEWLINENEWLINE dependencies = [("puput", "0001_initial")]NEWLINENEWLINE operations = [NEWLIN...
from __future__ import annotationsNEWLINENEWLINEimport subprocessNEWLINEimport sysNEWLINEfrom urllib.parse import ParseResultNEWLINENEWLINEimport requestsNEWLINENEWLINEimport murfeyNEWLINENEWLINENEWLINEdef check(api_base: ParseResult, install: bool = True, force: bool = False):NEWLINE """NEWLINE Verify that the c...
from django.conf import settingsNEWLINEfrom django.conf.urls.defaults import *NEWLINEfrom django.contrib import adminNEWLINEimport loggingNEWLINElog = logging.getLogger('satchmo_store.urls')NEWLINENEWLINE# discover all admin modules - if you override this for yourNEWLINE# own base URLs, you'll need to autodiscover ther...
def test_fixture(postgresql_instance):NEWLINE assert hasattr(postgresql_instance, 'port')NEWLINE
#!/usr/bin/pythonNEWLINENEWLINE__author__ = 'vilelag'NEWLINENEWLINEimport osNEWLINEimport argparseNEWLINEimport subprocessNEWLINEfrom multiprocessing import PoolNEWLINEimport itertoolsNEWLINEfrom sklearn.decomposition import PCANEWLINEimport numpy as npNEWLINEimport matplotlib.pyplot as pltNEWLINEfrom numpy.linalg impo...
import pkgutilNEWLINEimport insightsNEWLINEimport jsonNEWLINENEWLINE# from insights.client.config import InsightsConfigNEWLINEfrom insights.client.collection_rules import InsightsUploadConfNEWLINEfrom mock.mock import patch, MockNEWLINEfrom insights.specs.default import DefaultSpecsNEWLINEfrom insights.specs.sos_archiv...
from django.contrib import adminNEWLINENEWLINEfrom guardian.admin import GuardedModelAdminNEWLINEfrom userena.utils import get_profile_modelNEWLINENEWLINEtry:NEWLINE admin.site.unregister(get_profile_model())NEWLINEexcept admin.sites.NotRegistered:NEWLINE passNEWLINENEWLINEadmin.site.register(get_profile_model(),...
import sysNEWLINEimport osNEWLINEimport filecmpNEWLINEimport importlibNEWLINEimport datetimeNEWLINEimport commonNEWLINENEWLINEpath = os.path.abspath('.')NEWLINEsys.path.append(path)NEWLINENEWLINEdomain = 'maaseuduntulevaisuus'NEWLINEurl = 'http://www.maaseuduntulevaisuus.fi/maatalous/eu-s%C3%A4%C3%A4st%C3%A4%C3%A4-suor...
import numpy as npNEWLINEimport pandas as pdNEWLINEimport osNEWLINEimport datetimeNEWLINEimport requestsNEWLINENEWLINEfrom huey.models import Buoy, BuoyRealtimeWaveDetail, BuoyRawSpectralWaveDataNEWLINENEWLINEdef import_buoy_realtime_wave_detail(db_session):NEWLINE station_id = "46025"NEWLINE buoy = db_session.qu...
# BGP SP Topology APIsNEWLINE# Author: Naveena Suvarna (naveen.suvarna@broadcom.com)NEWLINENEWLINEimport copyNEWLINENEWLINEfrom spytest import st, utils, putilsNEWLINEfrom spytest.dicts import SpyTestDictNEWLINEimport apis.routing.ip as ipapiNEWLINEimport apis.routing.bgp as bgpapiNEWLINEimport apis.system.interfac...
# Licensed to the Apache Software Foundation (ASF) under oneNEWLINE# or more contributor license agreements. See the NOTICE fileNEWLINE# distributed with this work for additional informationNEWLINE# regarding copyright ownership. The ASF licenses this fileNEWLINE# to you under the Apache License, Version 2.0 (theNEWL...
from hp_model import operationNEWLINEimport matplotlib.pyplot as pltNEWLINENEWLINENEWLINEinit = 0NEWLINEstate = 0NEWLINEi = 0NEWLINENEWLINEcp1 = []NEWLINEcp2 = []NEWLINEerp = []NEWLINEpu = []NEWLINEefflist = []NEWLINElast_state = 0NEWLINEtemperature = []NEWLINEstate_list = []NEWLINEQ_list = []NEWLINEwhile 1:NEWLINE ...
n,m=map(int,input().split())NEWLINES=set(range(1,m+1))NEWLINEfor i in range(n):NEWLINE K,*A=map(int,input().split())NEWLINE S&=set(A)NEWLINEprint(len(S))
# Copyright 2020 - 2021 MONAI ConsortiumNEWLINE# Licensed under the Apache License, Version 2.0 (the "License");NEWLINE# you may not use this file except in compliance with the License.NEWLINE# You may obtain a copy of the License atNEWLINE# http://www.apache.org/licenses/LICENSE-2.0NEWLINE# Unless required by appl...
#!/usr/bin/pythonNEWLINENEWLINE__author__ = 'vilelag'NEWLINENEWLINEimport osNEWLINEimport argparseNEWLINEimport subprocessNEWLINEfrom multiprocessing import PoolNEWLINEimport itertoolsNEWLINEfrom sklearn.decomposition import PCANEWLINEimport numpy as npNEWLINEimport matplotlib.pyplot as pltNEWLINEfrom numpy.linalg impo...
# Copyright 2019 The meson development teamNEWLINE#NEWLINE# Licensed under the Apache License, Version 2.0 (the "License");NEWLINE# you may not use this file except in compliance with the License.NEWLINE# You may obtain a copy of the License atNEWLINE#NEWLINE# http://www.apache.org/licenses/LICENSE-2.0NEWLINE#NEWLI...
# coding=utf-8NEWLINE# *** WARNING: this file was generated by the Kulado Terraform Bridge (tfgen) Tool. ***NEWLINE# *** Do not edit by hand unless you're certain you know what you are doing! ***NEWLINENEWLINEimport jsonNEWLINEimport warningsNEWLINEimport kuladoNEWLINEimport kulado.runtimeNEWLINEfrom .. import utilitie...
# Copyright 2021 University College London. All Rights Reserved.NEWLINE#NEWLINE# Licensed under the Apache License, Version 2.0 (the "License");NEWLINE# you may not use this file except in compliance with the License.NEWLINE# You may obtain a copy of the License atNEWLINE#NEWLINE# http://www.apache.org/licenses/LIC...
from django.shortcuts import renderNEWLINEfrom property.views import hot_propertiesNEWLINEfrom property.models import PropertyNEWLINENEWLINENEWLINEdef index(request, *args, **kwargs):NEWLINE context = {NEWLINE 'carousel_property_list': hot_properties(4),NEWLINE 'hot_property_list': hot_properties(4),NE...
# pylint: disable=missing-docstringNEWLINEimport osNEWLINENEWLINEfrom resolwe.test import ProcessTestCase, tag_process, with_docker_executorNEWLINENEWLINENEWLINEclass ArchiverProcessTestCase(ProcessTestCase):NEWLINENEWLINE def setUp(self):NEWLINE super().setUp()NEWLINE self.files_path = os.path.abspath...
# Copyright 2017 Battelle Energy Alliance, LLCNEWLINE#NEWLINE# Licensed under the Apache License, Version 2.0 (the "License");NEWLINE# you may not use this file except in compliance with the License.NEWLINE# You may obtain a copy of the License atNEWLINE#NEWLINE# http://www.apache.org/licenses/LICENSE-2.0NEWLINE#NEWLIN...
# Copyright (c) Chris Choy (chrischoy@ai.stanford.edu) and Wei Dong (weidong@andrew.cmu.edu)NEWLINE#NEWLINE# Please cite the following papers if you use any part of the code.NEWLINE# - Christopher Choy, Wei Dong, Vladlen Koltun, Deep Global Registration, CVPR 2020NEWLINE# - Christopher Choy, Jaesik Park, Vladlen Koltun...
_base_ = [NEWLINE '../_base_/models/cascade_mask_rcnn_swin_fpn.py',NEWLINE '../_base_/datasets/coco_instance.py',NEWLINE '../_base_/schedules/schedule_1x.py', '../_base_/default_runtime.py'NEWLINE]NEWLINENEWLINEmodel = dict(NEWLINE backbone=dict(NEWLINE embed_dim=96,NEWLINE depths=[2, 2, 18, 2...
import networkxNEWLINEimport reNEWLINEfrom konlpy.tag import Mecab,OktNEWLINEimport mathNEWLINEimport pandas as pdNEWLINEfrom tqdm import tqdmNEWLINENEWLINE# Textrank 요약NEWLINEclass TextRank:NEWLINE def __init__(self, **kargs):NEWLINE self.graph = NoneNEWLINE self.window = kargs.get('window', 5)NEWLINE...
# -*- coding=utf-8 -*-NEWLINEfrom __future__ import absolute_import, print_functionNEWLINENEWLINEimport loggingNEWLINEimport operatorNEWLINEimport platformNEWLINEimport sysNEWLINEfrom collections import defaultdictNEWLINENEWLINEimport attrNEWLINEimport sixNEWLINEfrom packaging.version import VersionNEWLINENEWLINEfrom ....
# coding: utf-8NEWLINENEWLINE"""NEWLINE convertapiNEWLINENEWLINE Convert API lets you effortlessly convert file formats and types. # noqa: E501NEWLINENEWLINE OpenAPI spec version: v1NEWLINE NEWLINE Generated by: https://github.com/swagger-api/swagger-codegen.gitNEWLINE"""NEWLINENEWLINENEWLINEimport ppri...
import jsonNEWLINEimport os.pathNEWLINENEWLINEclass Inventory:NEWLINE pets = {}NEWLINENEWLINE def __init__(self) -> None:NEWLINE self.load()NEWLINENEWLINE def add(self, key , qty):NEWLINE q = 0NEWLINE if key in self.pets: # test to make sure key existNEWLINE v = self.pets[key]NE...
# encoding: utf8NEWLINEfrom __future__ import unicode_literalsNEWLINENEWLINENEWLINESTOP_WORDS = set("""NEWLINEà às acerca adeus agora ainda algmas algo algumas alguns ali além ambos anoNEWLINEanos antes ao aos apenas apoio apontar após aquela aquelas aquele aqueles aquiNEWLINEaquilo area área as assim através atrás até...
# Copyright 2014-2015 Robert Jordens <jordens@gmail.com>NEWLINE#NEWLINE# This file is part of redpid.NEWLINE#NEWLINE# redpid is free software: you can redistribute it and/or modifyNEWLINE# it under the terms of the GNU General Public License as published byNEWLINE# the Free Software Foundation, either version 3 of the ...
# Author: Nathan Trouvain at 27/09/2021 <nathan.trouvain@inria.fr>NEWLINE# Licence: MIT LicenseNEWLINE# Copyright: Xavier Hinaut (2018) <xavier.hinaut@inria.fr>NEWLINEimport numpy as npNEWLINENEWLINEfrom ...node import NodeNEWLINEfrom ...utils.validation import add_bias, check_vectorNEWLINENEWLINENEWLINEdef _initialize...
import argparseNEWLINEimport osNEWLINEimport os.path as ospNEWLINENEWLINEimport cv2NEWLINEimport numpy as npNEWLINENEWLINENEWLINEdef flow_to_img(raw_flow, bound=20.):NEWLINE """Convert flow to gray image.NEWLINENEWLINE Args:NEWLINE raw_flow (np.ndarray[float]): Estimated flow with the shape (w, h).NEWLINE ...
from dataclasses import dataclassNEWLINENEWLINENEWLINE@dataclassNEWLINEclass UserEntity:NEWLINE id: intNEWLINE username: strNEWLINE email: strNEWLINENEWLINE def get_id(self):NEWLINE return self.idNEWLINENEWLINE def get_user_id(self):NEWLINE return self.idNEWLINENEWLINE @propertyNEWLINE ...
"""NEWLINEImplementation of custom solvers: advection equation with forward-time, backward-space; Burgers' equation withNEWLINEMacCormack scheme and Korteweg-de Vries equation with Zabusky and Kruska scheme.NEWLINE"""NEWLINEimport numpy as npNEWLINEimport matplotlib.pyplot as pltNEWLINEimport matplotlib as mplNEWLINEim...
import jsonNEWLINEimport osNEWLINEimport csvNEWLINEimport reNEWLINEimport pandas as pdNEWLINEimport pickleNEWLINEimport collectionsNEWLINEimport subprocessNEWLINENEWLINENEWLINEimport sdi_utils.gensolution as gsNEWLINEimport sdi_utils.set_logging as slogNEWLINEimport sdi_utils.textfield_parser as tfpNEWLINEimport sdi_ut...
#!/usr/bin/env python3NEWLINENEWLINE# do lxc list --format=json swift-runwayNEWLINE# ...and delete themNEWLINENEWLINENEWLINE# while it would be cool if this worked, it doesn't and the docs are badNEWLINE# https://linuxcontainers.org/lxc/documentation/#pythonNEWLINE# import lxcNEWLINE# for defined in (True, False):NEWLI...
# Copyright (c) 2015 Jaime van Kessel, Ultimaker B.V.NEWLINE# The PostProcessingPlugin is released under the terms of the AGPLv3 or higher.NEWLINEfrom PyQt5.QtCore import QObject, pyqtProperty, pyqtSignal, pyqtSlotNEWLINENEWLINEfrom UM.PluginRegistry import PluginRegistryNEWLINEfrom UM.Resources import ResourcesNEWLINE...
from django.core.management.base import BaseCommand, CommandErrorNEWLINEfrom ._offences import OffenceScraperNEWLINEfrom ....api import modelsNEWLINEimport pprintNEWLINENEWLINEclass Command(BaseCommand):NEWLINE help = 'Scrapes offences'NEWLINENEWLINE def add_arguments(self, parser):NEWLINE passNEWLINENEWLI...
"""NEWLINE@author: Junguang JiangNEWLINE@contact: JiangJunguang1123@outlook.comNEWLINE"""NEWLINEimport randomNEWLINEimport timeNEWLINEimport warningsNEWLINEimport sysNEWLINEimport argparseNEWLINEimport shutilNEWLINEimport os.path as ospNEWLINENEWLINEimport torchNEWLINEimport torch.nn as nnNEWLINEimport torch.backends.c...
from rt_utils.rtstruct import RTStructNEWLINEimport pytestNEWLINEimport osNEWLINEfrom rt_utils import RTStructBuilderNEWLINENEWLINE@pytest.fixture()NEWLINEdef series_path() -> str:NEWLINE return get_and_test_series_path('mock_data')NEWLINENEWLINE@pytest.fixture()NEWLINEdef new_rtstruct() -> RTStruct:NEWLINE retur...
from math import ceilNEWLINENEWLINEimport numpy as npNEWLINEfrom numpy.testing import assert_array_equalNEWLINEimport pytestNEWLINENEWLINEfrom sklearn.ensemble import StackingClassifierNEWLINEfrom sklearn.exceptions import NotFittedErrorNEWLINEfrom sklearn.neighbors import KNeighborsClassifierNEWLINEfrom sklearn.svm im...
#!/usr/bin/env pythonNEWLINE#NEWLINE# Copyright (c) 2017 Amazon.com, Inc. or its affiliates. All RightsNEWLINE# Reserved.NEWLINE#NEWLINE# Additional copyrights may followNEWLINE#NEWLINENEWLINEimport osNEWLINEimport sysNEWLINEimport reNEWLINEimport argparseNEWLINEimport loggingNEWLINEimport...
import jsonNEWLINEimport osNEWLINEimport csvNEWLINEimport reNEWLINEimport pandas as pdNEWLINEimport pickleNEWLINEimport collectionsNEWLINEimport subprocessNEWLINENEWLINENEWLINEimport sdi_utils.gensolution as gsNEWLINEimport sdi_utils.set_logging as slogNEWLINEimport sdi_utils.textfield_parser as tfpNEWLINEimport sdi_ut...
import osNEWLINEimport shutilNEWLINEimport unittestNEWLINEfrom xbrr.edinet.client.document_client import DocumentClientNEWLINEfrom xbrr.edinet.reader.doc import DocNEWLINENEWLINENEWLINEclass TestDoc(unittest.TestCase):NEWLINENEWLINE @classmethodNEWLINE def setUpClass(cls):NEWLINE cls._dir = os.path.join(os...
# Copyright (c) 2021 Benjamin Holt -- MIT LicenseNEWLINENEWLINEfrom setuptools import setupNEWLINENEWLINEfrom allgit import _versionNEWLINE#####NEWLINENEWLINENEWLINE#####NEWLINEwith open("README.md", "r") as f:NEWLINE long_description = f.read()NEWLINENEWLINEsetup(NEWLINE name="allgit",NEWLINE version=_version...
# -*- coding: utf-8 -*-NEWLINE# Generated by Django 1.9 on 2016-01-14 10:38NEWLINEfrom __future__ import unicode_literalsNEWLINENEWLINEfrom django.db import migrations, modelsNEWLINENEWLINENEWLINEclass Migration(migrations.Migration):NEWLINENEWLINE initial = TrueNEWLINENEWLINE dependencies = [NEWLINE ]NEWLINEN...
from datetime import datetimeNEWLINENEWLINEdef convert_to_datetime(line):NEWLINE '''Extract date and time from a line of text, return as a datetime object.'''NEWLINE NEWLINE # Find the part of the string that contains the information about time.NEWLINE date_string = line.split()[1]NEWLINE date = datetime...
"""Tests the plotting function developed as part of 2E"""NEWLINENEWLINE# ImportsNEWLINEfrom floodsystem.plot import plot_water_levelsNEWLINEfrom floodsystem.datafetcher import fetch_measure_levelsNEWLINEimport datetimeNEWLINEfrom floodsystem.station import MonitoringStationNEWLINENEWLINEfictional_station = MonitoringSt...
from setuptools import setupNEWLINENEWLINENEWLINEsetup(NEWLINE name="Flask-Simple-Registration",NEWLINE version="0.1",NEWLINE url="http://github.com/mtrichardson/flask-simple-registration",NEWLINE license="MIT",NEWLINE author="Michael Richardson",NEWLINE author_email="michael@mtrichardson.com",NEWLINE...
# -*- coding:utf-8 -*-NEWLINE# adapted from https://www.itread01.com/content/1527482333.htmlNEWLINENEWLINEimport loggingNEWLINEimport sysNEWLINENEWLINEreload(sys) # reload 才能調用 setdefaultencoding 方法NEWLINEsys.setdefaultencoding('utf-8') # 設置 'utf-8'NEWLINENEWLINENEWLINE# from cfg import configNEWLINENEWLINEclass Time...
#!/usr/bin/env python3NEWLINENEWLINE"""Unit tests for Mininet Topologies in mininet_test_topo"""NEWLINENEWLINEfrom unittest import TestCase, mainNEWLINENEWLINEfrom clib.config_generator import FaucetFakeOFTopoGeneratorNEWLINENEWLINENEWLINEclass FaucetTopoTest(TestCase):NEWLINE """Tests for Faucet test suite mininet ...
#!/usr/bin/env pythonNEWLINE# encoding: utf-8NEWLINENEWLINEname = "Intra_R_Add_Exo_scission/training"NEWLINEshortDesc = "Kinetics used to train group additivity values"NEWLINElongDesc = """NEWLINEPut kinetic parameters for reactions to use as a training set for fittingNEWLINEgroup additivity values in this file.NEWLINE...
import pytestNEWLINEfrom numerous.engine.model.external_mappings import ExternalMappingElementNEWLINENEWLINEfrom numerous.utils.data_loader import InMemoryDataLoaderNEWLINEfrom pytest import approxNEWLINENEWLINEfrom numerous.engine.model.external_mappings.interpolation_type import InterpolationTypeNEWLINEfrom numerous....
# coding=utf-8NEWLINE# --------------------------------------------------------------------------NEWLINE# Copyright (c) Microsoft Corporation. All rights reserved.NEWLINE# Licensed under the MIT License. See License.txt in the project root for license information.NEWLINE# Code generated by Microsoft (R) AutoRest Code G...
_base_ = './mask_rcnn_r101_fpn_1x_coco.py'NEWLINEmodel = dict(NEWLINE pretrained='open-mmlab://resnext101_32x4d',NEWLINE backbone=dict(NEWLINE type='ResNeXt',NEWLINE depth=101,NEWLINE groups=32,NEWLINE base_width=4,NEWLINE num_stages=4,NEWLINE out_indices=(0, 1, 2, 3),NEW...
"""Program to draw Mandelbrot fractals: the graphical user interface.NEWLINENEWLINEAuthor: Lars van den Haak and Tom VerhoeffNEWLINENEWLINECopyright (c) 2020 - Eindhoven University of Technology, The NetherlandsNEWLINENEWLINEThis software is made available under the terms of the MIT License.NEWLINENEWLINE* Contributor ...
from __future__ import unicode_literalsNEWLINEfrom django.db import modelsNEWLINE#from django.utils import timezoneNEWLINEfrom accounts.models import UserNEWLINENEWLINE NEWLINE# 계산 객체 생성NEWLINEclass Inference(models.Model):NEWLINE author = models.ForeignKey(User, NEWLINE null = True...
from setuptools import setup, find_packagesNEWLINENEWLINENEWLINEsetup(NEWLINE name='zeit.find',NEWLINE version='3.0.10.dev0',NEWLINE author='gocept, Zeit Online',NEWLINE author_email='zon-backend@zeit.de',NEWLINE url='http://www.zeit.de/',NEWLINE description="vivi UI for querying elastic search",NEWLI...
from pyspark import SparkFilesNEWLINEfrom pyspark.sql import SparkSession, DataFrameWriterNEWLINEfrom pyspark.sql.functions import when, isnull, col, explode, splitNEWLINENEWLINEimport osNEWLINENEWLINEdef analyze(ss, json_file):NEWLINE print('Calculating hourly activities')NEWLINE df = ss.read.json(json_file)NEWL...
# -*- coding: utf-8 -*-NEWLINEfrom tests import HangulizeTestCaseNEWLINEfrom hangulize.langs.aze import AzerbaijaniNEWLINENEWLINENEWLINEclass AzerbaijaniTestCase(HangulizeTestCase):NEWLINENEWLINE lang = Azerbaijani()NEWLINENEWLINE def test_people(self):NEWLINE self.assert_examples({NEWLINE u'Nam...
"""add tagsNEWLINENEWLINERevision ID: 42f99b73b077NEWLINERevises: e59c406395d2NEWLINECreate Date: 2017-02-02 16:08:12.273221NEWLINENEWLINE"""NEWLINEfrom alembic import opNEWLINEimport sqlalchemy as saNEWLINENEWLINENEWLINE# revision identifiers, used by Alembic.NEWLINErevision = '42f99b73b077'NEWLINEdown_revision = 'e59...
from setuptools import setupNEWLINENEWLINEinstall_requires = [NEWLINE 'social-auth-app-django',NEWLINE]NEWLINENEWLINE# copy from `python-social-auth` social-core/setup.pyNEWLINEsocial_core_extras_require={NEWLINE 'openidconnect': ['python-jose>=3.0.0'],NEWLINE 'saml': ['python3-saml>=1.2.1'],NEWLINE 'azurea...
import osNEWLINEimport sysNEWLINEimport timeNEWLINEimport torchNEWLINEimport utilsNEWLINEimport loggingNEWLINEimport argparseNEWLINEimport torch.nn as nnNEWLINEimport torch.utilsNEWLINENEWLINEfrom adaptive_augmentor import AdaAugNEWLINEfrom networks import get_modelNEWLINEfrom networks.projection import ProjectionNEWLI...
import osNEWLINEfrom PyQt5 import QtCore, QtWidgetsNEWLINEfrom .ui.MainWindow import Ui_MainWindowNEWLINEfrom .ui.about import Ui_Form as Ui_aboutWindowNEWLINEfrom .ui.input import Ui_Form as Ui_inputWindowNEWLINEfrom .ui.help import Ui_Form as Ui_helpWindowNEWLINEimport pyqtgraph as pgNEWLINEimport pyqtgraph.exporter...
from os import pathNEWLINEfrom typing import Optional, TupleNEWLINEimport tarfileNEWLINEimport torchNEWLINEfrom pytorch_lightning import LightningDataModuleNEWLINEfrom torch.utils.data import ConcatDataset, DataLoader, Dataset, random_splitNEWLINEfrom torchvision.datasets import MNISTNEWLINEfrom torchvision.transforms ...
from ingest.api.ingestapi import IngestApiNEWLINEfrom ingest.exporter.bundle import BundleService, BundleNEWLINEfrom ingest.exporter.metadata import MetadataServiceNEWLINEfrom ingest.exporter.staging import StagingServiceNEWLINENEWLINENEWLINEclass SubmissionEnvelopeParseException(Exception):NEWLINE passNEWLINENEWLIN...
import osNEWLINEimport timeNEWLINEimport pprintNEWLINEimport argparseNEWLINEimport torchNEWLINEimport numpy as npNEWLINEimport pickleNEWLINEimport utilsNEWLINEimport csvNEWLINENEWLINEfrom model.hidden import HiddenNEWLINEfrom noise_layers.noiser import NoiserNEWLINEfrom average_meter import AverageMeterNEWLINENEWLINENE...
#!/usr/bin/env python3NEWLINENEWLINE"""NEWLINEusage: steps.py [-h] [--after AFTER] [--before BEFORE] [--tz TZ]NEWLINE [--output OUTPUT] [--account ACCOUNT] [--password PASSWORD]NEWLINE [--subaccount SUBACCOUNT]NEWLINE FLOWNEWLINENEWLINECreates a CSV file of steps within enga...
from flask import request,gNEWLINEfrom . import apiNEWLINEfrom .. import dbNEWLINEfrom ..models import Agent,AgentGroupNEWLINEfrom ..decorators import json, paginateNEWLINEfrom ..utils import random_strNEWLINEimport datetimeNEWLINENEWLINENEWLINE@api.route('/agents/<string:id>', methods=['GET'])NEWLINE@jsonNEWLINEdef ge...
from rlkit.core import loggerNEWLINEfrom rlkit.core.timer import timerNEWLINEfrom rlkit.data_management.online_vae_replay_buffer import \NEWLINE OnlineVaeRelabelingBufferNEWLINEfrom rlkit.data_management.shared_obs_dict_replay_buffer \NEWLINE import SharedObsDictRelabelingBufferNEWLINEimport rlkit.torch.vae.vae_s...
# -------------------------------------------------------------------------NEWLINE# Copyright (c) Microsoft Corporation. All rights reserved.NEWLINE# Licensed under the MIT License. See License.txt in the project root forNEWLINE# license information.NEWLINE# -------------------------------------------------------------...
# title.pyNEWLINENEWLINEimport htmlNEWLINEimport reNEWLINENEWLINEfrom bobbit.utils import strip_htmlNEWLINENEWLINE# MetadataNEWLINENEWLINENAME = 'title'NEWLINEENABLE = TrueNEWLINEPATTERN = r'.*(?P<url>http[^\s]+).*'NEWLINEUSAGE = '''Usage: <url>NEWLINELooks up title of URL.NEWLINEExample:NEWLINE > http://www.i...
# -*- coding: utf-8 -*-NEWLINENEWLINEfrom django.core import validatorsNEWLINEfrom django.utils.deconstruct import deconstructibleNEWLINEfrom django.utils.translation import ungettext_lazyNEWLINENEWLINEfrom collectionfield.converter import CollectionConverterNEWLINENEWLINENEWLINEclass ItemValidatorMixin(object):NEWLINE...
from rest_framework.status import HTTP_404_NOT_FOUNDNEWLINENEWLINENEWLINEERROR_GRID_DOES_NOT_EXIST = (NEWLINE "ERROR_GRID_DOES_NOT_EXIST",NEWLINE HTTP_404_NOT_FOUND,NEWLINE "The requested grid view does not exist.",NEWLINE)NEWLINE
from ast import BitAndNEWLINEimport importlibNEWLINEfrom cmath import cos, exp, log, log10, pi, sinNEWLINEimport matplotlib.pyplot as mpltNEWLINENEWLINE##################### ##################### #####################NEWLINE##################### ##################### #####################NEWLINENEWLINETWOPI = 2.0 * piN...
#!/usr/bin/env pythonNEWLINE#NEWLINE# Copyright (c) 2017 Amazon.com, Inc. or its affiliates. All RightsNEWLINE# Reserved.NEWLINE#NEWLINE# Additional copyrights may followNEWLINE#NEWLINENEWLINEimport osNEWLINEimport sysNEWLINEimport reNEWLINEimport argparseNEWLINEimport loggingNEWLINEimport...
import torchNEWLINEfrom .base import BaseSchedulerNEWLINENEWLINENEWLINEclass TorchScheduler(BaseScheduler):NEWLINE def __init__(self, optimizer, name, priority=0, active=False, *args, **kwargs):NEWLINE super().__init__(active, priority)NEWLINE self.optimizer = optimizerNEWLINE self.scheduler = g...
from service import ServiceScraper, ServiceSoundDetector, ServiceLanguageDetectorNEWLINENEWLINEif __name__ == "__main__":NEWLINE services = [ServiceScraper, ServiceSoundDetector, ServiceLanguageDetector]NEWLINENEWLINE for service in services:NEWLINE s = service()NEWLINE s.process()
class StatusAuditoria:NEWLINE CONCLUIDO = "OK"NEWLINE NAO_CONCLUIDO = "NOK"NEWLINE
from .tool.func import *NEWLINENEWLINEdef watch_list_2(conn, tool):NEWLINE curs = conn.cursor()NEWLINENEWLINE if tool == 'watch_list':NEWLINE div = load_lang("msg_whatchlist_lmt") + ' : 10 <hr class=\"main_hr\">'NEWLINE else:NEWLINE div = ''NEWLINENEWLINE ip = ip_check()NEWLINENEWLINE if ip...
# creating list out of dictionariesNEWLINENEWLINEpen_1 = {'color': 'black',NEWLINE 'price': '2.5',NEWLINE 'brand': 'faber castel'NEWLINE }NEWLINENEWLINEpen_2 = {'color': 'blue',NEWLINE 'price': '2.5',NEWLINE 'brand': 'faber castel'NEWLINE }NEWLINENEWLINEpen_3 = {'color': 'red',...
#! /usr/bin/env pythonNEWLINENEWLINE"""NEWLINEModule with functions for correcting bad pixels in cubes.NEWLINE"""NEWLINENEWLINENEWLINENEWLINE__author__ = 'Carlos Alberto Gomez Gonzalez, V. Christiaens'NEWLINE__all__ = ['frame_fix_badpix_isolated',NEWLINE 'cube_fix_badpix_isolated',NEWLINE 'cube_fix_...
from flask_script import Manager, ShellNEWLINEimport osNEWLINENEWLINEfrom app import create_appNEWLINENEWLINEapp = create_app(os.getenv('APP_SETTINGS'))NEWLINEmanager = Manager(app)NEWLINENEWLINENEWLINEdef make_shell_context():NEWLINE return dict(app=app)NEWLINENEWLINEmanager.add_command("shell", Shell(make_context=...
#!/usr/bin/env python3NEWLINENEWLINEimport argparseNEWLINENEWLINEfrom utils import (NEWLINE load_yaml, load_wordset, sorted_items, get_morphgnt, parse_verse_ranges)NEWLINENEWLINEargparser = argparse.ArgumentParser()NEWLINEargparser.add_argument("verses", help="verses to cover (e.g. 'John 18:1-11')")NEWLINEargparser....
#!/usr/bin/env python3NEWLINENEWLINEimport reNEWLINENEWLINENEWLINEdef parse(line):NEWLINE m = re.match(r'(.*) (\d+),(\d+) through (\d+),(\d+)', line)NEWLINE if m:NEWLINE op = m.group(1)NEWLINE p0 = [int(m.group(2)), int(m.group(3))]NEWLINE p1 = [int(m.group(4)), int(m.group(5))]NEWLINENEWLINE...
# Generated by Django 3.0 on 2020-04-21 20:13NEWLINENEWLINEfrom django.db import migrations, modelsNEWLINEimport django.db.models.deletionNEWLINENEWLINENEWLINEclass Migration(migrations.Migration):NEWLINENEWLINE initial = TrueNEWLINENEWLINE dependencies = [NEWLINE ]NEWLINENEWLINE operations = [NEWLINE ...
"""NEWLINECopyright (c) 2018-2020 Intel CorporationNEWLINENEWLINELicensed under the Apache License, Version 2.0 (the "License");NEWLINEyou may not use this file except in compliance with the License.NEWLINEYou may obtain a copy of the License atNEWLINENEWLINE http://www.apache.org/licenses/LICENSE-2.0NEWLINENEWLIN...
import socketNEWLINEimport selectNEWLINENEWLINEHEADER_LENGTH = 10NEWLINENEWLINEIP = "127.0.0.1"NEWLINEPORT = 1234NEWLINENEWLINENEWLINEserver_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)NEWLINENEWLINEserver_socket.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)NEWLINEserver_socket.bind((IP, PORT))NEW...
# _*_ coding: utf-8 _*_NEWLINE"""NEWLINE Swagger 配置NEWLINE"""NEWLINEimport osNEWLINEfrom collections import namedtupleNEWLINENEWLINEVERSION = "0.1.0" # 项目版本NEWLINENEWLINE# is_dev_mode = os.path.exists('app/config/dev_setting.py') # 'development' & 'product' (开发环境 or 生产环境)NEWLINENEWLINEis_dev_mode = TrueNEWLINENEWLINE...
# Copyright 2017 The TensorFlow Authors. All Rights Reserved.NEWLINE#NEWLINE# Licensed under the Apache License, Version 2.0 (the "License");NEWLINE# you may not use this file except in compliance with the License.NEWLINE# You may obtain a copy of the License atNEWLINE#NEWLINE# http://www.apache.org/licenses/LICENS...
import pendulumNEWLINEfrom dagster.core.scheduler.job import JobStatusNEWLINEfrom dagster_graphql.test.utils import (NEWLINE execute_dagster_graphql,NEWLINE infer_repository_selector,NEWLINE infer_schedule_selector,NEWLINE main_repo_location_name,NEWLINE main_repo_name,NEWLINE)NEWLINENEWLINEGET_SCHEDULES...
"""NEWLINEResults for test_glm.py.NEWLINENEWLINEHard-coded from R or Stata. Note that some of the remaining discrepancy vs.NEWLINEStata may be because Stata uses ML by default unless you specifically ask forNEWLINEIRLS.NEWLINE"""NEWLINEimport osNEWLINENEWLINEimport numpy as npNEWLINEimport pandas as pdNEWLINENEWLINEfr...
'''NEWLINE Run the use case described onNEWLINE https://docs.google.com/document/d/16m74ZhD1_TpgmGH_RPTUGthIMCGNsxRhJOpucbDX_4E/edit?hl=en_USNEWLINE'''NEWLINEimport timeNEWLINEfrom nose.tools import eq_ as eqNEWLINEfrom nose.tools import with_setupNEWLINEfrom openmdao.gui.test.functional.pageobjects.openmdao_login ...
from src.interfacing.ogs.connect import AuthenticationNEWLINEimport codecsNEWLINEimport sysNEWLINEimport osNEWLINEfrom time import sleepNEWLINENEWLINEdef loadList(pNameFile): NEWLINE iList = []NEWLINE with codecs.open(pNameFile, "r", "utf-8") as f:NEWLINE for line in f:NEWLINE iList.append(lin...
#!/usr/bin/env pythonNEWLINENEWLINE# for non-list/dict, CHANGE_TO -> variables replace previous valuesNEWLINE# for 'list' , ADD_TO -> append to listNEWLINE# EXCLUDE_FROM -> remove element from listNEWLINE# for 'dict' , REPLACE_WITH -> replace matching keys NEWLINE# ...
from django.views.decorators.csrf import csrf_exemptNEWLINEfrom django.shortcuts import renderNEWLINEfrom django.http import JsonResponseNEWLINEfrom backend.models import users,interviewer,interviewee,hr,play,interview,position,applyNEWLINEfrom django.views.decorators.csrf import csrf_protectNEWLINEfrom django.db.model...
# -*- coding: utf-8 -*-NEWLINEfrom __future__ import unicode_literalsNEWLINENEWLINEfrom django.db import migrations, modelsNEWLINEimport core.utilsNEWLINENEWLINENEWLINEclass Migration(migrations.Migration):NEWLINENEWLINE dependencies = [NEWLINE ('questions', '0007_auto_20151209_1526'),NEWLINE ]NEWLINENEWLI...
# -*- coding: utf-8 -*-NEWLINENEWLINE# Copyright (c) 2017 Ansible, Inc.NEWLINE# All Rights Reserved.NEWLINEimport osNEWLINEimport pytestNEWLINEfrom uuid import uuid4NEWLINEimport jsonNEWLINEimport yamlNEWLINEimport mockNEWLINENEWLINEfrom backports.tempfile import TemporaryDirectoryNEWLINEfrom django.conf import setting...
import timeNEWLINEfrom importlib import import_moduleNEWLINENEWLINEfrom django.conf import settingsNEWLINEfrom django.contrib.sessions.backends.base import UpdateErrorNEWLINEfrom django.contrib.sessions.middleware import SessionMiddlewareNEWLINEfrom django.core.exceptions import SuspiciousOperationNEWLINEfrom django.ut...
"""NEWLINEThe MIT License (MIT)NEWLINENEWLINECopyright (c) 2015-present RapptzNEWLINENEWLINEPermission is hereby granted, free of charge, to any person obtaining aNEWLINEcopy of this software and associated documentation files (the "Software"),NEWLINEto deal in the Software without restriction, including without limita...