text
stringlengths
6.04k
39.5k
# (originally from https://github.com/tensorflow/models/tree/master/research/differential_privacy, # possibly with some small edits by @corcra) # 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 complia...
from .query import Query import sbol3 as sbol import pylatex from PyPDF2 import PdfFileReader import os import graphviz from math import inf from collections import OrderedDict class UMLFactory: """ Class for generating UML diagrams from an ontology file """ namespace_to_prefix = {} def __init_...
""" Copyright (c) 2018 iCyP Released under the MIT license https://opensource.org/licenses/mit-license.php """ # codig :utf-8 #for python3.5 - for blender2.79 from .binaly_loader import Binaly_Reader from ..gl_const import GL_CONSTANS as GLC from .. import V_Types as VRM_Types from ..V_Types import nested_json_value_...
# Author: alexn11 (<EMAIL>) # Created: 2019-11-19 # Copyright (C) 2019, <NAME> # License: MIT License """ Imports """ import math import cmath import sys from PIL import Image import numpy import ezInputConf import tonglib """ Constants """ two_pi = 2. * math . pi # the list of variables configurable by ...
import unittest def f(txt): """ accept a string containing a scripture reference, normalize it, and then return the reformatted string """ from scriptures.reference import Reference ref = Reference(txt, canon='protestant', language='en') return ref.to_string(full_name=True) class TestBoo...
# encoding: utf8 from __future__ import unicode_literals, print_function import sys from spacy.tokens import Doc from .syntax_iterators import noun_chunks __all__ = [ 'EOS', 'Morph', 'ParsedSentence', 'create_parsed_sentences', 'trailing_spaces', 'rewrite_by_tokenizer', 'correct_dep', ] ...
''' Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved. NVIDIA CORPORATION and its licensors retain all intellectual property and proprietary rights in and to this software, related documentation and any modifications thereto. Any use, reproduction, disclosure or distribution of this software and related docu...
import logging import os from time import time import json import tempfile import tensorflow as tf import numpy as np import pandas as pd from random import shuffle from sklearn.preprocessing import StandardScaler from .utils import resolve_files, deserialize, serialize, log_elapsed_time from .acr_model import ACR_Mod...
#!/usr/bin/env python2 from __future__ import print_function import subprocess, sys, argparse import time import os.path ## old parser #from parse_abstract import ParseAbstract from parser import * from predicates import * from lift import * start_time = time.time() ######################################## # const...
import os import json import datetime import pathlib import time import cv2 import carla from collections import deque import torch import carla import numpy as np from PIL import Image, ImageDraw from leaderboard.autoagents import autonomous_agent from neat.architectures import AttentionField from neat.config import...
import os import warnings import glob import xarray as xr # TODO: make this more configurable # GCMs CMIP5_VIC_DAY_ROOT_DIR = {'grid': {'AK': '/glade/p/ral/hap/mizukami/oconus_hydro/alaska_run/output/daily/BCSD', 'HI': '/glade/p/ral/hap/mizukami/oconus_hydro/hawaii_run/output/daily...
#!/usr/bin/env python u""" ecco_monthly_harmonics.py Written by <NAME> (10/2021) Reads monthly ECCO ocean bottom pressure anomalies and converts to spherical harmonic coefficients INPUTS: ECCO Near Real-Time models kf080i: Kalman filter analysis https://ecco.jpl.nasa.gov/drive/files/NearRea...
""" Functions that can be used in *templates_multi* of any locale. Check the "html/wikidict/user_functions.html" file for a user-friendly version. """ import re from collections import defaultdict from typing import Dict, List, Optional def capitalize(text: str) -> str: """ Capitalize the first letter only. ...
""" mcpython - a minecraft clone written in python licenced under the MIT-licence (https://github.com/mcpython4-coding/core) Contributors: uuk, xkcdjerry (inactive) Based on the game of fogleman (https://github.com/fogleman/Minecraft), licenced under the MIT-licence Original game "minecraft" by Mojang Studios (www.m...
#!/usr/bin/env python3 """ Copyright (c) 2010, <NAME> All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of cond...
# Taken from https://github.com/genforce/idinvert_pytorch/blob/master/models/stylegan_encoder_network.py """Contains the implementation of encoder for StyleGAN inversion. For more details, please check the paper: https://arxiv.org/pdf/2004.00049.pdf """ import numpy as np import torch import torch.nn as nn import to...
__author__ = 'drakita' import numpy as N import math # from robotiq_85_msgs.msg import GripperCmd, GripperStat import rospy from trajectory_msgs.msg import JointTrajectory, JointTrajectoryPoint from sensor_msgs.msg import JointState from copy import deepcopy def pubVREP(vrepFile, xopt): # solution file xoptS =...
# -*- coding: UTF-8 -*- # # Tencent is pleased to support the open source community by making QTA available. # Copyright (C) 2016THL A29 Limited, a Tencent company. All rights reserved. # Licensed under the BSD 3-Clause License (the "License"); you may not use this # file except in compliance with the License. You may...
#!/usr/bin/env python # coding=utf-8 # -*- encoding: utf-8 -*- ''' @File : tidal.py @Time : 2019/02/27 @Author : <NAME> @Version : 1.0 @Contact : <EMAIL> @Desc : Tidal API ''' import os import re import uuid import requests import json from aigpy import fileHelper from aigpy im...
import itertools import numpy as np import pytest import vpype as vp from vpype_cli import DebugData, cli, execute from .utils import TESTS_DIRECTORY, execute_single_line CM = 96 / 2.54 EXAMPLE_SVG = TESTS_DIRECTORY / "data" / "test_svg" / "svg_width_height" / "percent_size.svg" MINIMAL_COMMANDS = [ "begin gr...
import warnings warnings.filterwarnings("ignore") import matplotlib matplotlib.use('Agg') ###We checked and print the arguments import sys print('Number of arguments:', str(len(sys.argv)), 'arguments.') if len(sys.argv)!=8: print(""" ### usage: python GCC.py [datafile] [threshold] [maxscale] [CEthreshold] [lp]...
''' Batched Room-to-Room navigation environment ''' import sys import MatterSim import csv import numpy as np import math import base64 import utils import json import ijson import h5py import ast import os import random import networkx as nx from param import args from utils import load_datasets, l...
""" download_structures.py Methods for downloading a Target Zip file used by the download_structure API. """ import os import zipfile import datetime import uuid import shutil import fnmatch import logging import copy import json import pandoc from django.conf import settings from viewer.models import ( Molecul...
#!/usr/bin/env python2 __author__ = 'brad' import sys import os import pygame from pygame.locals import * import engine import game # Screen constants COORDINATE_WIDTH = 160 COORDINATE_HEIGHT = 128 COORDINATE_SIZE = (COORDINATE_WIDTH, COORDINATE_HEIGHT) SCREEN_MULTIPLIER = 4 SCREEN_WIDTH = COORDINATE_WIDTH*SCREEN_MU...
from math import floor, log from time import sleep, time from random import randint, uniform from requests import get from urllib.parse import quote from concurrent.futures import ThreadPoolExecutor def gen_random(name): sleep(uniform(0, 1)) randRes = randint(0, 1) randName = randint(0, 2) if randRe...
"""Adapt functions from scikit-learn to use different backends.""" import itertools from functools import partial import math from sklearn.base import BaseEstimator, TransformerMixin from sklearn.utils.validation import check_is_fitted from ..backend import get_backend from ..validation import _get_string_dtype from...
from __future__ import annotations import operator from functools import partial from numbers import Number from typing import TYPE_CHECKING, Any, Callable import awkward as ak import numpy as np from awkward._v2._connect.numpy import NDArrayOperatorsMixin from awkward._v2.tmp_for_testing import v1_to_v2 from dask.ba...
# -*- coding: utf-8 -*- #################################################### ## ## ## Image Occlusion Enhanced ## ## ## ## Copyright (c) Glutanimate 2016-2017 ## ## (https://github.com/Gl...
#! /usr/bin/env python # -*- coding: utf-8 -*- # encoding: utf-8 """ pyQms ----- Python module for fast and accurate mass spectrometry data quantification :license: MIT, see LICENSE.txt for more details Authors: * <NAME>. * <NAME>. * <NAME>. * <NAME>. * <N...
import torch import torchvision import torchvision.transforms as transforms import torch.nn as nn from torch.utils.data.sampler import BatchSampler, RandomSampler import numpy as np import os from PIL import Image from sklearn.datasets import fetch_olivetti_faces #The dataset for tiny imagenet class TinyImagenet(to...
import pytest import networkx as nx import os @pytest.fixture def simple_flow_graph(): G = nx.DiGraph() G.add_node("a", demand=0) G.add_node("b", demand=-5) G.add_node("c", demand=50000000) G.add_node("d", demand=-49999995) G.add_edge("a", "b", weight=3, capacity=4) G.add_edge...
# -*- coding: utf-8 -*- # # The MIT License (MIT) # # Copyright (c) 2016-2018 yutiansut/QUANTAXIS # # 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 limi...
## -*- encoding: latin-1 -*- from numpy import * from scipy import optimize import scipy as sc import pyfftw import h5py ############## # Calculate Greens function within FLEX approximation ############## class gfunction_calc: """ Self consistency loop for Greens function, using FLEX approximat...
#RNN from the weekly exercises. from __future__ import absolute_import, division, print_function #%matplotlib inline # %matplotlib nbagg import tensorflow as tf import matplotlib import numpy as np import matplotlib.pyplot as plt from IPython import display from DataGenerationSequenceCommaPlacement import get_batch_co...
import attr import bs4 import datetime import re import requests import random import urllib.parse from ._common import log, kw_only from . import _graphql, _util, _exception from typing import Optional, Tuple, Mapping, BinaryIO, Sequence, Iterable, Callable FB_DTSG_REGEX = re.compile(r'name="fb_dtsg" value="(.*?)"'...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Sat Dec 19 12:05:58 2020 @author: rahul """ import sys sys.path.append('/home/rahul/Downloads/new-semantic-parsing-master/new_semantic_parsing') import os import pandas as pd import toml import logging from convert_data import preprocess_data from tqdm.auto...
import typing as tp from configparser import ConfigParser, Error from pathlib import Path import databroker import event_model import matplotlib.pyplot as plt import numpy as np from bluesky.callbacks.core import make_class_safe from bluesky.callbacks.stream import LiveDispatcher from databroker.v2 import Broker from ...
import math, time from sc2.constants import AbilityId from sc2.data import race_worker from sc2.ids.unit_typeid import UnitTypeId from sc2.position import Point2 from helper import attack_or_regroup, get_closest_unit, assign_damage_vs_target_and_group_health, attackable_target, reachable_target, select_random_point, ...
import datetime import time import gym import random import numpy as np import tensorflow as tf import tensorflow.contrib.eager as tfe import json import os def get_actions_and_neglogp(p_logits, postprocess_preds, actions=None): p_logits = postprocess_preds(p_logits) p_distributions = [tf.distributions.Catego...
import pandas as pd import json import os from pandas.core.frame import DataFrame import sqlalchemy from sqlalchemy.engine import create_engine from sqlalchemy.sql.expression import column, true def findAllFile(base): # os walk files for root, ds, fs in os.walk(base): for f in fs: fullname...
from sklearn.datasets.samples_generator import make_blobs, make_regression from numpy import linalg as la import numpy as np import pandas as pd import random import math """ .. sectionauthor:: <NAME> <https://github.com/aliarjomandbigdeli> .. since:: 6/2/2019 """ class RBFCoreES: def __init__(self): se...
#!/usr/bin/python2.5 # # Copyright 2009 Google Inc. # # 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 ...
from datetime import datetime, timedelta from django.utils.timesince import timesince from math import ceil from corehq.apps.commtrack.models import StockState from corehq.apps.products.models import Product from corehq.apps.reports.commtrack.const import STOCK_SECTION_TYPE from corehq.apps.reports.commtrack.util impor...
# Copyright (C) 2020 GreenWaves Technologies, SAS # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # published by the Free Software Foundation, either version 3 of the # License, or (at your option) any later version. # This progr...
from __future__ import print_function import copy import time import faiss import numpy as np import tqdm import global_vars as Global from datasets import MirroredDataset from utils.iterative_trainer import IterativeTrainerConfig from utils.logger import Logger from termcolor import colored from torch.utils.data.da...
import logging import pprint import re from collections import deque import getrealty import openpyxl import xlsxwriter pp = pprint.PrettyPrinter(width=1) logger = logging.getLogger(__name__) config = getrealty.settings.config def writeExcel(rnumbers): """Library for writing properties to an Excel Spreadsheet""...
#!/usr/bin/env python # -*- coding: utf8 -*- """ 2D Map Extractor This script is used to calculate the main 2D maps from a data-cube. All the maps are saved inside a single FITS file. Each maps is saved in a different extension. [0] Main extension - Contains the main header """ from __future__ im...
# # Copyright (c) 2022 Airbyte, Inc., all rights reserved. # import csv import datetime import io import json from abc import ABC from time import sleep from typing import Any, Iterable, List, Mapping, MutableMapping, Optional, Tuple import pendulum import requests from airbyte_cdk.models import SyncMode from airbyte...
from reportlab.lib.testutils import setOutDir,makeSuiteForClasses, outputfile, printLocation setOutDir(__name__) import operator, string from reportlab.platypus import * #from reportlab import rl_config from reportlab.lib.styles import PropertySet, getSampleStyleSheet, ParagraphStyle from reportlab.lib import colors fr...
r""" 2D advection diffusion equation for tracers. The advection-diffusion equation of tracer :math:`T` in non-conservative form reads .. math:: \frac{\partial T}{\partial t} + \nabla_h \cdot (\textbf{u} T) = \nabla_h \cdot (\mu_h \nabla_h T) :label: tracer_eq_2d where :math:`\nabla_h` denotes horizon...
import os import sys import time import argparse import json import pdb import inspect import win32api import tdcosim from tdcosim.global_data import GlobalData from tdcosim.procedure.procedure import Procedure baseDir=os.path.dirname(os.path.abspath(__file__)) if '~' in baseDir: baseDir=win32api.GetLongPathName(ba...
''' This script handles the training process. ''' import sys sys.path.append("../Stable-Deep-Compression/") import argparse import math import time import dill as pickle from tqdm import tqdm import numpy as np import torch import torch.nn.functional as F import torch.optim as optim from torchtext.data import Field, Da...
# Copyright 2015 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...
# # Copyright 2020, by the California Institute of Technology. ALL RIGHTS # RESERVED. United States Government Sponsorship acknowledged. Any commercial # use must be negotiated with the Office of Technology Transfer at the # California Institute of Technology. # """ ========== pds4_util.py ========== Contains fun...
def test_timezone(): from datetime import datetime, timedelta, timezone tz_min = timezone(timedelta(minutes=-(60 * 24 - 1))) tz_max = timezone(timedelta(minutes=60 * 24 - 1)) tz1 = timezone(timedelta(hours=2)) dt1 = datetime(2000, 12, 15, 15, 16, 17, tzinfo=tz1) assert tz1.utc == timezone(tim...
import hashlib import re from gettext import gettext as _ from tempfile import NamedTemporaryFile from django.contrib.auth.models import User from django.core.files import File from django.core.validators import ( MaxValueValidator, MinValueValidator, RegexValidator, URLValidator, ValidationError, ...
# coding: utf-8 from __future__ import division from __future__ import print_function from __future__ import unicode_literals import sys import os import numpy as np import time import random import torch import torch.nn.functional as F try: import cPickle as pickle except ImportError: import pickle from modifi...
# Volatility # Copyright (C) 2007-2013 Volatility Foundation # Copyright (c) 2010, 2011, 2012 <NAME> <<EMAIL>> # # This file is part of Volatility. # # Volatility is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation...
#!/usr/bin/env python # -*- coding: utf-8 -*- from gluon import * states=['Andaman and Nicobar Islands','Andhra Pradesh','Arunachal Pradesh', 'Assam','Bihar','Chandigarh','Chhattisgarh','Dadra and Nagar Haveli', 'Daman and Diu','Delhi','Goa','Gujarat','Haryana','Himachal Pradesh', 'Jammu and Kashmir','Jharkhand',...
# import libraries import operator import random from k0001def import appConfig, outputs, inputs, requests, conflicts, sequence, wachtgroen, timers, countData, \ detector_status, extend, extend_vag1, extend_vag2, extend_vag3, extend_vag4 if appConfig['automaat']['raspberry_pi']: from k0001def import rpiConfig ...
import os, sys from PIL import Image import torch.utils.data as data import torchvision.transforms as transforms import random import numpy as np from PIL import ImageEnhance import torch import pandas as pd #several data augumentation strategies def cv_random_flip(img, label,depth): flip_flag = random.randint(0,...
# -*- coding: utf-8 -*- import json import sys import argparse import numpy import bpy import bmesh # These are the RGB values that JMol uses to color atoms JMOL_COLORING = { "H": [255, 255, 255], "He": [217, 255, 255], "Li": [204, 128, 255], "Be": [194, 255, 0], "B": [255, 181, 181], "C": [...
from mrcnn import visualize import os import sys import time import numpy as np import imgaug # https://github.com/aleju/imgaug (pip3 install imgaug) # Download and install the Python COCO tools from https://github.com/waleedka/coco # That's a fork from the original https://github.com/pdollar/coco with a bug # fix f...
import os import math import numpy as np import sklearn.utils import tensorflow as tf import tensorflow.contrib.slim as slim from utils.logger import get_logger, Progbar from utils.prepro_text import batch_iter, dense_to_one_hot, remap_labels from utils.data_funcs import compute_ensemble_accuracy def highway_layer(in...
import os import torch import random import copy import csv from PIL import Image from torch.utils.data import Dataset import torchvision.transforms as transforms from torch.utils.data.dataset import Dataset import numpy as np import pydicom as dicom import cv2 from skimage import transform, io, img_as_float, exposure...
#!/usr/bin/env python """Compile scene definition from SVG into binary tilemap format. The source is a standard SVG file that can be edited with Inkscape, but with several restrictions: - The document origin is at the top-left corner of the document, so older Inkscape versions may not work. - The width and the hei...
from random import randint from random import shuffle # Create Consonant class in order to be able to delete blank ones class Consonant: def __init__(self, is_voiced, is_aspirated, place_of_articulation, type_of_articulation, is_ejective, is_lateral, is_nasal): self.is_voiced = is...
import dataclasses import enum import hashlib import json import logging import tarfile import typing import zlib import dacite import requests import oci.auth as oa import oci.client as oc import oci.convert as oconv import oci.kaniko as ok import oci.model as om import oci.util as ou logger = logging.getLogger(__n...
from __future__ import absolute_import, print_function import argparse import collections import hashlib import heapq import logging import multiprocessing import os.path import sqlite3 import sys import tarfile import traceback from datetime import datetime from typing import DefaultDict, List, Optional, Tuple impor...
""" Dataloader that loads OmniPrint meta-learning dataset in the same way as the standard Omniglot approach Adapted from https://github.com/dragen1860/MAML-Pytorch/blob/master/omniglotNShot.py https://github.com/dragen1860/MAML-Pytorch/blob/master/omniglot.py """ import os import glob import collections import nu...
#!/usr/bin/env python3 import sys # some arguments from argparse import ArgumentParser # logging import logging # bluez-python bindings import pydbusbluez as bluez from pydbusbluez.format import FormatTuple, FormatRaw, FormatBase, FormatPacked, FormatUint # Glib for dbus events from gi.repository.GLib import MainL...
# import obspy from obspy import read from obspy.core import Stream #imports from obspy.core import event from obspy.taup.taup import getTravelTimes from obspy import UTCDateTime import matplotlib.pyplot as plt import os.path import time import glob import shutil import numpy as np import scipy import cmath from pyla...
# Copyright (c) 2020 <NAME> # SPDX-License-Identifier: MIT """ An ensemble can several directories related generated by deployment jobs: :artifacts: Artifacts required for deployment (e.g. Terraform state files). :secrets: sensitive artifacts (e.g. certificates). They are vault encrypted in the repository. :local: Art...
import numpy as np import torch import torch.utils.data as data import torch.nn.functional as F import os import cv2 import math import random import json import pickle import os.path as osp from glob import glob import raft3d.projective_ops as pops from .augmentation import RGBDAugmentor, SparseAugmentor from . im...
import torch from torch import nn import math class Generate_Info(nn.Module): def __init__(self, inc, outc, out_seq, kernel_size=3, padding=0, dilation=1, stride=1, modulation=False, group_modulation=False, split_modulation=False, channelwise = False, recombine = 'multiply', repeat_concat=False, ...
import torch import torch.nn as nn import torch.nn.functional as F from torch.distributions import Normal import numpy as np import copy import utils import random import pdb from utils import soft_update, hard_update LOG_SIG_MAX = 2 LOG_SIG_MIN = -20 epsilon = 1e-6 # Initialize Policy weights def weights_init_(m): ...
import sys if not (sys.version_info.major == 3 and sys.version_info.minor > 5): print("Python version %s.%s not supported version 3.6 or above required - exiting" % (sys.version_info.major,sys.version_info.minor)) sys.exit(1) import os import json import unittest import logging # https://docs.python.org/2/libra...
#!/usr/bin/env python # # trace Trace a function and print a trace message based on its # parameters, with an optional filter. # # USAGE: trace [-h] [-p PID] [-v] [-Z STRING_SIZE] [-S] [-M MAX_EVENTS] [-o] # probe [probe ...] # # Licensed under the Apache License, Version 2.0 (the "Li...
from Tkinter import Canvas, NE, NW, Listbox, END, DISABLED, NORMAL import math import itertools import re class Plot(object): def __init__(self): self.yvals = [] self.xvals = [] self.points = [] self.color = "" colors = ["blue", "red", "green", "cyan", "magenta", "yellow", "black...
""" Copyright (c) 2020 <NAME> All rights reserved. @author <NAME> <<EMAIL>> This source code is licensed under the MIT license found in the LICENSE file in the root directory of this source tree. """ """SwIFT updater helper""" import gc import math from itertools import chain import heapq import time import...
import copy import datetime from inspect import Parameter import discord import re from contextlib import redirect_stdout from discord.ext import commands from io import StringIO from textwrap import indent from traceback import format_exc from typing import Optional, Union from ..utils import get_base_embed, paginate ...
from tqdm import tqdm from collections import OrderedDict from sklearn.metrics import roc_curve from scipy.optimize import brentq from scipy.interpolate import interp1d import os import yaml import numpy as np import torch import torch.nn as nn from torch.utils import data from model_RawNet import RawNet def keras_...
# -*- coding: utf-8 -*- """ Created on Wed Apr 8 17:09:42 2020 @author: Timothe """ import math import numpy as np from shapely.geometry import LineString from matplotlib.collections import LineCollection from math import sin, cos, radians, pi import sys, os sys.path.append(os.path.dirname(os.path.dirname(os.path.a...
#! /usr/bin/python # # Qt example for VLC Python bindings # Copyright (C) 2009-2010 the VideoLAN team # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at...
import copy import re from typing import Dict, Optional import chess import chess.engine from zulip_bots.lib import BotHandler START_REGEX = re.compile("start with other user$") START_COMPUTER_REGEX = re.compile("start as (?P<user_color>white|black) with computer") MOVE_REGEX = re.compile("do (?P<move_san>.+)$") RES...
# -*- coding: utf-8 -*- # The MIT License (MIT) # # 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 # ...
from os.path import join, isfile from flask import Flask, render_template, make_response, jsonify, request, redirect, abort from flask_sqlalchemy import SQLAlchemy from sqlalchemy import func from flask_login import LoginManager from flask_bcrypt import Bcrypt from flask_mail import Mail from flask_uploads import Uplo...
import tkinter as tk from tkinter import ttk from tkinter.font import Font from PIL import ImageTk, Image from abc import ABC, abstractmethod from .settings import _TITLE_FONT, _ACTIVE_BUTTON from typing import List import logging logger = logging.getLogger(__name__) class ABCReusableFrame(ABC, tk.Frame): def ...
import torch import torch.nn as nn import math import torch.nn.functional as F # import torchvision.transforms as transforms # import torchvision.transforms.functional as TF from torch.autograd import Variable import numpy as np import cv2 import collections from utils.parameters import crop_size from collections impo...
from collections import namedtuple import contextlib import glob import os import pprint import shutil import subprocess import sys from textwrap import dedent import yaml import pytest Result = namedtuple('Result', ['outcome', 'artifact', 'item']) class MockEnv: '''Use this to work with mock. Mutliple concur...
from __future__ import print_function import os, os.path, sys, errno, shutil, datetime import optparse import subprocess as sp import utils as U import config_utils as C # GENIE configuration if not U.read_cgenie_config(): sys.exit('GENIE not set up: run the setup-cgenie script!') # Command line arguments. p...
# --- # jupyter: # jupytext: # formats: ipynb,ouxml_link_checker//py:light # text_representation: # extension: .py # format_name: light # format_version: '1.5' # jupytext_version: 1.11.5 # kernelspec: # display_name: Python 3 # language: python # name: python3 # --- # # ...
#!/usr/bin/python3 # Copyright 2013, Mozilla Corporation # Copyright 2017-2020 <NAME> # Loosely based on a script written by <NAME> # https://github.com/bdaehlie/web_image_formats # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions ...
#!/usr/bin/env python ################################################################################ # Date: 2016/July/07 # # Module: mahalanobis_distance.py # # VERSION: 1.1 # # AUTHOR: <NAME> (<EMAIL>) # # DESCRIPTION: This program does a pairwise and to mean standarized euclidean # comparison for a ...
from typing import List, Dict, Any, Optional from enum import Enum import json import logging from collections import namedtuple from whendo.core.action import Action, Rez, log_action_result from whendo.core.exception import TerminateSchedulerException logger = logging.getLogger(__name__) def processing_results( ...
#!/usr/bin/env python # region Import from sys import path from os.path import dirname, abspath project_root_path = dirname(dirname(dirname(abspath(__file__)))) utils_path = project_root_path + "/Utils/" path.append(utils_path) from base import Base from network import Sniff_raw, DNS_raw from ipaddress import IPv4Add...
import matplotlib.pyplot as plt import matplotlib as mpl import numpy as np import itertools from nilearn import plotting from mpl_toolkits.axes_grid1 import make_axes_locatable from .glm_utils import Regressor from matplotlib.colors import to_rgb, is_color_like def plot_trial_modulation(beh, meta, sub, con, modulat...
#!/usr/bin/env python3 import argparse import numpy as np import astropy.units as u import matplotlib.pyplot as plt from astropy.visualization.wcsaxes import SphericalCircle from matplotlib.widgets import Slider from arts_localisation.constants import WSRT_LAT, DISH, CB_HPBW, REF_FREQ from arts_localisation.beam_mode...
# ----------------------------------------------------------------------------- # Copyright (c) 2014--, The Qiita Development Team. # # Distributed under the terms of the BSD 3-clause License. # # The full license is in the file LICENSE, distributed with this software. # ------------------------------------------------...
# Copyright (c) 2021 PaddlePaddle 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 appli...