content
stringlengths
5
1.05M
import glob import os import re class JasmineTest: def __init__(self, test_name, test_class_name, test_path, included_tags: list, excluded_tags: list): self.test_name = test_name self.test_class_name = test_class_name self.test_path = test_path self.included_tags = included_tags ...
STATS = [] num_timeouts = 15 num_timeouts = 40 num_problems = 55
#!/usr/bin/env python # -*- coding: UTF-8 -*- # Configuracion Pyro4 DATABASE = 'ws.db' OBJETO_PYRO = 'servidor1.configura' DIRECCION_PYRO = '192.168.1.115' # en nuestro caso la direccion del objeto y del servidor de nombrado será el mismo ya que estan en la misma maquina DIRECCION_PYRO_LOCAL = '192.168.1.115' KEY = ...
from django.contrib import admin from django.contrib.admin.utils import reverse_field_path from django.db.models import Max, Min from django.db.models.fields import DecimalField, FloatField, IntegerField from .forms import RangeNumericForm, SingleNumericForm, SliderNumericForm class NumericFilterModelAdmin(admin.Mod...
# -*- coding: utf-8 -*- # @Author: Liu Shaoweihua # @Date: 2019-11-18 # Copyright 2018 The Google AI Language Team 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://w...
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (c) 2022 Busana Apparel Group. All rights reserved. # # This product and it's source code is protected by patents, copyright laws and # international copyright treaties, as well as other intellectual property # laws and treaties. The product is licensed, not s...
import cv2 import os import glob from matplotlib import pyplot as plt import numpy as np def readImages(path): img_array = [] imgc = [] names = [] for filename in glob.glob(path): names.append(filename) names.sort() for filename in names: img = cv2.imread(filen...
#!/usr/bin/env python from __future__ import absolute_import import sys import argparse import symstore class CompressionNotSupported(Exception): pass def parse_args(): parser = argparse.ArgumentParser( description="publish windows debugging files") parser.add_argument("-d", "--delete", ...
# 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! *** import warnings import pulumi import pulumi.runtime from typing import Any, Mapping, Optional, Sequence, Union, overload from ... import _utilities fro...
__version__ = "v0.1.0"
# flake8: noqa from .load_catalog import load_catalog
import ctypes class MemoryBuffer: def __init__(self, ptr): self.start_addr = ptr self.position = ptr def tell(self): return self.position def read(self, count): if count == 0: return b'' if count < 0: raise Exception('Cant read negative num...
# coding: utf-8 from graph import UndirectedGraph, Vertex from reporter import Reporter from typing import Callable, List, Set import random PivotChoice = Callable[[UndirectedGraph, Set[Vertex]], Vertex] def visit(graph: UndirectedGraph, reporter: Reporter, pivot_choice_X: bool, candidates: Set[Vertex], ...
class Solution(object): def reorderLogFiles(self, logs): """ :type logs: List[str] :rtype: List[str] """ lls = {} dls = [] for log in logs: _, v = log.split(" ", 1) if v.split(" ", 1)[0].isalpha(): lls[log] = v ...
from flask import render_template,request,redirect,url_for, abort from . import main from flask_login import login_required,current_user from .forms import PitchesForm,CommentsForm,UpdateProfile from ..models import Pitches,Comments,User from .. import photos, db from datetime import datetime # from ..requests import ...
from hashlib import sha256 import json from typing import Protocol from flask import * from flask_cors import CORS from Crypto.Cipher import AES from script import decrypt, encrypt from get_data import get_all_data from flask_talisman import Talisman from addData import readJson,writeJson import json from ml import pre...
import pygame import utils import constants import os, sys # ----------------------------------------------------------- # class Environment # ----------------------------------------------------------- class Environment: def __init__(self, zone_name, map_name): if zone_name is None o...
# Generated by Django 3.1.8 on 2021-06-24 16:23 from django.conf import settings import django.core.validators from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ...
import pathlib import pyopenephys import numpy as np """ The Open Ephys Record Node saves Neuropixels data in binary format according to the following the directory structure: (https://open-ephys.github.io/gui-docs/User-Manual/Recording-data/Binary-format.html) Record Node 102 -- experiment1 (equivalent to a Session...
import yaml import xdg from dataclasses import dataclass, field from typing import Dict from pathlib import Path @dataclass class Configuration: path: str = field(default=xdg.XDG_DATA_HOME / "quest/tasks.yaml") trello: Dict = field(default_factory=dict) taskfile: Path = field(default=xdg.XDG_DATA_HOME / "...
import os def modifyFile(_f): _new_f = _f.replace(' - 副本.js', '.ts') os.rename(_f, _new_f) def getFile(_d): dirs = os.listdir(_d) for k in dirs: fpth = _d + "/" + k f = os.path.isfile(fpth) if f == False: getFile(fpth) else: i =...
from time import sleep import unittest,random,sys sys.path.append('./models') sys.path.append('./page_obj') from models import function,myunit from page_obj.loginPage import Login class LoginTest(myunit.MyTest): '账户登录测试' def user_login_verify(self,username='',password=''): Login(self.driver).user_log...
#-*- coding:utf-8; mode:python; indent-tabs-mode: nil; c-basic-offset: 2; tab-width: 2 -*- from bes.testing.unit_test import unit_test from bes.version.software_version import software_version as VC class test_software_version(unit_test): def test_compare(self): self.assertEqual( -1, VC.compare('1.2.3', '1.2.4...
# Generated by Django 3.1.6 on 2021-05-01 19:10 from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('ecom', '0007_contact'), ] operations = [ migrations.AlterModelOptions( name='category', options={'verbose_name_plural': 'Cat...
import sys import math import numpy as np import pandas as pd def topsis_fun(file,wght,impact): try: mat=pd.read_csv(file) except FileNotFoundError: raise Exception("File does not exist") #print(mat) row_count=mat.shape[0] col_count=mat.shape[1] if(len...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Wed Jan 22 20:19:16 2020 @author: taotao """ import check_db def status_check(): print('进入计算检测') return def calculate(message,trigger,item_price):#识别并计算 if(trigger == 1): people = message[-1].split("@") people = people[1:] print('people_list:',p...
# Generated by Django 2.1.5 on 2019-03-24 01:56 from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('api', '0007_auto_20190324_0118'), ] operations = [ migrations.RemoveField( model_name='serveruser', name='password', ...
import math import bcolors class Plot(object): def __init__(self, x_min, x_max, x_size, y_min, y_max, y_size, t_min, t_max, t_size): self.x_min = x_min self.x_max = x_max self.x_size = x_size self.y_min = y_min self.y_max = y_max self.y_size = y_size self.t_min = t_min self.t_max = t_max self.t_siz...
# Copyright 2013-2014 The rust-url developers. # # Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or # http://www.apache.org/licenses/LICENSE-2.0> or the MIT license # <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your # option. This file may not be copied, modified, or distributed # except ac...
# pyOCD debugger # Copyright (c) 2013-2019 Arm Limited # SPDX-License-Identifier: Apache-2.0 # # 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...
from rest_framework import viewsets from rest_framework.exceptions import MethodNotAllowed from rest_framework_extensions.mixins import NestedViewSetMixin from resources_portal.models import Material from resources_portal.serializers import MaterialRelationSerializer class OrganizationMaterialViewSet(NestedViewSetM...
""" Usage: source env.sh ; python storage.py create_blob_container openflights-raw source env.sh ; python storage.py create_blob_container openflights-adf source env.sh ; python storage.py create_blob_container test source env.sh ; python storage.py delete_blob_container openflights-raw source env.s...
"""Command-line interface for Acton.""" import logging import struct import sys from typing import BinaryIO, Iterable, List import acton.acton import acton.predictors import acton.proto.wrappers import acton.recommenders import click def read_bytes_from_buffer(n: int, buffer: BinaryIO) -> bytes: """Reads n byte...
import logging def debug(*args, **kw): logging.basicConfig(level=logging.ERROR, format="%(message)s") logger = logging.getLogger(__name__) logger.debug(*args, **kw)
import os from os import path from IPython import embed import click import pandas as pd import numpy as np from root2csv import converter from csv2hdf5 import glob_and_check from remove_events import get_run from melibea import process_melibea def check_globs(glob1, glob2): if isinstance(glob1, str): fna...
# -*- coding: utf-8 -*- __all__ = ['Sample', 'reserved_keys'] reserved_keys = ['image_bytes', 'image_type', 'image_path', 'image', 'bboxes', 'bbox_labels'] class Sample(dict): """ Sample class is a subclass of dict, storing information of a single sample The following keys are reserved: 'image_bytes...
# -*- coding: utf-8 -*- import json class User(object): def __init__(self, user_id, user_name, user_surname, email): self.user_id = user_id self.user_name = user_name self.user_surname = user_surname self.email = email # self.userLevel = userLevel # self.userTitle ...
from pandas import DataFrame, read_csv import matplotlib.pyplot as plt import pandas as pd from qgis.core import ( QgsApplication, QgsDataSourceUri, QgsCategorizedSymbolRenderer, QgsClassificationRange, QgsPointXY, QgsProject, QgsExpression, QgsField, QgsFields, QgsFeature, QgsFeatu...
"""Поле для ссылки на сертификат Revision ID: 7f6d52e2a594 Revises: 4028ddc57d5b Create Date: 2021-01-17 16:47:35.551727 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = '7f6d52e2a594' down_revision = '4028ddc57d5b' branch_labels = None depends_on = None def u...
""" This class defines the Attention Layer to use when training the model with the attention mechanism. Code readapted (under the courtesy of the author) from: https://github.com/lukemelas/Machine-Translation """ import torch.nn as nn import torch.nn.functional as F class Attention(nn.Module): def __init__(self, b...
"""app URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/2.1/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: path('', views.home, name='home') Class-based vie...
import numpy as np from scipy.fftpack import dct def cutSample(data): if len(np.shape(data))==2: data=data[:,0] fadeamount = 300 maxindex = np.argmax(data > 0.01) startpos = 1000 if len(data) > 44100: if maxindex > 44100: if len(data) > maxindex + (44100): ...
import json from dagster_slack import slack_resource from mock import patch from dagster import ModeDefinition, execute_solid, solid @patch("slack_sdk.WebClient.api_call") def test_slack_resource(mock_api_call): @solid(required_resource_keys={"slack"}) def slack_solid(context): assert context.resour...
import base64, httplib, json def googlecloud_tagimage(filename): with open(filename, 'rb') as image_file: encoded_string = base64.b64encode(image_file.read()) endpoint = '/v1/images:annotate?key=ADD_YOUR_KEY_HERE' request_body = { 'requests':[ { 'image':{ ...
import sys numArray = sys.argv uniques = [] for num in numArray: if num not in uniques: uniques.append(num) print("Unique Numbers are ", end=':') for num in uniques: print(num, sep=",")
# -*- coding: utf-8 -*- import unittest from includes import * from common import getConnectionByEnv, waitForIndex, sortedResults, toSortedFlatList from time import sleep from RLTest import Env def testSyntax1(env): conn = getConnectionByEnv(env) env.expect('ft.create', 'idx', 'ONfoo*', ...
def python_vignette(): from tests import pyunit_utils story1 = [pyunit_utils.locate("python/ipython_dataprep_input.py")] story2 = [pyunit_utils.locate("python/ipython_machinelearning_input.py")] approved_py_code_examples = story1+story2 pybooklet_utils.check_code_examples_in_dir(approved_py_code_e...
# ---------------------------- PASSWORD GENERATOR ------------------------------- # import random import pyperclip import json def genrate_password(): letters = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', 'A', 'B',...
from sys import path from os.path import dirname as dir path.append(dir(path[0])) __package__ = "model" from model import inference from datetime import datetime INFERENCE_TYPE = 'local' # local' | 'cmle' instances = [ { 'is_male': 'True', 'mother_age': 26.0, 'mother_ra...
def palindrome(number): return number == number[::-1] if __name__ == '__main__': init = int(input()) number = init + 1 while not palindrome(str(number)): number += 1 print(number - init)
import unittest from bdflib import reader import charset class JISTest(unittest.TestCase): def test_jis(self): with open('bdf/jiskan24-2003-1.bdf', 'rb') as f: bdf = reader.read_bdf(f) cconv = charset.JIS() single_cp = 0 multi_cp = 0 for cp in bdf.codepoints(...
""" This is the main program file for the DDASM assembler. It will read a DDA program file and convert it to a VHDL \ description of a ROM file. This ROM file serves as the program memory for the LDD mark II processor. DDASM = Digital Design Assmebly LDD = Lab Digital Design Digital Design refers to the Digital Design ...
# 短信验证码 过期时间 SMS_CODE_EXPIRETIME = 300 # 手机号码在redis中的过期时间,解决短时间内 向同一手机号重复发送短信 的问题 MOBILE_EXPIRETIME = 60 # 标识某一属性在 redis 中的使用次数,解决类似于抽奖次数的问题 MOBILE_FREQUENCY = 1
import os import threading from cheroot import wsgi from wsgidav.wsgidav_app import WsgiDAVApp from powerhub.directories import WEBDAV_RO, WEBDAV_BLACKHOLE, \ UPLOAD_DIR, WEBDAV_DIR from powerhub.args import args import time from watchdog.observers import Observer from watchdog.events import FileSystemEventHand...
#!/usr/bin/env python3 import os import time import subprocess import shutil import datetime import tempfile def main(): TMPROOT = r'/Volumes/RAM Disk' REPO = r"/Volumes/RAM Disk/redis/" SIT_BIN = r"/Users/abcdabcd987/Developer/sit/bin/sit" report = open('stress_test_%s.csv' % datetime.datetime.today()...
# ##################################################################################################################### # Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. # # ...
from vstutils.models import BQuerySet, BModel, Manager, models class HostQuerySet(BQuerySet): def test_filter(self): return self.filter(name__startswith='test_') class Host(BModel): objects = Manager.from_queryset(HostQuerySet)() name = models.CharField(max_length=1024) class HostGroup(BModel)...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations import mptt.fields class Migration(migrations.Migration): dependencies = [ ('publication_backbone', '0006_auto_20160224_1345'), ('fluent_contents', '0001_initial'), ] operations = [ ...
import time import pygame from pygame.locals import * # The individual event object that is returned # This serves as a proxy to pygame's event object # and the key field is one of the strings in the button list listed below # in the InputManager's constructor # This comment is actually longer than the class defin...
from interface import GameWindow from PyQt5.QtWidgets import QApplication import sys if __name__ == "__main__": app = QApplication(sys.argv) demo = GameWindow() demo.update() demo.showMaximized() sys.exit(app.exec_())
# Okta intel module - Group import json import logging from typing import Dict from typing import List from typing import Tuple import neo4j from okta.framework.ApiClient import ApiClient from okta.framework.OktaError import OktaError from okta.framework.PagedResults import PagedResults from okta.models.usergroup impo...
import time import requests from models.states import OrderSide class DeribitExchangeInterface: def __init__(self, key, secret, base_url, api_url, instrument): self.key = key self.secret = secret self.base_url = base_url self.api_url = api_url self.url = base_url + api_url ...
import numpy as np import matplotlib.pyplot as plt import matplotlib.animation as animation DT = 0.01 FRAMERATE = 60 N_ROWS = 64 SECONDS = 10 def read_field_file(file_path, type): if type != 'scalar' and type != 'vector': raise ValueError('type must be scalar or vector') file_str = open(file_path, 'r...
import requests from abc import ABC, abstractmethod from collections import OrderedDict from coronacli.config import OWID_DATA_URL class BaseScraper(ABC): """ Abstract scraper class defining common functionality among all scrapers and abstract methods to implement """ def __init__(self): super().__...
from __future__ import print_function import collections import os os.environ["CUDA_DEVICE_ORDER"]="PCI_BUS_ID" # The GPU id to use, usually either "0" or "1" os.environ["CUDA_VISIBLE_DEVICES"]="3" import tensorflow as tf from keras.models import Sequential, load_model from keras.utils import multi_gpu_model from kera...
from gym_trading.envs.trading_env import TradingEnv from gym_trading.envs.Testing_Env import TestingEnv
import unittest import numpy as np from materialscoord.einstein_crystal_perturbation import perturb_einstein_crystal from pymatgen.core.structure import Structure class EinsteinTest(unittest.TestCase): """Test einstein perturbation functionality.""" def test_perturb(self): # basic test to check str...
class Config(object): DEBUG = False TESTING = False class DevConfig(Config): DEBUG = False
class MyPolynomialDecay: """ Class to define a Polynomial Decay for the learning rate """ def __init__(self, max_epochs=100, init_lr=1e-3, power=1.0): """ Class constructor. :param max_epochs (int): Max number of epochs :param init_lr (float): Initial Learning Rate ...
import tensorflow as tf from niftynet.application.base_application import BaseApplication from niftynet.engine.application_factory import \ ApplicationNetFactory, InitializerFactory, OptimiserFactory from niftynet.engine.application_variables import \ CONSOLE, NETWORK_OUTPUT, TF_SUMMARIES from niftynet.engine....
import numpy as np import os import tensorflow as tf from tensorflow.contrib.framework import nest def loop_tf(loop_fn, inputs, persistent_initializer, transient_initializer, n=None, time_major=False): def create_tensor_array(initial_tensor: tf.Tensor): return tf.TensorArray(initial_tensor.dtype, size=n, ...
# import to namespace from .base import IRRBase # noqa from .native import IRRClient # noqa
# Generated by Django 3.1.1 on 2020-09-19 21:11 from django.db import migrations, models class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( name='Contact', fields=[ ('id', models.AutoField(...
import numpy as np import tensorflow as tf from .utils import * class Graph2Gauss: """ Implementation of the method proposed in the paper: 'Deep Gaussian Embedding of Graphs: Unsupervised Inductive Learning via Ranking' by Aleksandar Bojchevski and Stephan Günnemann, published at the 6th Internati...
# Copyright (C) 2005, Giovanni Bajo # Based on previous work under copyright (c) 2002 McMillan Enterprises, 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 2 # of the Licen...
from django.test import TestCase from django.contrib.auth import get_user_model from django.urls import reverse from rest_framework.test import APIClient from rest_framework import status from core.models import User from .utils import create_user CREATE_USER_URL = reverse('api:user_create') ME_URL = reverse('api:u...
import os import shutil import sys import argparse import time import itertools import numpy as np import torch import torch.nn as nn import matplotlib.pyplot as plt import torch.optim as optim import torch.nn.functional as F from sklearn.metrics import confusion_matrix import scikitplot as skplt from torch.backends i...
from sh import gmkproject from sh import gchproject from sh import gchuser from sh import glusers from sh import gstatement from cloudmesh.accounting.AccountingBaseClass import AccountingBaseClass class GoldAccounting(AccountingBaseClass): """The gold accounting implementation class""" def project_usage(se...
from django.db import models from django.dispatch import receiver from django.db.models.signals import post_save from django.contrib.auth.models import User from rest_framework.authtoken.models import Token # Create your models here. @receiver(post_save, Sender = User) def create_auth_token(sender, instance=None, cre...
# This file is part of the GhostDriver project from Neustar inc. # # Copyright (c) 2012, Ivan De Marino <ivan.de.marino@gmail.com / detronizator@gmail.com> # All rights reserved. # # Redistribution and use in source and binary forms, with or without modification, # are permitted provided that the following conditions a...
# doit automatically picks up tasks as long as their unqualified name is prefixed with task_. # Read the guide: https://pydoit.org/tasks.html from dodos.action import * from dodos.behavior import * from dodos.benchbase import * from dodos.ci import * from dodos.forecast import * from dodos.noisepage import * from dodo...
C_CONST = 0.375 MC_ITERATION_COUNT = 100 D_MAX = 100
from typing import Tuple from NewDeclarationInQueue.processfiles.customprocess.search_lines_in_pages import SearchLinesInPage from NewDeclarationInQueue.processfiles.customprocess.search_text_line_parameter import SearchTextLineParameter from NewDeclarationInQueue.processfiles.process_messages import ProcessMessages...
# Generated from Mu.g4 by ANTLR 4.7.1 # encoding: utf-8 from antlr4 import * from io import StringIO from typing.io import TextIO import sys def serializedATN(): with StringIO() as buf: buf.write("\3\u608b\ua72a\u8133\ub9ed\u417c\u3be7\u7786\u5964\3&") buf.write("\u0082\4\2\t\2\4\3\t\3\4\4\t\4\4\5\...
import numpy as np from tensorflow.examples.tutorials.mnist import input_data import json with open('config.json') as config_file: config = json.load(config_file) k = config['k'] codes_path = config['codes_path'] codes = [] for i in range(k): codes.append([float(i)/(k-1)*255]) codes = np.array(codes) print('#...
# Check dla a module w a set of extension directories. # An extension directory should contain a Setup file # oraz one albo more .o files albo a lib.a file. zaimportuj os zaimportuj parsesetup def checkextensions(unknown, extensions): files = [] modules = [] edict = {} dla e w extensions: setu...
"""A basic focus script for slitviewers (changes will be required for gcam and instruments). Subclass for more functionality. Take a series of exposures at different focus positions to estimate best focus. Note: - The script runs in two phases: 1) If a slitviewer: Move the boresight and take an exposure. T...
passages = { 'The Money Beat (Drumming)' : """Let me tell you how you can play the money beat on your drums. To get this beat going start with one part at a time. This way you can part your mind, and feel the groove a lot better. With you hi hat, play constant eight notes. We will add in some accents in the future,...
from django.db import models from django.contrib.auth.models import AbstractUser from django_countries.fields import CountryField # Create your models here. class Degree(models.Model): degree_id = models.CharField(max_length=9, verbose_name='Degree ID', primary_key=True) degree = models.CharField(max_length=20...
from setuptools import setup import os def read(fname): return open(os.path.join(os.path.dirname(__file__), fname)).read() setup( name="fastly-python", version="1.0.4", author="Chris Zacharias", author_email="chris@imgix.com", description=("A Python client libary for the Fastly API."), license="BSD", keywords...
#!/usr/bin/env python3 """Utility class for logging. This class is a wrapper around the original logging module :py:mod:`logging` and can be used to apply the `panda_autograsp <https://github.com/rickstaa/panda_autograsp>`_ formatters, filters and handlers to the logging object. """ # Make script both python2 and pyth...
# coding=utf-8 # *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** import warnings import pulumi import pulumi.runtime from typing import Any, Mapping, Optional, Sequence, Union, overload from .. import...
"""Test AdsConnection class. :author: Stefan Lehmann <stlm@posteo.de> :license: MIT, see license file or https://opensource.org/licenses/MIT :created on: 2018-06-11 18:15:58 """ import time import unittest import pyads import struct from pyads.testserver import AdsTestServer, AmsPacket from pyads import constants fr...
# coding: utf-8 """ Unit tests for the args module. """ import argparse from datetime import datetime import pytest from ..src.args import parse_date, parse_args, parse_file_arg def test_parse_date_invalid(): """Ensure that invalid dates fail to parse.""" with pytest.raises(argparse.ArgumentTypeError, match...
from vk_bot.core.modules.basicplug import BasicPlug class Texttobits(BasicPlug): doc = "Зашифровать сообщение в бинарный код" command = ("бинарный0",) def main(self): text = ' '.join(self.text[1:]) bits = bin(int.from_bytes(text.encode('utf-8', 'surrogatepass'), 'big'))[2:] encode = ...
import torch import numpy as np class ReplayBuffer(object): def __init__(self, buffer_mem, num_states, num_actions): self.switch = 0 self.buffer_mem = buffer_mem self.count_mem = 0 self.num_states = num_states self.num_actions = num_actions self.state = t...
import torch import torch.nn as nn import torch.nn.functional as F import zipfile import numpy as np class BaseModel(nn.Module): def __init__(self, args, vocab, tag_size): super(BaseModel, self).__init__() self.args = args self.vocab = vocab self.tag_size = tag_size def save(se...
# -*- coding: utf-8 -*- """ Created on Mon Nov 25 18:28:27 2019 @author: Arthur """ pass
from .preprocess import * from . import preprocess_utils from .epipolarloss import * from .kploss import *
import csv import sys import urllib3 as ulib import pandas as pd import datetime from bs4 import BeautifulSoup as bs ulib.disable_warnings() try: #Create csv file only with column headers columnNames = ['CompanyName','Year','Ergebnis je Aktie (unverwaessert, nach Steuern)','Ergebnis je Aktie (verwaessert, nach...