text
stringlengths
2
999k
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # Copyright (c) 2016, Fabian Greif # Copyright (c) 2018, Niklas Hauser # All Rights Reserved. # # The file is part of the lbuild project and is released under the # 2-clause BSD license. See the file `LICENSE.txt` for the full license # governing this code. import os im...
import logging from concurrent.futures.thread import ThreadPoolExecutor from typing import List from notion.block import TextBlock from notion.client import NotionClient from note import Note from repositories.base import NotesRepository logger = logging.getLogger() class NotionNotesRepository(NotesRepository): ...
#from memory_profiler import profile import gc #import time from .data.types import * from .data.Aug_Im_Adapter import Aug_Im_Adapter as _Adapter from .scheme.Augment_Scheme import Augment_Scheme from .data.Input_Data_Formatter import Input_Data_Formatter IDF = Input_Data_Formatter() import tensorflow as _tf class...
# Copyright 2016, Google Inc. # All rights reserved. # # 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 f...
# The MIT License (MIT) # Copyright (c) 2018 by EUMETSAT # # 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,...
""" WSGI config for abstract_demo_web project. It exposes the WSGI callable as a module-level variable named ``application``. For more information on this file, see https://docs.djangoproject.com/en/2.2/howto/deployment/wsgi/ """ import os from django.core.wsgi import get_wsgi_application os.environ.setdefault('DJ...
"""Helper for listing a summary of finished prums and progress on open prums. Projecta are small bite-sized project quanta that typically will result in one manuscript. """ from gooey import GooeyParser import datetime import dateutil.parser as date_parser from regolith.helpers.basehelper import SoutHelperBase ...
""" Authors: Randy Heiland (heiland@iu.edu) Adam Morrow, Grant Waldrow, Drew Willis, Kim Crevecoeur Dr. Paul Macklin (macklinp@iu.edu) --- Versions --- 0.1 - initial version """ import sys from PySide6 import QtCore, QtGui from PySide6.QtWidgets import * from PySide6.QtGui import QDoubleValidator class CellDef(QWidg...
# Models Imports from project.users.models import EndUser, Connection, Note, PeopleUnfollow, Setting, Website # Utility Imports from django.contrib import admin class EndUserAdmin(admin.ModelAdmin): list_display = ["img"] def img(self, obj): return obj.avatar admin.site.register(En...
# Copyright (C) 2011-2021 Free Software Foundation, Inc. # This program 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 License, or # (at your option) any later version. # # This progr...
#!/usr/bin/env python # # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # # Michael A.G. Aivazis # California Institute of Technology # (C) 1998-2005 All Rights Reserved # # {LicenseText} # # ~~~~~~~~~~~~~~~~~~~~~~~~...
import typing azure_headers: typing.Dict[str, str] = { "Content-Type": "application/x-www-form-urlencoded", "Accept": "application/json", } okta_headers: typing.Dict[str, str] = { "Accept": "application/json", "Content-Type": "application/json", "Cache-Control": "no-cache", } # order of preference ...
# Generated from Tabla.g by ANTLR 4.5.1 # encoding: utf-8 from antlr4 import * from io import StringIO def serializedATN(): with StringIO() as buf: buf.write("\3\u0430\ud6d1\u8206\uad2d\u4417\uaef1\u8d80\uaadd\3 ") buf.write("\u00cc\4\2\t\2\4\3\t\3\4\4\t\4\4\5\t\5\4\6\t\6\4\7\t\7") buf.writ...
import functools import inspect import os import sys import warnings from collections import defaultdict from collections import deque from contextlib import suppress from pathlib import Path from types import TracebackType from typing import Any from typing import Callable from typing import cast from typing import Di...
# Created by Artem Manchenkov # artyom@manchenkoff.me # # Copyright © 2019 # # Графический интерфейс wxPython # # https://wxpython.org/ # https://pypi.org/project/wxPython/ # # Пример простой формы на wxWidgets с обработчиками # # 1. pip install wxPython - установка пакета # 2. import wx - подключить в файле ....
import logging from django.core.management.base import BaseCommand from django.template.defaultfilters import slugify from july.models import User from july.people.models import Location from july.utils import check_location from optparse import make_option class Command(BaseCommand): help = 'fix locations' ...
import comet_ml import torch import gc import sys import psutil import os def memReport(): for obj in gc.get_objects(): if torch.is_tensor(obj): print(type(obj), obj.size()) def cpuStats(): print(sys.version) print(psutil.cpu_percent()) print(psutil.virtual_memory()) # physical ...
from distribute_setup import use_setuptools use_setuptools() from setuptools import find_packages, setup version = open('version.txt').read() classifiers = [ 'Development Status :: 4 - Beta' , 'Environment :: Console' , 'Intended Audience :: Developers' , 'License :: OSI App...
IDLE_VERSION = "2.6.9"
from math import cos,sin def f(x): return 1+pow(sin(x),2) def hat(p0,p1,p2): return p0 - (pow(p1-p0,2)/(p2-2*p1+p0)) def steffensen(p0,TOL,nMax): p0Hat = 0 p1Hat = 0 p1=0 p2=0 print("{0:} \t {1:} \t\t\t {2:} \t\t\t {3:} \t\t\t {4:} \t\t\t {5:}".format("i","p0","p1","p2","Hat","Error"))...
#!/usr/bin/env python # -*- coding: utf-8 -*- import os import sys import re from setuptools import setup # Get the version version_regex = r'__version__ = ["\']([^"\']*)["\']' with open('requests_oauthlib/__init__.py', 'r') as f: text = f.read() match = re.search(version_regex, text) if match: ...
# coding: utf-8 from __future__ import division, unicode_literals, print_function """ This module provides classes to run and analyze boltztrap on pymatgen band structure objects. Boltztrap is a software interpolating band structures and computing materials properties from this band structure using Boltzmann semi-cla...
from setuptools import setup with open('README.rst') as readme_file: long_description = readme_file.read() setup( name='big_O', version='0.10.1', description='Empirical estimation of time complexity from execution time', author='Pietro Berkes', author_email='pietro.berkes@googlemail.com', ...
import bpy from bpy.props import * from bpy.types import Node, NodeSocket from arm.logicnode.arm_nodes import * class CastPhysicsRayNode(Node, ArmLogicTreeNode): '''Cast physics ray node''' bl_idname = 'LNCastPhysicsRayNode' bl_label = 'Cast Physics Ray' bl_icon = 'QUESTION' def init(self, context...
from rest_framework.routers import DefaultRouter from .views import ExportViewSet router = DefaultRouter() router.register('', ExportViewSet, base_name='export') urlpatterns = router.urls
########################################################################## # If not stated otherwise in this file or this component's Licenses.txt # file the following copyright and licenses apply: # # Copyright 2021 RDK Management # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use th...
# This class implements the AIML pattern-matching algorithm described # by Dr. Richard Wallace at the following site: # http://www.alicebot.org/documentation/matching.html import marshal import pprint import re import string import sys class PatternMgr: # special dictionary keys _UNDERSCORE = 0 ...
""" Tests for CVSInferenceReport """ import os # pylint: disable=unused-import from wb.config.application import get_config from wb.utils.benchmark_report.benchmark_report import BenchmarkReport from config.constants import BENCHMARK_REPORT_FILE_NAME TEST_DEVICE_NAME = 'TestDevice' TEST_LATENCY_VALUE = 271.53 TEST_TH...
#! /usr/bin/env python # -*- coding: utf-8 -*- # Author: AxiaCore S.A.S. http://axiacore.com # # Based on js-expression-eval, by Matthew Crumley (email@matthewcrumley.com, http://silentmatt.com/) # https://github.com/silentmatt/js-expression-eval # # Ported to Python and modified by Vera Mazhuga (ctrl-alt-delete@live.c...
#!/usr/bin/python3 -tt # Copyright 2010 Google Inc. # Licensed under the Apache License, Version 2.0 # http://www.apache.org/licenses/LICENSE-2.0 # Google's Python Class # http://code.google.com/edu/languages/google-python-class/ """Mimic pyquick exercise -- optional extra exercise. Google's Python Class Read in the...
# -*- coding: utf-8 -*- from __future__ import absolute_import from __future__ import unicode_literals from django.contrib import admin from django.contrib.contenttypes.admin import GenericTabularInline from generic.models import Product, ProductPrice, Thing, Download class ProductInline(GenericTabularInline): mo...
# -*- coding: utf-8 -*- # Copyright 2010-2016, Google Inc. # All rights reserved. # # 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...
# coding: utf-8 """ Kubernetes No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) OpenAPI spec version: v1.8.2 Generated by: https://github.com/swagger-api/swagger-codegen.git """ from pprint import pformat from six import iteritems import re ...
# Copyright (c) 2019 PaddlePaddle 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 appl...
# -*- coding: utf-8 -*- ''' Configuration disposable regularly scheduled tasks for at. ========================================================== The at state can be add disposable regularly scheduled tasks for your system. ''' from __future__ import absolute_import # Import salt libs import salt.utils from six.moves...
""" 定义栈的数据结构,请在该类型中实现一个能够得到栈中所含最小元素的min函数(时间复杂度应为O(1))。 """ # -*- coding:utf-8 -*- class Solution: def __init__(self): # s1 是普通栈, s2 是最小栈 self.s1 = [] self.s2 = [] def push(self, node): # write code here # 此时 s2 压入的是当前值对应的最小值 self.s1.append(node) if ...
""" This file was generated by the tool TatSuSAG (the TatSu syntax analyser generator) Changes to this file may cause incorrect behavior and will be lost if the code is regenerated. """ from poc.classes.AuxISourceAnalyser import AuxISourceAnalyser from poc.classes.AuxInterpretation import AuxInterpretation from poc.cl...
""" This module exports all latin and greek letters as Symbols, so you can conveniently do >>> from sympy.abc import x, y instead of the slightly more clunky-looking >>> from sympy import symbols >>> x, y = symbols('x y') Caveats ======= 1. As of the time of writing this, the names ``O``,...
import unittest # Importing the unittest module from user import User #importing user class class TestUser(unittest.TestCase): ''' Test class that defines test cases for the user class behaviours. ''' def setUp(self): ''' Set up method to run before each test cases. ''' ...
# ---------------------------------------------------------------------------- # pyglet # Copyright (c) 2006-2008 Alex Holkner # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # # * Redistribu...
#!/usr/bin/env python # -- Content-Encoding: UTF-8 -- """ Tests the log shell commands :author: Thomas Calmant """ # Standard library import logging try: from StringIO import StringIO except ImportError: from io import StringIO try: import unittest2 as unittest except ImportError: import unittest # ...
# Traffic flow # # Copyright (c) 2018 Yurii Khomiak # # 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, merg...
#!/usr/bin/env python # coding: utf-8 # Einkommentieren, falls nur CPU genutzt werden soll #import os #os.environ["CUDA_VISIBLE_DEVICES"] = "-1" import numpy as np import tensorflow.compat.v1 as tf import cv2 import urllib from datetime import datetime # Geklaut von https://gist.github.com/madhawav/1546a4b99c8313f0...
############################################################### # pytest -v --capture=no tests/virtualbox/test_compute_virtualbox.py # pytest -v tests/virtualbox/test_compute_virtualbox.py # pytest -v --capture=no tests/virtualbox/test_compute_virtualbox.py:Test_compute_virtualbox.<METHODNAME> #######################...
#!/usr/bin/env python # -*- coding: UTF-8 -*- import os import sys default_encoding = 'utf-8' if sys.getdefaultencoding() != default_encoding: reload(sys) sys.setdefaultencoding(default_encoding) # 打印对象 def prn_obj(obj): print ', '.join(['%s:%s' % item for item in obj.__dict__.items()]) # 换行打印对象 def pr...
import os import ctypes import ckit import clnch_misc import clnch_statusbar import clnch_ini #-------------------------------------------------------------------- class SongMCI: def __init__( self, filename ): self.filename = filename ret = ctypes.windll.winmm.mciSendStringW( 'open "%s" alias...
from __future__ import annotations import json import pytest from all_repos.source.bitbucket_server import list_repos from all_repos.source.bitbucket_server import Settings from testing.mock_http import FakeResponse from testing.mock_http import urlopen_side_effect def _resource_json(): with open('testing/reso...
""" Django settings for profiles_project project. Generated by 'django-admin startproject' using Django 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/ """ impor...
# -*- coding: utf-8 -*- # Copyright 2013-2021 CERN # # 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...
# Copyright 2016 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/env python import json import csv JSON_FILE_PATH = '/home/lukas/carla/carla-aautoware/results/results.json' CSV_FILE_PATH = '/home/lukas/carla/carla-autoware/results/total_results.csv' def main(): """ Load results for previous route from json file and append line to the total_results.csv file ...
#!/usr/bin/env python # pylint: disable=R0902,R0912,R0913 # # A library that provides a Python interface to the Telegram Bot API # Copyright (C) 2015-2018 # Leandro Toledo de Souza <devs@python-telegram-bot.org> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Les...
# -*- coding: utf-8 -*- """ Created on Wed Feb 9 11:39:06 2022 @author: SimenLab """ import pathlib import numpy as np import pandas as pd import utilities import qualitative # data_path = r"./Data/data_save/1_8dfp_ntc3_512_1.npz" def load_data(path): load_path = pathlib.Path(path) data = np.load(load_path...
import datetime from database.database_schemas import Schemas from sqlalchemy import Column, ForeignKey, Integer, String, DateTime from sqlalchemy.dialects.mysql import BIGINT, SMALLINT, DOUBLE, TIMESTAMP, TINYINT, LONGTEXT from database.base import Base class Events(Base): """Maps to EVENTS table in informatio...
# Copyright (c) 2013 OpenStack Foundation. # Copyright 2015 Rackspace # # 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 ...
import math import numpy as np import matplotlib.pyplot as plt data = [] def parse_ping_csv(filename): data = np.genfromtxt(filename, delimiter=',', skip_header=1, skip_footer=3) # Remove any NaN occurence data = data[~np.isnan(data)] return data def histplot(data, xmin=0, xmax=1000, step=1): y,...
import json import requests import time from .fahclientexception import FahClientException from datetime import datetime class StatsClient(object): team_stats_cache = None team_stats_expire = 0 # Fetches team statistics from the F@H server. def get_team_stats(self, team_num): if self.team_sta...
#!/usr/bin/env python3 # Copyright (c) 2021 The DIVI developers # Distributed under the MIT/X11 software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # Tests the standardness logic related to transaction inputs and P2SH. from test_framework import BitcoinTestFram...
# Copyright 2015 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). import logging import os import sys import threading from contextlib import contextmanager from dataclasses import dataclass from setproctitle import setproctitle as set_process_title fr...
# Copyright 2015 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...
# antioch # Copyright (c) 1999-2019 Phil Christensen # # # See LICENSE for details """ Core functionality. """ from zope.interface import provider from antioch import IPlugin @provider(IPlugin) class CorePlugin(object): name = 'core' script_url = '' def get_environment(self): """ Ret...
import torch import torch.nn as nn import numpy as np import cv2 import random import os from model_old import UNet, LC2RGB os.makedirs("out", exist_ok=True) # Constants MODEL_ID = "0" CLIP_VALUE = 1 ON_CUDA = torch.cuda.is_available() N_EPOCHS = 500 BATCH_SIZE = 16 LEARN_RATE = 0.001 if ON_CUDA: print("GPU av...
from bluepy import btle from . import uuids from .cgg import ClearGrassSensor from .lywsd import LywsdSensor from .mjht import MjhtSensor from ..decorators import with_connect class Sensor: def __init__(self, mac): self._mac = mac self._peripheral = btle.Peripheral() self._instance = None...
from checkov.cloudformation.checks.resource.base_resource_value_check import BaseResourceValueCheck from checkov.common.models.enums import CheckCategories class APIGatewayXray(BaseResourceValueCheck): def __init__(self): name = "Ensure API Gateway has X-Ray Tracing enabled" id = "CKV_AWS_73" ...
# -*- coding: utf-8 -*- # Copyright 2020 Matrix.org Foundation C.I.C. # # 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...
#!/usr/bin/python3 # -*-coding:utf-8-*- __author__ = "Bannings" class Solution: # 解法一: x = f(x-1) + f(x-2) # def climbStairs(self, n: int) -> int: # if n <= 1: return 1 # return self.climbStairs(n-1) + self.climbStairs(n-2) # 解法二: 备忘录 # def climbStairs(self, n: int) -> int: # ...
#-*-coding:Utf-8 -* """Data validation, to be sure that rating data was imported correctly""" import numpy as np import os import pickle start_offset = 0 checks = 81 print_errors = False base_path = '../TreatedData/0_to_81/' def sorted_search(ar, x, get_closest=False): if len(ar) == 0: return 0 if get_closest el...
# -*- coding: utf-8 -*- """ werkzeug.serving ~~~~~~~~~~~~~~~~ There are many ways to serve a WSGI application. While you're developing it you usually don't want a full blown webserver like Apache but a simple standalone one. From Python 2.5 onwards there is the `wsgiref`_ server in the standa...
# Copyright (c) 2021-2022, InterDigital Communications, Inc # All rights reserved. # Redistribution and use in source and binary forms, with or without # modification, are permitted (subject to the limitations in the disclaimer # below) provided that the following conditions are met: # * Redistributions of source cod...
""" In charge of evolving a population for the set number of mating events. """ import sys from kaplan.ga_input import read_ga_input, verify_ga_input from kaplan.mol_input import read_mol_input, verify_mol_input from kaplan.ring import Ring, RingEmptyError from kaplan.tournament import run_tournament from kaplan.ou...
from sympy import * from sympy.abc import x, y from algebreb.ejercicios.tipos_ejercicios import UnOperando from algebreb.expresiones.polinomios import Polinomio, monomio_aleatorio, polinomio_coeficientes_aleatorios from algebreb.pasos.factorizacion import pasos_cubo_perfecto_binomios_latex, pasos_diferencia_cuadrados_l...
from __future__ import print_function, division import tensorflow as tf from tensorflow.keras.datasets import mnist from tensorflow.keras.layers import Input, Dense, Reshape, Flatten, Dropout, MaxPooling2D from tensorflow.keras.layers import BatchNormalization, Activation, ZeroPadding2D, Reshape #from tensorflow.kera...
from datetime import datetime as dt from .. import const from .model_base import ModelBase from .posters import Addable, Deleteable, Updatable from .project import Project class Suite(Addable, Deleteable, Updatable, ModelBase): _ADDABLE_FIELDS = const.SUITE_ADD_FIELDS _UPDATABLE_FIELDS = const.SUITE_UPDATE_F...
from pyhop_anytime import * global state, goals state = State('state') state.calibration_target = Oset([('instrument0','groundstation3'),('instrument1','groundstation3'),('instrument2','groundstation3'),('instrument3','star1'),('instrument4','groundstation3'),('instrument5','groundstation3'),('instrument6','star4'),('i...
# -*- coding: utf-8 -*- # # Copyright (C) 2020 CERN. # # invenio-app-ils is free software; you can redistribute it and/or modify it # under the terms of the MIT License; see LICENSE file for more details. """Records relations tests helpers.""" from __future__ import unicode_literals import json from flask import ur...
"""Script creating a CloudFormation template containing the resources required to set up budget alerting to a Slack channel """ import sys import os from dataclasses import dataclass from troposphere import Template, Parameter, Ref from troposphere import sns, serverless, budgets, awslambda LAMBDA_RUNTIME = 'nodejs8....
# -*- coding: utf-8 -*- class PoolExhaustedError(Exception): pass class ConnectionNotFoundError(Exception): pass
#!/usr/bin/env python3 import copy import random import pyfastaq random.seed(1) def mutated_nucleotide(nucleotide): other_nucleotides = ['A', 'C', 'G', 'T'] other_nucleotides.remove(nucleotide) return random.choice(other_nucleotides) nucleotides = ['A', 'C', 'G', 'T'] seq1 = [random.choice(nucleotides)...
# Copyright 2016 Open Source Robotics Foundation, 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...
# -*- coding: utf-8 -*- # Copyright © 2017 Apple Inc. All rights reserved. # # Use of this source code is governed by a BSD-3-clause license that can # be found in the LICENSE.txt file or at https://opensource.org/licenses/BSD-3-Clause from __future__ import print_function as _ from __future__ import division as _ from...
import pytest import unittest import ray import ray.rllib.agents.dqn.apex as apex from ray.rllib.policy.sample_batch import DEFAULT_POLICY_ID from ray.rllib.utils.metrics.learner_info import LEARNER_INFO, LEARNER_STATS_KEY from ray.rllib.utils.test_utils import ( check, check_compute_single_action, check_t...
# -*- coding: utf-8 -*- ''' :codeauthor: :email:`Pedro Algarvio (pedro@algarvio.me)` :copyright: © 2016 by the SaltStack Team, see AUTHORS for more details. :license: Apache 2.0, see LICENSE for more details. pytestsalt.salt.log_handlers.pytest_log_handler ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~...
# -*- coding:utf-8 -*- import json import re from unittest import skipIf import django import pytest from django import forms from django.core import exceptions, serializers from django.core.management import call_command from django.db import connection, models from django.db.migrations.writer import MigrationWriter ...
# testing/__init__.py # Copyright (C) 2005-2020 the SQLAlchemy authors and contributors # <see AUTHORS file> # # This module is part of SQLAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php from . import config # noqa from . import mock # noqa from .assertions import...
import inspect import itertools import logging from decimal import Decimal from typing import Union, Any, Tuple, Sequence, Mapping, Callable, TYPE_CHECKING, get_type_hints import datetime from enum import Enum from uuid import UUID from lightbus.utilities.deforming import deform_to_bus from lightbus.utilities.type_ch...
tabby_cat = "\tI'm tabbed in." persian_cat = "I'm split\non a line." backslash_cat = "I'm \\ a \\ rad." fat_cat = """ I'll do a list: \t* rad food backslash_cat = "I'm \\ a \\ rad." fat_cat = """ I'll do a list: \t* rad food \t* Fishies \t* Catnip\n\t* Grass """ print(tabby_cat) print(persian_cat) print(b...
import asyncio import concurrent import logging from concurrent.futures.thread import ThreadPoolExecutor from pathlib import Path from typing import Callable, Dict, List, Optional, Tuple import salvia.server.ws_connection as ws # lgtm [py/import-and-import-from] from salvia.consensus.constants import ConsensusConstan...
#!/usr/bin/env python from __future__ import division, print_function, absolute_import import functools import numpy as np import pycuda.autoinit import pycuda.gpuarray as gpuarray import pycuda.driver as drv from cuda_cffi.misc import init toolkit_version = drv.get_version() if toolkit_version < (7, 0, 0): rais...
# # Copyright (c) 2017 Juniper Networks, Inc. All rights reserved. # # This file contains generic plugin implementation device configuration # using ansible # from builtins import str from builtins import object import datetime from hashlib import md5 import json import time from abstract_device_api.abstract_device_x...
import logging from datetime import datetime import coloredlogs import click from . import VCF from . import __version__ log = logging.getLogger(__name__) LOG_LEVELS = ['DEBUG', 'INFO', 'WARNING', 'ERROR', 'CRITICAL'] def print_header(vcf_obj, include, exclude, samples=None): """Print the header of a vcf obj ...
# 2. Zmodyfikuj dopasowywanie adresu email tak aby: # 1. Dopuszczać kropki w rozszerzeniu domeny # 2. Za pomocą grup dopasować: nazwę, domenę, rozszerzenie domeny import re text = "nazwa@domena.com.pl" pattern = re.compile(r"(\w+)@(\w+)((?:\.\w+)+)")
# 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 ...
import os # todo: update directory structure directories = ['./data/', './data/delivery_challans/', './uploads/', './uploads/delivery_challans/'] def safe_make_folder(i): """Makes a folder (and its parents) if not present""" try: os.makedirs(i) except: pass if __name__ == "__main__": ...
import click import os from installer.configurators.common import update_main_terraform_vars @click.group() @click.option( "--branch", "-b", help='Branch to build Jazz framework from. Defaults to `master`', default='master' ) # TODO Maybe drop this @click.option( "--region", "-r", help='AW...
# 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...
""" Corrently.io *Corrently - from italian corrente, which is energy* # Introduction The Corrently ecosystem gets maintained by [STROMDAO GmbH](https://www.stromdao.de/) to support green energy services for prosumers, grid operators, regulators, integrators or any other party with an emerging need of consensus...
#-*- coding : utf-8 -*- class Distribute(object): def __init__(self): self.__layout = 0 self.__funcs = {list:self._list, dict:self._dict} @property def funcs(self): return self.__funcs def _drowTab( self, tab, add=' |' ): add = add * tab return " {add}".format(**locals()) def _dict( self, data, tab ):...
from __future__ import absolute_import from __future__ import print_function import os import csv import numpy as np import time import json import warnings from collections import deque from collections import OrderedDict from collections import Iterable from .utils.generic_utils import Progbar from keras import ba...
""" CryptoAPIs Crypto APIs 2.0 is a complex and innovative infrastructure layer that radically simplifies the development of any Blockchain and Crypto related applications. Organized around REST, Crypto APIs 2.0 can assist both novice Bitcoin/Ethereum enthusiasts and crypto experts with the development of thei...
#!/usr/bin/env python # # Copyright 2007 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 o...