text stringlengths 6.04k 39.5k |
|---|
# import the necessary packages
import numpy as np
import cv2
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
from advanced_lane_detection import config
def calibrate_cam(images, nx, ny):
# Arrays to store object points and images points for all the images.
objpoints = []
imgpoints = []
... |
"""Various utility functions for the ``jwql`` project.
Authors
-------
- <NAME>
- <NAME>
Use
---
This module can be imported as such:
>>> import utils
settings = get_config()
References
----------
Filename parser modified from <NAME>:
https://gist.github.com/jhunkeler/f08783ca2da7bfd1... |
"""This module defines the quantum manager class, to track quantum states.
The states may currently be defined in two possible ways:
- KetState (with the QuantumManagerKet class)
- DensityMatrix (with the QuantumManagerDensity class)
The manager defines an API for interacting with quantum states.
"""
from __... |
# -*- coding: utf-8 -*-
# (c) YashDK [yash-dk@github]
import qbittorrentapi as qba
import asyncio as aio
import os,logging,traceback,time
from datetime import datetime,timedelta
from . import Hash_Fetch
from .Human_Format import human_readable_bytes,human_readable_timedelta
from ..core.getVars import get_val
from tel... |
# (C) Copyright 2016-2021 Xilinx, Inc.
# All Rights Reserved.
#
# 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 ... |
from __future__ import annotations
from typing import List
import numpy as np
from numpy.typing import NDArray
from operation import MagneticOperation, remainder1_symmetry_operation
# ref: ITA Table1.5.1.1
transformation_matrix_monoclinic = {
"a_to_b": np.array([[0, 1, 0], [0, 0, 1], [1, 0, 0]]), # (a, b, c) ... |
from huectl.ro import read_only_properties as read_only
import huectl.bridge
from huectl.exception import InvalidOperation
from huectl.color import HueColor, HueColorxyY, HueColorHSB, HueColorPointxy, HueColorPointHS, HueColorGamut, HueColorTemp, kelvin_to_mired, map_range, mired_to_kelvin
import json
class HueAlertEf... |
"""
#;+
#; NAME:
#; ionic_clm
#; Version 1.0
#;
#; PURPOSE:
#; Module for ionic column densities in Abs Systems
#; 28-Oct-2014 by JXP
#;-
#;------------------------------------------------------------------------------
"""
from __future__ import print_function, absolute_import, division, unicode_literals
impo... |
#!/usr/bin/env python
'''
This is a rewrite of a past project to report potential ARP poisoning.
The original product was written in C.
Well-behaved ARP behavior requires both a request and a reply.
With a conversation as an analogy, this could be said as:
* Host A: I'm looking for someone at this addres... |
"""
Parses the OpenCPN Table format.
Example::
Herrington to Drum Point
Name Herrington to Drum Point
Depart From
Destination
Total distance 22.9 NMi
Speed (Kts) 6
Departure Time (%x %H:%M) 05/25/2021 08:43
Time enroute 3H 49M
Leg To waypoint Distance Bearing Latitude Longitude ... |
import json
import ssl
import sys
import urllib
from requests import Session
from requests.adapters import HTTPAdapter
from requests.packages.urllib3.poolmanager import PoolManager
from emailage import signature, validation
from emailage.signature import safety_quote
use_urllib_quote = hasattr(urllib, 'quote')
if... |
import os
import copy
import os.path
import warnings
from collections.abc import Sequence
from collections import OrderedDict, defaultdict
from functools import partial
from itertools import islice, chain
from typing import Set, Iterator, Dict, Callable, Optional, Any, Union, DefaultDict
import fiona
from fiona.io imp... |
import math
import itertools
from sklearn.cluster import DBSCAN
import numpy as np
import pysc2.agents.myAgent.myAgent_13_BIC_DQN.smart_actions as sa
from pysc2.agents.myAgent.myAgent_13_BIC_DQN.config import config
from pysc2.agents.myAgent.myAgent_13_BIC_DQN.tools import unit_list
from pysc2.lib import features
#... |
import multiprocessing
import numpy as np
import pandas as pd
import platform
from honeycomb_io import fetch_environment_by_name, fetch_environment_id, fetch_material_tray_devices_assignments, fetch_raw_cuwb_data
import process_pose_data
from .honeycomb_imu_data import fetch_imu_data
from .honeycomb_pose_data import ... |
from typing import Optional, Any, Dict, Union, List
import pandas as pd
from cryptocompsdk.general.parse import from_int, from_none, from_union, from_float, from_str, to_float, from_bool, \
from_dict, to_class, is_type, from_int_or_str, from_na, from_str_number
from cryptocompsdk.response import ResponseAPIBase, ... |
import logging
import json
import requests
import attrdict as ad
import itertools
import copy
import time
try:
config_file = open('conf/net/ext_service/overpass_server.json')
except:
print("overpass not configured, falling back to default overleaf.de")
config_file = open('conf/net/ext_service/overpass_serv... |
# imports
from opentrons import protocol_api
# metadata
metadata = {
'protocolName': 'Test qPCR Samples Using Opt Fwd and Rev and Probe Concentrations',
'author': '<NAME> <<EMAIL>>',
'description': 'Creates a 96w plate of optimal primer and probe concentrations to qPCR samples. Also creates a std curve.',
... |
# Pre Installed Imports
import os
from flask import Flask, templating, request, escape, session, redirect, make_response
from flask_wtf import FlaskForm
from flask_wtf.recaptcha import RecaptchaField
from wtforms import StringField, SubmitField, PasswordField
from wtforms.validators import DataRequired, Email, Eq... |
"""
OpenNEM primary schema adapted to support multiple energy sources
Currently supported:
- NEM
- WEM
"""
from geoalchemy2 import Geometry
from sqlalchemy import (
NUMERIC,
Boolean,
Column,
Date,
DateTime,
ForeignKey,
Index,
Integer,
Numeric,
Sequence,
Str... |
import logging
from time import sleep
from copy import deepcopy
from pyats.log.utils import banner
from .rpcbuilder import YSNetconfRPCBuilder
from .rpcverify import RpcVerify
log = logging.getLogger(__name__)
try:
from ncclient.operations import RaiseMode
except Exception:
log.error('Make sure you have nccl... |
### Copyright 2019, MTA SZTAKI, www.sztaki.hu
###
### 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 applicab... |
# -*- coding: utf-8 -*-
"""
Created on Fri Nov 17 13:21:59 2017
@author: Astrid
"""
from shark import supp
import pandas as pd
import os
import numpy as np
import math as m
def extractClimateYears(path_climate, year_start, years, number, path_save=None, exclude=list()):
climateparam_list = supp.getFileList(path_c... |
import glob
import cv2
import matplotlib.image as mpimg
import matplotlib.pyplot as plt
import numpy as np
import pickle
from skimage.feature import hog
from scipy.ndimage.measurements import label
from collections import deque
from moviepy.editor import VideoFileClip
def get_hog_features(img, orient, pix_per_cell, c... |
#!/usr/bin/env python
from __future__ import print_function, division, unicode_literals
import os
import pytz
from datetime import datetime
from copy import deepcopy
from .worker_base import(
WorkerBase
, WorkerError
, PreparationError
... |
#!/usr/bin/env python
# Imports to support type annotations
from __future__ import annotations
from typing import Dict, List, Optional, Tuple
import math
import random
from MapCharacterState import MapCharacterState
from CombatCharacterState import CombatCharacterState
from Point import Point
from GameTypes import A... |
"""
Advent of Code 2019 - Utilities Module
https://adventofcode.com/2019/
PEP 8 compliant
"""
__author__ = "<NAME>"
__email__ = "<EMAIL>"
import itertools
import heapq
import math
import os
import re
class Intcode():
def __init__(self, state=[]):
self.memory = {}
self.load(state)
self.... |
"""Data objects pertaining to building, signing, and parsing Transactions."""
from __future__ import annotations
import base64
import json
import math
from typing import Dict, List, Optional
import attr
from betterproto.lib.google.protobuf import Any as Any_pb
from terra_proto.cosmos.base.abci.v1beta1 import AbciMes... |
"""
Matrix44
A 4x4 matrix class stored in column major order for easier use with OpenGL.
"""
from __future__ import print_function
import math
import numpy
from numpy import array
from numpy import dot
from pedemath.vec3 import _float_almost_equal
from pedemath.vec3 import normalize_v3
from pedemath.vec3 import Vec3... |
import matplotlib
matplotlib.use("PS")
import numpy as np
import modin.pandas as pd
from sklearn.preprocessing import LabelEncoder
import warnings
warnings.filterwarnings("ignore")
import matplotlib.pyplot as plt
import seaborn as sns
app_train = pd.read_csv("application_train.csv")
print("Training data shape: ", ap... |
import os
import regex
from os import path
from soundchanger.conlang import cache, workers
regex.DEFAULT_VERSION = regex.VERSION1
cat_matcher = regex.compile(r'\{(\d*):?(\w*)\}')
def cat_replace(m, cats):
"""Replaces categories with regular expressions that will match them.
Args:
m: The match objec... |
#dsm_script
import json, requests, json, time, io, datetime, random,re, asyncio
from datetime import datetime, timezone
from colorama import init
from termcolor import colored
from python_anticaptcha import AnticaptchaClient, NoCaptchaTaskProxylessTask
# from pyppeteer import launch
# from pyppeteer_stealth import stea... |
import os
import math
import random
import operator
from functools import reduce
import numpy as np
from sklearn.metrics import f1_score
from tqdm import tqdm
from nltk.util import everygrams
from scipy.stats import pearsonr
import torch
import torch.nn as nn
import torch.nn.functional as F
from pytorch_pretrained_be... |
import numpy as np
from matplotlib.patches import Ellipse
import matplotlib.pyplot as plt
def make_fisher_matrix(params_dict, fisher_params, hpeak=0.0, obs='GS',
sigma=None, sigma_mod_frac=0.,
k_min=None, k_max=None,
z_min=None, z_max=None,
... |
#!/usr/bin/env python
################################# DEPENDENCIES #################################
import argparse, roslib, os, rospy, math, tf, yaml
import numpy as np
import geometry_msgs.msg
from tf.transformations import quaternion_matrix
from sensor_msgs.msg import CameraInfo
################################... |
"""
*Calculates plots for SIx from historical LENS*
"""
import numpy as np
from netCDF4 import Dataset
import matplotlib.pyplot as plt
import scipy.stats as sts
from mpl_toolkits.basemap import Basemap
directory = '/volumes/eas-shared/ault/ecrl/spring-indices/data/'
def SIxHistorical():
"""
Reads in historic... |
import time
import os
import numpy as np
import imageio
import saverloader
import skimage.morphology
from fire import Fire
import nets.raftnet
import utils.basic
import utils.vox
import utils.improc
import utils.misc
import utils.samp
import utils.improc
from utils.basic import print_, print_stats
from simplekittid... |
from __future__ import unicode_literals
import requests
import youtube_dl
import argparse
import os
import sys
import shutil
import ctypes
import time
from PIL import Image
from io import BytesIO
from pydub import AudioSegment
from mutagen.id3 import ID3, APIC
from mutagen.easyid3 import EasyID3
from PyQt5 import QtCor... |
"""keymaster Integration."""
from datetime import timedelta
import logging
from typing import Any, Dict
from openzwavemqtt.const import CommandClass
from openzwavemqtt.exceptions import NotFoundError, NotSupportedError
from openzwavemqtt.util.node import get_node_from_manager
import voluptuous as vol
from homeassista... |
from __future__ import print_function
from __future__ import division
import copy
import numpy as np
from types import MethodType
import sqaod
from sqaod import algorithm as algo
from sqaod.common import checkers
from . import formulas
class BipartiteGraphAnnealer :
""" python implementation of bipartite graph an... |
import logging
import time
import os
import keras
import numpy
from tensorflow.python.lib.io import file_io
from style_transfer import models
from style_transfer import layers
from style_transfer import utils
from style_transfer import dataset_builder
logger = logging.getLogger('trainer')
_log_statement = '''
Trai... |
#!/usr/bin/env python # -*- coding: utf-8 -*-
from __future__ import print_function
from titlecase import titlecase
import pandas as pd
import glob
import os
import pdb
import unicodedata
import numpy as np
def strip_accents(input_str):
nkfd_form = unicodedata.normalize('NFKD', input_str)
return u"".join([c fo... |
"""
Text search query language.
[ Grammar ]
Phrases:
the ducks find all instances of the "the ducks" (a bigram)
Query Expansion: [] brackets
[the ducks] "the ducks" or "the duck".
Equivalent to ("the duck" | "the ducks").
Expressions:
An expression can be:
- a... |
import pytest,warnings
import os,sys
sys.path.append(os.path.join(os.path.dirname(__file__), '../'))
warnings.resetwarnings()
warnings.simplefilter('ignore', FutureWarning)
warnings.simplefilter('ignore', DeprecationWarning)
from jax import numpy as jnp, lax, vmap
from deltapv import simulator,materials,scales,sun,opti... |
"""
Ledalab analysis functions (original folder: Ledalab/analyze)
"""
from __future__ import division
import numpy as np
from numpy import array as npa
import math
from scipy import stats
from scipy.signal import convolve
from scipy import interpolate
from scipy.linalg import norm
from . import leda2
from . import util... |
#!/usr/bin/env python
# coding: utf-8
"""
Utilities and functions for working with ALC, other datasets. Includes functions
for reading .Align xml scaling files saved during LA-ICP-MS analysis and
calculating scale factors for images from .Align data.
"""
import os
import operator
import json
from urllib.request impo... |
"""
Set up the plot figures, axes, and items to be done for each frame.
This module is imported by the plotting routines and then the
function setplot is called to set the plot parameters.
"""
from __future__ import absolute_import
from __future__ import print_function
import numpy as np
import matplotlib.pyplot as... |
# Patchwise Road Segmentation for Aerial Images with CNN
# <NAME>, <NAME>, <NAME>
# Group 5: Google Maps Team
# Department of Computer Science, ETH Zurich, Switzerland
# Computational Intelligence Lab
# This script contains the Baseline CNN model
import gzip
import os
import glob
import argparse
import pickle
import ... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
###############################################################################
######################## GROUND VARIATION FUNCTIONS ###########################
###############################################################################
# This module contains all the ... |
from nacl import public
from nacl.encoding import Base64Encoder
import random
import netaddr
from Jumpscale import j
class Network:
class Info:
def __init__(self):
self.workload_type = "NETWORK_RESOURCE"
def __init__(self, name, iprange):
self.info = self.Info()
self.name ... |
#!/usr/bin/env python3
# -*- coding: UTF-8 -*-
__author__ = "<NAME>"
__credits__ = ["<NAME>"]
__license__ = "MIT"
__maintainer__ = "<NAME>"
__email__ = "<EMAIL>"
import ctypes
import os
import threading
import time
from datetime import date
from functools import partial
from pathlib import Path
from typing import An... |
"""charcnn.py: classes that might be used when modeling classes.
<NAME> <<EMAIL>>, 2020. No rights reserved.
# C0 1.0 Universal
_Official translations of this legal tool are available [in other languages](
https://creativecommons.org/publicdomain/zero/1.0/legalcode)._
CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM... |
"""Web mercator XYZ tile utilities"""
from collections import namedtuple
import math
import sys
import warnings
import operator
if sys.version_info < (3,):
warnings.warn(
"Python versions < 3 will not be supported by mercantile 2.0.",
UserWarning,
)
from collections import Sequence
else:
... |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.15 on 2019-07-18 07:04
from __future__ import unicode_literals
from __future__ import division
from builtins import str
from past.utils import old_div
from django.db import migrations, connection, models
from django.contrib.gis.geos import Point
from bluebottle.clien... |
"""
========================================================================
01. Import data, apply MaxWell filter to MEG data, and find bad channels
========================================================================
The data are imported from the BIDS folder.
If you chose to run Maxwell filter (config.use_maxw... |
#!/usr/bin/env python3
import os
import sys
#~ import psycopg2
import getpass
import requests
import json
import urllib.request
#~ from Crypto.Protocol.KDF import PBKDF2
#~ from passlib.hash import pbkdf2_sha256
#~ from passlib.utils.pbkdf2 import get_prf
from Crypto.Cipher import AES
from Crypto.PublicKey import RSA
f... |
#!/usr/bin/env python
# Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
# Copyright (C) 2011-2020 German Aerospace Center (DLR) and others.
# This program and the accompanying materials are made available under the
# terms of the Eclipse Public License 2.0 which is available at
# https://www.ec... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Jun 25 19:48:03 2019
@authors: enzoampil & jpdeleon
"""
# Import standard library
import os
import requests
from datetime import datetime, timedelta
import time
from pathlib import Path
from pkg_resources import resource_filename
# Import modules
impor... |
"""Begin Here -> fucked up too many things, starting again from 0
Revision ID: 8<PASSWORD>6
Revises:
Create Date: 2021-06-07 13:09:12.993624
"""
from alembic import op
import sqlalchemy as sa
import sqlalchemy_utils
# revision identifiers, used by Alembic.
revision = '<PASSWORD>'
down_revision = None
branch_labels... |
# Copyright 2019 <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, so... |
"""
MIT License
Copyright (c) 2017 s0hvaperuna
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, d... |
import logging
import json
import re
import sys
import subprocess
from arc.paths import *
# init module __logger
__logger = logging.getLogger('ARC.Config')
# module-wise data structures to store parsed configs
__parsed_config = {}
__parsed_config_admin_defined = {}
__parsed_blocks = []
__default_config = {}
__default... |
from __future__ import print_function
import torch
import torch.nn as nn
import torch.nn.functional as F
import numpy as np
import copy
from matplotlib import pyplot as plt
from .self_attention import gather_edges, gather_nodes, Normalize
class PositionalEncodings(nn.Module):
def __init__(self, num_embeddings,... |
"""
Description
-----------
Implements model-specific data structures which are used by our cross-layer model.
:Authors:
- <NAME>
"""
import copy
from mcc.parser import *
from mcc.framework import *
from mcc.backtracking import *
from mcc.taskmodel import Task
from mcc.dot import DotFactory
class ServiceConstr... |
# encoding: utf-8
# Subject, Classification, Genre
from nose.tools import set_trace
from . import (
Base,
get_one,
get_one_or_create,
numericrange_to_string,
numericrange_to_tuple,
tuple_to_numericrange,
)
from constants import DataSourceConstants
from hasfulltablecache import HasFullTableCache... |
from itertools import count
import argparse, os, cPickle, sys, csv, glob, json, itertools, re, datetime
from unidecode import unidecode
from collections import Counter, defaultdict
from tokenizer import simpleTokenize
import config
def read(fname):
sent = []
for line in file(fname):
line = line.strip... |
# -*- coding: utf-8 -*-
# This code is part of Qiskit.
#
# (C) Copyright IBM 2020.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modif... |
from __future__ import print_function
import matplotlib.pyplot as plt
import sys
import time
import torchvision as tv
from torchvision.transforms import ToPILImage
from torchvision import utils
import psutil
# print(psutil.__version__)
import numpy as np
# import torch
import torch.nn as nn
# from torch.autograd import... |
#!/usr/bin/env python3
################################################################################
# SPDX-FileCopyrightText: Copyright (c) 2019-2021 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you... |
# ============================================================================
#
# Copyright (C) 2007-2016 Conceptive Engineering bvba.
# www.conceptive.be / <EMAIL>
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
... |
"""
Persistent state stored in a sqlite file.
"""
import logging
import ora
from pathlib import Path
import sqlalchemy as sa
import ujson
from .jobs import jso_to_job, job_to_jso
from .lib import itr
from .runs import Instance, Run
from .program import Program, Output, OutputMetadata
log = logging.getLogge... |
import os
from common import utility, crypto
import hashlib
import time
from copy import deepcopy
from multiprocessing import Process, Lock
def gossip(config, network, gossipSequence):
"""
creates and writes all gossip from the files nodeSaveFile and channelSaveFile defined in config
Writes this informat... |
import pywikibot
import requests
class Props:
APPLIES_TO_PART = "P518"
ARCHITECT = "P84"
BAG_BUILDING = "P5208"
BAG_PUBSPACE = "P5207"
BASED_ON_HEURISTIC = "P887"
CAPACITY = "P1083"
CATALOG = "P972"
CATALOG_CODE = "P528"
CCONTEXT = "P8296"
CCREATOR = "P6241"
COLLECTION = "P1... |
#!/usr/bin/python
#
# Copyright 2014 Amazon.com, Inc. or its affiliates. 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.
# A copy of the License is located at
#
# http://aws.amazon.com/apache2.0
#
# or in the "... |
import numpy as np
from collections import OrderedDict
from second.core import box_np_ops, region_similarity
from second.core.target_ops import create_target_np
from second.utils.config_tool import get_downsample_factor
from second.protos import target_pb2, anchors_pb2
from second.builder import similarity_calculator_... |
import os
import pickle
import glob
import re
import pyedflib
import numpy as np
import scipy.signal as ssignal
from tqdm import tqdm
from sklearn import preprocessing
# AUTHOR: https://github.com/drasros/sleep_staging_shhs/blob/master/shhs.py
# NOTE: Does not work on SHHS2 yet...
# SHHS2 has a mix of 125Hz recor... |
# coding=utf-8
# Copyright 2020 The Google Research Team Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by app... |
# -*- coding: utf-8 -*-
# *****************************************************************************
# NICOS, the Networked Instrument Control System of the MLZ
# Copyright (c) 2009-2022 by the NICOS contributors (see AUTHORS)
#
# This program is free software; you can redistribute it and/or modify it under
# the t... |
#!/usr/bin/env python
# Copyright (c) Facebook, Inc. and its affiliates.
"""
Detectron2 training script with a plain training loop.
This script reads a given config file and runs the training or evaluation.
It is an entry point that is able to train standard models in detectron2.
In order to let one script support tr... |
# pdf.py
import os.path as osp
import matplotlib as mpl
import matplotlib.pyplot as plt
import numpy as np
import astropy.units as au
import astropy.constants as ac
import pandas as pd
from mpl_toolkits.axes_grid1 import ImageGrid
from ..plt_tools.cmap import cmap_apply_alpha
from ..util.scp_to_pc import scp_to_pc
f... |
"""
Copyright 2018 EPAM Systems, 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 agreed... |
"""
Module to convert SWW to DEM files.
"""
from __future__ import division
# external modules
from past.builtins import str
from builtins import range
from past.utils import old_div
from future.utils import raise_
import os
import numpy as num
# ANUGA modules
from anuga.abstract_2d_finite_volumes.util import rem... |
from flask import request, flash, redirect, url_for, Blueprint, abort, jsonify, make_response, current_app
from flask_login import current_user, login_required
from functools import wraps
import sqlalchemy.exc
from werkzeug.exceptions import BadRequest, NotFound, Forbidden
from app.main.views.utils import render_tem... |
import numpy as np
from skimage.exposure import equalize_adapthist
import torch
from scipy.ndimage import gaussian_filter
import scipy
import random
import torch as th
from PIL import Image
from scipy.interpolate import RectBivariateSpline
class MyRandomImageContrastTransform(object):
def __init__(self, random_s... |
import copy
from os import path
from typing import List, Tuple, Union
import numpy as np
from autoconf import conf
from autofit import exc
from autofit.mapper import model_mapper as mm
from autofit.mapper.prior import prior as p
from autofit.non_linear.abstract_search import Result
from autofit.non_linear.... |
# -*- coding: utf-8 -*-
"""fspdf.fspdf: Fill and sign PDFs."""
__version__ = "0.1.4-dev"
import tkinter as tk
import os
import argparse
import configparser
import tempfile
import shutil
import subprocess
from PIL import ImageTk, Image, ImageFont, ImageDraw
class Page():
def __init__(self, img_file, canvas):... |
"""
Module to solve sqrt-LASSO convex program using regreg.
"""
import numpy as np
from scipy import sparse
from scipy.stats import norm as ndist, chi as chidist
from scipy.interpolate import interp1d
# regreg http://github.com/regreg
import regreg.api as rr
import regreg.affine as ra
from regreg.smooth.glm import ... |
# coding: utf-8
# (C) Copyright IBM Corp. 2020.
#
# 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 2014-2016 Rackspace US, 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 agreed t... |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
from __future__ import absolute_import, division, print_function
import os
import argparse
import pyLikelihood as pyLike
import numpy as np
from astropy.coordinates import SkyCoord
from astropy.table import Table, Column
from astropy.io import fits
fro... |
from influxdb import InfluxDBClient
from . import Measurement, MeasurementUtils
from typing import List, Type, Optional, Dict, Union, Tuple, TypeVar, Generic
import logging
import pytz
from pandas import DataFrame, Series
import datetime
import rfc3339
import dateutil
import traceback
from enum import Enum
import re
im... |
# Copyright 2019 Cortex Labs, 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 agreed to in wri... |
# 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... |
#!/usr/bin/env python3
# encoding: utf-8
#
# Copyright (C), 2012-2014 by <NAME>, <NAME>
#
# Very naive compilation script for the ADSPHD class.
#
# No file dependency checks are performed (use TeXnicCenter, Texmaker, latexmk,
# rubber, SCons, or make if you want such a feature).
#
import glob
import os
import re
impor... |
from sys import _current_frames, version_info
py3 = version_info[0] > 2
py2 = version_info[0] < 3
PY3 = py3
PY2 = py2
def UTF8():
import sys
reload(sys)
sys.setdefaultencoding("utf-8")
if py2:
UTF8()
def DisableHTTPSVerif():
import urllib3
urllib3.disable_warnings(urllib3.exceptions.Inse... |
# Databricks CLI
# Copyright 2017 Databricks, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"), except
# that the use of services to which certain application programming
# interfaces (each, an "API") connect requires that the user first obtain
# a license for the use of the APIs from Databricks,... |
#This files extracts knowledge from the document collection.
# Users makes some queries regarding some properties of the virus and the functions searches the collection for answers
# It returns the sentences with the exact properties
# Approach:
# The user makes two queries.
# A general and a specific one. The genera... |
"""
HTML Fragments
This module defines a HTML fragment class, which holds a piece of
HTML. This is primarily used in browser-based notebooks, though it
might be useful for creating static pages as well.
"""
#*****************************************************************************
# Copyright (C) 2008 <NAME... |
#!/usr/local/bin/python3
# -*- coding: utf-8 -*-
"""
* Copyright (C) 2021 <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:
*
* 1. Redistributions of source code must retain the above ... |
"""Tests methods defined in `qibo/abstractions/gates.py` and `qibo/abstractions/abstract_gates.py`."""
import pytest
from qibo.abstractions import gates
@pytest.mark.parametrize("gatename", ["H", "X", "Y", "Z",
"S", "SDG", "T", "TDG",
"I", "A... |
#!/usr/bin/env python
from __future__ import division
import argparse
import time
import csv
from collections import deque
import rospy
import numpy as np; np.set_printoptions(linewidth=500)
from std_msgs.msg import UInt8MultiArray
from geometry_msgs.msg import PoseStamped, Vector3Stamped
from aclswarm_msgs.msg imp... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.