text
stringlengths
2
999k
#!/usr/bin/env python ############################################################### # < next few lines under version control, D O N O T E D I T > # $Date$ # $Revision$ # $Author$ # $Id$ ############################################################### ############################################################### ...
import paho.mqtt.client as mqtt #import the client1 import time import sys import threading import unittest import Pub_Sub_client as pubsub class TestClient(unittest.TestCase): def setUp(self): pubsub.message="check_name;1;F;check_procedure" pass def test_subscriber(self): t1=...
from crawler import * class mobileapkworld_crawler(crawler): def __init__(self): super().__init__('https://mobileapkworld.com/', 'https://mobileapkworld.com/page/') self.urlBase = 'https://mobileapkworld.com/' self.folder_name = 'mobileapkworld/' if not os.p...
from nanoleafapi.nanoleaf import Nanoleaf, NanoleafRegistrationError, NanoleafConnectionError, NanoleafEffectCreationError from nanoleafapi.digital_twin import NanoleafDigitalTwin from nanoleafapi.nanoleaf import RED, ORANGE, YELLOW, GREEN, LIGHT_BLUE, BLUE, PINK, PURPLE, WHITE
# !/usr/local/python/bin/python # -*- coding: utf-8 -*- # (C) Wu Dong, 2021 # All rights reserved # @Author: 'Wu Dong <wudong@eastwu.cn>' # @Time: '2022/1/12 11:15 上午' # sys import typing as t # 3p from redis import RedisCluster as Redis # project from .ext import BaseExtensions from .macro import ( K_RDS_PREFIX, ...
# Copyright (c) 2017 Jon Cooper # # This file is part of pygame-xbox360controller. # Documentation, related files, and licensing can be found at # # <https://github.com/joncoop/pygame-xbox360controller>. import pygame import sys LINUX = 0 MAC = 1 WINDOWS = 2 if sys.platform.startswith("lin"): platform_i...
#!/usr/bin/python3 import sys import os import unittest from pprint import pprint from udpbrcst import PyLayerUDPb # FOR TESTING: my_command = "" my_params = [] my_udpb = PyLayerUDPb() # UNITTEST: class PyLayerUDPbTest(unittest.TestCase): _testMethodName = '' def __init__(self, in_name): global _log_mo...
# -*- coding: utf-8 -*- from django.http import HttpRequest from django.template import ( Context, RequestContext, Template, Variable, VariableDoesNotExist, ) from django.template.context import RenderContext from django.test import RequestFactory, SimpleTestCase, override_settings class ContextTests(SimpleTestC...
from typing import Dict import enum import numpy as np from pydrake.all import (LeafSystem, BasicVector, PortDataType, AbstractValue, QueryObject, ModelInstanceIndex, ContactResults, ExternallyAppliedSpatialForce) from qsim_cpp import QuasistaticSimulatorCpp from .si...
import collections import itertools import numpy as np from numba.core.compiler import compile_isolated from numba import njit, jit, typeof from numba.core import types, errors, utils from numba.tests.support import TestCase, MemoryLeakMixin, tag import unittest Rect = collections.namedtuple('Rect', ('width', 'heig...
from models.base.EntityBase import EntityBase from infrastructure.json.BaseConverter import BaseConverter @BaseConverter.register class ConnectionSecretBase(EntityBase): def __init__(self, ConnectionId: int = None, SecretId: int = None, Connection=None, ...
# coding:utf-8 import torch import torch.optim as optim import os from dataset_scene import * from torchvision import transforms from DAN import * global_cfgs = { 'state': 'Train', 'epoch': 10, 'show_interval': 50, 'test_interval': 1000 } dataset_cfgs = { 'dataset_train': lmdbDataset, 'dataset...
# # @file TestCompartmentVolumeRule.py # @brief CompartmentVolumeRule unit tests # # @author Akiya Jouraku (Python conversion) # @author Ben Bornstein # # $Id: TestCompartmentVolumeRule.py 10124 2009-08-28 12:04:51Z sarahkeating $ # $HeadURL: https://sbml.svn.sourceforge.net/svnroot/sbml/trunk/libsbml/src/bindi...
_base_ = [ '../../_base_/models/semfpn_semask_swin.py', '../../_base_/datasets/semask/coco_stuff10k.py', '../../_base_/default_runtime.py', '../../_base_/schedules/schedule_80k.py' ] model = dict( backbone=dict( embed_dim=96, depths=[2, 2, 18, 2], num_heads=[3, 6, 12, 24], wi...
# ceci est un commentaire nombre1 = 5 nombre2 = 10.45 nombre3 = 3 c = -((nombre1+nombre2)-(nombre1*nombre3))+(nombre1+(nombre2*nombre3)) #branches gitkraken print(c) print(nombre1) print("Hello aziz !") print(nombre1 + nombre2)
import os import time from Data.parameters import Data from filenames import file_extention from get_dir import pwd from reuse_func import GetData class BlockwiseCsv(): def __init__(self, driver, year, month): self.driver = driver self.year = year.strip() self.month = month.strip() ...
from __future__ import annotations import numpy as np import logging from typing import Any, Text, List, Dict, Tuple, Type from rasa.engine.graph import ExecutionContext, GraphComponent from rasa.engine.recipes.default_recipe import DefaultV1Recipe from rasa.engine.storage.resource import Resource from rasa.engine.st...
from pydantic import BaseModel class TrendItem(BaseModel): name: str url: str
''' Напишите программу, которая переведет название времени года с русского языка (Зима, Весна, Лето, Осень) на английский язык (Winter, Spring, Summer, Autumn) Формат входных данных Строка, содержащая название времени года на русском языке. Первая буква заглавная, остальные - строчные. Формат выходных данных Строка...
import tensorflow as tf def purity(dm): mul = tf.math.real(tf.linalg.trace(tf.linalg.matmul(dm, dm, adjoint_b=True))) return mul.numpy()
# Copyright 2021 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 agreed to...
from django.core.urlresolvers import reverse from core.mixins import JSONView, JSONListView from .mixins import UserListMixin, UserDetailMixin def get_item(db_user, request): href_relative_uri = reverse('api:users:user', kwargs={'username': db_user.username, ...
import requests class LookerClient(object): """Client for Looker API. Used to initialize the client id and secret. Parameters ---------- api_endpoint : str The API endpoint implemented for your Looker instance. Usually looks like https://<your-looker-host-name>:19999/api/3.0/ ...
""" Copyright 2020 The OneFlow Authors. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agr...
# -*- coding: utf-8 -*- # ganben # import unittest ''' https://leetcode.com/problems/merge-two-sorted-lists/description/ Merge two sorted linked lists and return it as a new list. The new list should be made by splicing together the nodes of the first two lists. Example: Input: 1->2->4, 1->3->4 Output: 1->1->2->3->...
# (C) Datadog, Inc. 2020-present # All rights reserved # Licensed under a 3-clause BSD style license (see LICENSE) import os import pytest import requests from datadog_checks.dev import docker_run from datadog_checks.dev.conditions import CheckDockerLogs, WaitFor from datadog_checks.dev.utils import load_jmx_config f...
from __future__ import division from wx.lib.agw import customtreectrl import wx from libtbx.utils import Sorry import re class PhilTreeCtrl (customtreectrl.CustomTreeCtrl) : def __init__ (self, *args, **kwds) : kwds = dict(kwds) kwds['agwStyle'] = wx.TR_HAS_VARIABLE_ROW_HEIGHT|wx.TR_HAS_BUTTONS| \ wx....
from cls.repository import Repository from cls.package import Package from cls.custom_file import CustomFile class Parser: def __init__(self,data): self.data = data def repositories_from_yaml(self): key = 'repositories' repositories = [] data = self.data for rkey in da...
"""Script wraps launch mechanism of non python host implementations. Arguments passed to the script are passed to launch function in host implementation. In all cases requires host app executable and may contain workfile or others. """ import os import sys # Get current file to locate start point of sys.argv CURRENT...
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (c) 2021 Intel 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 # # Unl...
from setuptools import setup, find_packages with open('README.md') as readme_file: README = readme_file.read() with open('HISTORY.md') as history_file: HISTORY = history_file.read() with open('VERSION') as file: VERSION = file.read() VERSION = ''.join(VERSION.split()) setup( name='b-cfn-s3-large...
import errno from functools import wraps, partial import logging from threading import Event, Lock, RLock from Queue import Queue from cassandra import ConsistencyLevel, AuthenticationFailed from cassandra.marshal import int8_unpack, int32_pack from cassandra.decoder import (ReadyMessage, AuthenticateMessage, OptionsM...
import numpy as np import torch def noisy_label_change_client(dataName, dict_users, dataset, noisy_client, noisy_rate): """ change correct label into noisy label dataName:'MNIST' or 'cifar' """ if dataName == 'MNIST': originTargets = dataset.train_labels.numpy() else: ...
import select import socket import threading import time from ssl import SSLContext from types import TracebackType from typing import Optional, Type from .._exceptions import ( CloseError, ConnectError, ConnectTimeout, ReadError, ReadTimeout, WriteError, WriteTimeout, map_exceptions, )...
def findDecision(obj): #obj[0]: Passanger, obj[1]: Time, obj[2]: Coupon, obj[3]: Education, obj[4]: Occupation, obj[5]: Bar, obj[6]: Coffeehouse, obj[7]: Restaurant20to50, obj[8]: Direction_same, obj[9]: Distance # {"feature": "Bar", "instances": 127, "metric_value": 0.9566, "depth": 1} if obj[5]<=2.0: # {"feature"...
# 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 torch def exclusive_cumprod(tensor, dim: int, eps: float = 1e-10): """ Implementing exclusive cumprod. There is cumprod i...
import random import sys import logging import os import collections import numpy as np np.random.seed(1) from tensorflow import set_random_seed set_random_seed(1) from gensim.models.keyedvectors import KeyedVectors from keras.utils.np_utils import to_categorical from keras.models import model_from_json from keras.c...
# 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...
#!/usr/bin/python # -*- coding: utf-8 -*- from unittest import TestCase from unittest.mock import MagicMock from unittest.mock import patch from datetime import datetime from datetime import timedelta from flask import Flask from flask_easyjwt import EasyJWTError from flask_easyjwt import FlaskEasyJWT from flask_ea...
from flask import Flask from flask_project import app if __name__=="__main__": app.run(debug=True)
from django.test import TestCase from django.contrib.auth import get_user_model from django.urls import reverse from django.test import Client class AdminSiteTests(TestCase): def setUp(self): self.client = Client() self.admin_user = get_user_model().objects.create_superuser( email='adm...
"""The HTTP api to control the cloud integration.""" import asyncio from functools import wraps import logging import aiohttp import async_timeout import attr from hass_nabucasa import Cloud, auth, thingtalk from hass_nabucasa.const import STATE_DISCONNECTED import voluptuous as vol from homeassistant.components impo...
# Copyright 2008-2012 Nokia Siemens Networks Oyj # # 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...
""" package = {"streamName": streamName, "streamTable": streamTable , "edgeName": sysutils.hostName(), "modbusAddress": busAdr , "dtsUTC": datetime.datetime.utcnow().strftime(dtsFormats.std) , "readings": readings} """ from typing import List from datetime import datetime from core.sys impo...
import pprint import sys from loadUtils import * from EmberEP import * from paramUtils import * class PartInfo: def __init__(self, nicParams, epParams, numNodes, nicsPerNode, numCores, detailedModel = None ): self.nicParams = nicParams self.epParams = epParams self.numNodes = int(numNodes) self.numCores = i...
#!/usr/bin/env python # Copyright (c) 2019 The Zcash developers # Distributed under the MIT software license, see the accompanying # file COPYING or https://www.opensource.org/licenses/mit-license.php . # # Test timestampindex generation and fetching for insightexplorer import sys; assert sys.version_info < (3,), ur"T...
#!/usr/bin/python # -*- coding: utf-8 -*- # # WPSeku: Wordpress Security Scanner # # @url: https://github.com/m4ll0k/WPSeku # @author: Momo Outaadi (M4ll0k) # # WPSeku 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 Found...
# Generated by Django 3.1.1 on 2020-12-02 13:26 import uuid from decimal import Decimal import django.db.models.manager import django_extensions.db.fields from django.conf import settings from django.db import migrations, models import grandchallenge.components.models import grandchallenge.core.storage import grandc...
#!/usr/bin/env python3 import logging import numpy as np import os import random import time from collections import defaultdict import cv2 import torch from iopath.common.file_io import g_pathmgr from torch.utils.data.distributed import DistributedSampler from . import transform as transform logger = logging.getLog...
# Copyright 2014 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. from py_trace_event import trace_event class NetworkController(object): """Control network settings and servers to simulate the Web. Network changes i...
def part1(fileName): counter = 0 prev_number = 999999999 with open(f'data/{fileName}') as f: lines = f.read().splitlines() lines = [int(x) for x in lines] for number in lines: if number > prev_number: counter +=1 prev_num...
import re p = re.compile('foo') p.match()
from hand_tracker import TrackerColors, HandTracker from time import time import mediapipe as mp import cv2 if __name__ == "__main__": capture = cv2.VideoCapture(0) previous_time = 0 current_time = 0 tracker_colors = TrackerColors( point_color=(255, 255, 255), connection_color=(0...
# Copyright 2013-2021 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) '''Produce a "view" of a Spack DAG. A "view" is file hierarchy representing the union of a number of Spack-installed pack...
__version__ = '4.2' VERSION = tuple(map(int, __version__.split('.'))) from django.apps import AppConfig from .simple import * from .query import * from .invalidation import * from .templatetags.cacheops import * from .transaction import install_cacheops_transaction_support class CacheopsConfig(AppConfig): name...
# =============================================================================== # # # # This file has been generated automatically!! Do not change this manually! # # ...
# # PySNMP MIB module RND-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/RND-MIB # Produced by pysmi-0.3.4 at Mon Apr 29 20:16:24 2019 # On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4 # Using Python version 3.7.3 (default, Mar 27 2019, 09:23:15)...
"""Module containing numerical functionalities for SfM""" import torch # TODO: this should go to `kornia.geometry.linalg` def cross_product_matrix(x: torch.Tensor) -> torch.Tensor: r"""Returns the cross_product_matrix symmetric matrix of a vector. Args: x: The input vector to construct the matrix i...
import numpy as np import math import pdb np.cat = np.concatenate np.random.seed(100) import torch as t import torch.nn as nn import torch.nn.functional as f import torch.optim as opt import os.path from torch import FloatTensor as FT from variational_methods import * from gutenberg_data import * from decoders import ...
LINK_STATUS_LOOKUP= { 0: "Link Down", 1: "Auto", 2: "10M Half", 3: "10M Full", 4: "100M Half", 5: "100M Full", 6: "1000M Full", 7: "" } POE_POWER_STATUS_LOOKUP= { 0: "OFF", 1: "TURNING-ON", 2: "ON", 3: "OVERLOAD", 4: "SHORT", 5: "NOSTANDARD-PD", 6: "VOLT...
from collections import namedtuple from fixtures import * # noqa: F401,F403 from lightning import RpcError from utils import DEVELOPER, only_one, wait_for, sync_blockheight, VALGRIND import os import pytest import time import random import shutil import unittest def test_connect(node_factory): l1, l2 = node_fa...
import os import doodad from doodad.wrappers.sweeper import launcher import d4rl import d4rl.flow import gym ENVS = [ #'flow-ring-random-v0', #'flow-ring-controller-v0', "flow-merge-random-v0", "flow-merge-controller-v0", ] mounts = [] mounts.append( doodad.MountLocal( local_dir="~/code/d4...
# Copyright 2013 OpenStack Foundation # 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 requ...
from rest_framework import generics, authentication, permissions from rest_framework.authtoken.views import ObtainAuthToken from rest_framework.settings import api_settings from user.serializers import UserSerializer, AuthTokenSerializer class CreateUserView(generics.CreateAPIView): """Create a new user in the sys...
import aiosqlite import discord from discord.ext import commands import discordSuperUtils class reactionrole(commands.Cog,discordSuperUtils.CogManager.Cog): def __init__(self, bot:commands.Bot): super().__init__() self.bot = bot self.ReactionManager = discordSuperUtils.ReactionManager(bot) ...
# -*- coding: utf-8 -*- """ Tencent is pleased to support the open source community by making 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available. Copyright (C) 2017-2021 THL A29 Limited, a Tencent company. All rights reserved. Licensed under the MIT License (the "License"); you may not use this file except in co...
#!/usr/bin/env python # coding: utf-8 # Copyright (c) 2001-2010 Twisted Matrix Laboratories. # See LICENSE for details. # # Exceedingly minor changes by B. A. Shelton, zancarius@gmail.com # !!! Do not blame Twisted Matrix Laboratories if using this monkey patch breaks # your application. !!! # # This file is based ...
__author__ = 'aymgal' from typing import List from lensmodelapi.api.base import APIBaseObject from lensmodelapi.api.lens_sample import LensSample from lensmodelapi.api.cosmology import Cosmology class LensUniverse(APIBaseObject): def __init__(self, cosmology: Cosmology, lens_s...
# Copyright 2018 Jonathan Xia # 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, sof...
"""Basic utilities for common scripting tasks. Author: Seth Axen E-mail: seth.axen@gmail.com """ import logging import time LOG_LEVELS = (logging.NOTSET, logging.INFO, logging.DEBUG, logging.WARNING, logging.ERROR, logging.CRITICAL) def setup_logging(filename=None, verbose=False, level=-1, ...
from abc import abstractmethod from collections import namedtuple from openmtc_server import Component Interface = namedtuple("Interface", ("name", "addresses", "hw_address")) Address = namedtuple("Address", ("address", "family")) class NetworkManager(Component): @abstractmethod def get_interfaces(self): ...
import deal import pytest def test_silent_contract_not_allow_print(): @deal.silent def func(msg): if msg: print(msg) func(None) with pytest.raises(deal.SilentContractError): func('bad')
#https://matplotlib.org/users/pyplot_tutorial.html import numpy as np import matplotlib.pyplot as plt # evenly sampled time at 200ms intervals t = np.arange(0., 5., 0.2) print(t) # red dashes, blue squares and green triangles plt.plot(t, t, 'r--', t, t**2, 'bs', t, t**3, 'g^') plt.plot(t, t**4, 'r*') plt.s...
import time from izi.decorators import auto_kwargs from izi.introspect import generate_accepted_kwargs DATA = {'request': None} class Timer(object): def __init__(self, name): self.name = name def __enter__(self): self.start = time.time() def __exit__(self, *args): print("{0} t...
""" ===================== Vector autoregression ===================== This example demonstrates how one can validate :code:`deepdow` on synthetic data. We choose to model our returns with the vector autoregression model (VAR). This model links future returns to lagged returns with a linear model. See [Lütkepohl2005]_ ...
#!/usr/bin/env python3 from test_framework.test_framework import BitcoinTestFramework from test_framework.util import * from test_framework.script import * from test_framework.mininode import * from test_framework.address import * from test_framework.qtum import * class QtumEVMConstantinopleActivationTest(BitcoinTest...
import json from rest_framework import serializers from django.core.urlresolvers import reverse from landscapesim.models import Region class ReportingUnitSerializer(serializers.Serializer): type = serializers.SerializerMethodField() properties = serializers.SerializerMethodField() geometry = serializers...
from nanome._internal._util._serializers import _TypeSerializer class _SliderCallback(_TypeSerializer): def version(self): return 1 def name(self): return "SliderCallback" def serialize(self, version, value, context): if (version == 0): plugin_mask = (context._plugin_...
# -*- coding: utf-8 -*- """ Created on Tue Feb 22 23:00:07 2022 @author: udaya """ from djitellopy import Tello import cv2 import numpy as np def initializeTello(): myDrone = Tello() myDrone.connect() myDrone.for_back_velocity = 0 myDrone.left_right_velocity = 0 myDrone.up_dow...
# -*- coding: utf-8 -*- import logging from odoo import api, fields, models, _ _logger = logging.getLogger(__name__) class View(models.Model): _inherit = 'ir.ui.view' @api.model def render_template(self, template, values=None, engine='ir.qweb'): """ 重新 render template 帶入title value ...
from sklearn.linear_model import LinearRegression from sklearn.model_selection import train_test_split # See Section 1.4 (Boston Hosing data set) bostonDF = ... x_train, x_test, y_train, y_test = train_test_split( bostonDF.drop(['label'],axis=1),bostonDF['label'],test_size=0.3) model = LinearRegression() model.fit(x_tr...
# # # from __future__ import absolute_import, division, print_function, \ unicode_literals from logging import getLogger logger = getLogger('Akamai') logger.warning('AkamaiProvider has been moved into a seperate module, ' 'octodns_edgedns is now required. Provider class should ' 'be...
#!/usr/bin/python3 from datetime import datetime, timedelta import os import sys import re import logging import mimetypes import boto3 import threading import shutil from boto3.s3.transfer import S3Transfer from newsblur_web import settings logger = logging.getLogger(__name__) def main(): BACKUP_DIR = '/srv/new...
# -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # source: google/ads/googleads_v3/proto/errors/resource_count_limit_exceeded_error.proto import sys _b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) from google.protobuf import descriptor as _descriptor from go...
#!/usr/bin/env python2 # # Distributed under the MIT/X11 software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # from test_framework.mininode import * from test_framework.test_framework import BitcoinTestFramework from test_framework.util import * import logging ...
from tkinter import * from tkinter import messagebox import os def newTask(): task = my_entry.get() if task != "": lb.insert(END, task) my_entry.delete(0, "end") else: messagebox.showwarning("warning", "Please enter some task.") def deleteTask(): lb.delete(ANCHOR) def...
"""Command-line arguments for setup.py, train.py, test.py. Author: Chris Chute (chute@stanford.edu) """ import argparse def get_setup_args(): """Get arguments needed in setup.py.""" parser = argparse.ArgumentParser('Download and pre-process SQuAD') add_common_args(parser) parser.add_argument('...
import json import datetime import glob, os converted = [] pk = 1 os.chdir(".") for f in sorted(glob.glob("*.json")): with open(f) as f: data = json.load(f) for item in data: date_obj = datetime.datetime.strptime(item['date'], '%m/%d/%y') formated_date = datetime.datetime.strftime(date_obj, '%Y-%m-%d'...
from functools import reduce from typing import List from polygonscan.enums.actions_enum import ActionsEnum as actions from polygonscan.enums.fields_enum import FieldsEnum as fields from polygonscan.enums.modules_enum import ModulesEnum as modules from polygonscan.enums.tags_enum import TagsEnum as tags class Accoun...
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Generated Tue Apr 10 13:54:54 2012 by generateDS.py version 2.7b. # import sys import getopt import re as re_ import common_types_1_0 as common import network_route_entry_object_1_0 as network_route_entry_object etree_ = None Verbose_import_ = False ( XMLParser_im...
# Copyright 2011 OpenStack Foundation # 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 requ...
""" Copyright (c) 2014, ICFLIX Media FZ LLC All rights reserved. Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. Desc: Convert Nagios cfg file into YAML """ import logging import logging.handlers import sys import re import yaml RE_DEFINE = re.compile(r'^define .+{[\s...
from setuptools import setup, find_packages setup(name='gcp-watchdog', version='0.3', description='Watchdog that monitors Google Cloud Platform services', long_description="""Watchdog that monitors Google Cloud Platform services. Creates a HTML report file which lists comput...
from snuba.clusters.storage_sets import StorageSetKey from snuba.datasets.errors_replacer import ErrorsReplacer, ReplacerState from snuba.datasets.events_processor import EventsProcessor from snuba.datasets.schemas.tables import WritableTableSchema from snuba.datasets.storage import WritableTableStorage from snuba.data...
import argparse from elasticsearch import Elasticsearch from setup_index import verify_or_setup_index from config import Config #load the args & config parser = argparse.ArgumentParser("Create an elasticsearch index for use with twitter monitor") parser.add_argument("--configfile", "-c", default="config.json", require...
from django.forms import * from softdelete.models import * import logging class ChangeSetForm(ModelForm): class Meta: model = ChangeSet exclude = ('content_type', 'object_id',)
def test_snap100_component_sub_pages(component_map, dash_doc): for _, grouper in component_map: for resources in grouper: href = "/".join(resources) dash_doc.visit_and_snapshot( href, hook_id="wait-for-page-/{}".format(href) )
from datetime import date nasc = int(input('Digite o ano do seu nascimento: ')) cat = date.today().year - nasc if cat <=9: print('Você se enquadra na categoria MIRIM ') elif cat <= 14: print('Você se enquadra na categoria INFANTIL ') elif cat <= 19: print('Você se enquadra na categoria JUNIOR ') elif cat <=...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Fix to enforce the wrapping inside the unit cell. @author: matteo """ from ase.io import write, read molecule = read('out_data/benzene_no_noise.xyz', index=':', format='extxyz')[0] molecule.wrap(pbc=True, center=True, pret...
from abc import ABC, abstractmethod from pyspark.sql.session import SparkSession class ConfiguratorInterface(ABC): @abstractmethod def configure(self, spark: SparkSession): pass