content
stringlengths
5
1.05M
# coding: utf-8 # CarND-Behavioral-Cloning-P3 # In[3]: #Importing Dependencies when required import os import csv samples=[] with open('./data/driving_log.csv') as csvfile: has_header = csv.Sniffer().has_header(csvfile.read(1024)) csvfile.seek(0) # Rewind. reader=csv.reader(csvfile) if has_header...
import sys sys.path.insert(1, '../') from selenium.webdriver.common.keys import Keys import random from random import randint from functions import fetchLists, wait, chanceOccured, cleanNumber, updateLists from bot import Bot class ProcessAccountsBot(Bot): def __init__(self, account: str = None): super()....
from flask import g def transform(ugc): if not g.netanyahu: return ugc new_ugc = [] for u in ugc: new_u = { 'censored': u.get('censored', False), 'ugcdocid': u['ugcdocid'], 'pages': u['pages'], 'summary': u.get('summary', '').strip(), ...
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals import frappe from erpnext import get_company_currency, get_default_company from erpnext.accounts.report.utils import get_currency, convert_to_pre...
from string import ascii_lowercase def destroyer(input_sets): """ takes in a tuple with 1 or more sets of characters and replaces the alphabet with letters that are in the sets First gets the candidates of the alphabets and gets the letters to knock out into a list :param input_sets: :return: str...
import mysql.connector from contextlib import closing with closing(mysql.connector.connect( host="localhost", port=3306, user="root", password="sql!DB123!", database="app" )) as db: with closing(db.cursor(dictionary=True)) as cur: sql = "select closing_date, currency_symbol, " \ ...
# 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 pathlib import Path import torch import torch.nn as nn from torch.autograd import Variable from mnist_efficientnet import io from mnist_efficientnet.network import Network, extract_result root = Path("../input/digit-recognizer") train_x, train_y = io.load_train_data(root) test = io.load_test_data(root) net = ...
""" Tests for the pynagios package. """ class TestPyNagios(object): pass
import pwndbg.color.theme as theme import pwndbg.config as config from pwndbg.color import generateColorFunction config_prefix = theme.Parameter('backtrace-prefix', '►', 'prefix for current backtrace label') config_prefix_color = theme.ColoredParameter('backtrace-prefix-color', 'none', 'color for prefix of c...
import torch import torch.nn as nn import torch.nn.functional as F class network1(nn.Module): def __init__(self): super().__init__() self.cnn1 = nn.Sequential( nn.ReflectionPad2d(1), nn.Conv2d(1, 4, kernel_size=3), nn.ReLU(inplace=True), nn.BatchNorm2...
#!/usr/bin/python # # Chrome - Profile Launcher for Chrome # @see http://stackoverflow.com/questions/16410852/keyboard-interrupt-with-with-python-gtk # https://pygobject.readthedocs.io/en/latest/getting_started.html # https://lazka.github.io/pgi-docs/ # http://www.programcreek.com/python/example/9059/gtk.IconView impo...
import unittest import os.path import os import sys sys.path.append(".") #from pywinauto.timings import Timings #Timings.Fast() excludes = ['test_sendkeys'] def run_tests(): testfolder = os.path.abspath(os.path.split(__file__)[0]) sys.path.append(testfolder) for root, dirs, files in...
import torch from torch import nn from torch.utils.data import DataLoader import os from abc import ABC from ssl_eval import Evaluator from typing import Tuple from .. import pkbar from ..logger import Logger, EmptyLogger from ..utils import AllReduce, after_init_world_size_n_rank from ..scheduler import Scheduler c...
"""Domain classes for fulltext extraction service.""" from typing import NamedTuple, Optional, Any from datetime import datetime from pytz import UTC from backports.datetime_fromisoformat import MonkeyPatch from enum import Enum MonkeyPatch.patch_fromisoformat() class Extraction(NamedTuple): # arch: domain "...
import bmesh as bm import bpy from bpy_extras import object_utils from mathutils import Matrix import numpy as np from smorgasbord.common.io import get_scalars from smorgasbord.common.mat_manip import make_transf_mat from smorgasbord.common.transf import transf_pts def combine_meshes(obs): """ Returns the me...
import time time.perf_counter() from game_mechanics import Player, Simulator from strategies import make_turn_strat import numpy as np import matplotlib.pyplot as plt # A bot plays Incan Gold in single-player mode. # The bot leaves when the turn reaches the Turn Threshold value. # The game is simulated many times for...
import logging _logger = logging.getLogger(__name__) import sys #import random import numpy as np from .agent import Agent from .ataristatebuffer import AtariStateBuffer class AtariAgent(Agent): """ This class is an implementation of an Atari agent. The agent interacts with the given environment, organizes ...
r""" Optimizing noisy circuits with Cirq =================================== .. meta:: :property="og:description": Learn how noise can affect the optimization and training of quantum computations. :property="og:image": https://pennylane.ai/qml/_images/noisy_circuit_optimization_thumbnail.png .. figure:: ../de...
#!/usr/bin/env python # coding=utf-8 import argparse import os import re #功能:输入一个只包含tree文件的目录,不加“/”,以及输入一个label map关系表,原来的标签必须非冗余,即不能一对多映射。然后在当前目录输出所有relabel后的tree文件。 #获取树目录下所有文件名 parser=argparse.ArgumentParser(description = "功能:批量修改nwk文件的label注释。输入一个包含tree文件的目录,和一个tree中老label和要替换的label的对应两列表。在当前目录输出relabel后的各个tree文件"...
from os import path from sys import modules from fabric.api import sudo from fabric.contrib.files import upload_template from pkg_resources import resource_filename def restart_systemd(service_name): sudo("systemctl daemon-reload") if sudo( "systemctl status -q {service_name} --no-pager --full".forma...
from machine import Pin import utime from ssd1306 import SSD1306_I2C #I/O Configuration led = Pin(28, Pin.OUT) onboard_led = Pin(25, Pin.OUT) button = machine.Pin(14, machine.Pin.IN, machine.Pin.PULL_DOWN) #Set Initial Conditions led.low() onboard_led.high() fast_blink = False # attach the interrupt to the buttonPin...
import os from setuptools import find_packages, setup with open(os.path.join('.', 'VERSION')) as version_file: version = version_file.read().strip() setup( name='mavelp', version=version, long_description=open('README.md').read(), package_dir={'': 'src'}, packages=find_packages(where='src'), )
from PySide2 import QtCore, QtGui, QtWidgets from PySide2.QtCore import (QCoreApplication, QPropertyAnimation, QDate, QDateTime, QMetaObject, QObject, QPoint, QRect, QSize, QTime, QUrl, Qt, QEvent) from PySide2.QtGui import (QBrush, QColor, QConicalGradient, QCursor, QFont, QFontDatabase, ...
__author__ = 'Thomas Kountis'
# -*- coding: utf-8 -*- """ * Created by PyCharm. * Project: catalog * Author name: Iraquitan Cordeiro Filho * Author login: pma007 * File: api * Date: 2/26/16 * Time: 11:26 * To change this template use File | Settings | File Templates. """ from flask import Blueprint, jsonify from catalog.models import Categ...
# # copied from # # https://scikit-learn.org/stable/auto_examples/covariance/plot_lw_vs_oas.html#sphx-glr-auto-examples-covariance-plot-lw-vs-oas-py # # import numpy as np import matplotlib.pyplot as plt from scipy.linalg import toeplitz, cholesky from sklearn.covariance import LedoitWolf, OAS np.random.seed(0) n_...
import json import logging import time import datetime as dt from bitbot import services, strategy import pandas as pd class Bot: """ A trading bot that executes a certain strategy Attributes: config (dict[str, any]): the loaded configuration next_action (services.OrderDirection): the nex...
import rospy import sys import tf import tf2_ros import geometry_msgs.msg if __name__ == '__main__': if len(sys.argv) < 8: rospy.logerr('Invalid number of parameters\nusage: ' './static_turtle_tf2_broadcaster.py ' 'child_frame_name x y z roll pitch yaw') sy...
# Generated by Django 3.2.12 on 2022-03-27 19:15 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('api', '0003_auto_20220328_0004'), ] operations = [ migrations.RenameField( model_name='predication', old_name='avg_...
""" Module for time series classification using Bayesian Hidden Markov Model ----------------- Version : 0.2 Date : December, 11th 2019 Authors : Mehdi Bennaceur Phase : Development Contact : _ Github : https://github.com/DatenBiene/Bayesian_Time_Series_Classification """ __version__ = "...
# Copyright (c) 2012-2015 Netforce Co. Ltd. # # 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, publ...
import re from num2words import num2words from word2number.w2n import word_to_num from pycorenlp import StanfordCoreNLP class PostProcess: month_map = { 1:'January', 2:'February', 3:'March', 4:'April', 5:'May', 6:'June', 7:'July', 8:'August', ...
#!/usr/bin/env python3 # -*- coding:utf-8 -*- ################################################################################## # File: c:\Projects\KENYA ONE PROJECT\CORE\engines\values.py # # Project: c:\Projects\KENYA ONE PROJECT\CORE\engines # # Created Date: Thur...
from .jxa_loader import *
import math import numpy as np import torch from torch import nn class MultiheadAttention(nn.Module): """General purpose multihead attention implementation.""" def __init__(self, input_dim, proj_dim, n_heads=1, dropout=0.0, attn_type='cross', initializer='xavier_uniform'): assert pr...
# Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under th...
# Copyright 2021 The Private Cardinality Estimation Framework 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 b...
""" Shutterstock CLI """ import click from .images import images from .videos import videos from .audio import audio from .editorial import editorial from .cv import cv from .ai_audio import ai_audio from .editor import editor from .contributors import contributors from .user import user from .test import te...
try: from SmartFramework.serialize.tools import serializejson_, authorized_classes from SmartFramework.serialize import serialize_parameters except: from serializejson import serialize_parameters from serializejson.tools import serializejson_, authorized_classes import array def serializejson_array(i...
import collections import copy import json import os import sys import unittest from ethereum import utils from ethereum import config from ethereum.tools import tester as t from ethereum.utils import mk_contract_address, checksum_encode import rlp import trie import trie.utils.nibbles from test_utils import rec_hex,...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Tue Feb 1 09:26:03 2022 @author: thejorabek """ '''son=10 print(son,type(son)) son=3.14 print(son,type(son)) son='Salom Foundationchilar' print(son,type(son)) son=True print(son,type(son)) son=int() print(son,type(son)) print("Assalom",123,3.14,True,sep='...
#!/usr/bin/env python # encoding: utf-8 ''' @author: Jason Lee @license: (C) Copyright @ Jason Lee @contact: jiansenll@163.com @file: 17.py @time: 2019/5/29 22:07 @desc: ''' class Solution: def letterCombinations(self, digits: str) -> List[str]: if len(digits) < 1: return [] str...
# Copyright (C) 2014-2017 Internet Systems Consortium. # # Permission to use, copy, modify, and distribute this software for any # purpose with or without fee is hereby granted, provided that the above # copyright notice and this permission notice appear in all copies. # # THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET ...
from os import stat from re import VERBOSE from request_api.services.commentservice import commentservice from request_api.services.notificationservice import notificationservice from request_api.models.FOIRawRequests import FOIRawRequest from request_api.models.FOIMinistryRequests import FOIMinistryRequest from reque...
# -*- Mode: python; tab-width: 4; indent-tabs-mode:nil; coding:utf-8 -*- # vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4 # # MDAnalysis --- https://www.mdanalysis.org # Copyright (c) 2006-2017 The MDAnalysis Development Team and contributors # (see the file AUTHORS for the full list of names) # # Released under t...
# -*- coding: utf-8 -*- import argparse from unittest import mock from unittest.mock import MagicMock, patch import pytest from pytube import cli, StreamQuery, Caption, CaptionQuery parse_args = cli._parse_args @mock.patch("pytube.cli.YouTube") def test_download_when_itag_not_found(youtube): youtube.streams = ...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # ---------------------------------------------------------------- # cssyacc/block.py # # class for block # ---------------------------------------------------------------- # copyright (c) 2014 - Domen Ipavec # Distributed under The MIT License, see LICENSE # ------------...
# liberate - Add the specified block to the list of available blocks. As part # of the liberation process, check the block's buddy to see if it can be # combined with the current block. If so, combine them, then recursively # call liberate. # @param block The block to be liberated def liberate(block): ...
import os import json import yaml import time import flask import distro import psutil import random import string import threading import jinja2.exceptions from flask import request from turbo_flask import Turbo from datetime import datetime try: from mcipc.query import Client except: # server offline pass ...
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'scanwindow.ui' # # Created: Sun Jun 5 22:23:54 2016 # by: PyQt4 UI code generator 4.10.4 # # WARNING! All changes made in this file will be lost! from PyQt4 import QtCore, QtGui try: _fromUtf8 = QtCore.QString.fromUtf8 except Att...
import argparse import datetime import json import logging import os import subprocess import tempfile import arcpy logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(levelname)s - %(message)s') log = logging.getLogger(__name__) def get_args(): parser = argparse.ArgumentParser() parser.add_argu...
import requests from src.models import Company from bs4 import BeautifulSoup as bs import time import asyncio class Scrap: def __init__(self): self.headers={ "Host":"www.nepalstock.com", "User-Agent":"Mozilla/5.0 (X11; Linux aarch64; rv:78.0) Gecko/20100101 Firefox/78.0", ...
from common_fixtures import * # NOQA import jinja2 import os if_upgrade_testing = pytest.mark.skipif( os.environ.get("UPGRADE_TESTING") != "true", reason='UPGRADE_TESTING is not true') pre_upgrade_namespace = "" post_upgrade_namespace = "" pre_port_ext = "" post_port_ext = "" @pytest.fixture(scope='session...
from backdoors.backdoor import * class Perl(Backdoor): prompt = Fore.RED + "(perl) " + Fore.BLUE + ">> " + Fore.RESET def __init__(self, core): cmd.Cmd.__init__(self) self.intro = GOOD + "Using Perl module" self.core = core self.options = { "port" : Optio...
pow2 = [] for x in range(1, 10): pow2.append(2 ** x) print(pow2) new_pow2 = [2 ** x for x in range(1,10)] # Comprehensions print(new_pow2) new_pow3 = [2 ** x for x in range(1,10) if x % 2 == 0] # Comprehensions with IF print(new_pow3) power = lambda x: 2 ** x conditional_values = [1,2,3,4,5] new_pow4 = [power(...
#!/usr/bin/env python3 """ A module which implements the MergeSort algorithm. """ import sys def parseInput(input): """ Converts an input string of integers into an array of integers. """ return [int(num) for num in input.split(',')] def mergeSort(a): """ Sorts and array of numbers into asc...
""" У каждой статьи указаны авторы (их несколько) и темы (их тоже несколько). Определите самую частую пару автор-тема. Если несколько пар встретились одинаковое число раз, то выведите обе (каждую на новой строчке). Формат ввода На каждой строчке сначала указаны фамилии авторов через пробел, потом запятая, потом темы (...
# Listing_20-1.py # Copyright Warren & Csrter Sande, 2013 # Released under MIT license http://www.opensource.org/licenses/mit-license.php # Version $version ---------------------------- # Minimum code for a PyQt program import sys from PyQt4 import QtCore, QtGui, uic # Import the Qt libraries we need form_cla...
#!/usr/bin/env python import rospy # from sensor_msgs.msg import Temperature from django_interface.msg import SilviaStatus from django_interface.srv import SilviaStatusRequest, SilviaStatusRequestResponse class StatusServer: """ Store machine status through subscription to status topic Respond to service r...
# Importing the Kratos Library import KratosMultiphysics as KM # CoSimulation imports import KratosMultiphysics.CoSimulationApplication.factories.solver_wrapper_factory as solver_wrapper_factory def Create(settings, models, solver_name): input_file_name = settings["input_file"].GetString() settings.RemoveValu...
from flask import render_template, redirect from flask_login import login_required from . import home from .. import db @home.route('/') @home.route('/index') def homepage(): """ Handles requests to `/` and `/index` routes It's the landing page, index page, homepage or whatever you like to call it """...
''' Blind Curated 75 - Problem 40 ============================= Reverse Bits ------------ Reverse the bits of a given 32-bit unsigned integer. [→ LeetCode][1] [1]: https://leetcode.com/problems/reverse-bits/ ''' def solution(n): ''' Working inwards from both ends, use bitwise logic to swap each pair of bits. '...
from collections import namedtuple from collections import defaultdict import spacy import warnings import numpy as np connection = namedtuple('connection', 'node weight') Index = namedtuple('Index', 'pid, sid, wid') nlp = spacy.load('en') # nlp = spacy.load('en_core_web_lg') # nlp = spacy.load('en_vectors_web_lg', ...
import praw import pdb import re import os from requests import Request, Session from requests.exceptions import ConnectionError, Timeout, TooManyRedirects import json #GET request url coin_url = 'https://pro-api.coinmarketcap.com/v1/cryptocurrency/quotes/latest' reddit = praw.Reddit('BTC9KBABY') #selects reddit...
""" 3D IoU Calculation and Rotated NMS Written by Shaoshuai Shi All Rights Reserved 2019-2020. """ import torch import numpy as np from opencood.utils.common_utils import check_numpy_to_torch from opencood.pcdet_utils.iou3d_nms import iou3d_nms_cuda def boxes_bev_iou_cpu(boxes_a, boxes_b): """ Args: ...
#! /usr/bin/env python import rospy from time import time, sleep from datetime import datetime from ar_track_alvar_msgs.msg import AlvarMarkers from controlmulti import * from callback_alvar import * if __name__ == '__main__': # try: rospy.init_node('control_node', anonymous= False) rate = rospy...
from enum import auto import graphene from serflag import SerFlag from handlers.graphql.types.access import create_access_type class VMActions(SerFlag): attach_vdi = auto() attach_network = auto() rename = auto() change_domain_type = auto() VNC = auto() launch_playbook = auto() changing...
import numpy as np from typing import Tuple, Union from .values_generator import ValuesGenerator class UniformGenerator(ValuesGenerator): def __init__( self, bounds: Tuple[Union[int, float], Union[int, float]], resolution: int = 1_000, seed: int = None, ): super(UniformGenerator, self).__init__(bounds...
from mimesis import Person from tests.base import BaseTestCase from tests.utils import add_user, add_group, add_user_group_association class TestGroupModel(BaseTestCase): """ Test Group model """ # Generate fake data with mimesis data_generator = Person('en') def test_model_group_add_group(s...
''' Usage: python remove_from_env.py $PATH $TO_BE_REMOVED returns $PATH without paths starting with $TO_BE_REMOVED ''' import sys ENV = sys.argv[1] REMOVE = sys.argv[2] new_path = [] for path in ENV.split(':'): if path.startswith(REMOVE): continue new_path.append(path) print ':'.join(n...
""" {This script calculates spread in velocity dispersion (sigma) from mocks for red and blue galaxies as well as smf for red and blue galaxies. It then calculates a full correlation matrix using sigma and smf of both galaxy populations as well as a correlation matrix of just sigma measurements of both galaxy po...
# 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 ...
A, B, X = map(int, input().split()) print("YES" if 0 <= X-A <= B else "NO")
from content.models import PopularQuestion from ..loader import dp from aiogram import types from ..utils.filters import starts_with from ..keyboards.inline import generic from ..utils.helpers import get_message_one_button @dp.callback_query_handler(starts_with('FAQ_element')) async def send_faq_carousel(callback_que...
# Import required library import os # To access environment variables from dotenv import load_dotenv # To load environment variables from .env file import serial # To connect via the serial port import time # To sleep for a few seconds # The thing ID and acc...
from py2neo import Graph,Node,Relationship,Subgraph graph = Graph('http://localhost:7474',username='neo4j',password='123456') tx = graph.begin() # ### 增加 # # 可以一个一个创建 # a = Node('Person',name='bubu') # graph.create(a) # b = Node('Person',name='kaka') # graph.create(b) # r = Relationship(a,'KNOWS',b) # graph.create(r...
from BaseHTTPServer import BaseHTTPRequestHandler, HTTPServer from SocketServer import ThreadingMixIn import threading import SocketServer from tools.tools import is_unsigned_integer import re import simplejson import cgi # urls: # - https://docs.python.org/3/glossary.html#term-global-interpreter-lock # - http://stac...
def formatString(input): input = re.sub("\s+", " ", input) if " " == input[0]: input = input[1:] if " " == input[-1]: input = input[:-1] return input
# Copyright 2015 The Oppia 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 applicable ...
import scrapy.http.response class CacheResponse(scrapy.http.response.Response): is_cache = False def mark_cache(self): self.is_cache = True return self def judge_cache(self): if not hasattr(self, 'is_cache'): return False return self.is_cache
from django.core.management.base import BaseCommand, CommandError from coinhub import pullData as myModel # Run via cron job similar to the form shown below # * * * * * python manage.py data_grabber --url https://api.coinmarketcap.com/v1/ticker/ class Command(BaseCommand): help = 'Collects data from an exchange' ...
import settings import shutil def make_cbz(): shutil.make_archive('comic','zip',root_dir=settings.IMAGES_PATH) shutil.move('comic.zip','comic.cbz') if __name__ == "__main__": make_cbz()
from __future__ import absolute_import import string from struct import unpack from vertica_python.vertica.messages.message import BackendMessage class ParameterStatus(BackendMessage): def __init__(self, data): null_byte = string.find(data, '\x00') unpacked = unpack('{0}sx{1}sx'.format(null_by...
import torch as to from torch.distributions.uniform import Uniform from pyrado.policies.base import Policy from pyrado.policies.base_recurrent import RecurrentPolicy from pyrado.utils.data_types import EnvSpec class IdlePolicy(Policy): """ The most simple policy which simply does nothing """ name: str = 'id...
#!/usr/bin/env python # Title : XGB_BostonHousing.py # Description : After using LinearRegression and GradientBoostingRegressor, we # can further improve the predicitions with state-of-the-art # algorithms, like XGBReegressor. It can use regularization and # bet...
import pytest from pandas import Timedelta @pytest.mark.parametrize('td, expected_repr', [ (Timedelta(10, unit='d'), "Timedelta('10 days 00:00:00')"), (Timedelta(10, unit='s'), "Timedelta('0 days 00:00:10')"), (Timedelta(10, unit='ms'), "Timedelta('0 days 00:00:00.010000')"), (Timedelta(-10, unit='ms...
from flask import Blueprint, jsonify, request from threading import Thread, Lock, Event from copy import deepcopy from node import Node import pickle import config import random import time node = Node() rest_api = Blueprint('rest_api', __name__) # ------------------------------------------ # ------------- Node endpo...
# -*- coding: utf-8 -*- # Generated by Django 1.9.4 on 2016-06-24 10:45 from __future__ import unicode_literals from django.db import migrations class Migration(migrations.Migration): dependencies = [ ("timeline_logger", "0001_initial"), ] operations = [ migrations.AlterModelOptions( ...
#!/usr/bin/python3 import fitz, shutil from fitz.utils import getColor from os import listdir from os.path import isdir, isfile, join import PySimpleGUI as sg print = sg.EasyPrint help_lisc_input = "Ce logiciel est soumis à la licence GPL v2, (c) Jodobear 2019.\n\nMentionner uniquement le dossier compr...
from torch.optim.lr_scheduler import LambdaLR class Scheduler(object): """Simple container for warmup and normal scheduler.""" def __init__(self, normal_schededuler, warmup_scheduler=None): self.warmup = warmup_scheduler self.sched = normal_schededuler def get_last_lr(self): """ R...
""" Pyncette ships with an optional Prometheus instrumentation based on the official prometheus_client Python package. It includes the following metrics: - Tick duration [Histogram] - Tick volume [Counter] - Tick failures [Counter] - Number of currently executing ticks [Gauge] - Task duration [Histogram] - Task volum...
from alc import dyn # example of metadata to be added in VSD WAN Service: # "rd=3:3,vprnAS=65000,vprnRD=65000:1,vprnRT=target:65000:1,vprnLo=1.1.1.1" # example of tools cli to test this script: tools perform service vsd evaluate-script domain-name "l3dom1" type vrf-vxlan action setup policy "py-vrf-vxlan" vni 12...
from abaqusConstants import * from .GeometricRestriction import GeometricRestriction from ..Region.Region import Region class SlideRegionControl(GeometricRestriction): """The SlideRegionControl object defines a slide region control geometric restriction. The SlideRegionControl object is derived from the Geome...
# -*- coding: utf-8 -*- """ ------------------------------------------------- @File : test_RPSprepare.py Description : @Author : pchaos tradedate: 18-5-16 ------------------------------------------------- Change Activity: 18-5-16: @Contact : p19992003#gmail.com --...
from amigocloud import AmigoCloud # Use amigocloud version 1.0.5 or higher to login with tokens # This will raise an AmigoCloudError if the token is invalid or has expired ac = AmigoCloud(token='<token>') query = ({ "author": "", "extra": "", "layer_name": "0", "name": "My first basela...
#!/usr/bin/env python3 from bank.user import User from bank.account import Account carter = User("Carter", 123, 1) account = Account(123, 1000, "checking") print("{} has account number {} with a pin number {}".format(carter.name, carter.account, carter.pin_number)) print("{} account with account number {} has balanc...
from setuptools import setup, find_packages setup( name='s3filesmanager', version='0.5.3', description='AWS S3 files manager', #long_description=open('docs/index.rst').read(), author='Jeffrey Hu', author_email='zhiwehu@gmail.com', url='https://github.com/zhiwehu/s3filesmanager', instal...
import sys sys.path.insert(0, "/work/ml_pipeline/regression_models/") import regression_models import numpy as np from sklearn.model_selection import train_test_split import pipeline from processing.data_management import load_dataset, save_pipeline from config import config from regression_models import __version__ as...
# Generated by Django 2.1.7 on 2019-03-06 19:18 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('project', '0005_auto_20190220_1112'), ] operations = [ migrations.AlterField( model_name='activeproject', name='proj...