text
stringlengths
3.07k
22.1k
#!/usr/bin/env python # -*- coding: utf-8 -*- """This module declares the different meanings that the Orbit 6 components can take and their conversions """ from numpy import cos, arccos, sin, arcsin, arctan2, sqrt, arctanh, sinh, cosh import numpy as np from ..errors import UnknownFormError from ..utils.node import...
from django.test import TestCase from django.contrib.auth.models import User from django.urls import reverse from csvexport import apps, settings from csvexport.actions import ModelNode from csvexport.forms import CSVFieldsForm from csvexport.forms import CSVFormatForm from csvexport.forms import UniqueForm from ..m...
import random import numpy as np import cv2 import matplotlib.pyplot as plt # from matplotlib import pyplot as plt import scipy from scipy import signal from PIL import Image from scipy.ndimage import median_filter # 由于卷积核的大小一般是奇数,因此这里假设卷积核是奇数的 ''' #################### 图像处理的基本函数 #################### '''...
import itertools import os import time from datetime import datetime import numpy as np import torch import torchvision.utils as vutils import utils from cyclegan import Generator as cycG from cyclegan import Discriminator as cycD def _weights_init(m): classname = m.__class__.__name__ if classname.find('C...
""" Contains all errors specific to this package. """ import re import sys __all__ = [ 'AccountLimitExceeded', 'AWSError', 'CartInfoMismatch', 'DEFAULT_ERROR_REGS', 'InvalidClientTokenId', 'InvalidSignature', 'InvalidAccount', 'MissingClientTokenId', 'MissingParameters', 'ParameterOutOfRange',...
import re from collections import defaultdict import numpy as np import pandas as pd from terminaltables import DoubleTable from pathlib import Path def weather_table(weather_dict, path): table_data = [] for weather, seeds in weather_dict.items(): successes = [] totals = [] collisions = [] collided_and_s...
import numpy as np import cv2 from sklearn.utils import shuffle from sklearn.model_selection import cross_val_score from sklearn.neighbors import KNeighborsClassifier import matplotlib.pyplot as plt import pandas as pd def single_ch_hist(image, channels, bins, chrange, color): hist = cv2.calcHist(image, channels,...
import discord import asyncio import os import math import feedparser import requests import shlex import database import bom import utils from settings import * from datetime import datetime, time, timezone from random import choice from discord.ext import commands from discord.utils import get import atexit CURR...
# SPDX-License-Identifier: MIT # # Copyright (c) 2020 <NAME> <<EMAIL>> import re import git import glob import tempfile import shutil import subprocess import jenkinsapi import requests import time import hashlib import os from enum import Enum from click import style, echo, confirm, progressbar from datetime import d...
#!/usr/bin/env python # -*- coding: utf-8 -*- """Tests for `ml` package.""" import pytest from click.testing import CliRunner from ml import np from ml import cli from ml.rbms import BernoulliRBM from ml.rbms.core import RBM from ml.rbms.rbm import SimpleBernoulliRBM from ml.rbms.gaussian import GaussianRBM from ml...
#!/usr/bin/env python """ A library and command-line utility for turning an XPJSON PlanSchema document into an HTML-format command dictionary. This tool focuses on the @commandSpecs part of the PlanSchema (and indirectly on the @paramSpecs used by the commands). It doesn't output anything about plan params, station p...
import torch import torch.nn as nn import torch.nn.functional as F from torch.distributions import Categorical, Distribution import torch_ac import math from torch.distributions.utils import _standard_normal, lazy_property # Function from https://github.com/ikostrikov/pytorch-a2c-ppo-acktr/blob/master/model.py def in...
import os import pickle import numpy import music21 import itertools from src import DATA_DIR from src.helpers import save_pickle, load_pickle, get_pitch_space def tokenize(chars): if type(chars) == bytes: chars = chars.decode("utf-8") return chars.replace('(', ' ( ').replace(')', ' ) ').split() def t...
# ___________________________________________________________________________ # # Prescient # Copyright 2020 National Technology & Engineering Solutions of Sandia, LLC # (NTESS). Under the terms of Contract DE-NA0003525 with NTESS, the U.S. # Government retains certain rights in this software. # This software is ...
from torch.utils.data import Dataset from torch.utils.data import Dataset, DataLoader from torch.utils.data.sampler import RandomSampler, SequentialSampler, WeightedRandomSampler from torch.utils.data.distributed import DistributedSampler import torch import cv2 import numpy as np import pandas as pd import numpy as n...
""" In this pretrain-finetune example, we do the following: epoch 1 - 10: pretrain a ResNet9 model on Cifar100 epoch 11-12: freeze the backbone, use a new classification head and finetune on cifar10 data """ import tempfile import fastestimator as fe import torch import torch.nn as nn import torch.nn.functional as fn...
#!/usr/bin/env python """ Translate reg_tracker.txt to a python script using the host_api Usage: regTrackerToPython.py <input_file_name> <output_file_name> [--no_firmware_load] Options: --help Shows this help message. """ from __future__ import print_function from __future__ import absolute_import from __fu...
import cv2 import math import numpy as np import h5py import sys import uuid from joblib import Parallel, delayed from bisect import bisect_left from datetime import datetime, timedelta from sklearn.model_selection import train_test_split from cloudseg.utils.files import get_contained_dirs, get_contained_files from...
from ctypes import pointer, c_float from .bindings import so, FPDF_RECT, FPDF_MATRIX, FPDF_ITEM_INFO from .font import Font import contextlib class PageObject: OBJ_TYPE_TEXT = 1 #: see :class:`TextObject` OBJ_TYPE_PATH = 2 #: see :class:`PathObject` OBJ_TYPE_IMAGE = 3 #: see :class:`ImageObject...
from __future__ import print_function import numpy as np import scipy.sparse as sp import hashlib import warnings import time # from gcn.utils import normalize_adj cupy_is_available = False try: import cupy as cp cupy_is_available = True except ImportError: warnings.warn("cupy is not imported, some operat...
import os import keras import h5py import math import numpy as np import datetime as dt from glob import glob from PIL import Image import cv2 import matplotlib.pyplot as plt import io class Hdf5Sequence(keras.utils.Sequence): def __init__(self, myHd5File, idlist, batch_size): self.srcF...
#!/usr/bin/env python3 # Back Side (HDMI/microUSB) # ------------- [] 17 - Shutdown / Reboot # | PiTFT | [] 22 - IP Address / VNC Server # | Display | [] 23 - Pixel Desktop ("startx") / RetroPie ("emulationstation") # ------------- [] 27 - Toggle Backlight import RPi.GPIO as GPIO import os, ...
import numpy as np import random import tensorflow as tf from lwau import LWAU from tensorflow.python.platform import flags import os from task_generator import TaskGenerator FLAGS = flags.FLAGS flags.DEFINE_integer('metatrain_iterations', 60000, 'number of metatraining iterations.') # Training options flags.DEFINE_...
import datetime import os import random from vod_metadata import default_template_path from vod_metadata.vodpackage import VodPackage __all__ = ["generate_metadata"] IMAGE_EXTENSIONS = [".bmp", ".jpg"] def _check_for_ae(ae_type, movie_name, extensions): ae_safe = ae_type.replace(' ', '_') ae_paths = ['{}_{...
#!/usr/bin/env python3 import argparse from pathlib import Path import numpy as np import statsmodels.api as sm from scipy import stats from matplotlib import pyplot as plt parser = argparse.ArgumentParser( description="Train generalized linear model to get coefficient for each variable." ) parser.add_argument( ...
import datetime from django import forms from django.contrib import admin from django.contrib.admin import SimpleListFilter from django.urls import reverse from ordered_model.admin import OrderedTabularInline from solo.admin import SingletonModelAdmin from taggit.models import Tag from taggit_helpers.admin import Taggi...
# -*- coding=utf-8 -*- from abc import ABC, abstractmethod from itertools import count from textwrap import dedent, indent from typing import AbstractSet, Any, Callable, Container, Generic, Iterable, \ Optional, \ Set, \ TypeVar T = TypeVar("T") INDENTION = " " * 2 class Parser(Generic[T], ABC): @a...
# -*- coding: utf-8 -*- """ Created on Tue Aug 21 13:03:42 2018 @author: <NAME> """ import numpy as np import matplotlib.pyplot as plt from IPython.display import SVG, display #Import Keras objects from keras.models import Model from keras.layers import Input, Flatten, Reshape, Softmax from keras.layers import Dens...
import csv import json import os import random import subprocess from django.conf import settings from django.contrib.auth.models import User from django.db import transaction from django.utils import timezone from django.utils.timezone import localtime from .models import CurriculumDocument, HumanRelevanceJudgment, ...
import argparse import json import logging import random import numpy as np import torch from decouple import config from tqdm import tqdm from GPT2.config import GPT2Config from GPT2.encoder import get_encoder from GPT2.model import GPT2LMHeadModel from GPT2.utils import load_weight # import os # import torch.nn....
#!/usr/bin/env python # Standard library import logging as log import random import sys import unittest from pprint import pprint as pp from unittest import TestCase # Third-party from numpy import array as arr from numpy.testing import assert_almost_equal from shapely.geometry import Point from shapely.geometry impo...
import numpy as np from keras.layers.core import Lambda, Merge from keras.layers.convolutional import Convolution2D from keras import backend as K from keras.regularizers import l1l2, Regularizer from keras.engine import Layer def crosschannelnormalization(alpha = 1e-4, k=2, beta=0.75, n=5,**kwargs): """ ...
from threading import Lock from mesh.standard import OperationError, ValidationError from scheme import Boolean, Text from scheme.supplemental import ObjectReference from sqlalchemy import MetaData, Table, create_engine, event from sqlalchemy.engine.reflection import Inspector from sqlalchemy.exc import NoSuchTableEr...
#! python3 # -*- encoding: utf-8 -*- ''' Current module: rman.app.httpcase.views.testsuite Rough version history: v1.0 Original version to use ******************************************************************** @AUTHOR: Administrator-<NAME>(罗科峰) MAIL: <EMAIL> RCS: rman.app.httpcase.views.tes...
''' Number: 4 This file models sequences of words using the statistical properties of n-grams. I follow the Markov assumption (or independence assumption). As for probabilities, I use and implement the Kneser-Ney Smoothing method. ''' import pandas as pd # --> Unigrams Probabilities (something wrong with this) def kn...
from __future__ import unicode_literals import os from django.shortcuts import get_object_or_404, redirect, render from django.urls import reverse from django.utils.translation import ugettext as _ from django.views.decorators.vary import vary_on_headers from django.core.files import File from wagtail import VERSION ...
# -*- coding: utf-8 -*- from telegram.ext import Updater, MessageHandler, CommandHandler, Filters import os import subprocess import logging import random import numpy import datetime import time import atexit logging.basicConfig( filename='spam.log', level=logging.INFO, format='[%(asctime)s] [%(levelname)...
import codecs import csv import io import os from collections import defaultdict import falcon from addok.config import config from addok.core import reverse, search from addok.helpers.text import EntityTooLarge from addok.http import View, log_notfound, log_query def register_http_endpoint(api): api.add_route(...
# -*- test-case-name: pymeta.test.test_pymeta -*- """ Public interface to OMeta, as well as the grammars used to compile grammar definitions. """ import string from .builder import TreeBuilder, moduleFromGrammar from .boot import BootOMetaGrammar from .runtime import OMetaBase, ParseError, EOFError class OMeta(OMetaBa...
""" Unit tests for ``cidrize``. """ import unittest from netaddr import IPRange, IPNetwork import pytest import cidrize class TestParseBrackets(unittest.TestCase): def test_parse_brackets(self): expected = IPRange("1.2.3.118", "1.2.3.121") _input = "1.2.3.1[18-21]" assert expected == ci...
""" """ import os import tempfile import unittest from .context import fabulist class BasicTestSuite(unittest.TestCase): """Basic test cases.""" def setUp(self): self.fab = fabulist.Fabulist() self.temp_path = None def tearDown(self): self.fab = None if self.temp_path: ...
import sys import numpy as np import torch import os from tqdm import tqdm, trange sys.path.append("..") import moviepy.editor as mpy import env import gym import pickle from gym import spaces from mpl_toolkits.mplot3d import Axes3D import matplotlib.pyplot as plt from config import argparser from config.motion_plan...
import re import sys import PySimpleGUI as sg from tkinter import filedialog from tkinter import * data_file = [] files = [] if len(sys.argv) == 1: layout = [[sg.Text('Document to open')], [sg.In(), sg.FileBrowse()],[sg.CloseButton('Open'), sg.CloseButton('Cancel')]] window = sg....
import argparse from torch.nn import functional from mdptetris_experiments.agents.action_networks import NN1DAction import os import random import time from collections import deque import numpy as np import torch from gym_mdptetris.envs import board, piece, tetris from gym_mdptetris.envs.tetris import TetrisFlat fro...
import cv2 import numpy as np import trackpy as tp import pandas as pd from ..general.parameters import get_param_val, get_method_key from ..track import intensity_methods as im from ..customexceptions.track_error import * from ..user_methods import * ''' -------------------------------------------------------------...
#!/usr/bin/env python # 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 # "Li...
# Third Party import pytest # Local import bel.lang.parse from bel.lang.ast import BELAst from bel.schemas.bel import Pair # TODO test reading in a string from a file doesn't remove the escape backslash def test_ordered_pairs(): """Matching left, right pairs of characters""" left = [10, 20, 40, 50, 70] ...
import pytest import numpy as np from funkyAD.base import AD, grad, Node from funkyAD.functions import addition, multiplication, division, floordiv, power, sign, r_der, pos, neg, _abs, invert, _round, floor, ceil, trunc, exp, sin, cos, tan # to do: # deal with int, float, long # test new methods # test AD class def...
""" Created on Thu Sep 28 15:17:50 2017 @author: zqwu """ import numpy as np import tensorflow as tf import copy import sys from deepchem.metrics import to_one_hot, from_one_hot from deepchem.models import KerasModel, layers from deepchem.models.losses import L2Loss, SoftmaxCrossEntropy from deepchem.trans import und...
# Copyright © 2012-2021 <NAME> <<EMAIL>> # # 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,...
import bge from resources import increase_resource from mathutils import Vector, noise import random class Unit(bge.types.KX_GameObject): def __init__(self, own): pass def select(self): pass class Ant(bge.types.BL_ArmatureObject): antlist = [] def __ini...
import os import sys import math import random import numpy as np from datetime import datetime sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) import data_utils def _stoke_decoding(stoke): lift_pen_padding = 2.0 lines = [] points = [] x_prev = 0 y_prev = 0 was_dr...
# Copyright 2016 <NAME> # # 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, softwa...
import random import random import sys import time from lib import game_object from lib.ascii import print_warrior, print_mage, print_rogue from lib.fight import fight_setup from lib.guards import BridgeGuard from lib.map import zonemap, solved_places from lib.npc import Spell from lib.player import myPlayer from lib....
"""Provide functions to write the Order Parameters into files.""" import numpy as np # For debugging. # TODO: Remove it after implement logging feature DEBUG=False def pandasdf2pdb(df): """Return a string in PDB format from a pandas dataframe. Parameters ---------- df : pandas dataframe with columns...
import matplotlib import matplotlib.pyplot as plt import json import jinja2 import os def _get_node_names(df): ''' :param df: pandas DataFrame, each column represents a state :return: dictionary of (column name, column unique value list) which means (state name, unique values in t...
import argparse import torch from rl import rl_model, omss_env, rl_utils from utils import config as cfg import torch.nn.functional as F import torch.nn as nn import numpy as np from sklearn.model_selection import train_test_split import os import wandb from tqdm import tqdm import time device = torch.device('cuda' i...
import base64 try: from hashlib import md5 except ImportError: from md5 import md5 import os.path import re import shutil from definitions import Style import res from lib.log import debug, exception from lib import zipdir from paths import TMP_PATH import world class Map(object): map_string = None ...
import hashlib import importlib from collections import namedtuple from datetime import datetime import pytest import pytz import requests from asn1crypto import tsp, algos, core, cms, ocsp from freezegun import freeze_time from oscrypto import asymmetric, symmetric from pyhanko_certvalidator import ValidationContext,...
# -*- coding: utf-8 -*- import os import socket import json import logging import uuid as _uuid # noinspection PyCompatibility from . import exceptions logger = logging.getLogger('samsungctl') LOGGING_FORMAT = '''\ [%(levelname)s][%(thread)d] %(name)s.%(module)s.%(funcName)s %(message)s ''' class CEC(object): ...
from sdk.db import database import os import json from sdk.db.mongo.schema import ClassInfo from sdk.db.mongo.schema import Section from bson.objectid import ObjectId from utils import logger def get_class_info(sc, cn, it, im): try: res = ClassInfo.objects.get( sc=sc, cn=cn, it=it, im=im) ...
# Copyright (c) 2017 Sony Corporation. 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 applicabl...
"""Tests for :py:class:`rasterio.warp.WarpedVRT`.""" from __future__ import division import affine import boto3 import pytest import rasterio from rasterio.crs import CRS from rasterio.enums import Resampling from rasterio import shutil as rio_shutil from rasterio.vrt import WarpedVRT from rasterio.warp import tran...
# -*- coding: utf-8 -*- # Copyright (c) 2017 SoftBank Robotics Europe. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """ Sequencer features """ import os import time import pytest from itertools import product from wooqi.src import global_va...
""" Useful neuroimaging coordinate map makers and utilities """ import numpy as np from .coordinate_system import CoordSysMaker from .coordinate_map import CoordMapMaker from ..transforms.affines import from_matrix_vector scanner_names = ['scanner-' + label for label in 'xyz'] + ['t'] mni_names = ['mni-' + label for...
"""A switch driver for the Nexus 5500 Currently the driver uses telnet to connect to the switch's console; in the long term we want to be using SNMP. """ import re from schema import Schema, Optional, And, Use import logging from hil.model import db, Switch from hil.ext.switches import _console from hil.errors impor...
import torch import torch.nn as nn import numpy as np from abc import ABC, abstractmethod import pandas as pd import json import bdmodule.bd_utils as bd_utils #from module.data_loading_fromlocal import read_turkprob class UserSimulator(ABC): @abstractmethod def answer(self ): pass class NoisyUser(Us...
# # Copyright 2015-2020 <NAME> <<EMAIL>> # # 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 ...
import collections from typing import List import numpy as np import torch from genrl.agents.deep.dqn.base import DQN def ddqn_q_target( agent: DQN, next_states: torch.Tensor, rewards: torch.Tensor, dones: torch.Tensor, ) -> torch.Tensor: """Double Q-learning target Can be used to replace the `get_targ...
# -*- coding: utf-8 -*- import logging from pathlib import Path def add_map_style(sum): ''' Write the map style element to the HTML header ''' logging.debug('Write the map style element to the HTML header') sum.write('<style>\n') sum.write(' #map {\n') sum.write(' height: 400px;\n') ...
import os import csv import glob import argparse import subprocess import pysam import pybedtools from math import floor from statistics import mean, stdev def get_reads(sample, readdir): r1 = glob.glob(f'{readdir}/{sample}_*R1*.gz')[0] r2 = glob.glob(f'{readdir}/{sample}_*R2*.gz')[0] return r1, r2 de...
import numpy as np import numpy.ma as ma from PIL import Image from dataclasses import dataclass from skimage.transform import resize import time from typing import Tuple nsamples = 2 width, height = 600, 400 # virtual width/height for FSAA vwidth, vheight = width * nsamples, height * nsamples bg_color = (0.2, 0.7, 0....
import datetime, os from typing import List, Dict from flask import ( Flask, jsonify, request, Response, make_response, render_template, send_from_directory, ) from ...libs import json_lib, converter_lib, io_lib from ...models.main import AlphaException from ._parameter import Parameter f...
""" Cluster ======= This filter will identify clusters of atoms in the system. It uses a recursive algorithm to build the clusters using a fixed cut-off. There are options to calculate the volumes of the clusters and also to draw convex hulls around the clusters to highlight them. Parameters are: .. glossary:: ...
"""FFmpeg writer tests of moviepy.""" import multiprocessing import os from PIL import Image import pytest from moviepy.video.compositing.concatenate import concatenate_videoclips from moviepy.video.io.ffmpeg_writer import ffmpeg_write_image, ffmpeg_write_video from moviepy.video.io.gif_writers import write_gif fro...
# # Analytics server # import pickle import jsonpickle import platform import json import io import os import sys import pika import numpy as np import pandas as pd import matplotlib.pyplot as plt import seaborn as sns from PIL import Image import datetime sns.set() from sklearn.metrics import r2_score, median_absolu...
import numpy as np import math import random import h5py A=0.01 class act:#激活函数 def sigmoid(x): return 1.0/(1.0+np.exp(-x)) def tanh(x): return (np.exp(x)-np.exp(-x))/(np.exp(x)+np.exp(-x)) def none(x): return x def relu(x): return 1 * (x > 0) * x def leaky_relu(x): ...
import datetime import requests from django.shortcuts import render, redirect from django.http import request, HttpResponse, HttpResponseRedirect from django.contrib.auth.decorators import login_required, user_passes_test from django.contrib import messages from django.core.paginator import Paginator from django.contr...
""" Module description ... Reference: - Surename1, Forename1 Initials., Surename2, Forename2 Initials, YEAR. Publication/Book title Publisher, Number(Volume No), pp.142-161. """ import sys import numpy as np import numpy.ma as ma from operator import itemgetter from scipy.integrate import solve_ivp from functools imp...
import sifutil import numpy as np import re import requests from bs4 import BeautifulSoup import pandas as pd import warnings import numpy as np # from mpl_toolkits.basemap import Basemap, cm import math from math import sin, cos, sqrt from pyproj import Proj, transform # requires netcdf4-python (netcdf4-py...
"""Build_Cloudtrail_Table Create the CloudTrail Logs table for Athena use. See the AWS documentation for Athena here: http://docs.aws.amazon.com/athena/latest/ug/getting-started.html """ import os import sys import json from datetime import datetime, timedelta import logging import boto3 from botocore.exception...
import cv2, os, sys import numpy as np import imutils as iu import sudoku_solver as solver class ocrClass: def __init__(self): samples = np.loadtxt('ml/generalsamples.data',np.float32) responses = np.loadtxt('ml/generalresponses.data',np.float32) responses = responses.reshape((responses.si...
import asyncio import datetime import json import logging import pathlib import ssl import sys import traceback import urllib import websockets from os import path MAX_SYMBOLS = 50 # Hard limit imposed by FinnHub class FinnhubClient: """ Maintains a websocket connection with the FinnHub data source. Keeps track...
""" LIP predictor This script allows the user to train and/or test a classifier of Linear Interacting Peptides in protein structures (PDBs). """ import argparse from os import mkdir, path from os.path import isdir, isfile, abspath import logging import configparser import pandas as pd import numpy as np from lip_fea...
import os,time import numpy as np import rawpy import glob, scipy.io import torch import torch.nn as nn import torch.optim as optim from tensorboardX import SummaryWriter from model import SeeInDark from net_canny import Net from pytorch_msssim import MSSSIM saveimg = True ps = 512 #patch size for training device =...
from .utils import decompress_mesh_data from ..skeleton import Skeleton from ..trimesh_io import Mesh import h5py import os import orjson import pandas as pd import warnings import numpy as np from dataclasses import asdict warnings.simplefilter(action="ignore", category=pd.errors.PerformanceWarning) NULL_VERSION = 1...
# Lint as: python2, python3 # Copyright 2018 The TensorFlow Authors All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # #...
# 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...
import os import re import sys import ast import astor import nbformat from nbconvert import PythonExporter from scalpel.core.mnode import MNode from scalpel.SSA.ssa import SSA from scalpel.util import get_path_by_ext # we need to define cretieras for variables def filter_line(line): if len(line)==0: retu...
""" """ import os, shutil from .ModuleLoader import ModuleLoader # copied from McUtils since I don't want a dependency here (yet) __all__ = ["Config", "ConfigManager", "ConfigSerializer"] class ConfigSerializer: loader = ModuleLoader(rootpkg="Configs") @classmethod def get_serialization_mode(cls, fil...
from django.shortcuts import render from django.http import HttpResponseRedirect, HttpResponse from django.core.urlresolvers import reverse from .models import * from .forms import * from django.template.defaulttags import register @register.filter def get_item(dictionary, key): return dictionary.get(key) # Create y...
# !/usr/bin/env python # coding=utf-8 # @Time : 2019-07-02 21:00 # @Author : <EMAIL> # @File : io_utils.py import sys import collections import csv import json import logging import os.path import pickle import random import tarfile import zipfile from six.moves import urllib import requests import h5py import ...
#!/usr/bin/env python # encoding: utf-8 import subprocess import numpy as np import pandas as pd import os import fire from keras.layers import Input, Embedding from keras.layers import Flatten, Dense, concatenate, Dropout, Reshape from keras.models import Model from keras.layers.normalization import BatchNormalizatio...
from django.contrib.auth.decorators import login_required from django.contrib.auth.forms import AdminPasswordChangeForm, PasswordChangeForm, UserCreationForm from django.contrib.auth import update_session_auth_hash, authenticate, login from django.contrib import messages from django.contrib.auth.models import User from...
""" batch mode """ # TODO look into Mesa's BatchRunner class... import json import time import pandas as pd import argparse from collections import Counter # suppress deprecation warning we can't do anything about import warnings warnings.filterwarnings(action='ignore', category=FutureWarning, module=r'.*pyproj' ) ...
from abc import abstractmethod import numpy as np from intervaltree import IntervalTree from loguru import logger from vimms.Common import ScanParameters ######################################################################################################################## # DEW Exclusions ########################...
# coding: utf-8 # # Mask R-CNN - Train on Shapes Dataset # # # This notebook shows how to train Mask R-CNN on your own dataset. To keep things simple we use a synthetic dataset of shapes (squares, triangles, and circles) which enables fast training. You'd still need a GPU, though, because the network backbone is a R...
#!/usr/bin/env python # -*- coding: utf-8 -*- import os import json import logging import argparse import torch from source.inputter.corpus import KnowledgeCorpus from source.model.seq2seq import Seq2Seq from source.utils.engine import Trainer from source.utils.generator import BeamGenerator from source.utils.misc imp...
import tkinter as tk # Used for main gui import tkinter.ttk as ttk # Used for pretty widgets import tkinter.messagebox as msg # Used for gui messages import tkinter.filedialog # Used for gui filedialog import os # Create files, search directories import shutil ...
"""Este módulo contém o conjunto de operações utilizadas pelos módulos principais como por exemplo, o método :func:`QApedia.io.load_templates` que utiliza o método :func:`QApedia.utils.extract_variables` desse módulo para extrair o conjunto de variáveis presentes na query geradora (``generator_query``). Neste módulo, ...