text
stringlengths
2
999k
import os import bpy import bpy.utils.previews from bpy.app.handlers import persistent from . import internals from . import preferences from . import qcd_move_widget from . import qcd_operators from . import ui addon_qcd_keymaps = [] addon_qcd_view_hotkey_keymaps = [] addon_qcd_view_edit_mode_hotkey_keymaps = [] q...
from import_export.admin import ImportExportModelAdmin from django.contrib import admin from django.contrib.auth import get_user_model from django.contrib.auth.admin import UserAdmin from .forms import CustomUserCreationForm, CustomUserChangeForm from .models import * class CustomUserAdmin(UserAdmin): add_form = ...
import sys sys.path.append('/root/csdc3/lib/ablib') sys.path.append('/root/csdc3/src/logs') sys.path.append('/root/csdc3/src/logs/config_setup') from sensor_constants import * from sensor_manager import SensorManager import argparse from time import sleep def main(): parser = argparse.ArgumentParser(description="S...
# Copyright(c) 2017, Intel Corporation # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistributions of source code must retain the above copyright notice, # this list of conditions and the followin...
# Copyright (c) 2015-2019 Vector 35 Inc # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the # rights to use, copy, modify, merge, publish, ...
#!/usr/bin/env python3 import asyncio import json import random # the bulk of our AI LEFT = b'Left\n' RIGHT = b'Right\n' FORWARD = b'Forward\n' def decision(my_id, world) -> bytes: """Pick a direction entirely randomly.""" return random.choice([LEFT, RIGHT, FORWARD]) async def next_state(reader: asyncio....
# Generated by Django 3.1 on 2020-09-25 12:31 from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('worker', '0014_auto_20200925_1411'), ] operations = [ migrations.RemoveField( model_name='workday', name='end', ), ...
#!/usr/bin/env python3 from sqlalchemy.ext.declarative import declarative_base from sqlalchemy import Column, String, Float, DateTime, Integer from sqlalchemy import create_engine from sqlalchemy.orm import sessionmaker Base = declarative_base() class Order(Base): __tablename__ = "orders" id = Column(Intege...
import pytest import numpy as np import pandas as pd import os from pathlib import Path from pandas.testing import assert_series_equal from obsidiantools.api import Vault # NOTE: run the tests from the project dir. WKD = Path(os.getcwd()) @pytest.fixture def expected_metadata_dict(): return { 'rel_file...
""" Use this script to dump the event data out to the terminal. It needs to know what the sock_dir is. This script is a generic tool to test event output """ import optparse import os import pprint import time import salt.utils.event def parse(): """ Parse the script command line inputs """ parser...
# An addition print(6 + 12) # A subtraction print(6 - 12) # A multiplication print(3 * 5) # A division print((5 + 5) / 2) # Exponentiation print(2 ^ 5) # Modulo print(28 % 6) # Assign the value 42 to x x = 42 # Print out the value of the variable x print(x) # Assign the value 5 to the variable my_apples ...
import sqlite3 def cursor(): global conn return conn.cursor() def commit(): global conn conn.commit() def insert(table, data): global conn c = conn.cursor() keys = [*data] template_list = ','.join(['?'] * len(data)) query = "INSERT INTO {} ({}) VALUES ({})".format(table, ','.join(...
"""This file provide the base for every models""" from .extensions import DB class CrudMixin(object): """Mixin that create/read/update/delete methods""" __table_args__ = {'extend_existing': True} @classmethod def create(cls, commit=True, **kwargs): """Creates a new record and saves to databa...
from radium.equity.equity import Equity from radium.pair.pair import Pair
"""Application routes.""" from flask import render_template from flask import current_app as app @app.route("/") def home(): """Home page.""" return render_template("home.html") @app.errorhandler(404) def page_not_found(e): # note that we set the 404 status explicitly return render_template("404.htm...
from thrift.protocol.TBinaryProtocol import TBinaryProtocolAccelerated from thrift.transport import TTransport, TSocket from thrift.transport.TTransport import TTransportException from jiffy.directory import directory_service class Perms: def __init__(self): pass none = 0 owner_read = 0o400 ...
import json import torch import torch.nn.functional as F from transformers import BertTokenizer from .sentiment_classifier import SentimentClassifier with open("config.json") as json_file: config = json.load(json_file) class Model: def __init__(self): self.device = torch.device("cuda:0" if torch.c...
import requests class ApiHandler: """ Class for making requests to the Twitter API v2 https://developer.twitter.com/en/docs/twitter-api/early-access """ def __init__(self, path, authentication): """ :param path: Endpoint path. :param authentication: Authentication object (...
# Copyright 2013 IBM Corp. # # 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 agree...
# 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 # "License"); you may not u...
# Copyright (C) 2015 Nippon Telegraph and Telephone 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.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
import os import math import json import datetime import copy import pandas as pd import numpy as np from collections import defaultdict from ray import tune import matplotlib.pyplot as plt from matplotlib.pyplot import cm def create_dict(filename): loaded = json.load(open(filename)) result = dict() for ke...
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! """Client and server classes corresponding to protobuf-defined services.""" import grpc from shared.library.component_b.common import person_message_pb2 as component__a_dot_common_dot_person__message__pb2 from shared.library.component_b.query import...
#!/usr/bin/env python from ansible.module_utils.basic import * ANSIBLE_METADATA = {'metadata_version': '1.0', 'status': ['preview'], 'supported_by': 'community'} DOCUMENTATION = ''' --- module: cisco_ucs_boot_order short_description: configures boot order on a cisco ucs serv...
# -*- coding: utf-8 -*- from datetime import timedelta from hashlib import sha1 import json import logging import os import traceback from compat import StringIO from compat.models import GenericForeignKey from django.contrib.contenttypes.models import ContentType from django.db import models from django.db.models imp...
# Copyright (C) 2021 Dino Bollinger, ETH Zürich, Information Security Group # Released under the MIT License """ Using a database of collected cookie + label data, determine potential GDPR violations by checking whether Google Analytics cookie variants (or another known cookie, can be specified) were misclassified. ---...
import datetime from google.cloud import firestore urls_collection = firestore.Client(project="tldr-278619").collection(u"urls") def get_answer_from(text, answer_space, default): answer = input(text) if not answer: return default answer = answer.lower() if answer in answer_space: re...
#!/usr/bin/env python #Reference: the baxter_stocking_stuffer project by students in Northwestern's MSR program - Josh Marino, Sabeen Admani, Andrew Turchina and Chu-Chu Igbokwe #Service provided - ObjLocation service - contains x,y,z coordinates of object in baxter's stationary body frame, whether it is ok to grasp an...
import time import unittest from theano.compile.pfunc import pfunc from theano import tensor import numpy import theano import theano.tensor as T # Skip test if cuda_ndarray is not available. from nose.plugins.skip import SkipTest import theano.sandbox.cuda as cuda_ndarray if cuda_ndarray.cuda_available == False: ...
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright (C) 2011 Ion Torrent Systems, Inc. All Rights Reserved import sys import os import subprocess import time import json import numpy import csv from optparse import OptionParser def utf8_decoder(s): try: return s.decode('utf-8') except: retur...
from unittest import TestCase from unittest.mock import Mock from dataclay.heap.ClientHeapManager import ClientHeapManager import uuid class TestClientHeapManager(TestCase): def test_add_to_heap(self): runtime = Mock() dc_object = Mock() object_id = uuid.uuid4() dc_object.get_obje...
# # Copyright (c) 2017 Joy Diamond. All rights reserved. # @gem('Sapphire.DualTwig') def gem(): require_gem('Sapphire.Tree') dual_twig_cache = {} lookup_dual_twig = dual_twig_cache.get store_dual_twig = dual_twig_cache.__setitem__ @share def construct__ab(t, a, b): t.a = a ...
import time import numpy as np from config import Configuration as Cfg from utils.monitoring import performance, ae_performance from utils.visualization.diagnostics_plot import plot_diagnostics def train_network(nnet): if Cfg.reconstruction_loss: nnet.ae_n_epochs = nnet.n_epochs train_autoencode...
# -*- coding: utf-8 -*- import unittest from src.pyutil.datetime_jp import ( now, today, isPast, isFuture, changeTimezone, futureDate, pastDate, ) from datetime import datetime, timedelta, date import time import pytz # reference : pytz timezone list # https://gist.github.com/heyalexej/8bf...
import json import os.path import pathlib import shutil import time import typing from mitmproxy import contentviews from mitmproxy import ctx from mitmproxy import flowfilter from mitmproxy import io, flow from mitmproxy import version from mitmproxy.tools.web.app import flow_to_json web_dir = pathlib.Path(__file__)...
# # Copyright (c) 2021, NVIDIA 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.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed ...
# Copyright (c) Facebook, Inc. and its affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. import argparse import logging from examples.textless_nlp.gslm.speech2unit.pretrained.utils import ( get_and_dump_features, ) def get_p...
""" Support for Modbus. For more details about this component, please refer to the documentation at https://home-assistant.io/components/modbus/ """ import logging import threading import voluptuous as vol import homeassistant.helpers.config_validation as cv from homeassistant.const import ( EVENT_HOMEASSISTANT_...
from django.db import models from users.models import User class Ticket(models.Model): user = models.ForeignKey( User, related_name="tickets", null=True, on_delete=models.SET_NULL, ) created = models.DateTimeField(auto_now_add=True) message = models.TextField() addi...
import torch import torch.nn as nn import torch.nn.functional as F from base.base_net import BaseNet class Wheel_LeNet(BaseNet): def __init__(self): super().__init__() self.rep_dim = 32 self.pool = nn.MaxPool2d(2, 2) self.conv1 = nn.Conv2d(1, 16, 5, bias=False, padding=2) ...
"""Tests uti.nodes functions.""" from textwrap import dedent from typing import Any import pytest from docutils import frontend, nodes from docutils.parsers import rst from docutils.utils import new_document from sphinx.transforms import ApplySourceWorkaround from sphinx.util.nodes import (NodeMatcher, clean_astext, ...
import os import re import shutil from typing import Union from zipfile import ZipFile import pytest from _pytest.fixtures import FixtureRequest from _pytest.tmpdir import TempPathFactory, _mk_tmp from mock import patch from demisto_sdk.commands.common.constants import LAYOUT, LAYOUTS_CONTAINER from demisto_sdk.comma...
from .main import cli if __name__ == '__main__': cli()
#!/usr/bin/python # # Copyright 2018-2021 Polyaxon, 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 ...
import vistrails.core.db.action import vistrails.db.versions import vistrails.core.modules.module_registry import vistrails.core.modules.utils from vistrails.core.modules.vistrails_module import Module, ModuleError, \ ModuleConnector, InvalidOutput from vistrails.core.modules.basic_modules import NotCacheable, Cons...
from django.test import TestCase from django.contrib.auth import get_user_model class ModelTests(TestCase): def test_create_user_with_email_successful(self): """Test creating a new user with an email is successful""" email = 'test@netholdings.com.au' password = 'good4now' user = g...
from django.contrib.auth.models import User, Group from rest_framework import serializers from events.models import EventPage, EventSignup class DiscordUserSerialiser(serializers.Serializer): discord_user = serializers.CharField(read_only=True) def create(self, validated_data): pass def update(...
import itertools import random import networkx as nx import sys import pandas as pd sys.setrecursionlimit(2000) def recursion(a, b, n, m): if n==0: return m if m==0: return n if a[n-1] == b[m-1]: return recursion(a, b, n-1, m-1) return 1 + min([ recursion(a, b, n-1, m), ...
# -*- coding: utf-8 -*- from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals import datetime import collections import logging from django.conf import settings from ralph.util import plugin from ralph_pricing.models imp...
import os import glob import torch import pickle from os import listdir from os.path import isfile, join import numpy as np import librosa import librosa.display import matplotlib.pyplot as plt from scipy.fftpack import dct from torch.utils.data import random_split, Dataset, DataLoader use_cuda = torch.cuda.is_availab...
# Copyright (c) 2020 FSMLP Authors. All Rights Reserved. import argparse import os, sys import logging import cv2 import numpy as np import json from PIL import Image, ImageDraw, ImageFont import math import unidecode import onnxruntime from paddle.fluid.core import PaddleTensor from paddle.fluid.core import Analysi...
from . import * # noqa from ..app import app def seed_db(db): """ Add seed entities to the database. """ with app.app_context(): # for x in AnalysisNature.create_defaults(): # db.session.add(x) # # for x in Country.create_defaults(): # db.session.add(x) ...
#!/usr/bin/env python """ Network VLAN Helper Classes """ from bacpypes.debugging import bacpypes_debugging, ModuleLogger from bacpypes.comm import Client, Server, ApplicationServiceElement, bind from bacpypes.pdu import Address, PDU from bacpypes.npdu import npdu_types, NPDU from bacpypes.vlan import Node from bac...
from flask import url_for from flask_wtf import FlaskForm from wtforms import ValidationError from wtforms.fields import (BooleanField, PasswordField, StringField, SubmitField, RadioField) from wtforms.fields.html5 import EmailField from wtforms.validators import Email, EqualTo, InputRequire...
# Generated by the protocol buffer compiler. DO NOT EDIT! # source: privacy.proto import sys _b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) from google.protobuf.internal import enum_type_wrapper from google.protobuf import descriptor as _descriptor from google.protobuf import message as _m...
from .GradientDescent import GradientDescent class NAG(GradientDescent): """ NAG, Nesterov Accelerated Gradient, computes the function derivative base on the next position of the paramente. Looking ahead helps NAG in correcting its course quicker than Momentum based gradient descent. Attributes: ...
import time from compas.rpc.services.default import start_service try: from xmlrpclib import ServerProxy except ImportError: from xmlrpc.client import ServerProxy def start(port, **kwargs): start_service(port) def stop(port, **kwargs): print('Trying to stop remote RPC proxy...') server = Serve...
from functions import check_hadoop_services, check_local_path from .exceptions import CustomRequestFailed from rest_framework import permissions actions= ['start', 'stop', 'restart', 'upload', 'run', 'check'] class HadoopPermission(permissions.BasePermission): """ Validity check for hadoop actions. """ ...
from datetime import ( date, datetime, timedelta, ) from functools import partial from io import BytesIO import os import re import numpy as np import pytest import pandas.util._test_decorators as td import pandas as pd from pandas import ( DataFrame, Index, MultiIndex, get_option, se...
from mp_api.routes.synthesis.models.core import ( SynthesisRecipe, SynthesisTypeEnum, SynthesisSearchResultModel, ) from mp_api.routes.synthesis.models.materials import ( Component, ExtractedMaterial, ) from mp_api.routes.synthesis.models.operations import ( Value, Conditions, Operation,...
"""Control application""" import time class Control: """ Control class """ # Control status modes STATUS_IDLE = 0 STATUS_CAPTURING = 1 STATUS_DITHERING = 2 STATUS_STOPPING = 3 # Loop delay in seconds LOOP_DELAY = 0.5 cached_camera_list = None cached_camera_config = ...
from .mesonet import MesoInception, MesoNet
import unittest import numpy import numpy as np from pyscf.pbc import gto as pgto import pyscf.pbc.dft as pdft from pyscf.pbc.df import fft, aft, mdf ################################################## # # port from ao2mo/eris.py # ################################################## from pyscf import lib from pyscf....
# Copyright (c) 2013 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 required by applicable law...
""" This module implements the Prefect context that is available when tasks run. Tasks can import prefect.context and access attributes that will be overwritten when the task is run. Example: ```python import prefect.context with prefect.context(a=1, b=2): print(prefect.context.a) # 1 print(prefect.context.a) ...
# Finds the appropriate MPF branch to go with this mpf-mc branch import git import os import sys parent_directory = (os.path.realpath(os.path.join(os.path.dirname(os.path.realpath(__file__)), os.pardir))) sys.path.insert(1, parent_directory) # pylint: disable-msg=wrong-import-position from mpfmc._version import __sho...
from data_importers.management.commands import BaseXpressDemocracyClubCsvImporter class Command(BaseXpressDemocracyClubCsvImporter): council_id = "E07000070" addresses_name = "parl.2019-12-12/Version 2/merged.tsv" stations_name = "parl.2019-12-12/Version 2/merged.tsv" elections = ["parl.2019-12-12"] ...
import json import os from errata_tool import ErrataConnector, Erratum from errata_tool.build import Build from errata_tool.products import ProductList from errata_tool.product import Product from errata_tool.product_version import ProductVersion from errata_tool.release import Release from errata_tool.variant import V...
# -*- coding: utf-8 -*- # # This file is part of Invenio. # # Copyright (C) 2021 Graz University of Technology. # # Invenio-Records-Marc21 is free software; you can redistribute it and/or # modify it under the terms of the MIT License; see LICENSE file for more # details. """Pytest configuration. See https://pytest-i...
#----------------------------------------------------------------------------- # Copyright (c) 2005-2015, PyInstaller Development Team. # # Distributed under the terms of the GNU General Public License with exception # for distributing bootloader. # # The full license is in the file COPYING.txt, distributed with this s...
from temboo.Library._23andMe.Ancestry import Ancestry, AncestryInputSet, AncestryResultSet, AncestryChoreographyExecution from temboo.Library._23andMe.Genomes import Genomes, GenomesInputSet, GenomesResultSet, GenomesChoreographyExecution from temboo.Library._23andMe.Genotype import Genotype, GenotypeInputSet, Genotype...
from collections import Counter, defaultdict from itertools import chain from six import iteritems, itervalues, string_types from . import builtin from .file_types import generated_file from .install import can_install from .. import options as opts, path from ..build_inputs import build_input from ..file_types import...
"""SchemaModel components""" from typing import ( Any, Callable, Dict, Iterable, List, Optional, Set, Tuple, Type, TypeVar, Union, cast, ) from .checks import Check from .errors import SchemaInitError from .schema_components import ( Column, Index, PandasDtyp...
print('C L A S S I C S O L U T I O N') range_of_numbers = [] div_by_2 = [] div_by_3 = [] other_numbers = [] for i in range(1,11): range_of_numbers.append(i) if i%2 == 0: div_by_2.append(i) elif i%3 == 0: div_by_3.append(i) else: other_numbers.append(i) print('The range of numbe...
import csv import errno import os import numpy import re import tempfile import threading import time from smqtk.utils import SmqtkObject def safe_create_dir(d): """ Recursively create the given directory, ignoring the already-exists error if thrown. :param d: Directory filepath to create :type ...
# Copyright (c) 2017-2019 Uber Technologies, Inc. # SPDX-License-Identifier: Apache-2.0 import argparse import logging import data import torch import pyro import pyro.distributions as dist import pyro.poutine as poutine from pyro.infer import MCMC, NUTS logging.basicConfig(format="%(message)s", level=logging.INFO)...
#!/usr/bin/env python # -*- coding: utf-8 -*- """The setup script.""" from setuptools import setup, find_packages with open('README.rst') as readme_file: readme = readme_file.read() with open('HISTORY.rst') as history_file: history = history_file.read() requirements = [ 'Click>=6.0', 'PyYAML>=3.12'...
import FWCore.ParameterSet.Config as cms process = cms.Process("PROD") process.load("SimG4CMS.Calo.pythiapdt_cfi") process.load('FWCore.MessageService.MessageLogger_cfi') process.load("IOMC.EventVertexGenerators.VtxSmearedGauss_cfi") #process.load("Configuration.Geometry.GeometryExtended2018Reco_cff") process.load("Co...
# 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) """ These tests check the database is functioning properly, both in memory and in its file """ import datetime import func...
# -*- coding: utf-8 -*- # PLEASE DO NOT EDIT THIS FILE, IT IS GENERATED AND WILL BE OVERWRITTEN: # https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code from ccxt.async_support.base.exchange import Exchange import base64 import hashlib import math from ccxt.base.errors import ExchangeError f...
from django.http import HttpResponseRedirect from django.urls import path, reverse from django.utils.translation import pgettext_lazy from .views import show_jurisdiction urlpatterns = [ path("", show_jurisdiction, name="publicbody-show_jurisdiction"), path( pgettext_lazy("url part", "entity/"), ...
import urwid class TableCell(urwid.Text): def __init__(self, content, width = 10, separator=True,align='left'): self.separator = separator self._content = content self._align = align self._width = width self._content = self._render_content() super().__init__(self._co...
# Matthieu Brucher # Last Change : 2007-08-28 00:36 """ A simple line search, in fact no searches at all """ class SimpleLineSearch(object): """ A simple line search, takes a point, adds a step and returns it """ def __init__(self, alpha_step = 1., **kwargs): """ Needs to have : - nothing C...
""" Helper modules. These should be stand alone modules that could reasonably be their own PyPI package. This comes with two benefits: 1. The library is void of any business data, which makes it easier to understand. 2. It means that it is decoupled making it easy to reuse the code in different sections of the ...
# from collections import defaultdict import os, fileinput, subprocess, sys import zlib, gzip import tools, variables import create_SQL_tables_snakemake as cst import obo_parser import random, multiprocessing from collections import deque PLATFORM = sys.platform # def unzip_file(fn_in, fn_out, number_of_processes=4)...
from aiohttp import web, WSMsgType from aiohttp_security import authorized_userid from players import AlreadyRegistered from protocol import handle_command, handle_error, send_command from commands import ErrorCommand import json import logging from global_defs import global_playground, registry async def websocket_h...
#coding:utf-8 # # id: bugs.core_1690 # title: arithmetic exception, numeric overflow, or string truncation in utf8 tables # decription: # tracker_id: CORE-1690 # min_versions: [] # versions: 2.1.3 # qmid: None import pytest from firebird.qa import db_factory, isql_act, Action # versi...
from django.db import models from django.urls import reverse from django_quill.fields import QuillField from user.models import User class Article(models.Model): title = models.CharField(max_length=128, blank=False, verbose_name="заглавие") cover = models.ImageField(upload_to="cover_images/%Y/%m/%d", blank=Tr...
from distutils.core import setup from Cython.Build import cythonize from distutils.extension import Extension import os pid_dir = os.path.join(os.path.dirname(__file__), "../firmware/lib/pid") setup( ext_modules = cythonize([ Extension("cpid", ["cpid.pyx", os.path.join(pid_dir, "src/pid.c")], ...
# coding=utf-8 """ Tests for deepreg/dataset/loader/interface.py """ from test.unit.util import is_equal_np import numpy as np import pytest from deepreg.dataset.loader.interface import ( AbstractPairedDataLoader, AbstractUnpairedDataLoader, DataLoader, FileLoader, GeneratorDataLoader, ) from dee...
# qubit number=5 # total number=47 import cirq import qiskit from qiskit import IBMQ from qiskit.providers.ibmq import least_busy from qiskit import QuantumCircuit, QuantumRegister, ClassicalRegister from qiskit import BasicAer, execute, transpile from pprint import pprint from qiskit.test.mock import FakeVigo from ma...
from __future__ import print_function, absolute_import import os import sys cmd = sys.modules["pymol.cmd"] from pymol import _cmd import threading import traceback if sys.version_info[0] == 2: import thread import urllib2 else: import _thread as thread import urllib.request as urllib2 import re impo...
# coding=utf-8 # *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** import json import warnings import pulumi import pulumi.runtime from typing import Union from .. import utilities, tables class GetAcc...
import os import unittest from conans.model.ref import ConanFileReference from conans.paths import CONANFILE from conans.test.utils.cpp_test_files import cpp_hello_conan_files from conans.test.utils.tools import TestClient, TestServer from conans.util.files import load class OnlySourceTest(unittest.TestCase): d...
# AUTOGENERATED! DO NOT EDIT! File to edit: 16_servers_started_via_docker.ipynb (unless otherwise specified). __all__ = ['BaseServer', 'FastAPIUvicornServer', 'DjangoGunicornWSGIServer', 'NginxDockerServer'] # Cell import time import subprocess from pydantic import BaseModel from .files import BenchmarkFile from ....
import os import torch import random import numpy as np from functools import reduce from visdom import Visdom from torchvision.transforms import ToPILImage, ToTensor from shutil import copyfile import torch.nn.functional as F def add_prefix(path, pref): """ Add prefix to file in path Args: path: ...
from phoney import __version__ def test_version(): assert __version__ == '0.1.0'
#!/usr/bin/env python # -*- coding: utf-8 -*- # File: train-atari.py # Author: Yuxin Wu import argparse import cv2 import gym import multiprocessing as mp import numpy as np import pickle import os import six import sys import uuid import tensorflow as tf from six.moves import queue from tensorpack import * from tens...
import signal import requests import docker import json import time import sys def signal_handler(signal, frame): print("Stopping Grafana...") docker_client = client.from_env() try: grafana = [ c for c in docker_client.containers.list() if c.attrs['Config']['Image'] == "gra...
""" This module implements a remote pool to use with AMP. """ from twisted.protocols import amp class AMPProxy(amp.AMP): """ A Proxy AMP protocol that forwards calls to a wrapped callRemote-like callable. """ def __init__(self, wrapped, child): """ @param wrapped: A callRemote-like ...