text
stringlengths
1
927k
import os import secrets from PIL import Image from flask_blog import mail from flask_mail import Message from flask import current_app, url_for def save_picture(form_picture): random_hex = secrets.token_hex(8) _, f_ext = os.path.splitext(form_picture.filename) picture_fn = random_hex + f_ext picture_...
import unittest from conans.client.build.cppstd_flags import cppstd_default from conans.test.utils.mocks import MockSettings from conans.tools import cppstd_flag def _make_cppstd_flag(compiler, compiler_version, cppstd=None, compiler_base=None): settings = MockSettings({"compiler": compiler, ...
"""Auto-generated file, do not edit by hand. UG metadata""" from ..phonemetadata import NumberFormat, PhoneNumberDesc, PhoneMetadata PHONE_METADATA_UG = PhoneMetadata(id='UG', country_code=256, international_prefix='00[057]', general_desc=PhoneNumberDesc(national_number_pattern='\\d{9}', possible_length=(9,), poss...
from django.shortcuts import render import pickle import os.path import mimetypes import base64 from googleapiclient.discovery import build from google_auth_oauthlib.flow import InstalledAppFlow from google.auth.transport.requests import Request from email.mime.image import MIMEImage from email.mime.multipart import...
# Lint as: python3 # Copyright 2021 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 ...
import pytest from app.api.v2 import errors from app.api.v2.managers import config_api_manager from app.api.v2.managers.config_api_manager import ConfigApiManager, ConfigNotFound, ConfigUpdateNotAllowed from app.utility.base_world import BaseWorld class StubDataService: def __init__(self,): self.abilitie...
""" Runner module to directly manage the git external pillar """ import logging import salt.pillar.git_pillar import salt.utils.gitfs from salt.exceptions import SaltRunnerError log = logging.getLogger(__name__) def update(branch=None, repo=None): """ .. versionadded:: 2014.1.0 .. versionchanged:: 201...
from FreeTAKServer.model.SpecificCoT.SendFederatedCoT import SendFederatedCoT from .SendCoTAbstractController import SendCoTAbstractController from FreeTAKServer.controllers.configuration.LoggingConstants import LoggingConstants from FreeTAKServer.controllers.CreateLoggerController import CreateLoggerController loggin...
"""Freeze modules and regen related files (e.g. Python/frozen.c). See the notes at the top of Python/frozen.c for more info. """ from collections import namedtuple import hashlib import os import ntpath import posixpath import platform import subprocess import sys import textwrap import time from update_file import ...
# coding: utf-8 # flake8: noqa """ LOCKSS Configuration Service REST API API of the LOCKSS Configuration REST Service # noqa: E501 OpenAPI spec version: 1.0.0 Contact: lockss-support@lockss.org Generated by: https://github.com/swagger-api/swagger-codegen.git """ from __future__ import absolut...
#!/usr/bin/env python import sys import math import numpy as np from tensorflow.keras.models import load_model from aes import aes_sbox, aes_sbox_inv import matplotlib matplotlib.use('TkAgg') import matplotlib.pyplot as plt def get_label(plaintext, key, index): return aes_sbox[plaintext[index] ^ key[index]] n...
import pandas as pd import matplotlib.pyplot as plt from data import games info_filter = games['type'] == 'info' attendance_filter = games['multi2'] == 'attendance' attendance = games.loc[info_filter & attendance_filter, ['year', 'multi3']] attendance.columns = ['year', 'attendance'] attendance.loc[:, 'attendance'] ...
from collections import ChainMap import os from pathlib import Path from pickle_spree import PopenFactory import subprocess import sys class CallableDefinedInMain: def __call__(self): return 1 callable = CallableDefinedInMain() new_popen = PopenFactory(callable=callable) subprocess.Popen = new_popen pythonpa...
def solution(A): list_range = len(A) difference_list = [] for p in range(1, list_range): post_sum = sum(A[p:]) behind_sum = sum(A[:p]) difference = behind_sum - post_sum if difference < 0: difference *= -1 difference_list.append(difference) retur...
#!/usr/bin/env python3 import os, sys, re from argparse import ArgumentParser from difflib import unified_diff from json import load def dprint(msg): print('[DEBUG]: %s' % str(msg)) class HeaderChecker: def __init__(self, header, padding=1000, ignored_files=[], ignored_ext=[], ignored_patterns=[]): s...
import numpy as np import pandas as pd import os import pdb from scipy.spatial.distance import cosine from sklearn.metrics import roc_curve, confusion_matrix import sys from tqdm import tqdm from sklearn.metrics import auc import argparse fprs = [0.01,0.02,0.03,0.04,0.05,0.06,0.07,0.08,0.09,0.1,0.2,0.3,0.4,0.5] groups...
""" Precisely APIs Enhance & enrich your data, applications, business processes, and workflows with rich location, information, and identify APIs. # noqa: E501 The version of the OpenAPI document: 11.9.3 Generated by: https://openapi-generator.tech """ import re # noqa: F401 import sys # noqa: F4...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations from django.conf import settings import django.utils.timezone import model_utils.fields class Migration(migrations.Migration): dependencies = [ ('buildings', '__first__'), migrations.swappabl...
n1 = int(input('primeiro numero:')) n2 = int(input('segundo numero:')) n3 = int(input('terceiro numero:')) menor = n1 if n2<n1 and n2<n3: menor=n2 if n3<n1 and n3<n2: menor=n3 maior = n1 if n2>n1 and n2>n3: maior=n2 if n3>n1 and n3>n2: maior=n3 print ('menor = {}'.format(menor)) print ('maior = {}'.f...
from datetime import datetime import json import pytest import traitlets as tl import numpy as np from numpy.testing import assert_equal import podpac from podpac.core.coordinates.utils import make_coord_array from podpac.core.coordinates.coordinates1d import Coordinates1d from podpac.core.coordinates.array_coordinat...
import numpy as np import torch from torch import nn, optim from torch.utils.data import DataLoader from torchvision.models.resnet import resnet50, resnet34 from torch import Tensor from typing import Dict from l5kit.configs import load_config_data from l5kit.data import LocalDataManager, ChunkedDataset from l5kit.dat...
from django.apps import AppConfig class CourseApplicationConfig(AppConfig): default_auto_field = 'django.db.models.BigAutoField' name = 'course_application'
# -*- coding: utf-8 -* from . import main
# -*- coding: utf-8 -*- from __future__ import (absolute_import, division, print_function, unicode_literals) # # Shamelessly ripped from # http://code.activestate.com/recipes/576949-find-all-subclasses-of-a-given-class/ # def itersubclasses(cls, _seen=None): """ itersubclasses(cls) ...
# -*- coding: utf-8 -*- #----------------------------------------------------------------------------- # Copyright (c) 2005-2021, PyInstaller Development Team. # # Distributed under the terms of the GNU General Public License (version 2 # or later) with exception for distributing the bootloader. # # The full license is...
# Auto-generated at 2021-09-27T17:01:31.256010+08:00 # from: Justice Cloudsave Service (3.38.0) # Copyright (c) 2018 - 2021 AccelByte Inc. All Rights Reserved. # This is licensed software from AccelByte Inc, for limitations # and restrictions contact your company contract manager. # pylint: disable=duplicate-code # p...
import argparse import logging from model import DCGAN_1024 def init_logger(): logging.basicConfig( format="[%(asctime)s] [%(levelname)s] [%(name)s] %(message)s", datefmt="%Y/%m/%d %H:%M:%S", level=logging.INFO ) if __name__ == '__main__': parser = argparse.ArgumentParser() pa...
import numpy as np from dnn_utils import sigmoid,sigmoid_backward,relu,relu_backward def initialize_two_layer(n_x,n_h,n_y): W1 = np.random.randn(n_h,n_x) * 0.01 b1 = np.zeros(n_h,1) W2 = np.random.randn(n_y,n_h) * 0.01 b2 = np.zeros(n_y,1) param = {"W1":W1,"b1":b1,"W2":W2,"b2":b2} return param def initialize...
#!/usr/bin/python # # Copyright 2016 Google Inc. 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 b...
# Copyright 2015 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
""" ASGI config for techtest project. It exposes the ASGI callable as a module-level variable named ``application``. For more information on this file, see https://docs.djangoproject.com/en/3.1/howto/deployment/asgi/ """ import os from django.core.asgi import get_asgi_application os.environ.setdefault('DJANGO_SETT...
# -*- coding: utf-8 -*- """ Created on Mon Oct 31 15:45:22 2016 @author: wang """ #from matplotlib import pylab as plt #from numpy import fft, fromstring, int16, linspace #import wave from read_wav_xml_good_1 import* from matrix_24_2 import* from max_matrix_norm import* import numpy as np # open a wave file filename...
from dataclasses import dataclass from debussy_concert.core.config.movement_parameters.base import MovementParametersBase @dataclass(frozen=True) class BigQueryDataPartitioning: partitioning_type: str gcs_partition_schema: str partition_field: str destination_partition: str @dataclass(frozen=True) c...
# @x3raqe #ممول محمد """QuotLy: Avaible commands: .انستا """ import datetime import asyncio from telethon import events from telethon.errors.rpcerrorlist import YouBlockedUserError from telethon.tl.functions.account import UpdateNotifySettingsRequest from userbot.utils import admin_cmd @borg.on(admin_cmd(pattern="ست...
# coding=utf8 # Copyright 2018 JDCLOUD.COM # # 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 ...
#!/usr/bin/env python # -*- coding: utf-8 -*- # # tebless documentation build configuration file, created by # sphinx-quickstart on Tue Jul 9 22:26:36 2013. # # This file is execfile()d with the current directory set to its # containing dir. # # Note that not all possible configuration values are present in this # aut...
import pygame import random pygame.init() azul = (50, 100, 213) laranja = (205, 102, 0) verde = (0, 255, 0) amarelo = (255, 255, 102) dimensoes = (600, 600) x = 300 y = 300 d = 20 lista_cobra = [[x, y]] dx = 0 dy = 0 x_comida = round(random.randrange(0, 600 - d) /20) * 20 y_comida = round(random.randrange(0, 60...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('glitter', '0003_remove_empty_contentblocks'), ] operations = [ migrations.AlterField( model_name='contentblock',...
from django.shortcuts import render, redirect from django.views import View from django.contrib.auth.models import User from django.contrib.auth.decorators import login_required from django.utils.decorators import method_decorator from django.http import HttpResponse from result.models import ResponseSheet import os im...
#!/usr/bin/env python import os import sys if __name__ == '__main__': os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'socialrating.settings') try: from django.core.management import execute_from_command_line except ImportError as exc: raise ImportError( "Couldn't import Django....
############################################################################### # # The MIT License (MIT) # # Copyright (c) Tavendo GmbH # # 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 with...
import numpy as np from scipy.sparse import lil_matrix import scipy.sparse.linalg as sp import scipy.sparse as sparse import math import csv import matplotlib.pyplot as plt def linear_powerflow_model(Y00,Y01,Y10,Y11_inv,I_coeff,V1,slack_no): # voltage linearlization V1_conj = np.conj(V1[slack_no:]) V1_conj...
#!/usr/bin/env python import os import sys import plac import importlib from pathlib import Path from spacy.util import get_package_path from spacy.compat import symlink_to @plac.annotations( lang=plac.Annotation(help='Language code'), lang_path=plac.Annotation(help='Language path')) def link_lang_spacy(lang...
""" Django settings for DankiBackEnd project. Generated by 'django-admin startproject' using Django 3.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 path...
#!/usr/bin/env python # -*- coding: utf-8 -*- # @Time : 2019-01-17 13:49 # @Author : pang # @File : fund.py # @Software: PyCharm import datetime import os import asyncio import re import logging import time import random import aiohttp from motor.motor_asyncio import AsyncIOMotorClient from ruia import Request...
from django.db import models from django.contrib.auth.models import User from django.db.models.signals import post_save from django.dispatch import receiver from sorl.thumbnail import ImageField # Create your models here. class Profile(models.Model): user= models.OneToOneField( User, on_delete=mod...
#!/usr/bin/env python # -*- coding: UTF-8 -*- #------------------------------------------------------------------------------- """pyzombie HTTP RESTful resource handler.""" __author__ = ('Lance Finn Helsten',) __version__ = '1.0.1' __copyright__ = """Copyright 2009 Lance Finn Helsten (helsten@acm.org)""" __license__ = ...
import uuid from sanic import response from sanic.exceptions import abort from sanic.request import Request from sanic.views import HTTPMethodView as SanicHTTPView from ..cache import cache class SubscribeView(SanicHTTPView): async def get(self, request: Request, uid: uuid): token = request.args.get('t...
#!/usr/bin/env python from collections.abc import Mapping, Callable import os from pathlib import Path import numpy as np import pandas as pd import pytest import openmc.data @pytest.fixture(scope='module') def elements_endf(): """Dictionary of element ENDF data indexed by atomic symbol.""" endf_data = os.e...
import pytest import json from os import path from fixture.fixture import Fixture with open(path.join(path.dirname(path.abspath(__file__)), 'config.json')) as f: config = json.load(f) @pytest.fixture(scope="session") def app(request): fixture = Fixture(admin_root=config['admin']['url'], ...
from django import forms from .utils import number2powers, BitOptions class BitOptionsWidget(forms.CheckboxSelectMultiple): """ Default BitOptionsField widget to present every option (bit) as checkbox. """ def value_from_datadict(self, data, files, name): """ Given a dictionary of da...
# 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...
""" id, date, name, election_type, state_id, is_statewide, registration_info, absentee_ballot_info, results_uri, polling_hours, has_election_day_registration, registration_deadline, absentee_request_deadline, hours_open_id """ import datetime import csv import config from maryland_polling_location import PollingLoc...
# coding=utf-8 from datetime import datetime from sqlalchemy import Column, String, Integer, Boolean, ForeignKey, DateTime from imaging_db.database.base import Base def _serial_to_date_time(dataset_serial): substrs = dataset_serial.split("-") date_time = datetime(int(substrs[1]), # year ...
# -*- coding: utf-8 -*- ''' An SDB module for getting credentials from confidant. Configuring the Confidant module ================================ The module can be configured via sdb in the minion config: .. code-block:: yaml confidant: driver: confidant # The URL of the confidant web service url: '...
""" Evaluate """ import re import math import datetime import random import torch from torch.nn import functional as F from torch.utils.data import DataLoader import matplotlib.pyplot as plt from loss import iou_loss, HairMattingLoss, acc_loss, F1_loss from utils import create_multi_figure USE_CUDA = torch.cuda.is_a...
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may ...
# Generated by Django 3.2.4 on 2021-06-17 10:56 import datetime from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('testing', '0005_useranswer_is_correct'), ] operations = [ migrations.AddField( model_name='usertestresult', ...
# -*- coding: utf-8 -*- # Copyright 2020 Google LLC # # 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...
# -*- coding: utf-8 -*- # ----------------------------------------------------------------------------- # (C) British Crown Copyright 2017-2020 Met Office. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions a...
# Copyright (c) 2021, Appman and Contributors # See license.txt # import frappe import unittest class TestService(unittest.TestCase): pass
[ ## this file was manually modified by jt { 'functor' : { 'arity' : '1', 'call_types' : [], 'ret_arity' : '0', 'rturn' : { 'default' : 'T', }, 'special' : ['swar'], 'simd_types' : ['real_'], 'type_defs' : [], 't...
from unittest import IsolatedAsyncioTestCase from unittest.mock import patch, AsyncMock, call from guapow import __app_name__ from guapow.service.watcher import util class MapProcessesTest(IsolatedAsyncioTestCase): @patch(f'{__app_name__}.service.watcher.util.async_syscall', side_effect=[(0, " 1 # a \n 2 # b \n...
from flask_wtf import FlaskForm from wtforms import StringField, TextAreaField class PostForm(FlaskForm): title = StringField('Заголовок') body = TextAreaField('Текст')
from __future__ import absolute_import from .ptfimages import *
from os import system, listdir from PIL import Image num = int(input('请输入你想生成的缩略图的长: ') ) for pic in listdir('.'): if pic[-4:] == '.jpg': tmp_pic = pic[:-4] + '.png' temp_pic = pic[:-4] + '.bmp' system('ffmpeg -i ' + pic + ' -vf scale=' + str(num) + ':-1 ' + tmp_pic) system('ffmpeg ...
class Translation(object): START_TEXT = "**I'm a Rename and Convert Bot\nJust send me any media to change file name.\nUse /help command for more details **" ###################### HELP_USER = """**>>Send File/Video\n>>Select desired Option\n>>And Done wait for it to process files**""" DOWNLOAD_MSG = "**Down...
#!/usr/local/bin/python import sys # sys.path.append('/Users/jore/courses/NIMBUS/RESEARCH/CPS_TYPES/cps_units/') import unittest from detect_physical_unit_inconsistencies import CPSUnitsChecker from unit_error_types import UnitErrorTypes from unit_error import UnitError import os global_debug = False global_debug_verb...
from docusign_rooms import RoomsApi from flask import session, request from ...utils import create_rooms_api_client class Eg003Controller: @staticmethod def get_args(): """Get required session and request arguments""" return { "account_id": session["ds_account_id"], # Represents ...
# 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...
from mock import MagicMock from mock import patch class TestBasic: """Some basic tests, checking import, making sure APIs remain consistent, etc""" def test_import_serverextension(self): """Check that serverextension hooks are available""" from jupyter_resource_usage import ( _jup...
import numpy as np import h5py from pprint import pprint def read_calib(mtt_path): mtt_file = h5py.File(mtt_path) istracking = np.squeeze(np.asarray([mtt_file['mt']['cam_istracking']]) == 1) calind = np.squeeze(np.int32(mtt_file['mt']['calind']))[istracking] - 1 mc = { 'Rglobal': np.asarray(m...
# Copyright (c) 2021 NVIDIA CORPORATION. All rights reserved. # 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, mod...
from fontTools.misc.eexec import decrypt, encrypt def test_decrypt(): testStr = b"\0\0asdadads asds\265" decryptedStr, R = decrypt(testStr, 12321) assert decryptedStr == b'0d\nh\x15\xe8\xc4\xb2\x15\x1d\x108\x1a<6\xa1' assert R == 36142 def test_encrypt(): testStr = b'0d\nh\x15\xe8\xc4\xb2\x15\x1...
# -*- coding: utf-8 -*- # Generated by Django 1.9.2 on 2016-03-16 03:14 from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion import jigsaw.models class Migration(migrations.Migration): dependencies = [ ('jigsaw', '0003_auto_20160315_1733'), ...
class Solution(object): def removeElement(self, nums, val): """ :type nums: List[int] :type val: int :rtype: int """ a=0 x=0 while(x<len(nums)): if nums[x]==val: nums.pop(x) x-=1 x+=1 ...
from django.core.exceptions import ObjectDoesNotExist from django.db import models from django.utils import formats from django.utils.html import escape from django.utils.safestring import mark_safe from django.utils.text import capfirst from django.utils.encoding import force_unicode, smart_unicode, smart_str from dja...
# exported from PySB model 'model' from pysb import Model, Monomer, Parameter, Expression, Compartment, Rule, Observable, Initial, MatchOnce, Annotation, ANY, WILD Model() Monomer('Ligand', ['Receptor']) Monomer('ParpU', ['C3A']) Monomer('C8A', ['BidU', 'C3pro']) Monomer('SmacM', ['BaxA']) Monomer('BaxM', ['BidM', '...
ATArticle = 0 ATString = 1 ATBasePrice = 2 ATReleased = 3 ATEmblemPrices = 4 AHat = 0 AGlasses = 1 ABackpack = 2 AShoes = 3 APriceBasic = 250 APriceBasicPlus = 400 APriceCool = 800 APriceAwesome = 1500 AccessoryTypes = {101: (AHat, 'hbb1', APriceBasic, 1), 102: (AHat, 'hsf1', APriceC...
from cs50 import SQL db = SQL("sqlite:///immuns.db") global currentUser def manualDel(number, curUser): stem = db.execute("SELECT * FROM :dataBase WHERE id=:ids", dataBase=curUser, ids=number) for stoop in stem: comm = stoop["committee"] db.execute("UPDATE generalList SET delegate_name = '' ...
# Generated by Django 3.2.8 on 2021-10-18 11:53 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( name='Product', fields=[ ...
#! /usr/bin/python3 #-------------------------------------------------------------------------------------------------# # NAME: ibm_db-special_columns.py # # # ...
"""This is a testing case for the unsteady ring vortex lattice method solver with static geometry. Based on an equivalent XFLR5 testing case, the expected output for this case is: CL: 0.588 CDi: 0.011 Cm: -0.197 Note: The expected output was created using XFLR5's inviscid VLM2 analysis type, wh...
from setuptools import setup, find_packages setup( name='lookahead', version='0.0.2', packages=find_packages(), install_requires=['scikit-learn', 'scipy', 'numpy', 'qmcpy'] )
#!/usr/bin/env python # # Cloudlet Infrastructure for Mobile Computing # # Author: Kiryong Ha <krha@cmu.edu> # Zhuo Chen <zhuoc@cs.cmu.edu> # # Copyright (C) 2011-2013 Carnegie Mellon University # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in com...
from __future__ import print_function, unicode_literals import mock from twisted.trial import unittest from ..._dilation.connection import (parse_record, encode_record, KCM, Ping, Pong, Open, Data, Close, Ack) class Parse(unittest.TestCase): def test_parse(self): self....
import asyncio import threading import time import unittest from slixmpp.test import SlixTest class TestInBandByteStreams(SlixTest): def setUp(self): self.stream_start(plugins=['xep_0047', 'xep_0030']) def tearDown(self): self.stream_close() def testOpenStream(self): """Test re...
# PROGRAM: To find the digital root of an integer # FILE: digitalRoot.py # CREATED BY: Santosh Hembram # DATED: 23-09-20 num = int(input("Enter an integer: ")) temp = num sum = 10 while(sum>=10): sum = 0 while(num!=0): dg = num % 10 sum = sum + dg num = num // 10 num = sum ...
# # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not...
import sys import argparse import pprint def load_arguments(): argparser = argparse.ArgumentParser(sys.argv[0]) argparser.add_argument('--train', type=str, default='') argparser.add_argument('--dev', type=str, default='') argparser.add_argument('--test',...
# This config is incomplete, but will specify all the required key # when combined with fragment_config_base.py. c.jira.project_key = "TEST" c.jira.max_retries = 7 c.jira.sync_milestones = False c.github.repository = "testing/test-repo"
import random import shutil import os import numpy as np import data_loader import audio_processing from typing import Dict from loguru import logger from tqdm import tqdm from pprint import pprint class DataGenerator: def __init__(self, conf: Dict, batch_size: int = 8): assert "csv_file_path" in conf ...
import numpy as np import cv2 as cv flann_params= dict(algorithm = 6, table_number = 6, # 12 key_size = 12, # 20 multi_probe_level = 1) #2 def init_feature(): """initialize feature detector and matcher algorithm """ detector = cv.ORB_create(300...
#! /usr/bin/python # -*- coding: utf-8 -*- """Deep learning and Reinforcement learning library for Researchers and Engineers.""" MAJOR = 2 MINOR = 1 PATCH = 1 PRE_RELEASE = '' # Use the following formatting: (major, minor, patch, prerelease) VERSION = (MAJOR, MINOR, PATCH, PRE_RELEASE) __shortversion__ = '.'.join(map...
from setuptools import setup, find_packages setup( name = "regulations", version = "0.1.0", license = "public domain", packages = find_packages() )
from com.jcraft.jsch import JSchException from com.jcraft.jsch import JSch from org.python.core.util import FileUtil from java.time import Duration from com.couchbase.client.java import Cluster, ClusterOptions from com.couchbase.client.java.env import ClusterEnvironment from com.couchbase.client.core.env import Timeout...
#Importation : import pandas as pd import numpy as np ################################################ #Parameters : #Planck constant (J/Hz) h=6.62607004*10**-34 #Boltzmann constant (J/K) kB=1.38064852*10**-23 #Light velocity in vaccum (m/s) c=299792458.0 #############################################################...
#!/usr/bin/env python3 #------------------------------------------------------------------------ # SignalFlow: Modulation example. #------------------------------------------------------------------------ from signalflow import * #------------------------------------------------------------------------ # Create the g...
import torch import torch.nn as nn import torch.nn.functional as F import torchvision class CustomResnetV1(nn.Module): def __init__(self): super(CustomResnetV1, self).__init__() self.resnet = torchvision.models.resnet18(pretrained=True) self.resnet.conv1 = nn.Conv2d(3, 64, kernel_size=(3,...