text
stringlengths
2
999k
import torch.nn as nn from ..functions import F_affine2d, F_affine3d class STN2d(nn.Module): def __init__(self, local_net): super(STN2d, self).__init__() self.local_net = local_net def forward(self, x): params = self.local_net(x) x_transformed = F_affine2d(x[0], params.view...
#!/usr/bin/env python3 """Set up file for running tests.""" import unittest def test(): loader = unittest.TestLoader() testSuite = loader.discover('linkograph.tests') runner = unittest.TextTestRunner() runner.run(testSuite)
from frazzl import Service from ariadne import QueryType schema = """ type Query { getTest2: Test2 } type Test2 { test1: String } """ query = QueryType() def resolve_getTest2(*args, **kwargs): return query.set_field("getTest2", resolve_getTest2) testService = Service("testService2", schema, query)
# 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 ...
#!/usr/bin/env python3 from itertools import chain from setuptools import setup from snakeoil.dist import distutils_extensions as pkgdist pkgdist_setup, pkgdist_cmds = pkgdist.setup() setup(**dict( pkgdist_setup, license='BSD', author='Tim Harder', author_email='radhermit@gmail.com', descriptio...
''' * File: settings.py * Author: George Ungureanu <ugeorge@kth.se> * Purpose: This file contains methods for collecting configuration options and initialize the settings object which holds the parameters throughout the program execution. * License: BSD3 ''' ''' Copyright (...
from __future__ import print_function from functools import wraps import logging try: import ujson as json except ImportError: import json from flask import Flask as _Flask from flask.globals import _request_ctx_stack from werkzeug.wrappers import Response from werkzeug.datastructures import Headers from werk...
# -*- coding: utf-8 -*- from __future__ import unicode_literals import json import re from scripts.data_cleaner import set_new_error #from scripts.data_cleaner_v2 import calculateNumber class PublicAccountCleanerMix: # cleaning def column_formatter_v3(self, reset=False, image_num=None): from public...
from django.shortcuts import render # Create your views here. from django.http import HttpResponse def index(request): return HttpResponse('TEST URL')
from pyrepo import correlations as corrs from scipy.stats import pearsonr import unittest import numpy as np # Test for Spearman rank correlation coefficient class Test_Spearman(unittest.TestCase): def test_spearman(self): """Test based on paper Sałabun, W., & Urbaniak, K. (2020, June). A new coefficient...
import numpy as np import pandas as pd """ Contains core classes and methods for initializing a Assembly System, the inputs are provided in assemblyconfig file in utilities""" class AssemblySystem: """Assembly System Class :param assembly_type: Type of assembly Single-Station/Multi-Station :type assembly_system:...
# automatically generated, do not modify # namespace: NamespaceA import flatbuffers class SecondTableInA(object): __slots__ = ['_tab'] # SecondTableInA def Init(self, buf, pos): self._tab = flatbuffers.table.Table(buf, pos) # SecondTableInA def ReferToC(self): o = flatbuffers.nu...
from setuptools import setup, find_packages setup( name='w3lib', version='1.12.0', license='BSD', description='Library of web-related functions', author='Scrapy project', author_email='info@scrapy.org', url='https://github.com/scrapy/w3lib', packages=find_packages(exclude=('tests', 'te...
import pandas as pd import matplotlib.pyplot as plt import matplotlib # Look pretty... # matplotlib.style.use('ggplot') plt.style.use('ggplot') # # TODO: Load up the Seeds Dataset into a Dataframe # It's located at 'Datasets/wheat.data' # wheat_df = pd.read_csv('/home/dipanjan/DAT210x/Module3/Datasets/wheat.data', ...
import numpy as np import os, sys sys.path.append(os.path.dirname(__file__)) from diis_solver import diis_solver, diis_solver_uhf sys.path.pop() import jk import xform def homo_lumo_mix(C, nocc, beta): """ Mix a portion of LUMO to HOMO. Used when generating spin-unrestricted guess. """ if beta < 0...
import pytest from .funcs import assert_query QUERY = ''' { __schema { types { kind name fields { name } } queryType { fields { name } } mutationType { fields { name } } subscriptionType { fields { name...
""" MIT License Copyright 2021 Hannes Holey Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, dist...
""" Copyright (c) 2018-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 Unless required by applicable law or agreed to in wri...
# Copyright 2017 Amazon.com, Inc. or its affiliates. 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. A copy of # the License is located at # # http://aws.amazon.com/apache2.0/ # # or in the "license" file acc...
#!/usr/bin/env python # -*- coding: utf-8 from __future__ import unicode_literals import platform as pf from . import core class PlatformCollector(object): """Collector for python platform information""" def __init__(self, registry=core.REGISTRY, platform=None): self._platform = pf if platform is N...
from client_database_connection import mycursor import os sql = "INSERT INTO free_node (node_id) VALUES (%s)" val = (node_id) mycursor.execute(sql, val) command = 'python get_code_when_free.py' os.system(command)
# Copyright 2017 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...
"""Django's command-line utility for administrative tasks.""" import os import sys def main(): """Run administrative tasks.""" os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'translate.settings') try: from django.core.management import execute_from_command_line except ImportError as exc: ...
#!/usr/bin/env python # -*- coding: utf-8 -*- # Author: Dusan Klinec, ph4r05, 2018 import binascii from binascii import unhexlify import unittest import aiounittest from monero_glue.xmr import common, crypto from monero_glue.xmr.core import ec_py class CryptoTest(aiounittest.AsyncTestCase): """Simple tests""" ...
# -*- coding: utf-8 -*- # PLEASE DO NOT EDIT THIS FILE, IT IS GENERATED AND WILL BE OVERWRITTEN: # https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code from ccxt.async_support.base.exchange import Exchange import hashlib from ccxt.base.errors import ExchangeError from ccxt.base.errors impor...
from prometheus_client import CollectorRegistry from asyncworker.conf import settings from asyncworker.metrics.collectors.gc import GCCollector from asyncworker.metrics.collectors.platform import PlatformCollector from asyncworker.metrics.collectors.process import ProcessCollector NAMESPACE = ( f"{settings.METRIC...
from typing import Dict, Optional, Union from ...error import GraphQLError from ...language import ( OperationTypeDefinitionNode, OperationType, SchemaDefinitionNode, SchemaExtensionNode, ) from ...type import GraphQLObjectType from . import SDLValidationContext, SDLValidationRule __all__ = ["UniqueOp...
# 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! *** from enum import Enum __all__ = [ 'CostAllocationPolicyType', 'CostAllocationResourceType', 'RuleStatus', ] class CostAllocationPolicyTy...
import os import numpy as np import torch import torch.nn.functional as F from lib.utils.bbox_transform import decode_bbox_target from tools.kitti_object_eval_python.evaluate import evaluate as kitti_evaluate from lib.config import cfg import lib.utils.kitti_utils as kitti_utils import lib.utils.iou3d.iou3d_utils as i...
from math import log10 from sklearn.gaussian_process import GaussianProcessRegressor from sklearn.gaussian_process.kernels import Matern import numpy as np from .utils import create_rng class BO: """ Bayesian Optimization framework """ def __init__(self, k, hidden_dim=(100, 10000), s...
# coding=utf-8 # Copyright 2022 The Deeplab2 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 ...
from rip_pages import rip_pages from read_pages import read_pages from format_csv import format_csv # STEP 1: CONFIG VARIABLES SOURCE_DOC = '114sdoc7' FILE_NAME = "GPO-CDOC-" + SOURCE_DOC + ".pdf" OUT_FILE = 'senate_data.csv' MISSING_FILE = 'missing_data.json' START_PAGE = 17 END_PAGE = 2259 # STEP 2: Rip text, read ...
my_list = [1, 2, 2, 4, 6] #print reverse print(my_list[::-1]) student = {'user': 'Lubo', 'pass': 'admin', 'course': ['C# Fundamentals', 'C# ASP', 'Algorithms']} for key in student: print(key) for kvp in student.items(): print(f'the key is: {kvp[0]}, and values are: {kvp[1]} ') print(s...
import datetime from dateutil.relativedelta import relativedelta print("Programa para calcular o prazo de exame de ultrassom...\nO mesmo deve ser feito entre 22 e 24 semanas de gestação") print("você deverá informar com quantas semanasa de gestação a paciente se encontra, no formato aaaa/mm/dd") semanas = int(input("C...
from __future__ import annotations from typing import Generator, NoReturn class StdReader: def __init__( self, ) -> NoReturn: import sys self.buf = sys.stdin.buffer self.lines = self.async_readlines() self.chunks: Generator def async_readlines( self, ...
# Licensed under a 3-clause BSD style license - see LICENSE.rst """Tests for the astropylibrarian.reducers.utils module. """ from __future__ import annotations from typing import TYPE_CHECKING from astropylibrarian.reducers.utils import iter_sphinx_sections if TYPE_CHECKING: from .conftest import HtmlTestData ...
#!/usr/bin/python import sys, string, os, popen2, shutil, platform, subprocess, pprint, time import util, commands, csv from math import sqrt #clean up the src do_clean = True #build the src do_build = True #clean, build, and run the benchmarks do_run = True #collect data to plot #do_collect_data = True if do_cl...
#!/bin/env python3 # -*- coding: utf-8 -* ''' 感谢Curtin提供的其他脚本供我参考 感谢aburd ch大佬的指导 项目名称:xF_jd_beauty_plant.py Author: 一风一扬 功能:健康社区-种植园自动任务 Date: 2022-1-4 cron: 10 9,11,15,21 * * * jd_beauty_plant.py new Env('化妆馆-种植园自动任务'); 活动入口:25:/¥2EaeU74Gz07gJ% 教程:该活动与京东的ck通用,所以只需要填写第几个号运行改脚本就行了。 青龙变量填写export plant_cookie="1",代表京...
# 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...
__all__ = ["ChangeScene", "Runner", "WindowRunner", "NonInteractiveRunner", "newRunner"] from .. import config, render, Logger from ..events import EventLoopManager, WaitForUpdate, WaitForFixedUpdate, WaitForRender from ..errors import PyUnityException import copy import os class ChangeScene(Exception): pass cla...
""" Sphinx plugins for RapidSMS documentation. """ try: import json except ImportError: try: import simplejson as json except ImportError: try: from django.utils import simplejson as json except ImportError: json = None from sphinx import addnodes, roles fro...
#!/usr/bin/env python3 # pylint: disable=unused-import import collections import functools import io import itertools import operator as op import re import timeit import numpy as np import aocd YEAR = 2021 DAY = 11 def step(grid): grid += 1 flash = np.zeros_like(grid, dtype=bool) while np.any(grid[~fl...
import unittest.mock as mock import pytest import requests_mock from openeo.rest.auth.auth import NullAuth, BearerAuth from openeo.rest.connection import Connection, RestApiConnection, connect, OpenEoApiError API_URL = "https://oeo.net/" @pytest.mark.parametrize( ["base", "paths", "expected_path"], [ ...
import asyncio import json import logging from datetime import datetime from typing import Any, Dict, Iterable, List, Optional, Set, Union import httpx import websockets from websockets import exceptions logger = logging.getLogger("yufuquantsdk") class WebsocketAPIClient: def __init__(self, uri: str, ws: websoc...
import discord from discord.ext import commands import os intents = discord.Intents.default() intents.members = True testing = False client = commands.Bot(command_prefix = "-", case_insensitive = True, intents=intents) client.remove_command('help') for filename in os.listdir('./cogs'): if filenam...
# -*- coding: utf-8 -*- import logging import math import os import random import shutil import tensorflow as tf from jack import readers from jack.core.tensorflow import TFReader from jack.eval import evaluate_reader, pretty_print_results from jack.util.hooks import LossHook, ExamplesPerSecHook, ETAHook logger = l...
#!/usr/bin/env python3 # Copyright 2019 Christian Henning # # 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 l...
# 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...
from typing import List, Dict, Any import torch import trtorch._C from trtorch import _types def _supported_input_size_type(input_size: Any) -> bool: if isinstance(input_size, torch.Size): return True elif isinstance(input_size, tuple): return True elif isinstance(input_size, list): ...
from django.conf.urls import patterns, url urlpatterns = patterns('appointments.views', url(r'^appointment/(?P<practice_id>\d+)/$', 'appointment_form', name='appointment_form'), url(r'^appointment/created/(?P<practice_id>\d+)/$', 'appointment_created', name='appointment_created'), )
from PIL import Image from PIL import ImageDraw from PIL import ImageFont from rotary_class import RotaryEncoder class Display(): def __init__(self, disp): self.disp = disp self.dimensions = (disp.width, disp.height) self.image = Image.new('1', self.dimensions) self.draw = ImageDraw...
from tests.analyzer.utils import UnusedTestCase from unimport.statement import Import, ImportFrom class AsImportTestCase(UnusedTestCase): def test_as_import_all_unused_all_cases(self): self.assertSourceAfterScanningEqualToExpected( """\ from x import y as z import x ...
import os from .takeout_sqlite3 import SQLite3 import multiprocessing CONTACTS = 'Contacts' + os.sep + 'All Contacts' + os.sep + 'All Contacts.vcf' DRIVE = 'Drive' MY_ACTIVITY_ASSISTANT_PATH = 'My Activity' + os.sep + 'Assistant' + os.sep + 'MyActivity.html' MY_ACTIVITY_GMAIL_PATH = 'My Activity' + os.sep + 'Gmail' +...
from __future__ import print_function import os import pickle import time from gym_puyopuyo import register import gym import numpy as np import neat import visualize piece_shape = (3, 2) DRAW_NETS = False NUM_COLORS = 3.0 # 3 colors in the small env mode # TODO: could probably read color number from observation da...
import uuid from app import db from app.dao.dao_utils import transactional from app.models import ( BroadcastMessage, BroadcastEvent, BroadcastProvider, BroadcastProviderMessage, BroadcastProviderMessageNumber, BroadcastProviderMessageStatus ) def dao_get_broadcast_message_by_id_and_service_i...
# ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- # The MIT License (MIT) # # Copyright (c) 2020 www.open3d.org # # Permission is her...
import os def to_bool(value): return ( value is True or (isinstance(value, str) and value.lower() in ['true', 'yes']) or (isinstance(value, (int, float)) and value > 0) ) bind = '0.0.0.0:{}'.format(os.getenv('GUNICORN_PORT', '8000')) max_requests = int(os.getenv('GUNICORN_MAX_REQUEST...
import pytest from skidl import * from .setup_teardown import * def test_pin_names_1(): codec = Part("xess.lib", "ak4520a") assert codec["ain"] == codec.n["ain"] assert codec[1:4] == codec.p[1:4] def test_pin_names_2(): codec = Part("xess.lib", "ak4520a") codec[4].name = "A1" codec[8].name...
from dataclasses import dataclass from dataclasses import field from typing import Any from typing import Callable from typing import Mapping from typing import Optional from typing import Sequence from typing import Type from svarog import forge from svarog import register_forge from svarog.types import Forge JSONMa...
import subprocess def process_image(filename, scale=1.0): output, _ = subprocess.Popen(['./Capture2Text_CLI', '-platform', 'offscreen', '-i', filename, '--blacklist', '~|\\V', '--scale-factor', str(scale)], stdout...
# -*- encoding: utf-8 -*- # Module iaframe from numpy import * def iaframe(f, WT=1, HT=1, DT=0, k1=None, k2=None): from ia870 import iaunion, iaintersec,ialimits if k1 is None: k1 = ialimits(f)[1] if k2 is None: k2 = ialimits(f)[0] assert len(f.shape)==2,'Supports 2D only' y = iaintersec(f,k2) ...
#contextos from flask import Flask import flask app = Flask(__name__) ## 1 Configuração ### Add configuração app.config["DEBUG"] = True app.config["SQLALCHEMY_DB_URI"] = "mysql://" ### Registrar Rotas @app.route("/path") def funcao(): pass # ou app.add_url_rule("/path", funcao) ### Inicializar extensões #fro...
import jwt from contextlib import contextmanager from datetime import datetime, timedelta from sqlalchemy import Column, Integer, String, DateTime, Boolean from sqlalchemy import ForeignKey, func from sqlalchemy.orm import relationship from saraki.auth import _request_ctx_stack, User, Org from saraki.model import Bas...
#!/usr/bin/python2.4 -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/ # Additional basic string exercises # D. verbing # Given a string, if its length is a...
from multiprocessing import Pool import argparse import glob import os import io import time import logging import gluonnlp as nlp import tokenizer as tokenization parser = argparse.ArgumentParser(description='BERT tokenizer') parser.add_argument('--input_files', type=str, default='wiki_*.doc', hel...
''' Main functionality of ``image_slicer``. ''' import os import time import optparse from math import sqrt, ceil, floor from PIL import Image from helpers import get_basename class Tile(object): """Represents a single tile.""" def __init__(self, image, number, position, coords, filename=None): sel...
import sys; from more_itertools import windowed, first_true orig_data = list(map(int, open('d9.txt'))) data = orig_data[:] target = 32321523 for i, e in enumerate(data): if i == 0: continue data[i] = data[i - 1] + data[i] for i in range(len(data)): for j in range(i): if data[i] - data[j] == target:...
"""Xiaomi aqara single key switch device.""" import logging from zigpy.profiles import zha from zigpy.zcl.clusters.general import ( AnalogInput, Basic, Groups, Identify, MultistateInput, OnOff, Ota, Scenes, ) from .. import ( LUMI, XIAOMI_NODE_DESC, BasicCluster, Xiaomi...
# Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See LICENSE in the project root # for license information. from __future__ import absolute_import, division, print_function, unicode_literals import atexit import os import sys import debugpy from debugpy import ...
""" Problem: The function 'doubler' takes a word as input. It should create and print a string, where each character in the string is doubled, for example: "test" -> "tteesstt" Tests: >>> doubler("test") tteesstt >>> doubler("original") oorriiggiinnaall >>> doubler("hihihi") hhiihhi...
import binascii import sys import Adafruit_PN532 as PN532 # Setup how the PN532 is connected to the Raspbery Pi/BeagleBone Black. # It is recommended to use a software SPI connection with 4 digital GPIO pins. # Configuration for a Raspberry Pi: CS = 8 #pn532_nss----->rpi_ce0:8 MOSI = 9 #pn532_mosi---->rpi__m...
from macaque import cli def test_cli_template(): assert cli.cli() is None
# Antes de mais nada install o flask = pip install flask from flask import Flask app = Flask(__name__) @app.route('/') def homepage(): return 'Essa é minha HomePage' @app.route('/contatos') def contatos(): return 'Essa são os meus contatos' app.run()
from itertools import zip_longest DAY = 'day' HOUR = 'hour' NAME = 'name' class Formatter: def __init__(self, indent=5 * ' '): self.indent = indent def append(self, text, tag=None): raise NotImplementedError('Must override append() in derived class') def println(self, *args): se...
__all__ = [ "prototype", ] import sys from inspect import ( signature, ) from typing import ( TypeVar, Callable, ) from .exceptions import ( PrototypeError, ) if sys.version_info >= (3, 10): from typing import ParamSpec else: from typing_extensions import ParamSpec # pragma: no cover ...
import PIL.Image from io import BytesIO from IPython.display import clear_output, Image, display import numpy as np def showarray(a, fmt='jpeg'): a = np.uint8(np.clip(a, 0, 255)) f = BytesIO() PIL.Image.fromarray(a).save(f, fmt) display(Image(data=f.getvalue())) def showtensor(a): mean = np.arra...
import mimetypes from pathlib import Path from appdirs import user_config_dir from tqdm import tqdm NAME = "novelsave" AUTHOR = "Mensch272" # base project directory BASE_DIR = Path(__file__).resolve().parent.parent STATIC_DIR = BASE_DIR / "novelsave/resources" # operating system specific configuration file # confi...
#!/usr/bin/env python # -*- coding: utf-8 -*- import logging import os import sys import click from newschimp import renderer, sender from newschimp.social import fb, gg, lanyrd from newschimp.cli import cli_group from newschimp.utils import ComplexCLI, load_settings LOGGER = logging.getLogger(__name__) def create...
try: from setuptools import setup except ImportError: from distutils.core import setup PACKAGE = "flightaware" NAME = "flightaware" DESCRIPTION = "A python REST interface for flightaware data" AUTHOR = "Fred Palmer" AUTHOR_EMAIL = "fred.palmer@gmail.com" URL = "https://github.com/fredpalmer/flightaware" confi...
import pyaf.Bench.TS_datasets as tsds import tests.artificial.process_artificial_dataset as art art.process_dataset(N = 32 , FREQ = 'D', seed = 0, trendtype = "Lag1Trend", cycle_length = 30, transform = "Quantization", sigma = 0.0, exog_count = 20, ar_order = 12);
# # (C) Copyright IBM Corp. 2020 # # 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 writi...
""" RenderPipeline Copyright (c) 2014-2016 tobspr <tobias.springer1@gmail.com> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use...
"""Base class for inventory interactive/stdout tests. """ import difflib import json import os import pytest from ....defaults import FIXTURES_DIR from ..._common import fixture_path_from_request from ..._common import update_fixtures from ..._interactions import SearchFor from ..._interactions import Step from ..._t...
# -*- coding: utf-8 -*- ''' Apache Libcloud Load Balancer State =================================== Manage load balancers using libcloud :codeauthor: ``Anthony Shaw <anthonyshaw@apache.org>`` Apache Libcloud load balancer management for a full list of supported clouds, see http://libcloud.readthedocs.io/en/lates...
import pathlib from silex_client.utils.log import logger class AnyParameter(object): def __new__(cls, value): return value class CommandParameterMeta(type): def __new__(cls, name: str, bases: tuple, dct: dict): def serialize(): return { "name": "parameter", ...
N = input() L = len(N) K = int(input()) dp = [[[0] * 2 for _ in range(K + 1)] for _ in range(L + 1)] dp[0][0][1] = 1 for i, x in zip(range(L), map(int, N)): for k in range(K): dp[i+1][k][0] += dp[i][k][0] # d == 0 if x == 0: dp[i+1][k][1] += dp[i][k][1] elif x > 0: d...
config = { "username": 'slask', "icon": ":poop:", }
"""Patching utilities for working with fake objects. See :ref:`using-fudge` for common scenarios. """ __all__ = ['patch_object', 'with_patched_object', 'PatchHandler', 'patched_context', 'patch'] import sys import fudge from fudge.util import wraps class patch(object): """A test decorator that patc...
# Copyright (c) Aishwarya Kamath & Nicolas Carion. Licensed under the Apache License 2.0. All Rights Reserved """ COCO dataset which returns image_id for evaluation. Mostly copy-paste from https://github.com/ashkamath/mdetr/blob/main/datasets/gqa.py """ import json from pathlib import Path import torch import torchvi...
from assertpy import assert_that from httmock import HTTMock from sahyun_bot.commands.admin import Index, Rank from sahyun_bot.users_settings import UserRank from tests.mock_customsforge import customsforge def test_require_admin(commander, hook): for command in ['!lock', '!index', '!rank']: with command...
import os import base64 from simpleutil.utils import digestutils from goperation.filemanager import LocalFile from goperation.manager.rpc.agent.application.taskflow.middleware import EntityMiddleware from goperation.manager.rpc.agent.application.taskflow.database import Database from goperation.manager.rpc.agent.appl...
#!/usr/bin/env python3 # XML API, for dealing with XML strings # -*- coding: utf-8 -*- __all__ = ['parseargs', 'collect'] '<users>\n\t<user>\n\t\t<id>1</id>\n\t\t<name>Fred</name>\n\t\t<salary>500000</salary>\n\t</user>\n\t<user>\n\t\t<id>1</id>\n\t\t<name>ScienceCat</name>\n\t\t<salary>500000</salary>\n\t</user>\n\t...
import json import logging from sqlalchemy import Column, Integer, String, Float, DateTime, Boolean, func from iotfunctions import bif from ai.functions import SimpleAnomaly from iotfunctions.metadata import EntityType from iotfunctions.db import Database from iotfunctions.enginelog import EngineLogging from custom imp...
# -*- coding: utf-8 -*- """Amavis factories.""" from __future__ import unicode_literals import datetime import time import factory from . import models from .utils import smart_bytes SPAM_BODY = """X-Envelope-To: <{rcpt}> X-Envelope-To-Blocked: <{rcpt}> X-Quarantine-ID: <nq6ekd4wtXZg> X-Spam-Flag: YES X-Spam-Scor...
#!/usr/bin/env python from __future__ import print_function, division import os, sys import matplotlib.pyplot as plt import numpy as np import argparse from astropy import log from os import path from glob import glob from subprocess import check_call import shutil from astropy.table import Table from astropy.io import...
import os from datetime import datetime from flask import Flask, render_template, flash, safe_join, send_file from flask_user import login_required, current_user from werkzeug.utils import secure_filename from pygate_grpc.client import PowerGateClient from deplatformr.models.filecoin_models import Ffs, Files, Logs from...
from setuptools import find_packages, setup with open("README.md", "r") as fh: long_description = fh.read() setup( name='msnexport', version='0.1', license="MIT", classifiers=["Programming Language :: Python :: 3.7"], author='Charles Marceau', author_email='charlesmarceau3@gmail.com', ...
from mythic_payloadtype_container.MythicCommandBase import * import json from mythic_payloadtype_container.MythicRPC import * import base64 class InjectArguments(TaskArguments): def __init__(self, command_line): super().__init__(command_line) self.args = { "template": CommandParameter(...
import numpy as np from .base import Price class GBM(Price): """Brownian motion.""" def __init__(self, T=1., sigma1=0.02, sigma2=0.01, s1=1., s2=1., drift1=0., drift2=0., n=100): self.sigma1 = sigma1 self.sigma2 = sigma2 self.drift1 = drift1 self.drift2 = drift...
# Copyright (c) 2016 by Matt Sewall. # All rights reserved. import math import csv import json import os import shutil from sys import argv from datetime import datetime from django.utils.encoding import smart_str, smart_unicode from operator import itemgetter from elo_classes import * from elo import * # Elos dicti...