text
stringlengths
1
927k
# -*- coding: utf-8 -*- """Pipeline for GuiltyTargets.""" from typing import List, Tuple import pandas as pd from .constants import gat2vec_config from .gat2vec import Classification, Gat2Vec, gat2vec_paths from .ppi_network_annotation import AttributeNetwork, LabeledNetwork, Network, generate_ppi_network, parse_dg...
#!/usr/bin/env python3 # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. import subprocess import os import shutil import sys from checkpoint._test_helpers import makedir from _test_commons import _single_run, _distributed_run checkpoint_dir = os.path.abspath("checkpoint/ch...
""" Test that the fiftyone core does not depend on Tensorflow or PyTorch. """ import sys import pytest # raise an ImportError if any of these modules are imported # https://docs.python.org/3/reference/import.html#the-module-cache sys.modules["tensorflow"] = None sys.modules["tensorflow_datasets"] = None sys.modules[...
# coding=utf-8 # -------------------------------------------------------------------------- # 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 ...
# Copyright 2014 PerfKitBenchmarker 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 appli...
#!/usr/bin/env python import numpy as np import rospy from std_msgs.msg import Int32 from geometry_msgs.msg import PoseStamped from styx_msgs.msg import Lane, Waypoint from scipy.spatial import KDTree import math ''' This node will publish waypoints from the car's current position to some `x` distance ahead. As ment...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # Copyright 2020 Nagoya University (Wen-Chin Huang) # Apache 2.0 (http://www.apache.org/licenses/LICENSE-2.0) """Voice Transformer Network (Transformer-VC) related modules.""" import logging import torch import torch.nn.functional as F from espnet.nets.pytorch_backe...
import os CARTOGRAM_EXE = os.environ['CARTOGRAM_EXE'] CARTOGRAM_DATA_DIR = os.environ['CARTOGRAM_DATA_DIR'] CARTOGRAM_COLOR = os.environ['CARTOGRAM_COLOR'] DEBUG = True if os.environ['CARTOGRAM_DEBUG'].lower() == "true" else False DATABASE_URI = os.environ['CARTOGRAM_DATABASE_URI'] USE_DATABASE = True if os.environ['C...
#!/usr/bin/env python3 # Copyright (c) 2017 The Bitcoin Core developers # Copyright (c) 2017-2020 The Raven Core developers # Copyright (c) 2021 The Bagi Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """ Testing ...
from . import ingredients from . import items from . import recipes from . import tags MODULES = ( ingredients, items, recipes, tags, ) def register_blueprints(api): """Initialize application with all modules""" for module in MODULES: api.register_blueprint(module.blp)
from django.contrib import admin from twitterbot.models import ResponseTemplate, TwitterBotError, TwitterBotResponseLog class TwitterBotErrorAdmin(admin.ModelAdmin): list_display = ('stack_trace', 'timestamp') class TwitterBotResponseLogAdmin(admin.ModelAdmin): list_display = ('tweet_url', 'tweet_content',...
""" This module allows to run an experiment from a configuration template file. """ import argparse from ConfigGenerator import ConfigGenerator from use_network import train def main(): """ Parse the CLI arguments and then run the experiment with different trials (i.e. hyper-parameter configurations). "...
################################### # CS B551 Fall 2018, Assignment #3 # # Scoring code by D. Crandall # # PLEASE DON'T MODIFY THIS FILE. # Edit pos_solver.py instead! # class Score: def __init__(self): self.word_scorecard = {} self.sentence_scorecard = {} self.word_count = 0 self....
# 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 logging import math from collections.abc import Collection from dataclasses import dataclass, field from typing import List import tor...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models from django.utils.translation import ugettext_lazy as _ from django.utils.encoding import python_2_unicode_compatible class LocationManager(models.Manager): def nearby(self, latitude, longitude, proximity): """ ...
#!/usr/bin/env python import glob import argparse from astropy.table import Table import numpy as np # Set up the command line argument parser parser = argparse.ArgumentParser(description='Compare two versions of spec1D files from CUBS IMACS or LDSS3') parser.add_argument('-d1', metavar='directory 1', type=str, help='...
import uuid from aiohttp.web_exceptions import HTTPNotFound, HTTPUnauthorized, HTTPForbidden from aiohttp_apispec import docs, request_schema, response_schema, querystring_schema from app.crm.models import User from app.crm.schemes import ListUsersResponseSchema, UserGetRequestSchema, UserGetResponseSchema, \ Use...
from humans import Anastasis import random, time, os, re, tweepy consumer_key = os.environ['TWITTER_CONSUMER_KEY'] consumer_secret = os.environ['TWITTER_CONSUMER_SECRET'] access_token = os.environ['TWITTER_ACCESS_TOKEN'] access_token_secret = os.environ['TWITTER_ACCESS_TOKEN_SECRET'] auth = tweepy.OAuthHandler(consum...
## $Id$ ''' Defines database backend library and database table and object relationships. Example usage: import database, db_mid # get platform with id 7; will raise exception if no such platform. p7 = database.Platforms[7] # get platforms with friendly name "commodore 64" p_c64 = database.Platforms.find(user_frie...
import math from classifier import Classifier class ROIRevisitClassifier(Classifier): def __init__(self,param): super(ROIRevisitClassifier,self).__init__(param) self.last_state = False def update(self,t,obj_dict): current_object = obj_dict['fly'] if current_object is not None:...
# -*- coding: utf-8 -*- ''' tests for pkgrepo states ''' # Import Python libs from __future__ import absolute_import # Import Salt Testing libs from tests.support.case import ModuleCase from tests.support.mixins import SaltReturnAssertsMixin from tests.support.unit import skipIf from tests.support.helpers import ( ...
from Utils.Array import input_array """ https://www.geeksforgeeks.org/to-find-smallest-and-second-smallest-element-in-an-array/ Find the smallest and second smallest elements in an array Important part could be handling the corner cases, like handling the duplicates (even if you sort it) Approach 1 : sorting O...
# 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. # # allow explicit reimports (mypy) by renaming all imports from . import helpers as helpers from .auto.auto import AutoExecutor as AutoExecut...
from Strategier import Strategier from BuyStrategier import BuyStrategier from SellStrategier import SellStrategier from GdaxArmy import GdaxArmy from Trader import Trader
"""The general algorithm for all of the data-based variable importance methods is the same, regardless of whether the method is Sequential Selection or Permutation Importance or something else. This is represented in the ``abstract_variable_importance`` function. All of the different methods we provide use this func...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ | This file is part of the web2py Web Framework | Created by niphlod@gmail.com | License: LGPLv3 (http://www.gnu.org/licenses/lgpl.html) Scheduler with redis backend --------------------------------- """ import os import time import socket import datetime import loggi...
import os import subprocess import tempfile from pathlib import Path def build_arg_env(env_var_name): val = os.getenv(env_var_name) return f"--build-arg {env_var_name}={val}" def build_img(cuda_version, oneflow_src_dir, use_tuna, use_system_proxy, img_tag): cudnn_version = 7 if str(cuda_version).sta...
import pytest from ats.users.models import User from ats.users.tests.factories import UserFactory @pytest.fixture(autouse=True) def media_storage(settings, tmpdir): settings.MEDIA_ROOT = tmpdir.strpath @pytest.fixture def user() -> User: return UserFactory()
from collections import defaultdict, deque with open("input.txt") as input_file: lines = input_file.read().splitlines() g = defaultdict(set) for line in lines: n1, n2 = line.split("-") g[n1].add(n2) g[n2].add(n1) def walk(node, path, return_here): if node == "end": yield path fo...
# 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 contextlib import json import logging import math import os from argparse import Namespace from collections import OrderedDict, default...
import json from lib.k8s import K8sClient class deleteCoreV1NamespacedEndpoints(K8sClient): def run( self, body, name, namespace, gracePeriodSeconds=None, orphanDependents=None, pretty=None, config_override=None): ...
#!/usr/bin/env python3 """ Hexdump Utility =============== A command line hexdump utility. See the module's `Github homepage <https://github.com/risapav/ihex_analyzer>`_ for details. """ # pouzite kniznice import struct import codecs # definovanie konstant ROWTYPE_DATA = 0x00 # Data container ROWTYPE_EOF = 0x01 # E...
import tkinter as tk import time import threading global autoXP, manualXP, roundTitle, button from google.cloud import vision import re import pyautogui global autoXPIsOn autoXPIsOn = False def getRoundsToPlay(): pyautogui.screenshot('energyCount.png', region=(x + 286, y + 430, 45, 32)) # Get a screenshot of t...
# Generated by Django 3.2.4 on 2021-08-24 18:41 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('Task', '0008_auto_20210815_1346'), ] operations = [ migrations.AddField( model_name='task', name='help_text', ...
##################################################################################### # # Copyright (c) Microsoft Corporation. All rights reserved. # # This source code is subject to terms and conditions of the Microsoft Public License. A # copy of the license can be found in the License.html file at the root of this ...
# -*- coding: utf-8 -*- # Copyright 2018 New Vector Ltd # # 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 la...
import re from string import ascii_uppercase from scrapy import Request from product_spider.items import RawData from product_spider.utils.spider_mixin import BaseSpider class MolcanPrdSpider(BaseSpider): name = 'molcan' base_url = 'http://molcan.com' start_urls = map(lambda x: f"http://molcan.com/prod...
from easyfilemanager.core import FileManager
#! /usr/bin/env python # Thomas Nagy, 2011 # Try to cancel the tasks that cannot run with the option -k when an error occurs: # 1 direct file dependencies # 2 tasks listed in the before/after/ext_in/ext_out attributes from waflib import Task, Runner Task.CANCELED = 4 def cancel_next(self, tsk): if not isinstance(t...
# coding: utf-8 """ Mojang Authentication API No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 OpenAPI spec version: 2020-06-05 Generated by: https://openapi-generator.tech """ from __future__ import absolute_import import uni...
import elementally as elmy import unittest import itertools pos_array = [1, 2, 3, 4, 5] pos_array_2 = [5, 4, 3, 2, 1] neg_array = [-10, -20, -30, -40, -50] neg_array_2 = [-50, -40, -30, -20, -10] def odd_generator(): i=1 while(True): yield i i+=2 def complex_generator(): i=1 while(True...
# The MIT License (MIT) # # Copyright (c) 2020 Evgeny Medvedev, evge.medvedev@gmail.com # # 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...
# Copyright 2021 Alexis Lopez Zubieta # # 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, publi...
from __future__ import absolute_import import torch from torch import nn from torch.nn import functional as F from torch.nn import init import torchvision from collections import OrderedDict from ..models.layers.adain import SMMBlock __all__ = ['ResNet', 'resnet18', 'resnet34', 'resnet50', 'resnet101', '...
# -*- coding: utf-8 -*- # Copyright 2020 Google LLC # # 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 o...
#!/usr/bin/env python import sys import time _ENABLE_GUI = "--gui" in sys.argv # If you don't want to see log messages on the console, uncomment the # following line. You might want to do this if you are using the GUI # which displays logs itself. _DISABLE_CONSOLE_LOG = True #from sim.basics import Hub as switch #...
# -*- coding: utf-8 -*- """ This is the script that is actually frozen into an executable: simply executes py.test main(). """ if __name__ == "__main__": import sys import pytest sys.exit(pytest.main())
# coding: utf-8 """ Isilon SDK Isilon SDK - Language bindings for the OneFS API # noqa: E501 OpenAPI spec version: 9 Contact: sdk@isilon.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ import pprint import re # noqa: F401 import six class CloudSettingsSettingsSleep...
import os import sys import json import time from PyQt5 import QtCore, QtWidgets from PyQt5.QtWidgets import * from PyQt5.QtGui import * from PyQt5.QtCore import pyqtSignal, pyqtSlot class WindowObj3MxrcnnInfer(QtWidgets.QWidget): backward_3_mxrcnn = QtCore.pyqtSignal(); def __init__(self): super()...
# -*- coding: utf-8 -*- # Generated by Django 1.9.8 on 2016-08-22 20:32 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('jobs', '0009_auto_20160822_1211'), ] operations = [ migrations.AddField( ...
import json import requests import yaml from fair_test import FairTest, FairTestEvaluation class MetricTest(FairTest): metric_path = 'i1-data-knowledge-representation-weak' applies_to_principle = 'I1' title = 'Data uses a formal knowledge representation language (weak)' description = """Maturity Indi...
# Copyright (c) 2012 ARM Limited # All rights reserved. # # The license below extends only to copyright in the software and shall # not be construed as granting a license to any other intellectual # property including but not limited to intellectual property relating # to a hardware implementation of the functionality ...
import requests from httprunner import built_in, exceptions, loader, response from httprunner.compat import basestring, bytes from tests.api_server import HTTPBIN_SERVER from tests.base import ApiServerUnittest class TestResponse(ApiServerUnittest): def setUp(self): self.functions_mapping = loader.load_m...
import json import csv import pandas as pd from isic_api import ISICApi from pandas.io.json import json_normalize # Initialize the API; no login is necessary for public data api = ISICApi(username="SkinCare", password="unbdeeplearning") outputFileName = 'imagedata' imageList = api.getJson('image?limit=25000&offset=0&...
"""talentpool URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/3.2/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') Class-ba...
# 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...
from django.contrib import admin from experiment_session.models import ExperimentSession, Combination, Repeat # Register your models here. admin.site.register(ExperimentSession) admin.site.register(Combination) admin.site.register(Repeat)
import tree import redis import time import socket import os from simple_queue import redis_queue import logging REDIS_HOST=os.environ["REDIS_HOST"] REDIS_PORT=6379 rq = redis_queue(redis_host = REDIS_HOST, redis_port=REDIS_PORT) # This is the job that simulates a particular forest # NOTE: characteristic contains log...
# -*- coding: utf-8 -*- from __future__ import (absolute_import, division, print_function) import json from branca.element import Figure, JavascriptLink from folium.map import Layer from folium.utilities import _isnan, _iter_tolist, none_max, none_min from jinja2 import Template class HeatMap(Layer): """ ...
from math import pow pi = 3.14159 raio = int(input()) volume = (4.0/3) * pi * (pow(raio, 3)) print('VOLUME = {:.3f}'.format(volume))
from typing import Type, List from jivago.inject import typing_meta_helper from jivago.lang.annotations import Override from jivago.lang.stream import Stream from jivago.serialization.deserialization_strategy import DeserializationStrategy, T TYPES_WHICH_DESERIALIZE_TO_LISTS = ('List', 'Iterable', 'Collection') cla...
class HT16K33: def __init__(self, i2, a = 0x70): self.i2 = i2 self.a = a self.command(0x21) # Clock on self.command(0x81) # Display on self.bright(15) self.load([0] * 16) def bright(self, n): assert 0 <= n < 16 self.command(0xe0 + n) ...
import json from pyquery import PyQuery from scylla.database import ProxyIP from .base_provider import BaseProvider class ProxyScraperProvider(BaseProvider): def urls(self) -> [str]: return ['https://raw.githubusercontent.com/sunny9577/proxy-scraper/master/proxies.json'] def parse(self, document: ...
import typer import uvicorn from .app import app from .config import settings cli = typer.Typer(name="fastapi_workshop API") @cli.command() def run( port: int = settings.server.port, host: str = settings.server.host, log_level: str = settings.server.log_level, reload: bool = settings.server.reload, ...
#!/usr/bin/env python # -*- coding: utf-8 -*- from glob import glob from setuptools import setup, find_packages import versioneer pkg_name = 'nbsafety' def read_file(fname): with open(fname, 'r', encoding='utf8') as f: return f.read() history = read_file('HISTORY.rst') requirements = read_file('requir...
from setuptools import setup, find_packages setup( name = 'pygifconvt0001', version = '1.0.6', description = 'Test package for distribution', author = 'rumfox', author_email = 'maebong@gmail.com', url = '', download_url = '', inst...
# Cast column to f64 before convert it to pandas # This is a hack, use the assert_equal comparator when nulls is # fully supported on cudf.sort_values import json import logging import os import re import time import blazingsql from blazingsql import DataType # import git import numpy as np import pandas as pd from ...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # __author__ = 'Liantian' # __email__ = "liantian.me+code@gmail.com" from io import BytesIO import qrcode from flask import Flask, render_template, send_file, request from qrcode.exceptions import DataOverflowError ecl_map = { 'L': qrcode.constants.ERROR_CORRECT_L, ...
#!/usr/bin/env python # Copyright 2018 Google LLC # # 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ...
"""System-provided config objects and constructors.""" from typing import AbstractSet, Any, Dict, List, NamedTuple, Optional, Type, Union, cast from dagster import check from dagster.core.definitions.configurable import ConfigurableDefinition from dagster.core.definitions.executor_definition import ( ExecutorDefin...
""" Routes module. Responsible for providing the means to register the application routes. """ from example_web_app.controllers.health_api import HealthApiController from example_web_app.controllers.example_api import ExampleApiController def setup_routes(app): ### # Register the HelloWorld API handlers ...
""" Reference implementation for the correlation energy of MP3 with an RHF reference. References: - Equations from [Szabo:1996] """ __authors__ = "Daniel G. A. Smith" __credits__ = ["Daniel G. A. Smith", "Dominic A. Sirianni"] __copyright__ = "(c) 2014-2018, The Psi4NumPy Developers" __license__ = "BSD-3-Clau...
# -*- coding: utf-8 -*- from __future__ import absolute_import, unicode_literals import django import six DJANGO3 = django.VERSION[0] == 3 DJANGO2 = django.VERSION[0] == 2 # # if DJANGO2 or DJANGO3: # def is_anonymous(user): # return user.is_anonymous # # else: # def is_anonymous(user): # retu...
from django.apps import AppConfig class ObdConfig(AppConfig): name = 'obd'
#! usr/bin/env python3 # -*- coding:utf-8 -*- """ Copyright 2018 The Google AI Language Team Authors. BASED ON Google_BERT. @Author:zhoukaiyin """ from __future__ import absolute_import from __future__ import division from __future__ import print_function import collections import os from bert import modeling from ber...
# -*- coding: utf-8 -*- # # Copyright 2019 Google LLC # # 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law...
from warnings import warn from bluesky.utils import maybe_await from bluesky.preprocessors import print_summary_wrapper from bluesky.run_engine import call_in_bluesky_event_loop, in_bluesky_event_loop from .protocols import Checkable def plot_raster_path(plan, x_motor, y_motor, ax=None, probe_size=None, lw=2): ""...
# Copyright (c) 2002-2011 IronPort Systems and Cisco Systems # # 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, mo...
#!/usr/bin/env python3 # Writing csv files import csv # Write a csv file with three rows and four columns with open("output.csv", "w") as data_file: output_writer = csv.writer(data_file) output_writer.writerow(["Hello, World!", "How", "are", "you?"]) output_writer.writerow(["This", "is", "Sparta", "bit...
#!/usr/bin/env python3 import os import hashlib dir_path = os.path.dirname(os.path.realpath(__file__)) file = open(dir_path + "/input.txt", "r") input_txt = file.read().strip() # print(input_txt) # input_txt = "abcdef" # input_txt = "pqrstuv" def try_suffix(suffix, starts_with): s = input_txt + str(suffix) ...
from random import randint from operator import itemgetter rankin = {} jogadores = {'Jogador-1':randint(1, 6), 'Jogador-2':randint(1, 6), 'Jogador-3':randint(1, 6), 'Jogador-4':randint(1, 6)} print('VALORES SORTEADOS') for i, v in jogadores.items(): print(f'{i} tirou {v} no dado') print('='*29) rankin...
# coding: utf-8 """ NEF_Emulator No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501 OpenAPI spec version: 0.1.0 Generated by: https://github.com/swagger-api/swagger-codegen.git """ from __future__ import absolute_import import re # ...
import numpy as np from collections import deque from typing import Union from torch import nn, FloatTensor, LongTensor from torch.functional import F from torch.optim import Adam from torch.nn import CrossEntropyLoss from mae_envs.envs import DraftState from mcts import SearchNode, SearchProblem class SwarmAgent(...
#!/usr/bin/env python3 # # This file is part of LiteDRAM. # # Copyright (c) 2020 Florent Kermarrec <florent@enjoy-digital.fr> # SPDX-License-Identifier: BSD-2-Clause import os import argparse from migen import * from litex_boards.platforms import kc705 from litex.soc.cores.clock import * from litex.soc.interconnec...
# coding=utf-8 # -------------------------------------------------------------------------- # 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 ...
# Generated by Django 2.0.8 on 2018-08-07 23:16 from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('forum', '0003_bbcodeimage'), ] operations = [ migrations.AlterModelOptions( name='bbcodeimage', options={'verbose_name': 'BB...
import hubspot.crm.extensions.cards as api_client from ....discovery_base import DiscoveryBase class Discovery(DiscoveryBase): @property def cards_api(self) -> api_client.CardsApi: return self._configure_api_client(api_client, "CardsApi")
#!/usr/bin/env python3 import argparse import json import os import subprocess import re import sys import yaml # Color codes for colored output! BOLD = subprocess.check_output(['tput', 'bold']).decode() GREEN = subprocess.check_output(['tput', 'setaf', '2']).decode() NC = subprocess.check_output(['tput', 'sgr0']).de...
import string template = string.Template("""# # Copyright (c) 2014 Juniper Networks, Inc. All rights reserved. # # Vcenter Plugin configuration options # [DEFAULT] # Everything in this section is optional # Vcenter plugin URL vcenter.url=$__contrail_vcenter_url__ #Vcenter credentials vcenter.username=$__contrail_v...
""" Module with SQLite helpers, see http://flask.pocoo.org/docs/0.12/patterns/sqlite3/ """ import logging import threading from contextlib import contextmanager from psycopg2 import pool, extras from constants import SCHEMA_PATH, POSTGRES_DSN logger = logging.getLogger(__name__) class DBPool: _lock = threadin...
"""Blueprint for HacsWebResponse.""" import os from time import time from homeassistant.components.http import HomeAssistantView from jinja2 import Environment, PackageLoader from aiohttp import web from integrationhelper import Logger from .hacsbase import Hacs WEBRESPONSE = {} def webresponse(classname): ""...
## # This file contains the auth credentials used to access openstack deployments # we wish to manage. The 'default' credentials will be used for any deployments # not specifed here. # deployment_auth = { # Example # 'deployment_name': { # 'user': 'email@domain.com', # 'pasword': 'password', # 't...
# Generated by Django 2.1.7 on 2019-07-09 23:01 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('hydroserver_core', '0002_auto_20190709_2226'), ] operations = [ migrations.AlterField( model_name='timeseries', name...
import os.path import re import sys import math import numpy as np import google.protobuf.text_format import pytest import glob # Local files current_file = os.path.realpath(__file__) current_dir = os.path.dirname(current_file) sys.path.insert(0, os.path.join(os.path.dirname(current_dir), 'common_python')) import tool...
def hello(): print("Hello from Package 2")
import pyinputplus as pyip response = pyip.inputNum(blockRegexes=[r'[02468]$']) print(f"Your number is {response}")
n,m=map(int,input().split()) x=[i for i in range(1,n+1)] for i in range(m): a,b=map(int,input().split()) x[a-1],x[b-1]=x[b-1],x[a-1] for i in x: print(i,end=' ')
import pytest from indy_catalyst_agent.storage import StorageRecord class TestStorageRecord: def test_create(self): record_type = "TYPE" record_value = "VALUE" record = StorageRecord(record_type, record_value) assert record.type == record_type assert record.value == recor...
#!/usr/bin/env python # file name: google_search.py # created by: Ventura Del Monte # purpose: Google Search Implementation # last edited by: Ventura Del Monte 04-10-2014 from internal_browser import * from bs4 import BeautifulSoup import urlparse import re class GoogleSearch(InternalBrowser): # base_url = "https:/...
import sys import errno sys.path.append('../../common') from env_indigo import * indigo = Indigo() indigo.setOption("molfile-saving-skip-date", "1"); if not os.path.exists(joinPathPy("out", __file__)): try: os.makedirs(joinPathPy("out", __file__)) except OSError as e: if e.errno != errno.EEXI...