text
stringlengths
2
999k
from eth2spec.test.context import ( PHASE0, LIGHTCLIENT_PATCH, with_all_phases_except, spec_state_test, ) from eth2spec.test.helpers.state import next_epoch @with_all_phases_except([PHASE0, LIGHTCLIENT_PATCH]) @spec_state_test def test_get_committee_count_delta(spec, state): assert spec.get_commit...
import atexit import os import shutil current_uuid = None def setup_proj_dir(uuid): global current_uuid current_uuid = uuid directory = './{}/'.format(current_uuid) if not os.path.exists(directory): os.makedirs(directory) @atexit.register def remove_proj_dir(): global current_uuid dir...
import configparser import os import sys import time import glob import numpy as np import pandas as pd import matplotlib.pyplot as plt from astropy.io import fits import marg_mcmc as wl import batman # Set path to read in get_limb.py from bin_analysis sys.path.insert(0, '../bin_analysis') import get_limb as gl def ...
""" This module holds several utilities regarding RSA and server fingerprints. """ import os import struct from hashlib import sha1 try: import rsa import rsa.core except ImportError: rsa = None raise ImportError('Missing module "rsa", please install via pip.') from ..tl import TLObject # {fingerprin...
import sys from cms.sitemaps import CMSSitemap from django.conf import settings from django.conf.urls import include from django.conf.urls.i18n import i18n_patterns from django.contrib import admin from django.contrib.sitemaps.views import sitemap from django.contrib.staticfiles.urls import staticfiles_urlpatterns fro...
import alpenglow as prs import alpenglow.experiments import alpenglow.evaluation import pandas as pd import math import unittest from alpenglow.utils import ParameterSearch, ThreadedParameterSearch class TestThreadedParameterSearch(unittest.TestCase): def test_runMultiple(self): data = pd.read_csv( ...
""" Django settings for app project. Generated by 'django-admin startproject' using Django 3.1.1. For more information on this file, see https://docs.djangoproject.com/en/3.1/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/3.1/ref/settings/ """ from pathlib imp...
# -*- coding: utf-8 -*- import sys from os.path import join, dirname from setuptools import setup, find_packages VERSION = (0, 0, 11) __version__ = VERSION __versionstr__ = '.'.join(map(str, VERSION)) f = open(join(dirname(__file__), 'README')) long_description = f.read().strip() f.close() install_requires = [ '...
__all__ = [] from . import ( stack, binomial_trees, queue, disjoint_set ) from .binomial_trees import ( BinomialTree ) from pydatastructs.miscellaneous_data_structures.disjoint_set import DisjointSetForest from pydatastructs.miscellaneous_data_structures.stack import Stack from pydatastructs.mi...
import torch import torch.nn as nn import torch.optim as optim import torch.utils.data as data import torch.nn.functional as F import torchvision.datasets as datasets import torchvision import torchvision.transforms as transforms from torch.autograd import Variable import math import os import time import numpy as n...
#!/usr/bin/python import sys import re import fileinput data0="" for line in fileinput.input(): data0+=line data1 = data0.split("\n") if data1[-1]=="": data1 = data1[:-1] def capitalizeFirst(name): return name[0].upper()+name[1:] indent=" " attribPostfix="" attribNamespace="at::" useAttribs=False gen...
#!/usr/bin/env python """Provide streamlined plotting functions.""" # Imports import pandas as pd import numpy as np import matplotlib.pyplot as plt import seaborn as sns from munch import Munch, munchify # Metadata __author__ = "Gus Dunn" __email__ = "w.gus.dunn@gmail.com" # Functions def plot_scatter_pairs(dat...
# -*- coding: utf-8 -*- # Generated by Django 1.11.7 on 2018-07-27 11:48 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('facilities', '0001_initial'), ] operations = [ migrations.AlterField( ...
"""A set of functions which are useful for working with sound""" import numpy as np import soundfile as sf import pickle import matplotlib.pyplot as plt import sounddevice as sd def tone_generater(duration, sample_rate, freq): """ generate a single clear tone Parameters ---------- duration: int ...
# (c) Copyright [2015] Hewlett Packard Enterprise Development LP # # 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 r...
from utility import util CONN = util.connectAlpaca() class algo: pass
'''mim.py - Mongo In Memory - stripped-down version of mongo that is non-persistent and hopefully much, much faster ''' import re import sys import time import itertools import collections import logging import warnings from datetime import datetime from hashlib import md5 import pickle try: import spidermonkey ...
import logging import time import typing as tp import weakref from abc import ABCMeta, abstractmethod from datetime import datetime from satella.coding.structures import OmniHashableMixin from smok.predicate.event import Color, Event logger = logging.getLogger(__name__) class Time(OmniHashableMixin): """ A ...
import time import json import re from slackclient import SlackClient from tabulate import tabulate from peewee import * from datetime import datetime from dateutil import tz from models import db, Player, Match SIGNUP_REGEX = re.compile('signup', re.IGNORECASE) WINNER_REGEX = re.compile('^I\s+(beat)\s+<@([A-z0-9]*)>...
from src.Dominion.Cardtypes.Victorycard import Victorycard class Province(Victorycard): EXPENCES = 8 VICTORYPOINTS = 6
import argparse import numpy as np import os from torch_geometric.nn import global_add_pool, global_mean_pool, global_max_pool from Bio.PDB import PDBParser, Selection parser = PDBParser() # RADII for atoms in explicit case. RADII = {} RADII["N"] = "1.540000" RADII["N"] = "1.540000" RADII["O"] = "1.400000" RADII["C"]...
# coding: utf-8 """ Control-M Services Provides access to BMC Control-M Services # noqa: E501 OpenAPI spec version: 9.20.30 Contact: customer_support@bmc.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ import pprint import re # noqa: F401 import six from ctm_saas_cl...
# -*- coding: utf-8 -*- from collections import Counter, deque import cv2 as cv from sklearn.utils._joblib import load RECTANGLE_COLOR = (69, 53, 220) TEXT_COLOR = (41, 37, 33) NUMBER_OF_ROIS = 29 Q_KEY = ord('q') W_KEY = ord('w') E_KEY = ord('e') ESC_KEY = 27 def putText(frame, text): cv.putText(frame, text...
import datetime import calendar from sqlalchemy import func, case, Integer from sqlalchemy.orm import aliased from sqlalchemy.sql.expression import label, between, and_, or_ from wtforms.validators import Required from wtforms import BooleanField, IntegerField from wikimetrics.models import Page, Revision, MediawikiUs...
"""Work-in-progress Java code generator for a given schema salad definition.""" import os import shutil import string from io import StringIO from io import open as io_open from typing import Any, Dict, List, MutableMapping, MutableSequence, Optional, Union from urllib.parse import urlsplit import pkg_resources from ...
from src.Heuristic.IHeuristics import IHeuristics from src.moves import * class MisplaceHeuristic(IHeuristics): """ This simple heuristic just adds one point to the score for each misplaced tile. """ def __init__(self): pass def compute(self, board) -> int: total_node_score = 0 ...
# -*- coding:utf-8 -*- import paddle.fluid as fluid def cnn_net(data, dict_dim, emb_dim=128, hid_dim=128, hid_dim2=96, class_dim=2, win_size=3): """ Conv net """ # embedding layer emb = fluid.layers.embedding(input=data, size=...
bl_info = { "name": "set activeStripTime to preview", "description": "アクティブなストリップの範囲をプレビュー範囲に設定", "author": "Yukimi", "version": (0,2), "blender": (2, 6, 0), "location": "NLA", "warning": "", "wiki_url": "", "tracker_url": "", "category": "Animetion"} import bpy def Striptime_t...
#!/usr/bin/python # -*- coding: utf-8 -*- # Author: violinsolo # Created on 2019/4/11
import subprocess from modules import checks def getOutputFromCommand(command): checks.checkIfString(command, 1, 800) result = subprocess.run(command, stdout=subprocess.PIPE, shell=True).stdout.decode('utf-8') return result
# MIT License # # Copyright (c) 2019 Lucas Willems # # 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...
"""Read and write swan spectra files""" import os import re import gzip import datetime import pandas as pd import numpy as np from wavespectra.core.attributes import attrs from wavespectra.core.utils import to_nautical E2V = 1025 * 9.81 class SwanSpecFile(object): """Read spectra in SWAN ASCII format.""" ...
import os from os import walk def bundle(root, outfile): contents = walk(root) open(outfile, 'w+').close() add_files_in_directory(root, outfile) for root, dirs, files in contents: for dir in dirs: print("\n" + dir) path = os.path.join(root, dir) add_files_in_...
class Student0: def __init__(self, name, marks): self.name = name self.marks = marks self.gotmarks = self.name + ' obtained ' + self.marks + ' marks.' class Student1: def __init__(self, name, marks): self.name = name self.marks = marks def gotmarks(self): ...
# Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved. # Copyright 2018 The Google AI Language Team Authors and The HuggingFace Inc. team. # # 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 Licens...
# -*- coding: utf-8 -*- # 用 PageRank 挖掘希拉里邮件中的重要任务关系 import matplotlib matplotlib.use('Qt4Agg') import pandas as pd import networkx as nx import numpy as np from collections import defaultdict import matplotlib.pyplot as plt # 数据加载 emails = pd.read_csv("./input/Emails.csv") # 读取别名文件 file = pd.read_csv("./input/Aliase...
import pandas as pd import plotly.express as px import plotly.graph_objects as go from datetime import datetime, timedelta from database import fetch_all_wea_as_df, fetch_all_dis_as_df from plotly.subplots import make_subplots from sklearn.ensemble import RandomForestRegressor from prediction import kde as kde_func im...
from eletronico import Eletronico from log import LogMixin class Smartphone(Eletronico, LogMixin): def __init__(self, nome): super().__init__(nome) self._conectado = False def conectar(self): if not self._ligado: info = f'{self._nome} não esta ligado.' print(in...
#Week 6 - Functions and Building Functions: #a function is like store and reuse, write a pattern once # and reuse it, DRY - Don't Repeat Yourself #def: start the definition of a function #a function takes some input and produces an output #invoking a function: e.g. number=int("42") #def testfun(var) - var is called ...
from unittest import TestCase import trw import numpy as np import torch import collections import trw.train.collate import trw.utils class TestCollate(TestCase): def test_collate_dicts(self): batch = { 'list': [1, 2, 3], 'value': 42.0, 'np': np.ones(shape=[3, 2]), ...
#!/usr/bin/env python3 # Copyright (c) 2017-2018 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test breekcoin-cli""" from test_framework.test_framework import BitcoinTestFramework from test_framewor...
#!/usr/bin/env python ''' This script starts an object detection service which uses the filtered pcl data to detect and recognize the object ''' from pcl_helper import * from transform_helper import Transformer from image_helper import ImagePub import pcl import rospy from sensor_msgs.msg import PointCloud2 from ...
# coding: utf-8 from django.conf import settings from django.core.cache import caches from django_th.tests.test_main import MainTest from django_th.models import ServicesActivated from mastodon import Mastodon as MastodonAPI from th_mastodon.forms import MastodonProviderForm, MastodonConsumerForm from th_mastodon.mo...
""" jupyterlab_examples_datagrid setup """ import json from pathlib import Path import setuptools HERE = Path(__file__).parent.resolve() # The name of the project name = "jupyterlab_examples_datagrid" lab_path = (HERE / name.replace("-", "_") / "labextension") # Representative files that should exist after a succe...
from keras import applications import keras import numpy as np from keras.preprocessing.image import load_img from keras.preprocessing.image import img_to_array import matplotlib.pyplot as plt from keras.applications.imagenet_utils import decode_predictions import os from keras.models import model_from_json from keras....
# coding: utf8 """MMM-Facial-Recognition - MagicMirror Module Face Recognition Testing Script The MIT License (MIT) Copyright (c) 2016 Paul-Vincent Roll (MIT License) Based on work by Tony DiCola (Copyright 2013) (MIT License) Run this script to test your training data. Permission is hereby granted, free of charge, ...
from __future__ import annotations import numbers import decimal import fractions import math import re as regex import sys from functools import lru_cache from .containers import Tuple from .sympify import (SympifyError, _sympy_converter, sympify, _convert_numpy_types, _sympify, _is_numpy_instance) fro...
# coding: utf-8 """ Memsource REST API Welcome to Memsource's API documentation. To view our legacy APIs please [visit our documentation](https://wiki.memsource.com/wiki/Memsource_API) and for more information about our new APIs, [visit our blog](https://www.memsource.com/blog/2017/10/24/introducing-rest-apis...
from klein import route, run @route("/") def home(request): return "Hello, world!" run("localhost", 8080)
# Copyright (C) 2012 Andy Balaam and The Pepper Developers # Released under the MIT License. See the file COPYING.txt for details. from nose.tools import * from assert_parser_result import assert_parser_result from assert_parser_result import assert_parser_result_from_code from assert_parser_result import parse_stri...
# Generated by Django 3.1.2 on 2020-10-20 08:16 from django.conf import settings from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ('instagram', '0001_initia...
import random from lib.types import IStdin, IStdout def hamming_distance(a, b): counter = 0 for i in str(bin(a ^ b)): if i == '1': counter += 1 return counter def main(stdin: IStdin, stdout: IStdout): stdout.write("To get the flag you will need to calculate the Hamming distance of two numbe...
import datetime from googlesearch import search from urllib.error import HTTPError import pickle import codecs from google_auth_oauthlib.flow import InstalledAppFlow from google.auth.transport.requests import Request from googleapiclient.discovery import build import dateutil.parser from google.cloud import texttosp...
import pybamm import numpy as np import pandas as pd import os import unittest class TestSimulation(unittest.TestCase): def test_basic_ops(self): model = pybamm.lithium_ion.SPM() sim = pybamm.Simulation(model) self.assertEqual(model.__class__, sim._model_class) # check that the ...
# Copyright The PyTorch Lightning team. # # 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...
import unittest import pandas from assignment_1_1.function_1_1 import convert_names class Test(unittest.TestCase): def test_function(self): test_df = pandas.DataFrame({"abbrev": ["CT", "CO", "CA", "TX"]}) self.assertEqual(test_df.columns.tolist(), ["abbrev"]) if __name__ == "__main__": unittes...
# # Tencent is pleased to support the open source community by making Angel available. # # Copyright (C) 2017 THL A29 Limited] = a Tencent company. All rights reserved. # # Licensed under the BSD 3-Clause License (the "License") you may not use this file except in # compliance with the License. You may obtain a copy of...
"""SCons.Tool.bcc32 XXX """ # # Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007 The SCons Foundation # # 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...
""" This module is a part of HoneySpot project. The module can be used to uncover Kippo and possibly Cowrie. This is a work in progress and might give false results. https://github.com/micheloosterhof/cowrie/blob/master/cowrie/commands/fs.py#L309 - Lack on -p switch """ # Cowrie has problem playing nice with Python SS...
from django import forms from django.views.generic import FormView from django.views.generic import RedirectView class HelloForm(forms.Form): name = forms.CharField(required=False) address = forms.CharField(required=False) class HelloView(FormView): template_name = "hello/index.html" form_class = He...
# -*- coding: utf-8 -*- """ bromelia.etsi_3gpp_swm.definitions ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Defines handy structures that are used within the library for the 3GPP SWm Application Id. :copyright: (c) 2020-present Henrique Marques Ribeiro. :license: MIT, see LICENSE for more details. """ ...
# model settings model = dict( type='FCOSTD', pretrained='open-mmlab://resnet50_caffe', backbone=dict( type='ResNet', depth=50, num_stages=4, out_indices=(0, 1, 2, 3), frozen_stages=-1, norm_cfg=dict(type='BN', requires_grad=False), style='caffe'), ...
# Definition for a binary tree node. class TreeNode: def __init__(self, x): self.val = x self.left = None self.right = None def __repr__(self): return f"TreeNode(val={self.val})" # also LeetCode 104 class Solution: def maxDepth(self, root: TreeNode) -> TreeNode: def _recursiveDepth(root: TreeNode, depth:...
# Generated by the protocol buffer compiler. DO NOT EDIT! # source: google/protobuf/internal/more_extensions.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.pro...
from twisted.application.service import IServiceMaker from twisted.plugin import IPlugin from zope.interface import implementer from anchore_engine.services.catalog import CatalogService from anchore_engine.twisted import WsgiApiServiceMaker, CommonOptions @implementer(IServiceMaker, IPlugin) class CatalogServiceMak...
""" A collection of functions to find the weights and abscissas for Gaussian Quadrature. These calculations are done by finding the eigenvalues of a tridiagonal matrix whose entries are dependent on the coefficients in the recursion formula for the orthogonal polynomials with the corresponding weighting function over ...
# -------------------------------------------------------- # Fast R-CNN # Copyright (c) 2015 Microsoft # Licensed under The MIT License [see LICENSE for details] # Written by Ross Girshick # -------------------------------------------------------- import numpy as np def bbox_transform(ex_rois, gt_rois): ...
import logging import os import sys from collections import deque from pickle import Pickler, Unpickler from random import shuffle import numpy as np from tqdm import tqdm from Arena import Arena from MCTS import MCTS log = logging.getLogger(__name__) class Coach(): """ This class executes the self-play + ...
# USAGE # python detect_mask_video.py # import the necessary packages from tensorflow.keras.applications.mobilenet_v2 import preprocess_input from tensorflow.keras.preprocessing.image import img_to_array from tensorflow.keras.models import load_model from imutils.video import VideoStream import numpy as np im...
# -*- coding: utf-8 -*- from __future__ import print_function import contextlib import glob import os import sys from shutil import rmtree from invoke import Exit from invoke import task try: input = raw_input except NameError: pass BASE_FOLDER = os.path.dirname(__file__) class Log(object): def __ini...
import argparse import baselineUtils import torch import torch.utils.data import torch.nn as nn import torch.nn.functional as F import os import time from transformer.batch import subsequent_mask from torch.optim import Adam,SGD,RMSprop,Adagrad from transformer.noam_opt import NoamOpt import numpy as np import scipy.io...
from . import ConvertToSLA from UM.i18n import i18nCatalog catalog = i18nCatalog('cura') def getMetaData(): return { 'plugin': { 'name': catalog.i18nc('@label', 'Convert To SLA'), 'author': 'pHeX Labs', 'version': '1.0', 'description': catalog.i18nc('@info...
from enum import IntEnum from collections import defaultdict # mapper for gesture swipe update event data class GestureSwipeUpdate(IntEnum): DEVICE_NUM = 0 TYPE = 1 # cleaup needed for entry below TIME = 2 NUM_FINGERS = 3 # cleanup needed for all entries below DX = 4 DY = 5 DX_UNAC...
# This file is part of the CERN Indico plugins. # Copyright (C) 2014 - 2022 CERN # # The CERN Indico plugins are free software; you can redistribute # them and/or modify them under the terms of the MIT License; see # the LICENSE file for more details. from flask import g, request, session from flask_pluginengine impor...
# 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/env python import os import sys if __name__ == "__main__": os.environ.setdefault("DJANGO_SETTINGS_MODULE", "shop.settings.development") from django.core.management import execute_from_command_line execute_from_command_line(sys.argv)
import sys from flask import Flask # socketio = SocketIO() def create_app(config_filename): """Create an application.""" dir = sys.path[0] app = Flask(__name__, template_folder=dir+'/templates', static_folder=dir+'/static') app.config.from_object(config_filename) # #setup user management # ...
import asyncio from django.conf import settings from django.shortcuts import get_object_or_404 from loguru import logger from rest_framework.decorators import api_view, permission_classes from rest_framework.permissions import IsAuthenticated from rest_framework.response import Response from agents.models import Agen...
# -*- coding: utf-8 -*- ''' SoftLayer HW Cloud Module ========================= The SoftLayer HW cloud module is used to control access to the SoftLayer hardware cloud system Use of this module only requires the ``apikey`` parameter. Set up the cloud configuration at: ``/etc/salt/cloud.providers`` or ``/etc/salt/clo...
#!/usr/bin/env python3 import pyglet import glooey import run_demos class TestLabel(glooey.Label): # custom_text = 'Custom attribute text' custom_color = '#deeed6' custom_font_size = 14 custom_bold = True custom_padding = 20 class TestButton(glooey.Button): # Foreground = TestLabel clas...
from __future__ import absolute_import from __future__ import print_function import os import sys # the next line can be removed after installation sys.path.insert(0, os.path.dirname(os.path.dirname( os.path.dirname(os.path.abspath(__file__))))) import nngen as ng import veriloggen import matrix_abs a_shape =...
import os from apscheduler.jobstores.sqlalchemy import SQLAlchemyJobStore from notedata.work import WorkApp app = WorkApp('notecron') app.create() basedir = app.dir_common # os.path.abspath(os.path.dirname(__file__)) #redis_host = '192.168.3.122' login_password = '123456' logs_path = app.dir_log cron_db_url = 'sql...
#!/usr/bin/python3 # Copyright 2019 Canonical 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 agre...
import hashlib from django.db import models class Home(models.Model): img = models.CharField(max_length=200) name = models.CharField(max_length=32) trackid = models.IntegerField(default=1) class Meta: abstract = True class HomeWheel(Home): class Meta: db_table = 'axf_wheel' c...
# -*- coding: utf-8 -*- from __future__ import print_function, absolute_import import logging import numpy as np import matplotlib.pyplot as pl from matplotlib.ticker import MaxNLocator, NullLocator from matplotlib.colors import LinearSegmentedColormap, colorConverter from matplotlib.ticker import ScalarFormatter tr...
# -*- coding: utf-8 -*- """ Copyright (C) 2017 Sebastian Golasch (plugin.video.netflix) Copyright (C) 2019 Stefano Gottardo (original implementation module) Checks when settings are changed SPDX-License-Identifier: MIT See LICENSES/MIT.md for more information. """ from contextlib import contextmana...
import pytest from py42.clients.alerts import AlertsClient from py42.sdk.queries.alerts.alert_query import AlertQuery from py42.services.alertrules import AlertRulesService from py42.services.alerts import AlertService @pytest.fixture def mock_alerts_service(mocker): return mocker.MagicMock(spec=AlertService) ...
# -*- coding: utf-8 -*- """ GraphicsView.py - Extension of QGraphicsView Copyright 2010 Luke Campagnola Distributed under MIT/X11 license. See license.txt for more infomation. """ from ..Qt import QtCore, QtGui, QT_LIB try: from ..Qt import QtOpenGL HAVE_OPENGL = True except ImportError: HAVE_OPENGL = ...
#! /usr/bin/env python # -*- coding: utf-8 -*- import os from sqlalchemy import Column, ForeignKey, Integer, String, create_engine from sqlalchemy.ext.declarative import declarative_base from sqlalchemy.orm import relationship, sessionmaker if os.path.exists('test.db'): os.remove('test.db') # tworzymy instancję k...
#!/usr/bin/python3 from argparse import ArgumentParser from pathlib import Path import numpy as np def convert_pace_to_input_format(input_path: Path) -> str: with input_path.open() as input_file: lines = input_file.readlines() p_str, problem, n, m = lines[0].split() assert p_str == "p" asser...
from api import api from util.json_util import jsonify from marshmallow import missing class Location: """ Namespace with Webargs input value locations as constants. """ json = ('json',) # in the request body query = ('query',) # == 'querystring' headers = ('headers',) @api.errorhandler(40...
"""Tests related to `primitives.Awaitable` object.""" import pytest from primitives import Awaitable @pytest.mark.asyncio() async def test_awaitable_object_return_null(): """Empty `Awaitable` object should return null. An awaitable object is empty when return value was not specified. """ awaitable ...
from .nn import NN from .. import activations from .. import initializers from .. import regularizers from ... import config from ...backend import tf from ...utils import timing class ResNet(NN): """Residual neural network.""" def __init__( self, input_size, output_size, num_...
# -*- coding: utf-8 -*- from __future__ import division from __future__ import print_function import os import sys import unittest # noinspection PyProtectedMember from numpy.testing import assert_allclose from numpy.testing import assert_array_less from numpy.testing import assert_equal from numpy.testing import ass...
import json import logging import os import re from concurrent.futures import as_completed, ThreadPoolExecutor from datetime import datetime from multiprocessing import Lock from typing import Union from urllib.parse import quote from urllib.request import ( urlopen, ) from sqlite_functions import ( create_tab...
from __future__ import (absolute_import, division, print_function, unicode_literals) import os.path import pkg_resources import yaml from panphon import _panphon from panphon import permissive class Collapser(object): def __init__(self, tablename='dogolpolsky_prime.yml', feature_set='sp...
from django.conf import settings from django.middleware.locale import LocaleMiddleware from django.urls import reverse from django.utils import translation class CustomLocaleMiddleware(LocaleMiddleware): """Enable locale only on student-site""" def process_request(self, request): # /2022 stud...
from typing import Any, Optional, List, Tuple from prompt_toolkit.document import Document from prompt_toolkit.shortcuts.prompt import PromptSession from prompt_toolkit.styles import Style, merge_styles from prompt_toolkit.lexers import Lexer, SimpleLexer from questionary.constants import ( DEFAULT_QUESTION_PREFI...
# AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT from ..preprocess import Retroicor def test_Retroicor_inputs(): input_map = dict( args=dict( argstr="%s", ), card=dict( argstr="-card %s", extensions=None, position=-2, ), ...
# coding=utf-8 # ------------------------------------------------------------------------- # # Part of the CodeChecker project, under the Apache License v2.0 with # LLVM Exceptions. See LICENSE for license information. # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception # # ------------------------------------...