text
stringlengths
2
999k
# Copyright (c) Microsoft Corporation. # Licensed under the MIT License import json import uuid from datetime import datetime from typing import TYPE_CHECKING if TYPE_CHECKING: from azure.kusto.ingest import BlobDescriptor, IngestionProperties class IngestionBlobInfo: def __init__(self, blob_descriptor: "Blo...
import threading import time import unittest from datetime import datetime from pika.exchange_type import ExchangeType from rabbitmq_client import ( RMQConsumer, RMQProducer, ConsumeParams, QueueParams, ExchangeParams, ConsumeOK, ConfirmModeOK ) def started(rmq_client, timeout=2.0): st...
from django.contrib import admin from .models import Author, Book, BookInstance, Genre # Register your models here. admin.site.register([Author, Book, BookInstance, Genre])
from uuid import uuid4 from django.db import models class Plan(models.Model): """ A course plan. Each plan consists of many terms. """ id = models.UUIDField(primary_key=True, default=uuid4, editable=False) name = models.TextField() class Term(models.Model): """ A term in a plan. Each term consists ...
# 054 - LER ANO DE NASCIMENTO DE 07 PESSOAS E MOSTRAR QUANTAS PESSOAS SÂO MAIORES DE IDADE. from datetime import date atual = date.today().year tmaior = 0 tmenor = 0 for pessoa in range(1, 8): nasc = int(input(f'Em que ano {pessoa}° a pessoa nasceu? ')) idade = atual - nasc if idade >= 21: tmaior +...
# Copyright 2018 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...
from grit.core.base import get_img_dir from grit.decisiontree.dt_goal_recogniser import OcclusionGrit, GeneralisedGrit model = OcclusionGrit.load('heckstrasse') model.save_images() # truncate = ['RT', 'RFTT', 'RFFF'] truncate = [] goal_type = 'turn-right' goal_tree = model.decision_trees[goal_type] pydot_tree = goal...
##===-- debuggerdriver.py ------------------------------------*- Python -*-===## ## ## The LLVM Compiler Infrastructure ## ## This file is distributed under the University of Illinois Open Source ## License. See LICENSE.TXT for details. ## ##===-------------------------------------------------------...
# Generated by Django 2.1.7 on 2019-04-11 22:12 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( name='Artwork', fields=[ ...
''' ==================================================================== Copyright (c) 2003-2016 Barry A Scott. All rights reserved. This software is licensed as described in the file LICENSE.txt, which you should have received as part of this distribution. ======================================================...
import operator from decimal import Decimal from typing import List import pandas as pd from watchmen.common.snowflake.snowflake import get_surrogate_key from watchmen.common.utils.data_utils import build_collection_name from watchmen.pipeline.core.by.parse_on_parameter import __week_number_of_month from watchmen.pip...
from django import forms from django.core.validators import RegexValidator # from phonenumber_field.formfields import PhoneNumberField SHARING_FREQUENCY_CHOICES = [ ("one_time", "One-Time Collection"), ("bene_action", "Only when beneficiaries take a specific action"), ("daily", "Data is shared with third-...
# 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
""" A collection of linear circuits (e.g. amplifiers, filters, ...). """
# 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 or agreed to in writing, s...
info = { 'driver': 'SQL Server', 'server': 'dns/ip', 'database': 'name', 'username': '', 'password': '' } def get_connection_string(info): return 'DRIVER={{{}}};SERVER={};DATABASE={};Uid={};Pwd={}'.format(info['driver'], info['server'], info['database'], info['username'], info['password'])
from datetime import datetime from time import time import pandas import requests from crypto_package.conf import service_config as conf def get_candles(exchange: str, currency_pair: str, timeframe: str, time_start=None, time_end=None, last_n_candles=None): """Gets required candles. Parameters: ...
from django.db import models from django.utils.timezone import datetime,now class Category(models.Model): name = models.CharField(max_length=20) def __str__(self): return self.name class Project(models.Model): title = models.CharField(max_length=100) description = models.TextField() techn...
# Licensed to the StackStorm, Inc ('StackStorm') 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 use th...
import logging from selenium import webdriver import json from abprocess.authenticator import Authenticator from abprocess.booking_course import BookingCourse from datetime import datetime from abprocess.logger import LogFileHandler from abprocess.process import Process import os logger = logging.getLogger() LogFile...
from django.contrib import admin from polymorphic.admin import (PolymorphicChildModelFilter, PolymorphicChildModelAdmin) import sistema.polymorphic from groups import models @admin.register(models.AbstractGroup) class AbstractGroupAdmin(sistema.polymorphic.PolymorphicParentModelAdmin):...
# -*- coding: utf-8 -*- # Author: Vera Heck <heck@pik-potsdam.de> # script designed to run parallel (step size given by number of nodes) import numpy as np import matplotlib matplotlib.use("Agg") import matplotlib.pyplot as plt import matplotlib.cm as cm import mpi array = np.array # import code import data_fig7 a...
# Copyright 2020 Huawei Technologies Co., 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 law or a...
# -*- coding: utf-8 -*- """ mundiapi This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ). """ class GetCheckoutBankTransferPaymentResponse(object): """Implementation of the 'GetCheckoutBankTransferPaymentResponse' model. Bank transfer checkout response ...
# coding=utf-8 # Copyright 2020 The HuggingFace Team 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 require...
import os import cv2 import time import argparse import multiprocessing import numpy as np import tensorflow as tf from utils.app_utils import FPS, WebcamVideoStream from multiprocessing import Queue, Pool from object_detection.utils import label_map_util from object_detection.utils import visualization_utils as vis_u...
# Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserve. # # 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 applic...
''' Code for reading in combined spectra. Any way that you can get your hands on the spectra should be fine, as long as you Here we adopt APOGEE DR14. Edit os.environs below for a later version of APOGEE data release. Since our spectral model training set was normalized using the DR12 wavelength definition, even tho...
# 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, overload from ... import _utilities __...
""" Full assembly of the parts to form the complete network """ import torch.nn.functional as F from models.unet_parts import * class UNet(nn.Module): def __init__(self, n_channels, n_classes, bilinear=True): super(UNet, self).__init__() self.n_channels = n_channels self.n_classes = n_cl...
import streamlit as st from pathlib import Path import base64 from modules.toc import * # Initial page config page_title ='Postgres Cheatsheet for Python' # st.set_page_config( # page_title='Postgres Cheatsheet for Python', # layout="wide", # # initial_sidebar_state="expanded", # ) def img_t...
from django import forms from django.contrib.auth.models import User from django.core.exceptions import ValidationError from authy.models import Profile def ForbiddenUsers(value): forbidden_users = ['admin', 'css', 'js', 'authenticate', 'login', 'logout', 'administrator', 'root', 'email', 'user', 'join', 'sql...
# Lint as: python3 # 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 agr...
""" Django settings for alineapp_avatar_1103_2 project. Generated by 'django-admin startproject' using Django 2.2.2. For more information on this file, see https://docs.djangoproject.com/en/2.2/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/2.2/ref/settings/ ""...
import argparse try: import configparser from configparser import NoOptionError, NoSectionError except ImportError: import ConfigParser as configparser from ConfigParser import NoOptionError, NoSectionError import datetime import getpass import logging import os import sys import boto3 from botocore.ex...
# -*- coding: utf-8 -*- """ Created on Wed Feb 24 07:01:07 2021 @author: Mahmu """ # HYPOTHESIS: h(x) = ax^2 import numpy as np def problem4(): RUNS = 1000 a_total = 0 N = 2 # size of data set for _ in range(RUNS): # two random points x_rnd = np.random.uniform(-1, ...
#!/usr/bin/env python3 # Copyright (c) 2014-2021 Daniel Kraft # Distributed under the MIT/X11 software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # RPC tests for name operations and the rawtx API. from test_framework.names import NameTestFramework, val from tes...
# Copyright 2021 The TensorFlow 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 applicable law or agreed to ...
# -*- coding: utf-8 -*- # Generated by Django 1.10.1 on 2017-08-26 04:20 from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ ('details', '0004_stall_imageurl'), ]...
# Embedded file name: c:\Jenkins\live\output\win_32_static\Release\midi-remote-scripts\Push\NavigationNode.py import Live.DrumPad import Live.Song import Live.Track DeviceType = Live.Device.DeviceType from itertools import imap from functools import partial from _Framework.SubjectSlot import SlotManager, Subject, subje...
""" This file offers the methods to automatically retrieve the graph Chloroflexus aggregans. The graph is automatically retrieved from the STRING repository. Report --------------------- At the time of rendering these methods (please see datetime below), the graph had the following characteristics: Datetime: 2021...
from .detection import get_boundaries, get_clean_labels, get_section_beats, get_structure_array, get_tempos, process
import pytest pytestmark = pytest.mark.django_db from seahub.test_utils import BaseTestCase from seaserv import seafile_api from mock import patch, MagicMock class SharedRepoTest(BaseTestCase): def setUp(self): from constance import config self.config = config self.repo_id = self.create_...
"""The tests for the rss_feed_api component.""" from defusedxml import ElementTree import pytest from openpeerpower.const import HTTP_NOT_FOUND from openpeerpower.setup import async_setup_component @pytest.fixture def mock_http_client(loop, opp, opp_client): """Set up test fixture.""" config = { "rss...
# Copyright 2019 The LUCI Authors. All rights reserved. # Use of this source code is governed under the Apache License, Version 2.0 # that can be found in the LICENSE file. from PB.recipes.recipe_engine.engine_tests import proto_properties PYTHON_VERSION_COMPATIBILITY = 'PY2+3' DEPS = [ 'assertions', 'proper...
# -*- coding: utf-8 -*- # Define here the models for your scraped items # # See documentation in: # http://doc.scrapy.org/en/latest/topics/items.html import scrapy class MovieScrappingItem(scrapy.Item): weekday = scrapy.Field() name = scrapy.Field() url = scrapy.Field() hours = scrapy.Field() po...
""" Automatically extract best config and epoch and retrain the model on both train + val sets """ import os import subprocess import re import argparse from hyperparam_checking import find_best_config_hyperparam_tune, find_best_perf def retrain(hyperparam_tune_path, save_path, all_model_types=[], all_lambdas=[], sho...
import os import sys import psutil from monk.pytorch_prototype import prototype from monk.compare_prototype import compare from monk.pip_unit_tests.pytorch.common import print_start from monk.pip_unit_tests.pytorch.common import print_status import torch import numpy as np from monk.pytorch.losses.return_loss import...
import numpy class SumTree(object): def __init__(self, capacity): self.write = 0 self.capacity = capacity self.tree = numpy.zeros(2*capacity - 1) self.data = numpy.zeros(capacity, dtype=object) def _propagate(self, idx, change): parent = (idx - 1) // 2 self.t...
def str_sort_python_builtin(s: str) -> str: return "".join(sorted(s)).strip()
# #START_LICENSE########################################################### # # # This file is part of the Environment for Tree Exploration program # (ETE). http://etetoolkit.org # # ETE is free software: you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by # t...
""" Module to define multi value options for click. """ import click from aiida.cmdline.params import types class MultipleValueOption(click.Option): """ An option that can handle multiple values with a single flag. For example:: @click.option('-n', '--nodes', cls=MultipleValueOption) Will be a...
############################################################################## # Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC. # Produced at the Lawrence Livermore National Laboratory. # # This file is part of Spack. # Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. # LLNL-CODE-64...
# -*- coding: utf-8 -*- __bibtex__ = """ @article{emcee, author = {{Foreman-Mackey}, D. and {Hogg}, D.~W. and {Lang}, D. and {Goodman}, J.}, title = {emcee: The MCMC Hammer}, journal = {PASP}, year = 2013, volume = 125, pages = {306-312}, eprint = {1202.3665}, doi = {10.1086/670067} } """...
# Copyright 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. # SPDX-License-Identifier: Apache-2.0 import luigi from servicecatalog_puppet.workflow.codebuild_runs import code_build_run_for_task class CodeBuildRunTask(code_build_run_for_task.CodeBuildRunForTask): code_build_run_name = luigi.Parame...
from shapely.geometry import Point, Polygon # Create Point objects p1 = Point(24.952242, 60.1696017) p2 = Point(24.976567, 60.1612500) # Create a Polygon coords = [(24.950899, 60.169158), (24.953492, 60.169158), (24.953510, 60.170104), (24.950958, 60.169990)] poly = Polygon(coords) print(p1.within(poly)) print(p2.wit...
"""Unit test for KNX/IP Tunnelling Request/Response.""" import asyncio import unittest from unittest.mock import patch import pytest pytestmark = pytest.mark.asyncio from xknx import XKNX from xknx.dpt import DPTArray from xknx.io import Tunnelling, UDPClient from xknx.knxip import ErrorCode, KNXIPFrame, KNXIPService...
import json import pprint import os import sys import subprocess import time from subprocess import PIPE # This key would be different for each user. KEY_TO_INTERNAL_ACCOUNT='12345' DEMO_USER='scott' def main(): try: command = sys.argv[1] if command == 'monitor': setup() w...
import rrdtool as rt import sys result = rt.fetch(sys.argv[1], "AVERAGE") start, end, step = result[0] legend = result[1] rows = result[2] endTime = end - 600 #while i <= end - 600: for i in range(10,0,-1): print(endTime,rows[len(rows)-(3+i)][0] + rows[len(rows)-(3+i)][1]) endTime = endTime - 300
#!/usr/bin/python # # Copyright 2015 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required b...
# -*- coding: utf-8 -*- # 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 to in writing, software...
import itertools import random import logging import numpy as np import matplotlib.pyplot as plt import os from mnist_stdp_multiple_baseline import * from utilis import * from args_mnist import args as my_args # from ax import optimize import pandas as pd from itertools import product import time if __name__ == '__ma...
import os from pathlib import Path from typing import Text import pytest from rasa.nlu.training_data.converters.nlg_markdown_to_yaml_converter import ( NLGMarkdownToYamlConverter, ) from rasa.shared.constants import LATEST_TRAINING_DATA_FORMAT_VERSION @pytest.mark.parametrize( "training_data_file, should_fi...
from os import system from pip._internal.utils.misc import get_installed_distributions from runas import runas def check_dependencies(): """Install all the dependencies listed within requirements.txt""" with open('requirements.txt', 'r') as dependencies: dependencies = set(dependencies.read().split())...
# Generated by Django 2.1.3 on 2018-12-27 13:25 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('restapi', '0013_annotatedrecording_is_evaluated'), ] operations = [ migrations.AddField( model_...
""" This module lets you practice one form of the ACCUMULATOR pattern, namely, the "IN GRAPHICS" form which features: -- DRAWING OBJECTS via ACCUMULATING positions and/or sizes, as in: x = x + pixels Additionally, it emphasizes that you must ** DO A CONCRETE EXAMPLE BY HAND ** before you can implement a sol...
import torch import os from torchvision import datasets from torchvision import transforms class ImageFolderWithPaths(datasets.ImageFolder): """Custom dataset that includes image file paths. Extends torchvision.datasets.ImageFolder """ # override the __getitem__ method. this is the method that dataloa...
# -*- coding: utf-8 -*- # Copyright (C) 2021 GIS OPS UG # # # 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 ...
from django.shortcuts import render from django.http import HttpResponse # Create your views here. #login view def login(request): return render(request, 'base.html') #Doctor Console def doc_console(request): return render(request, 'd_console.html') #Client Consloe def cli_console(request): return rende...
import pytest pytestmark = [pytest.mark.indexing] @pytest.mark.parametrize('expected', [ "# http://localhost/batch_hub/type=Experiment/hub.txt", "hub ENCODE_DCC_search", "shortLabel Hub (search:)", "longLabel ENCODE Data Coordination Center Data Hub", "genomesFile genomes.txt", "email encode-h...
import copy from abc import ABC, abstractmethod from typing import Iterable, List, Optional import numpy as np class ActionNoise(ABC): """ The action noise base class """ def __init__(self): super(ActionNoise, self).__init__() def reset(self) -> None: """ call end of epi...
def update_logs(file, message): from .helpers.datetime_helper import get_current_datetime dt = get_current_datetime() l_message = '[ ' + dt + ' ] ' + str(message) l_file = open(file, mode='a') l_file.write(l_message) return 1 def head_update(config, current_path, new_branch, new_commit): ...
#!/usr/bin/python # (c) 2018 Piotr Olczak <piotr.olczak@redhat.com> # (c) 2018-2019, NetApp, Inc # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) ''' na_ontap_info ''' from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA =...
# Copyright 2016 Google 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 or agreed to in writing, ...
# coding: utf-8 """ Literature Graph Service Fetch paper and author data from the Semantic Scholar corpus # noqa: E501 OpenAPI spec version: 1.0 Generated by: https://github.com/swagger-api/swagger-codegen.git """ from __future__ import absolute_import import datetime import json import mimetypes ...
# This code is part of Qiskit. # # (C) Copyright IBM 2018, 2020. # # This code is licensed under the Apache License, Version 2.0. You may # obtain a copy of this license in the LICENSE.txt file in the root directory # of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. # # Any modifications or derivat...
from operator import itemgetter import logging from django.apps import apps from django.conf import settings from django.contrib.admin.utils import get_fields_from_path from django.db import models from django.db.models.fields import FieldDoesNotExist from django.utils.encoding import force_text from django.views.gene...
import numpy as np from scipy.spatial.distance import cdist from menpo.visualize import PointCloudViewer from menpo.shape.base import Shape class PointCloud(Shape): r""" An N-dimensional point cloud. This is internally represented as an ndarray of shape (``n_points``, ``n_dims``). This class is important ...
# -*- coding: utf-8 -*- from .nlp import AipNlp from .speech import AipSpeech
import unittest import math from quaternion import Quaternion class TestQuaternionMethods(unittest.TestCase): def test_init(self): test_quat = Quaternion(10, -10, 100, 0) self.assertEqual(test_quat.real, 10) self.assertEqual(test_quat.i, -10) self.assertEqual(test_quat.j, 1...
#!/usr/bin/python # -*- coding: utf-8 -*- # # (c) 2016, René Moser <mail@renemoser.net> # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the Lice...
class CollectionTypeDescriptionFactory(object): def __init__(self, type_registry): # taking in type_registry though not using it, because we will someday # I think. self.type_registry = type_registry def for_collection_type(self, collection_type): return CollectionTypeDescrip...
#Revision 2: Added motor saturation speed #Revision 3: Cleaned up and added changes that hopefully boost efficiency #Revision 4: Implemented state propagation by Heun's method for more accuracy #Revision 5: Cleaned up code by adding string formatting #Revision 6: Doesn't send velocity data now, and sends smaller pack...
from qfengine.broker.fee_model.fee_model import FeeModel class ZeroFeeModel(FeeModel): """ A FeeModel subclass that produces no commission, fees or taxes. This is the default fee model for simulated brokerages within QSTrader. """ def _calc_commission(self, asset, quantity, consideration, br...
# -*- coding: utf-8 -*- # # complexity documentation build configuration file, created by # sphinx-quickstart on Tue Jul 9 22:26:36 2013. # # This file is execfile()d with the current directory set to its containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # # ...
from __future__ import unicode_literals from utils import CanadianJurisdiction from pupa.scrape import Organization class Ajax(CanadianJurisdiction): classification = 'legislature' division_id = 'ocd-division/country:ca/csd:3518005' division_name = 'Ajax' name = 'Ajax Town Council' url = 'http://w...
from conans.model.conan_file import ConanFile from conans import CMake import os #This easily allows to copy the package in other user or channel channel = os.getenv("CONAN_CHANNEL", "testing") username = os.getenv("CONAN_USERNAME", "sunside") class DefaultNameConan(ConanFile): name = "DefaultName" version = ...
from unittest import TestCase import pandas as pd from .test_trading_calendar import ExchangeCalendarTestBase from trading_calendars.exchange_calendar_xtse import XTSEExchangeCalendar class XTSECalendarTestCase(ExchangeCalendarTestBase, TestCase): answer_key_filename = 'xtse' calendar_class = XTSEExchangeCa...
import progressbar from mpl_toolkits.mplot3d import Axes3D import matplotlib.pyplot as plt import matplotlib.cm as cmx import matplotlib.colors as colors import numpy as np from mlfromscratch.utils.data_operation import calculate_covariance_matrix from mlfromscratch.utils.data_operation import calculate_correl...
import math import aerospike from aerospike import predicates as p from aerospike import exception as ex from flask import current_app aerospike_host = current_app.config['AEROSPIKE_HOST'] aerospike_port = current_app.config['AEROSPIKE_PORT'] namespace = current_app.config['AEROSPIKE_NAMESPACE'] set_name = current_...
from urllib.request import urlopen from urllib.error import URLError from bs4 import BeautifulSoup from cryptograph import * from names import * err_SERVICE_DECRYPT_FAILED = 0 err_SERVICE_CONNECT_FAILED = 1 err_SERVICE_PARSER_FAILED = 2 SERVICE_URL = 'http://openapi.airkorea.or.kr/openapi/services/rest' SERVICE_NA...
#!/home/cdieken/applied_python/bin/python import telnetlib import time TELNET_PORT = 23 TELNET_TIMEOUT = 6 def send_command(remote_conn, cmd): cmd = cmd.rstrip() remote_conn.write(cmd + '\n') time.sleep(1) return remote_conn.read_very_eager() def main(): ip_addr = '50.76.53.27' username = '...
# 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 agreed to in writing, ...
""" Question: Happy Number Write an algorithm to determine if a number is "happy". A happy number is a number defined by the following process: Starting with any positive integer, replace the number by the sum of the squares of its digits, and repeat the process until the number equals 1 (where it will st...
# -*- coding: utf-8 -*- from tccli.services.cfs.cfs_client import register_arg from tccli.services.cfs.cfs_client import get_actions_info from tccli.services.cfs.cfs_client import AVAILABLE_VERSION_LIST
# Copyright (c) 2021 AccelByte Inc. All Rights Reserved. # This is licensed software from AccelByte Inc, for limitations # and restrictions contact your company contract manager. # # Code generated. DO NOT EDIT! # template file: justice_py_sdk_codegen/__main__.py # pylint: disable=duplicate-code # pylint: disable=li...
from ..typecheck import * from .import adapter import sublime import re class PHP(adapter.AdapterConfiguration): type = 'php' docs = 'https://github.com/xdebug/vscode-php-debug#installation' async def start(self, log, configuration): node = await adapter.get_and_warn_require_node(self.type, log) install_pat...
"""Root level conftest. This provides fixtures and adds the utility importable modules available to all tests. If there are domain specific modules put them in the correct folders. """ import sys import os import os.path as osp from pathlib import Path tests_dir = Path(osp.dirname(__file__)) utils_dir = tests_dir /...
""" learning rate scheduler, which adaptive changes the learning rate based on the progress """ import logging class LRScheduler(object): """Base class of a learning rate scheduler""" def __init__(self): """ base_lr : float the initial learning rate """ self.base_lr ...
# Licensed under a 3-clause BSD style license - see LICENSE.rst import warnings warnings.warn("the ``irsa_dust`` module has been moved to " "astroquery.ipac.irsa.irsa_dust, " "please update your imports.", DeprecationWarning, stacklevel=2) from astroquery.ipac.irsa.irsa_dust import *