content
stringlengths
5
1.05M
{ "targets": [ { "target_name": "napi_typedarray_macros_test", "include_dirs": [ "<!(node -e \"require('napi-macros')\")", "<!(node -e \"require('./index')\")" ], "libraries": [ "-lmsvcrt.lib" ], "sources": [ "./test.c" ] } ] }
import numpy as np from irs_lqr.irs_lqr import IrsLqr class IrsLqrFirstOrder(IrsLqr): def __init__(self, system, params, sampling): super().__init__(system, params) """ Direct iterative LQR using Randomized Smoothing. This variant samples gradients directly. - sampling: s...
# -*- coding: utf-8 -*- """Provides all at one.""" import inspect from typing import Any, Final, List, Type from mimesis.locales import Locale from mimesis.providers.address import Address from mimesis.providers.base import BaseDataProvider, BaseProvider from mimesis.providers.binaryfile import BinaryFile from mimes...
import re from datetime import date, datetime, timedelta, timezone from decimal import Decimal from typing import List, NamedTuple, Optional from pricehist import exceptions from pricehist.series import Series SourcePrice = NamedTuple( "SourcePrice", [ ("price", Decimal), ("time", Optional[dat...
import json import pandas as pd from dataprep.scrape_all_alexa_information import main file_name = "data_for_trainig_model_corpus_2018_audience_overlap_sites_level_3_and_referral_data_2018_corpus_level3_deep.csv" df = pd.read_csv(file_name) df.head() unique_sources = df.source.unique().tolist() uniqu...
"""Parser logic that parses declaration nodes. The functions in this file that have names beginning with an underscore are to be considered implementation details of the declaration parsing. That is, they are helpers for the other functions rather than meant to be used directly. The primary purpose for this distinctio...
from pyramid.view import view_config from .. import models from sqlalchemy import exc from ..exceptions.custom_error import CustomError from pyramid.httpexceptions import HTTPForbidden, HTTPNoContent from ..scripts.utils import Utils import logging log = logging.getLogger(__name__) from pyramid.view import notfound_vie...
import yaml import requests from datetime import datetime import simplejson as json def get_parameters(stack_file, stack_name, secret, stack_region=None, stack_account=None, action=None, profile_name=None, slack_webhook_url=None): stacks = None try: with open(sta...
"""这是一个父模块""" import requests import logging from selenium import webdriver from selenium.webdriver.common.by import By from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.support import expected_conditions as EC import logging import re class Parent(object): def __init__(self): ...
# Copyright 2015 Ufora 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 i...
from distutils.core import setup setup( author = 'Owen Imholte', author_email = 'releases@owenimholte.com', description = 'A utility to perform PKCS encoding', download_url = 'https://github.com/owenfi/crypto-pkcs7-example', license = 'unlicense.org', name = 'pkcs', py_modules = ['pkcs1','p...
from flask import Flask, render_template, request, redirect, url_for from flask_sqlalchemy import SQLAlchemy import linecache app = Flask(__name__) app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///db.sqlite' app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = True db = SQLAlchemy(app) class Language(db.Model): __ta...
import pickle from typing import Dict, Tuple import seaborn as sns from matplotlib import cm from matplotlib import pyplot as plt from mpl_toolkits.axes_grid1 import make_axes_locatable from study_classification_histogram_comparison import RESULT_FILE_NAME from tqdm import tqdm from paddle.custom_types import AnyPath...
def get_grade(s1, s2, s3): score = (s1 + s2 + s3) / 3 if 90 <= score <= 100: return 'A' elif 80 <= score < 90: return 'B' elif 70 <= score < 80: return 'C' elif 60 <= score < 70: return 'D' return 'F'
#!/usr/bin/env python # encoding: utf-8 from sqlalchemy import Table from sqlalchemy import Column from sqlalchemy import Integer from sqlalchemy import BigInteger from sqlalchemy import String from sqlalchemy import DateTime from sqlalchemy import Float from sqlalchemy import Text from .app import db class JsonSe...
# Copyright (c) 2019-2021, Manfred Moitzi # License: MIT License from functools import partial from ezdxf.lldxf.hdrvars import SingleValue, Point2D, Point3D, HeaderVarDef from ezdxf.lldxf.const import ( DXF12, DXF2000, DXF2004, DXF2007, DXF2010, DXF2013, DXF2018, ) HEADER_VAR_MAP = { "$...
import torch, timeit, functools def test(a,b): return a.matmul(b) A = torch.randn(15000,15000) B = torch.randn(15000,15000) Ag = A.cuda() Bg = B.cuda() cpu_timer = timeit.Timer(functools.partial(test,A,B)) cpu_time = cpu_timer.timeit(1) gpu_timer = timeit.Timer(functools.partial(test,Ag,Bg)) gpu_time = gpu_timer.time...
''' ------------------------------------------------------------------ سلام نکته اول اینکه در این قسمت شرت کات درون خود وی اس کد برای درست کردن فایل رو پیدا کردم ctrl + shift + p خط فرمان new file نوشتن و اسم دادن در هر جای ctrl + b که باشیم و روش دیگر در ctrl + b که می...
from datetime import datetime from elasticsearch import Elasticsearch es = Elasticsearch() doc = { 'temperature': 17, 'time': datetime.now() } # insert res = es.index(index="temp", doc_type='_doc', id=4, body=doc) print(res['result']) # get # res = es.get(index="test-index", doc_type='tweet', id=1) # print(re...
from app import create_app, db from app.Model.models import Post, Field, Language app = create_app() @app.before_first_request def initDB(*args, **kwargs): db.create_all() if Field.query.count() == 0: fields = ['Machine Learning','High Performance Computing', 'Object Oriented Programming',...
import json test={'Q5':'5Do you have a dog?'} js=json.dumps(test) with open('5.json','w') as jsf: jsf.write(js)
#!/usr/bin/python # # vfsreadlat.py VFS read latency distribution. # For Linux, uses BCC, eBPF. See .c file. # # Written as a basic example of a function latency distribution histogram. # # USAGE: vfsreadlat.py [interval [count]] # # The default interval is 5 seconds. A Ctrl-C will print the partially # gathered his...
from azureml.core.run import Run import argparse import time parser = argparse.ArgumentParser() parser.add_argument("--a", type=int, dest="a", help="The alpha parameter") parser.add_argument("--b", type=int, dest="b", help="The beta parameter") args = parser.parse_args() # Produce bad values if 'a' greater than 2 if ...
from django.db import models from django.utils.translation import ugettext_noop from jsonfield import JSONField class ConfigStore(models.Model): """ A model class to store all config variables in the database. """ key = models.CharField(max_length=255, unique=True, db_index=True) """A string, th...
""" Load, download and initialise trained and untrained Sequence UNET models. """ from logging import warning import os import ftplib import tqdm from shutil import unpack_archive from contextlib import closing from tensorflow.keras import layers, models from sequence_unet.graph_cnn import GraphCNN from sequence_unet ...
# Imports from django.core.management.base import BaseCommand, CommandError from django.core import mail from polls.models import * from django.shortcuts import render, get_object_or_404, redirect class Command(BaseCommand): help = 'Sends an email from oprahprogramtest@gmail.com' def add_arguments(self, parser): ...
import torch import torch.nn as nn from functools import partial from timm.data import IMAGENET_DEFAULT_MEAN, IMAGENET_DEFAULT_STD from timm.models.helpers import load_pretrained from timm.models.layers import DropPath, to_2tuple, trunc_normal_ from timm.models.resnet import resnet26d, resnet50d from timm.models.regis...
#!/usr/bin/env python # -*- coding: utf-8 -*- from flask import flash, render_template, request, current_app from . import main from flask_login import login_required from ..models import Permissions, Post, Tag @main.app_context_processor def inject_permissions(): return dict(Permissions=Permissions) ...
# file: dblp_bibtex_fetcher.py # date: 08/24/2013 # author: Tzu-Mao Li # description: a parser to obtain the bibtex files from a dblp webpage # input the url(e.g. http://www.informatik.uni-trier.de/~ley/db/journals/tog/tog31.html ) # and the program will automatically create folders and files ...
# Copyright (c) The Diem Core Contributors # SPDX-License-Identifier: Apache-2.0 from diem.testing.miniwallet import RestClient, AccountResource from diem import identifier, utils from typing import Union import pytest, requests @pytest.fixture def account(target_client: RestClient) -> AccountResource: return t...
from xmc.tools import dynamicImport class ErrorEstimator(): """ This class is responsible for the error estimation of the multi-something MC estimation. """ def __init__(self,**keywordArgs): # Attributes self.parameters = keywordArgs.get("parameters",None) # Methods ...
# Generated by Django 2.2.2 on 2019-06-20 17:57 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('openbook_common', '0013_language'), ('openbook_posts', '0035_auto_20190620_1357'), ] operations = [ ...
# # Naive Bayes Classifier chapter 6 # # _____________________________________________________________________ class Classifier: def __init__(self, bucketPrefix, testBucketNumber, dataFormat): """ a classifier will be built from files with the bucketPrefix excluding the file with textBucket...
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. # SPDX-License-Identifier: Apache-2.0 import os from unittest import TestCase from unittest.mock import patch, MagicMock, call with patch("boto3.resource") as boto_resource_mock: with patch("boto3.client") as boto_client_mock: from funct...
import torch import torch.nn as nn import torch.nn.functional as F from ..utils import downsample_block class DCGANDiscriminator(nn.Module): def __init__(self, img_size, channels, dropout=0.25): super().__init__() self.model = nn.Sequential( *downsample_block(channels, 16, bn=False, d...
from Past_exams.Dec_19_2020.medicine.medicine import Medicine class Painkiller(Medicine): def __init__(self): super().__init__(20)
from __future__ import annotations import asyncio from collections import defaultdict from typing import Any, List, Optional from magda.module.module import Module from magda.utils.logger import MagdaLogger class Graph: """ Graph class Graph holds all modules added to the same group. It's responsible f...
import itertools import datetime seats4 = [2,3,5,7] seats8 = [2,3,5,7,11,13,17,19] partners = [] opponents = [] txtPairingAre = "The pairing options is: " seperator = "," print ("***********************************") print(datetime.datetime.now()) print ("***********************************") print("This is a bughouse ...
from __future__ import absolute_import, division, print_function import logging from functools import wraps import numpy as np from matplotlib.backends.backend_agg import FigureCanvasAgg from .misc import DeferredMethod __all__ = ['all_artists', 'new_artists', 'remove_artists', 'get_extent', 'view_casca...
import asyncio import time import urllib.parse from typing import Optional, Tuple from asgiref.typing import WWWScope def get_remote_addr(transport: asyncio.Transport) -> Optional[Tuple[str, int]]: socket_info = transport.get_extra_info("socket") if socket_info is not None: try: info = so...
# SPDX-License-Identifier: BSD-3-Clause # Copyright (c) 2021 Scipp contributors (https://github.com/scipp) # @author Andrew R. McCluskey (arm61) import scipp as sc from ess.reflectometry import corrections def test_illumination_correction_no_spill(): beam_size = 1.0 * sc.units.m sample_size = 10.0 * sc.units....
#!/usr/bin/env python # # This library is free software, distributed under the terms of # the GNU Lesser General Public License Version 3, or any later version. # See the COPYING file included in this archive import hashlib import unittest import struct from twisted.internet import protocol, defer, selectreactor from...
# Copyright (c) 2012-2013, Mark Peek <mark@peek.org> # All rights reserved. # # See LICENSE file for full license. from aws import Action as BaseAction from aws import BaseARN service_name = 'AWS CodeCommit' prefix = 'codecommit' class Action(BaseAction): def __init__(self, action=None): sup = super(Act...
#! /usr/bin/env python # Han Tan # UC Davis # October 2013 # Takes .sam files, filters for reads that align uniquely to # the genome, converts this to .bam and created the .sorted.bam # file to be used for SNP calling # Usage batch-sam-to-bam-uniquereads.py import os, sys, math li = os.listdir(os.getcwd()) print l...
import json, sys import pandas as pd # import numpy as np # import math # import itertools # import re # import scipy.stats as sp from operator import itemgetter as it class musei(object): #Loads a hard-coded slack message. ## Should access data via API request from a different source (JS?) def loadDemoMe...
import pytest import os import logging logging.basicConfig(filename='example.log', level=logging.DEBUG) mylogger = logging.getLogger() def setup_module(module): ''' setup for the entire module ''' mylogger.info('Inside Setup') # Do the actual setup stuff here pass def setup_functio...
"""WebSocket protocol versions 13 and 8.""" import asyncio import collections import json import random import re import sys import zlib from enum import IntEnum from struct import Struct from typing import Any, Callable, List, Optional, Tuple, Union from .base_protocol import BaseProtocol from .helpers import NO_EXT...
"""Test Toolbox command `3scale`""" import re import os import pytest from packaging.version import Version # noqa # pylint: disable=unused-import from testsuite.toolbox import toolbox from testsuite import TESTED_VERSION # noqa # pylint: disable=unused-import pytestmark = pytest.mark.skipif("TESTED_VERSION < Ver...
""" Created on May 13, 2014 @author: Jonathan Laperle(jonathan.laperle@usherbrooke.ca) """ def mean(container): """Averages all elements in container Args: container: a container of sum()able elements Returns: The mean value of all elements """ return sum(container)/len(container)...
import discord import json import CaptchaCreator import os class Client(discord.Client): def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) #Set this to the limited role id you created. self.limitedRoleID = #ROLE ID HERE #Set this to your servers ID. sel...
#coding: utf-8 from __future__ import division import matplotlib.pyplot as plt import os, numpy as np def PlotConservative(filename=None, title=None): local_conserv = [] for name in filename: local = [] try: with open(name, "r") as f: for line in f: ...
from .gevent_wrapper import sleep from infi.pyutils.lazy import cached_method, clear_cache from logging import getLogger logger = getLogger(__name__) class StorageModel(object): """StorageModel provides a layered view of the storage stack. The layers currently exposed by the model are: * SCSI * Mult...
import sys # from .ant import AntEnv from .humanoid import HumanoidEnv from .halfcheetah_jump import HalfCheetahEnv as HalfCheetahJumpEnv from .halfcheetah_vel import HalfCheetahEnv as HalfCheetahVelEnv from .ant_angle import AntEnv as AngAngleEnv # import halfcheetah_vel # env_overwrite = {'Ant': AntEnv,'AntAngle': ...
import ctypes as C import os from dataclasses import dataclass from typing import Final from astruct import typed_struct from astruct.ctypes_utils import get_bytes_for_field from astruct.type_hints import * from utils import ro_cached_property from .items import ItemTable from .skills import SkillTable from .specials...
default_app_config = 'hackoregon_transportation_systems.toad.apps.ToadConfig'
from json import dumps import logging import os from file_manager import FileManager from flask import Flask, request, abort, make_response import models from utils import handler, TokenAuth from flask_sandboy import BadRequestException app = Flask(__name__) app.config.from_pyfile('config.cfg') file_manager = FileMa...
from trinity.db.base import ( AsyncDBPreProxy, ) from trinity.db.eth1.chain import ( AsyncChainDBPreProxy, ) from trinity.db.eth1.header import ( AsyncHeaderDBPreProxy, ) from trinity.db.beacon.chain import ( AsyncBeaconChainDBPreProxy, ) def test_can_instantiate_proxy(): # The test fails if we fo...
class JoystickEvent(object): pass class JoystickAxisEvent(JoystickEvent): def __init__(self, amount): self.amount = float(amount) def __repr__(self): return str(type(self)) + '<amount={}>'.format(self.amount) def __str__(self): return repr(self) def __hash__(self): ...
# Copyright 2018-2020 Drexel University # Author: Geoffrey Mainland <mainland@drexel.edu> import datetime from functools import cached_property import json import logging import os import pytz import re import pandas as pd import dragonradio.tools.mgen as mgen from dragonradio.tools.cache import DataFrameCache, cache...
import pytest import torch from openff.interchange.models import PotentialKey from openff.toolkit.typing.engines.smirnoff import ForceField from simtk import unit as simtk_unit from descent.data import DatasetEntry from descent.tests import is_close from descent.utilities.smirnoff import exercised_parameters, perturb_...
class Node: def __init__(self, val, children=[]): self.val = val self.children = [] for child in children: self.children.append(Node(child)) def __repr__(self): return 'node is {}'.format(str(self.val)) def __str__(self): return str(self.val) class KTr...
""" Item 77: Isolate Test from Each Other with setUp, testDown, setUpModule, and tearDownModule It is important to write both unit tests (for isolated functionality) and integration tests (for modules that interact with each other). Use the setup and tearDown methods to make sure your tests are isolated from each ...
from netaddr import IPAddress import pytest from tests.common.helpers.assertions import pytest_assert pytestmark = [ pytest.mark.topology('any'), pytest.mark.device_type('vs') ] def test_interfaces(duthosts, enum_dut_hostname, tbinfo): """compare the interfaces between observed states and target state"""...
import unittest import sys sys.path.append('..') from code_df.commit import Commit from code_df import utils from pandas.util.testing import assert_frame_equal import json def read_file(path): """ Given a line-by-line JSON file, this function converts it to a Python dictionary and returns all such lines a...
# (c) @AbirHasan2005 # This is Telegram Video Watermark Adder Bot's Source Code. # I Hardly Made This. So Don't Forget to Give Me Credits. # Done this Huge Task for Free. If you guys not support me, # I will stop making such things! # Edit anything at your own risk! # Don't forget to help me if I done any mistake in...
#!/usr/bin/env python # # Protein Engineering Analysis Tool DataBase (PEATDB) # Copyright (C) 2010 Damien Farrell & Jens Erik Nielsen # # 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 ver...
# Copyright 2021 Hathor Labs # # 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...
# SPDX-License-Identifier: Apache-2.0 import unittest from distutils.version import StrictVersion import lightgbm import numpy from numpy.testing import assert_almost_equal from onnx.defs import onnx_opset_version from onnxconverter_common.onnx_ex import DEFAULT_OPSET_NUMBER from lightgbm import LGBMClassifier, LGBMR...
from django.contrib import admin from django.db import models # Register your models here. from kegs.models import Beer, Keg class MyBeerAdmin(admin.ModelAdmin): model = Beer list_display = ('name', 'style', 'abv', 'bitterness', 'datebrewed', 'description',) class MyKegAdmin(admin.ModelAdmin): model = Ke...
word = input("Input a word: ") world_list = list(word) result = [] for _ in range(len(world_list)): result.append(world_list.pop()) # print("".join(result)) print(word[::-1])
#!/usr/bin/env python import rospy import moveit_msgs.msg import std_msgs.msg import os, rospkg def main(): rospy.init_node('urscript_sending_example_node', anonymous=True) pub = rospy.Publisher("/b_bot_controller/ur_driver/URScript", std_msgs.msg.String, queue_size=1) rospy.sleep(1.0) # Wait for the publisher...
# This is a class declaration. It will allow us to create objects called person class person: # The first function we write will be what is automatically called on object # creation. It is used to initialize the data in the object. The values after # the equals signs are default values that will automatical...
from django.conf.urls import url from template.views import echo, filters, extend urlpatterns = [ url(r'^echo/$', echo), url(r'^filters/$', filters), url(r'^extend/$', extend), ]
import datetime from django.conf import settings from money import Money as Convert, Money from apiv1.external.mifosx import _get_next_repayment_raw, mifosx_api from apiv1.internal.utils import format_currency_display __author__ = 'audakel' def _get_next_repayment(user, data=''): res = _get_next_repayment_raw(us...
import connexion.problem def notfound(detail): return connexion.problem(404, "Not Found", detail) def badrequest(detail): return connexion.problem(400, "Bad Request", detail) def internalerror(detail): return connexion.problem(500, "Internal Server Error", detail)
#!/usr/bin/env python3 #!/usr/bin/env python2 import logging import sys from main import Bot_core logging.basicConfig( level=logging.DEBUG, format='%(asctime)s %(name)s %(levelname)s - %(message)s', datefmt='%Y-%m-%d %H:%M:%S', ) # logger.debug("debug message") # logger.info("info message") # logger.war...
SECRET_PASSWORD = "passwort1" correct_password = False tries_left = 3 while not correct_password and tries_left > 0: user_input = input("Geben Sie ihr Passwort ein.\n") if(SECRET_PASSWORD == user_input): print("Authentifizierung erfolgreich!") correct_password = True else: print("Fa...
# Generated by the protocol buffer compiler. DO NOT EDIT! # source: pacote.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 google.protobuf import message as _message from google.protobuf import reflection as _reflec...
import peewee # type: ignore import datetime import config db = peewee.SqliteDatabase(config.DATABASE, pragmas={ 'journal_mode': 'wal', 'foreign_keys': 1, 'ignore_check_constraints': 0}) class DataPoint(peewee.Model): date = peewee.DateTimeField(default=datetime.datetime.now) place = peewee.Char...
arr = [2,3,1,3,2] rangearr = [0] * len(arr)*2-1 print(arr) for i in range(len(arr)) : rangearr[i+len(arr)] = arr[i] print(rangearr)
#!/usr/bin/env python words = [ '', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight', 'nine', 'ten', 'eleven', 'twelve', 'thirteen', 'fourteen', 'fifteen', 'sixteen', 'seventeen', 'eighteen', 'nineteen' ] for t in ['twenty', 'thirty', 'forty', 'fifty', 'sixty', 'seventy', 'eighty', 'n...
# Previously worked when in bot-be-named main directory, might need to edit paths for it being in perfect_pitch module now import os from modules.music_race import music_race_constants if not os.path.exists( os.path.join( os.getcwd(), "modules", music_race_constants.MUSIC_RACE_DIR, ...
#!/usr/bin/python3 import argparse import pathlib import json import pprint import os import subprocess ARCH_DIR = pathlib.Path('arch').resolve() BIN_DIR = pathlib.Path('bin').resolve() BUILD_DIR = pathlib.Path('.build').resolve() INCLUDE_DIR = pathlib.Path('include').resolve() SRC_DIR = pathlib.Path('src').resolve() ...
''' loan_payoff_tools: Test module. Meant for use with py.test. Write each test as a function named test_<something>. Read more here: http://pytest.org/ Copyright 2014, Phillip Green II Licensed under MIT ''' import unittest import os.path import tempfile import shutil import datetime import loan_payoff_tools.analy...
# Generated by Django 2.2.3 on 2019-11-24 19:46 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('rse', '0003_auto_20191124_1935'), ] operations = [ migrations.AlterField( model_name='rseallocation', name='deleted_...
import re from sqlalchemy import create_engine from sqlalchemy.orm import sessionmaker from src.models.Base import Base from src.models.EveryMonthTimeScheduleItem import EveryMonthTimeScheduleItem from src.models.Item import Item from src.models.ItemState import ItemState from src.models.List import List from src.mod...
# -*- coding: utf-8 -*- import os import sys sys.path.append(os.path.join(os.path.abspath(os.path.dirname(__file__)), 'webroot')) def main(): from app.app_env import PATH_APP_ROOT, PATH_DATA from app.base.webapp import tp_web_app _web_app = tp_web_app() if not _web_app.init(PATH_APP_ROOT...
# -*- coding: utf-8 -*- """ This is the find module. The find module supplies one function, logistic_regression() """ from sklearn.linear_model import LogisticRegression import pandas as pd def logistic_regression( data_frame: pd.DataFrame, penalty: str = "l2", dual: bool = False, tol: float = 1e...
import string from core.model.meta_column import MetaColumn from core.service.column_generator.base import RegisteredGenerator, SingleColumnGenerator from core.service.column_generator.decorator import parameter from core.service.data_source.data_provider import DataProvider from core.service.generation_procedure.data...
from __future__ import print_function, absolute_import, division import yamlreader import boto3 import logging import yaml from monocyte import Monocyte def read_config(path): return {} if path is None else yamlreader.yaml_load(path) def get_config_path_from_args(args): return args["--config-path"] def ge...
# Usado para ler imagens from PIL import Image # Usado para armazenar imagem import numpy as np import os class RLE: def __init__(self, nomeArq, tipoArq) -> None: self.nome_arq = nomeArq self.tipo_arq = tipoArq self.im = Image.open(self.nome_arq + self.tipo_arq) self.im...
from pathlib import Path import pytest import zebr0 import zebr0_script @pytest.fixture(scope="module") def server(): with zebr0.TestServer() as server: yield server def test_ok(server, tmp_path): server.data = {"dummy.conf": "yin: yang\n"} client = zebr0.Client("http://localhost:8000", config...
# Lint as: python2, python3 # Copyright 2020 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 # ...
def check_palindromic(number): number = list(str(number)) for i in xrange(len(number)): if number[i] != number[-i-1]: return False return True palindromics = [] for x in xrange(999, 0, -1): for y in xrange(999, 0, -1): number = x*y if check_palindromic(nu...
import pytest from random_guesser import random_guesser_v1 from random_guesser import random_guesser_v2 def test_random_guesser_v1(): labels = random_guesser_v1("Lorem ipsum dolor sit amet, consectetur adipiscing elit.") assert isinstance(labels, dict) assert len(labels) == 14 assert "score_accountabi...
""".on Plugin for @UniBorg""" import asyncio from telethon import events from telethon.tl.types import ChannelParticipantsAdmins from uniborg.util import admin_cmd @borg.on(admin_cmd("on")) async def _(event): if event.fwd_from: return mentions = "`I am NøøB bot of LEGENDARY \n\nNOOBDA Bøt : 2.0...
import pytest from app.main.helpers.dm_google_analytics import custom_dimension, CurrentProjectStageEnum def test_custom_dimension_create_with_enum_instance(): dimension_dict = custom_dimension(CurrentProjectStageEnum, CurrentProjectStageEnum.AWARDED) assert dimension_dict == {'data_id': 8, 'data_value': 'aw...
# terrascript/data/invidian/stdlib.py # Automatically generated by tools/makecode.py (24-Sep-2021 15:27:59 UTC) import terrascript class stdlib_base64decodehash(terrascript.Data): pass __all__ = [ "stdlib_base64decodehash", ]
import psycopg2.extras from controller import RobotRotine as rr from api import graphqlconsume, querygraphql import time import datetime import numpy as np """ current = np.datetime64(datetime.datetime.now()) currentab = np.datetime64(current) + np.timedelta64(5, 'h') lastdate = np.datetime64(currentab) - np.timedelta6...
#!/usr/bin/env python # -*- coding: UTF-8 -*- """ Author: AJ Reynolds Date: 01-24-2015 Purpose: Program to cleanup the various lists and entries used from the TRAKT website to support syncrmt and other DadVision modules. ABOUT Current functions: Remove entries from the watchlist that have been delivered. Repopulate ...