text
stringlengths
3.07k
22.1k
""" This script generates a pandadoc.hpp file representing the Python wrappers that can be parsed by doxygen to generate the Python documentation. You need to run this before invoking Doxyfile.python. It requires a valid makepanda installation with interrogatedb .in files in the lib/pandac/input directory. """ from _...
__all__ = [ 'Cache', 'NULL_CACHE', ] import collections import contextlib import dataclasses import hashlib import io import logging import os import random import shutil import tempfile import threading from pathlib import Path import g1.files from g1.bases import collections as g1_collections from g1.bases ...
import warnings import numpy as np from numba import njit from joblib import Memory from .utils import loss, compute_covariances location = './cachedir' memory = Memory(location, verbose=0) EPS = 1e-12 def one_update(C_hat, C, a): ''' exact update for the noise/powers ''' Rna = np.linalg.solve(C, a...
from solution import Solution class Fish: def __init__(self, internal_timer: int = 8): self.internal_timer = internal_timer def __repr__(self): return f"{self.internal_timer}" def day_passed(self): self.internal_timer -= 1 if self.internal_timer < 0: self.inte...
import argparse import os import sys sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) from cakechat.utils.env import init_cuda_env init_cuda_env() from cakechat.dialog_model.factory import get_reverse_model from cakechat.dialog_model.model import CakeChatModel from cakechat.dialog_model....
# -*- coding: utf-8 -*- """Generate a Powerpoint file for an event. This script looks for queued jobs within the database and runs them sequentially each minute""" from __future__ import print_function import sys import shutil import datetime import subprocess import random import os import psycopg2.extras from odf....
#!/usr/bin/env python3 """ Functionality for accessing wireless network. Automation of MitM Attack on WiFi Networks Bachelor's Thesis UIFS FIT VUT <NAME> 2016 """ import logging import os import re import subprocess from contextlib import contextmanager from wifimitm.common import WifimitmError from .model import Wir...
from itertools import zip_longest import tensorflow as tf import tensorflow.keras.layers as layers from tensorflow.keras import Model from tensorflow.keras.models import Sequential class BasePolicy(Model): """ The base policy object :param observation_space: (Gym Space) The observation space of the envi...
import networkx as nx import matplotlib.pyplot as plt import numpy as np def draw_physical_network(net, labels=True): edge_density = {} node_density = { l.name : len(l.coder) for l in net.layers.values() } for l in net.layers.values(): for conn in l.connections.values(): k ...
from bs4 import BeautifulSoup, SoupStrainer from datetime import datetime from pytz import timezone, utc import tzlocal from .consts import * from time import mktime def extract_date_from_html(html_page, tz='US/Central'): _span = BeautifulSoup(html_page, 'html.parser', parse_only=SoupStr...
import re import sys from collections import Counter import spacy from nltk.stem import PorterStemmer from tqdm import tqdm try: import en_core_web_sm except ModuleNotFoundError: print("\nPlease run 'pipenv run spacy' before running the main program") sys.exit() nlp = en_core_web_sm.load(disable=["parser...
import tensorflow as tf def get_signed_grad(input_image, input_label, pretrained_model, loss_object, target=None): with tf.GradientTape() as tape: tape.watch(input_image) prediction = pretrained_model(input_image) if target is None: loss = loss_object(input_label, prediction) ...
from pyomrx.utils.env_utils import debug_mode import pandas as pd from PIL import Image from imutils.perspective import four_point_transform from scipy.spatial.distance import euclidean from pyomrx.core.exceptions import * import cv2 from pathlib import Path from pyomrx.utils.cv2_utils import load_and_check_image, ext...
# Copyright 2017 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 by applicable law or a...
from designer.helper_functions import FakeSettingList, get_designer from designer.uix.settings import SettingListContent from designer.undo_manager import PropOperation from kivy.core.window import Window from kivy.properties import ( BooleanProperty, ListProperty, NumericProperty, ObjectProperty, O...
import csv import codecs import matplotlib.pyplot as plt import numpy as np import os import pandas as pd import re import statistics from a0001_retrieve_meta import retrieve_path from a0001_retrieve_meta import clean_dataframe from find_color import find_color def analyze_general(name_article): """...
import sys from pathlib import Path import requests import requests.auth import json from bs4 import BeautifulSoup import shortuuid as suuid from error.AuthError import AuthError from error.LoginError import LoginError LOGIN_SERVER = 'https://login.questrade.com/oauth2/' \ 'token?grant_type=refresh_to...
import numpy as np import numpy.matlib import scipy as sp import scipy.io as sio import inspect import pdb from numbers import Number import warnings import pdb singleton = None class Result: def __init__(this, name, passes=0, total=0): this.name = name this.passes = float(passe...
import os import time import requests import numpy as np import pandas as pd SECONDS_IN_A_WEEK = 604800 """int: number of seconds in a week. Used for storing and forecasting interval specification""" def deltatime(time): """ Helper function that generates a difference in seconds between the deal moment and th...
#!/usr/bin/env python import numbers import numpy as np import pycuda.driver as drv import pycuda.elementwise as elementwise import pycuda.gpuarray as gpuarray from pycuda.tools import dtype_to_ctype # List of available numerical types provided by numpy: # XXX This try/except is an ugly hack to prevent the doc buil...
#!/usr/bin/env python """ This file contains the DMI class, which does all of the direct image modifications, state parsing, and general DMI interactions for the wall transformer script. """ import os, sys, re, math from PIL import Image, PngImagePlugin nasty_hardcoded_state_list = [ "1-i", "2-i", "3-i", "4-i", "1-...
import torch from torch import nn as nn from rlkit.pythonplusplus import identity import numpy as np class CNN(nn.Module): # TODO: remove the FC parts of this code def __init__( self, input_width, input_height, input_channels, output_size, ...
#!/usr/bin/env python import requests import json import time from urlparse import urlparse # Needs to be run in a Stackstorm virtualenv from st2actions.runners.pythonrunner import Action class ProjectAndStageId(object): staging_successful = 'staging_successful' staging_failed = 'staging_failed' stagin...
import pandas as pd import os import glob import click from tqdm import tqdm import numpy as np from sklearn.ensemble import RandomForestClassifier from sklearn.inspection import permutation_importance from sklearn.model_selection import train_test_split from sklearn.neural_network import MLPClassifier from sklearn.met...
import subprocess import jira import os import sys import argparse from urllib.parse import quote jiraURL = 'https://issues.cask.co/' jiraAgentUsername = 'releaseAgent' class ReleaseNote(): """ Class to hold data for a release note """ def __init__(self, id, releaseNote, issueType): self.id = id ...
import numpy as np import sys import json import random import lib import model_base import model_normal import data import helper_datasources import config sys.path.append(config.mscoco_dir) from pycocotools.coco import COCO from pycocoevalcap.eval import COCOEvalCap from pycocoevalcap.meteor.meteor import Meteor fr...
# barycentric interpolation tool # just 3 glyphs # now, how to get your glyphs in there? # drag the pointer to a corner and do control-click to get the menu # select any glyph from any open UFO import AppKit import math import vanilla from mojo.canvas import Canvas, CanvasGroup import mojo.drawingTools as ctx from fo...
# -*- coding: utf-8 -*- """ Created on Fri Sep 14 12:08:40 2018 @author: Jon """ import geopandas as gpd import numpy as np import rivgraph.geo_utils as gu import rivgraph.ln_utils as lnu import rivgraph.im_utils as iu def prune_network(links, nodes, shoreline_shp, inlets_shp, skel_gdobj): ...
import os import sys import numpy as np import matplotlib.pyplot as plt import keras.backend as K from keras.models import Model from keras.layers import Input, LSTM, GRU, Dense, Embedding, \ Bidirectional, RepeatVector, Concatenate, Activation, Dot, Lambda from keras.preprocessing.text import Tokenizer from keras.pr...
from cachalot.api import invalidate from cacheops import invalidate_obj from crispy_forms.bootstrap import Field, InlineRadios, PrependedText from crispy_forms.helper import FormHelper from crispy_forms.layout import HTML, ButtonHolder, Div, Layout, Submit from django import forms from django.conf import settings from ...
""" GeoReport v2 Server ------------------- Open311 GeoReport v2 Server implementation written in Flask. :copyright: (c) Miami-Dade County 2011 :author: <NAME> (@julianbonilla) :license: Apache License v2.0, see LICENSE for more details. """ from data import service_types, service_definitions,...
import discord from discord.ext import commands import os import json import inspect import io import textwrap import traceback import aiohttp from contextlib import redirect_stdout import base64 import json bot = commands.Bot(command_prefix=commands.when_mentioned_or('_')) bot.remove_command('help') @bot.event async...
from decimal import Decimal from django.core.validators import MaxValueValidator from django.db import models from django.utils.translation import ugettext_lazy as _ from django.core.urlresolvers import reverse from django.utils.encoding import python_2_unicode_compatible from autoslug import AutoSlugField from mptt.f...
import os import h5py import glob import shutil import numpy as np import pandas as pd import datetime as dt from dateutil.relativedelta import relativedelta from ftplib import FTP import matplotlib.pyplot as plt from matplotlib.colors import LogNorm import geopandas as gpd from shapely.ops import cascaded_...
from time import sleep import logging import string def to_be_foreground(func): #A safety check wrapper so that certain checks don't get called if menu is not the one active def wrapper(self, *args, **kwargs): if self.in_foreground: return func(self, *args, **kwargs) else: ...
# roi.py # region-of-interest setting dialog for background modeling # KMB import os import wx from wx import xrc import motmot.wxvideo.wxvideo as wxvideo import numpy as num import scipy.ndimage.morphology as morph import codedir import imagesk from params import params RSRC_FILE = os.path.join(codedir.codedir,'xr...
from panda3d.core import * from operator import itemgetter import random import itertools __all__ = ['Grid3D', 'Tileset', 'generate_level'] def frange(start, stop, step): r = start while r < stop: yield r r += step def num_range(start, step, num): count=0 while count<num: yiel...
from os import sys, path as osp sys.path.append(osp.dirname(osp.dirname(osp.dirname(__file__)))) import random import argparse import warnings import numpy as np from tqdm import tqdm import matplotlib.pyplot as plt import torch from torch_geometric.nn import GNNExplainer from models import GAT from graphlime import...
from __future__ import annotations import asyncio import logging from typing import TYPE_CHECKING, Coroutine, Optional from .channel import Channel from .guild import Guild from .member import Member from .message import Message from .user import ClientUser, User from .role import Role from .invite import Invite if ...
import logging from pandas import Timestamp import pytest from helpers import get_datapath from openghg.standardise.surface import parse_noaa mpl_logger = logging.getLogger("matplotlib") mpl_logger.setLevel(logging.WARNING) # Disable this for long strings below - Line break occurred before a binary operator (W503) #...
from Settings import * from Functions import * def main(): global SCREEN, FPSCLOCK # set These two variable as global variable so that they can be used in other functions -- scope ( LEGB ) pygame.init() # method in module -- pygame FPSCLOCK = pygame.time.Clock() SCREEN = pygame.display.set_mode((SCREEN...
# from learning_to_simulate import connectivity_utils # from learning_to_simulate import graph_network import paddle import connectivity_utils_paddle import graph_network_paddle import paddle.nn as nn import numpy as np import pgl STD_EPSILON = 1e-8 class LearnedSimulator(object): def __init__( self, ...
# MIT License # # Copyright (C) 2021. Huawei Technologies Co., Ltd. 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 th...
# -*- coding: utf-8 -*- from calendar import timegm from datetime import datetime, timedelta from logging import getLogger try: from queue import Queue, Full except ImportError: from Queue import Queue, Full # Python 2 from socket import gethostname from threading import Thread from time import time try: f...
#! /usr/bin/env python # encoding: utf-8 # WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file import heapq,traceback try: from queue import Queue,PriorityQueue except ImportError: from Queue import Queue try: from Queue import PriorityQueue except ImportError: class PriorityQueue(Queu...
# @title: container.py # @author: <NAME> # @date: 15.06.2021 # Imports import torch.optim as optim from dataclasses import dataclass from typing import Any from torch.utils.tensorboard import SummaryWriter import numpy as np from enum import Enum # Code class FrameType(Enum): Single = 0 Stacked2D ...
from dataclasses import dataclass, field from typing import Sequence, Set, List, Optional, Callable, Any from enum import Enum from math import inf from abc import ABC, abstractmethod class FieldNames(Enum): WORD = 0 LEMMA = 1 TAG = 2 ENTITY = 3 @dataclass(frozen=True) class Field: field: FieldN...
import cv2 from sensor.cam_estimate_laser_angle import load_img_as_grey_with_threshold, show_image, \ load_img_as_grey_with_threshold_erosion_dilation from sensor.distance_from_files import load_dir, cam_angles_and_laser_angles_from_file, distances_from_image from sensor.distance_from_files import cam_angles_from_...
import torch from torch import Tensor from .optimizer import Optimizer from typing import List, Optional class Adamax(Optimizer): r"""Implements Adamax algorithm (a variant of Adam based on infinity norm). .. math:: \begin{aligned} &\rule{110mm}{0.4pt} ...
import random from collections import deque from flow_control import * from debug_utils import * class Request(): def __init__(self, _id, src_id, dst_id, serv_time): self._id = _id self.src_id = src_id self.dst_id = dst_id self.serv_time = serv_time self.epoch_departed_client = None self.epoch_arrived_n...
from glob import glob import json import logging import os import importlib_resources import urllib.parse from contextlib import ExitStack import atexit import socketio from gevent import pywsgi from geventwebsocket.handler import WebSocketHandler from flask import Flask, redirect, send_from_directory, Response, rend...
import argparse import re import random from os import walk from heapq import nlargest random.seed(None) LEVELS = ['choice', 'fill', 'fill_all'] def get_default_bunches(): bunches = [] txtre = re.compile(r'words-\d+.txt') for (dirpath, dirnames, filenames) in walk('./words'): for filename in file...
"""Manager for interacting with VKontakte""" import asyncio import json import re from collections import namedtuple from random import random import aiohttp from kutana.logger import logger from kutana.manager.manager import Manager from kutana.manager.vk.environment import VKEnvironment from kutana.plugin import At...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # Copyright 2020-2021 by <NAME>. All rights reserved. This file is part # of the Robot Operating System project, released under the MIT License. Please # see the LICENSE file included as part of this package. # # author: <NAME> # created: 2020-10-05 # modified: 2021-0...
########################################################## # Standard Library Imports import os import datetime import json from collections import defaultdict ########################################################## # Third Party Imports import numpy as np import pandas as pd ######################...
""" Text manipulation utilities ================================================================================================== This module contains functions for manipulating texts. Functions in this module ---------------------------------------------------------------------------------------- """ import re ...
from __future__ import division from __future__ import print_function import os import networkx as nx import sys import glob import time import random import argparse import scipy.sparse as sp from scipy.sparse import coo_matrix import numpy as np from sklearn.metrics import recall_score from sklearn.metrics import p...
#!/usr/bin/env python3 """ Run with a repo/build number or list of Travis CI build times to show the optimal build order to run faster and make full use of all available parallel build jobs. Requires the Travis Client CLI https://github.com/travis-ci/travis.rb#installation # Example $ # Check build 22 of hugovk/num...
############################################################################## # # Copyright (c) 2004 Zope Foundation and Contributors. # All Rights Reserved. # # This software is subject to the provisions of the Zope Public License, # Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. # THIS SOF...
from whoosh.analysis import * from whoosh.index import create_in from whoosh.qparser import * from whoosh.fields import * from whoosh import scoring from whoosh import index import csv import statistics import numpy as np import matplotlib.pyplot as plt import math import itertools def mrr(gt, se): sum = 0 fo...
# -*- coding: utf-8 -*- from __future__ import unicode_literals import frappe __version__ = '0.0.1' def is_app_for_actual_site() -> bool: """ When overriding Frappe or other apps methods, it allow us to set that specific override to the actual `site app`. Used when multi tenancy (multisites) is on. :rtype: bo...
#!/usr/bin/env python # coding: utf-8 # # Thực hiện học trên model # # In[1]: # import import random import math import time import pandas as pd import numpy as np import torch import torch.utils.data as data import torch.nn as nn import torch.nn.functional as F import torch.optim as optim # In[2]: # Thiết địn...
""" Cache API class. """ from __future__ import print_function import os import shutil from dbcollection.core.manager import CacheManager from dbcollection.utils import nested_lookup def cache(query=(), delete_cache=False, delete_cache_dir=False, delete_cache_file=False, reset_cache=False, reset_path_cac...
import errno from typing import Any import pytest from alsa_midi import (Address, ALSAError, Port, PortCaps, PortInfo, PortType, SequencerClient, alsa, ffi) from alsa_midi.port import get_port_info_sort_key @pytest.mark.require_alsa_seq def test_port_create_close(): client = SequencerCli...
# -*- coding: utf-8 -*- from email import utils, charset from email.mime import multipart, text, application from os import path import re from watson.common.imports import get_qualified_name from watson.mail import backends __all__ = ['Message'] TAG_REGEX = re.compile(r'<[^>]+>') class Address(object): """An i...
#!/usr/bin/env python """ Thumpy web process to resize images. """ import argparse import os import traceback import yaml from six.moves.urllib.parse import parse_qsl from six import BytesIO try: from collections import OrderedDict except ImportError: from ordereddict import OrderedDict from PIL import Im...
from product import Product from category import Category from users import Users from bill import Bill from prettytable import PrettyTable import getpass logged_in_admin_id = None selected_user_id = None selected_customer_id = None from firebase_admin import db from db import db_obj, Db def print_product_by_id(...
from tkinter import * from PIL import ImageTk from tkinter import messagebox import pymysql from tkinter.ttk import Treeview from tkinter import ttk import import_ipynb from datetime import datetime import Manufacturer_View import Buyer_View import Billing_Software root = Tk() root.title('Login Page') root.geometry('6...
""" MIT License Copyright (c) 2021 <NAME> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distri...
import pandas as pd import numpy as np import glob import segmentation_models_pytorch as smp import torch.nn as nn import torch import cv2, os, time, platform from PIL import Image from matplotlib import pyplot as plt from tqdm import tqdm from torch.utils.data import DataLoader, Dataset from albumentations.pytorch imp...
import glob import json import math import os import re import shutil import string import tarfile import time import typing import pyrogram from apscheduler.schedulers.background import BackgroundScheduler from apscheduler.triggers.cron import CronTrigger from pytz import utc import db_management ...
"""\ Code for converting .IMG files from the Harry Potter PS1 games into usable image files. """ import struct import os from typing import List, Tuple, Union, Optional import numpy as np from PIL import Image # sizes in bytes FULLSCREEN_SIZE = 262144 STORY_SIZE = 123392 TEXT_SIZE = 72192 # dimensions FULLSCREEN_DI...
# Copyright 2016 SAP SE # 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 applic...
import pickle import re import textwrap from collections import namedtuple from pathlib import Path from typing import List from sphinx.ext.intersphinx import fetch_inventory InventoryInfo = namedtuple( "InventoryInfo", ["domain", "priority", "uri", "display_name"] ) Settings = namedtuple( "Settings", [ ...
# constraints.py # <NAME> # Last updated: 6/28/18 # Major modification log: # # 2018-06-01 ra - created module # import math # import copy - pylint say unused, test if rming breaks anything. import itertools import numpy as np import programs.engine.cenquery as cenquery class AbstractConstraintsCreator: """ Ne...
import numpy as np from qutip import * from pylab import * from scipy.fftpack import fft import matplotlib.pyplot as plt import yaml from scipy.interpolate import interp1d class parameters: def __init__(self, wc, wq, eps, g, chi, kappa, gamma, t_levels, c_levels): self.wc = wc self.wq = wq ...
# sdssobj.py # ALS 2017/05/11 """ define class sdssobj, which can check whether there is such an object and load xid """ import os import numpy as np import astropy.coordinates as ac import astroquery import astropy.table as at from astropy.io import fits import astropy.units as u import astropy.io.ascii import requ...
########################################## # Duino-Coin API Module # https://github.com/revoxhere/duino-coin # Distributed under MIT license # © Duino-Coin Community 2021 ########################################## import hashlib import json import os import queue import socket import sys import threading import time im...
import nengo import numpy as np class DecoderNode(nengo.Node): def __init__(self, size_in): super(DecoderNode, self).__init__(None, size_in=size_in, label='') class ProbeNode(nengo.Node): def __init__(self, size_in): super(ProbeNode, self).__init__(output=self.collect, ...
# -*- coding: utf-8 -*- """ Test pylti/test_common.py module """ import unittest import semantic_version import httpretty import oauthlib.oauth1 from six.moves.urllib.parse import urlencode, urlparse, parse_qs import pylti from pylti.common import ( LTIOAuthServer, verify_request_common, LTIException, ...
'''Train CIFAR10 with PyTorch.''' import sys sys.path.append("/home/shuxuang/eval-code/SSD") # sys.path.append("/workspace/code/SSD") import torch import torch.nn as nn import torch.optim as optim import torch.nn.functional as F import torch.backends.cudnn as cudnn import torchvision import os import argparse import ...
""" MIT License Copyright (c) 2021 <NAME> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distri...
import svgwrite from collections import namedtuple class Dimensions: def __init__(self, grid_cols, grid_rows, max_text_size, max_label_width, legend_items): self.image_margin = 10 self.character_height = 8 self.character_width = 6.42 # tested with Chromium, hopefully it is the same in other...
import io import os import socket import tempfile import unittest from textwrap import dedent from unittest.mock import Mock from unittest.mock import patch from plumbum.machines.paramiko_machine import ParamikoMachine from sshkernel.ssh_wrapper_plumbum import SSHWrapperPlumbum from sshkernel.ssh_wrapper_plumbum impo...
import numpy as np import cv2 import matplotlib.path as mplPath import pathlib final_robots_pixels_coords = [] def find_point(x1_1,y1_1,x1_2,y1_2,x2_1,y2_1,x2_2,y2_2): A1 = y1_1 - y1_2 B1 = x1_2 - x1_1 C1 = x1_1*y1_2 - x1_2*y1_1 A2 = y2_1 - y2_2 B2 = x2_2 - x2_1 C2 = x2_1*y2_2 - x2_2*y2_1 ...
from __future__ import print_function import logging import click_logging from dbnd._core.cli.utils import with_fast_dbnd_context from dbnd._core.constants import AlertDefOperator, AlertSeverity, RunState, TaskRunState from dbnd._core.errors.base import DatabandApiError from dbnd._core.utils.basics.text_banner impor...
import hashlib from django.db import models from django.db.models import Q from athanor.utils.text import partial_match from evennia.utils.utils import lazy_property from evennia.typeclasses.models import SharedMemoryModel class MushObject(models.Model): obj = models.OneToOneField('objects.ObjectDB', related_name...
import requests import json import sys import math from optparse import OptionParser sys.path.append('../') from config import config requests.packages.urllib3.disable_warnings() ######################################################################## ##################################### ######## Required Variables ...
# coding=utf-8 """ flask_resteasy.processors ~~~~~~~~~~~~~~~~~~~~~~~~~ """ from abc import abstractmethod from flask import request from inflection import pluralize from flask_resteasy.errors import UnableToProcess class RequestProcessor(object): """Base class for request processors. :param cfg: ...
"""Storage for change and authentication history.""" from __future__ import annotations from datetime import datetime from typing import Optional from sqlalchemy import and_, func, or_ from sqlalchemy.ext.asyncio import AsyncSession from sqlalchemy.future import select from sqlalchemy.sql import Select, text from ....
from keras.models import Model from keras.layers.convolutional import ZeroPadding2D from keras.layers import Input, concatenate, Conv2D, MaxPooling2D, Conv2DTranspose from keras.utils.vis_utils import plot_model from keras.callbacks import EarlyStopping from keras.optimizers import Adam import h5py def read_dataset(p...
""" Source code for ESPNet. Heavily based on https://github.com/sacmehta/ESPNet/blob/master/test/Model.py. Only the CustomESPNet was added as wrapper. """ import os import torch import torch.nn as nn from daain.backbones.esp_net.layers import BR, CBR, C, DilatedParllelResidualBlockB, DownSamplerB from daain.backbones...
# -*- coding: utf-8 -*- # @Author: yilin # Python version: 2.7 # GUI reference: https://github.com/lancebeet/imagemicro import os import sys import math import argparse from PIL import Image from PIL import ImageTk import Tkinter import tkFileDialog import numpy as np import cv2 from doc_scanner import ( get_d...
import os from flask import jsonify, request, send_from_directory from blockchain_view.node_web_view import NodeWebView __node_web = NodeWebView() _DEFAULT_UI_PATH = '../blockchain_ui/' # TODO check if all the http status codes are correct and the messages are not duplicated def start_node_server(config_info): ...
import os, json, time, pickle, time, gc import pandas as pd import numpy as np import tensorflow as tf from sklearn.model_selection import StratifiedKFold from sklearn.metrics import f1_score, accuracy_score from build_model import build_model from utils import train_model_cv, index_word_embeddings, prepare_embedding_m...
from datetime import datetime import httpx import pytest import respx from gevent.lock import RLock from gevent.pool import Pool from gevent.queue import JoinableQueue from selenium.common.exceptions import WebDriverException, NoSuchElementException from selenium.webdriver.remote.webdriver import WebDriver from scalp...
#!/usr/bin/env python ''' CyberGate Config Decoder ''' __description__ = 'CyberGate Config Extractor' __author__ = '<NAME> http://techanarchy.net' __version__ = '0.1' __date__ = '2014/03/15' import sys import string from optparse import OptionParser import pype32 def run(rawData): #try: rawconfig = rawData.split...
import itertools import random import numpy as np try: import gym from gym import spaces if gym.__version__ != '0.10.5': print("Gym version!=0.10.5. Update to latest gym or verify you have FetchX-v1s envs") except ImportError as e: print('Could not load gym. Robotics environments ...
import json import logging import os import tempfile import paramiko import pysftp from django.conf import settings from django.core.exceptions import ValidationError from django.utils import timezone from django.utils.translation import ugettext_lazy as _ from paramiko.py3compat import decodebytes from laske_export....
import json import pathlib import pytest import requests from requests.exceptions import ConnectionError def is_responsive(url): try: response = requests.get(url) if response.status_code == 200: return True except ConnectionError: return False test_headers = { "Conte...