text stringlengths 6.04k 39.5k |
|---|
import argparse
import os
import shutil
import sys
from collections import OrderedDict
from contextlib import contextmanager
from typing import Dict, Sequence
from unittest.mock import Mock
import pytest
import toml
from hermes.typeo import actions, spoof, typeo
@pytest.fixture(scope="module", params... |
from typing import Union, Optional, List, Dict, Tuple, Any
from collections import OrderedDict
import os
import copy
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import japanize_matplotlib
from . import variables as vs
from . import utils
from . import vis_utils
def create_one_question_data... |
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import re
import time
from urllib import urlencode
from urlparse import parse_qs, urlsplit, urlunsplit
from buildbot.status.builder import FAILURE, SUCC... |
#!/home/mario/anaconda3/envs/project2_venv/bin python
import os
import torch
from torch import nn
from torch.nn import init
# Classes
class BatchNormModule(nn.Module):
"""
DESCRIPTION:
Module to store the batch normalisation (BN) equations to apply per timestep and layer.
The whole class has been adap... |
import numpy as np
from .coordinates import rotate_axis, polar_coordinates, spherical_coordinates
from .atoms import next_neighbors
from .autosave import autosave_data
from .utils import runningmean
from .pbc import pbc_diff, pbc_points
from .logging import logger
from scipy import spatial
@autosave_data(nargs=2, kw... |
import tensorflow as tf
import tensorflow.contrib as tf_contrib
import numpy as np
import os
import time
import sys
def save(sess , checkpoint_dir , step , saver , model_dir='' , model_name="ResNet" , final=False):
checkpoint_dir = os.path.join(checkpoint_dir, model_dir)
checkpoint_dir_final = os.path.joi... |
#!/usr/bin/python
# (c) 2021, NetApp, Inc
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
DOCUMENTATION = '''
module: na_ontap_partitions
short_description: NetApp ONTAP Assign partiti... |
import os, re, sys, glob, types, itertools
import numpy as np
from collections import defaultdict
def _xor(a, b):
return not ((a and b) or (not a and not b))
def _is_property(obj, name):
return isinstance(getattr(type(obj), name, None), property)
def _is_method(x):
return type(x) in [types.MethodType, type... |
import itertools
import logging
import os.path as osp
import tempfile
from collections import OrderedDict
from pycocotools.coco import COCO,_isArrayLike
import time
import mmcv
import numpy as np
from .coco import CocoDataset
from .builder import DATASETS
from collections import defaultdict
from refile import smart_ope... |
#!/usr/bin/env python
# vizDr.py
import os
import zipfile
import requests
import numpy as np
import pandas as pd
import seaborn as sns
from string import letters
from matplotlib import colors
import matplotlib.pyplot as plt
from pandas.tools.plotting import radviz
from matplotlib.colors import ListedColormap
from pan... |
#!/usr/local/bin/python3
# -*- coding: utf-8 -*-
# DESCRIPTION: Given a metadata excel file with names to remove
# and a directory with text files passed as arguments to the script,
# names of students and instructors are replaced with <name>
#
# Usage example:
# python deidentify_macaws.py --directory=../headers/fi... |
import sys
import glob
import copy
import math
import time
from pathlib import Path
import numpy as np
from scipy.spatial.transform import Rotation
import open3d as o3d
import matplotlib.pyplot as plt
import cv2 as cv
from . image_depth import ImageDepth
from cpp.pose_graph import optimize_pose_graph_with_matches, opt... |
import csv
import logging
import numpy as np
import math
import torch
import torch.nn.functional as F
import torch.optim as optim
from torch import nn
from torch import distributions
from torch.utils.data.sampler import WeightedRandomSampler
from meta_learn import metrics
from .utils import avg_shortest_path_length, to... |
from __future__ import absolute_import
import ast
from collections import namedtuple
from functools import partial
import pycodestyle
__version__ = "0.0.1"
class SentryVisitor(ast.NodeVisitor):
NODE_WINDOW_SIZE = 4
def __init__(self, filename, lines):
self.errors = []
self.filename = filen... |
#!/usr/bin/env python
"""
A GUI tool for annotating onsets in audio files.
Example of how to run:
> python scripts/annotate.py onsets/rwc/segment_index.csv --verbose
See the README.md for more detailed information.
Keys:
"""
from __future__ import print_function
import argparse
import claudio
import logging
impo... |
# -*- coding: utf-8 -*-
"""
------------------------------------------------------------------------------
Copyright (C) 2019 Université catholique de Louvain (UCLouvain), Belgium.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may... |
import os
import struct
import binascii
import socket
import threading
import datetime
from time import time, sleep
from json import load, loads, dumps
from src.utils import *
from src.db_worker import *
from src.logs.log_config import logger
from src.protocols.Teltonika.crc import crc16
class Teltonika:
BASE_PAT... |
# Copyright (c) 2016, #
# Author(s): <NAME>, #
# Date: 28/07/2016 #
# A... |
import enum
from typing import Callable, Tuple, Union
import gin
import numpy as np
import torch
from scipy.special import softmax
from cid.memory.score_based import (ScoreBasedReplayMemory,
TransitionScorer)
FloatTupleT = Tuple[float, float]
@gin.configurable(blacklist=['exampl... |
import shutil
import logging
import os
import time
import copy
import numpy as np
import torch
from checkpoint import Checkpoint
from optim import Optimizer
from collections import namedtuple
def loss_containers(opt):
ldic = {}
# t: train, v: val, p: print
ldic['ptHE'] = [0., 0.]
ldic['pvHE'] = 0.
... |
"""Small General-Purpose Utility Functions."""
import os
import sys
import ujson
import ssl
from urllib import parse
import aiohttp
import asyncio
import uvloop
from aiohttp import web
from aiocache import cached, SimpleMemoryCache
from aiocache.serializers import JsonSerializer
from ..config impo... |
import argparse
import binascii
import logging
import os
import random
#os.environ["CUDA_VISIBLE_DEVICES"] = "0"
import sys
from pathlib import Path
from typing import Optional
import pdb
import copy
import numpy as np
import torch
import torch.nn.functional as F # noqa
import torch.optim as optim
import tqdm
from ig... |
from classtime.logging import logging
logging = logging.getLogger(__name__) # pylint: disable=C0103
import re
class Schedule(object):
"""Represents a 5-day week of 24-hour days
Each day is split into 48 thirty-minute blocks
"""
NUM_BLOCKS = 24*2
"""Number of blocks in one day"""
NUM_DAYS = ... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of this
# software and associated documentation files (the "Software"), to deal in the Software
# without restriction,... |
# Copyright 2021 Aix-Marseille Université
# "Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements; and to You under the Apache License, Version 2.0. "
import numpy as np
import scipy.special as sp_spec
from scipy.optimize import minimize
from .Zerlaut import ZerlautAdaptati... |
from py_snap_helpers import *
import otbApplication
from ogr import osr
import ogr
import gdal
import geopandas as gp
import os
import pandas as pd
import numpy as np
from shapely.geometry import box
from shapely.wkt import loads
import sys
gdal.UseExceptions()
#sys.path.append('/opt/OTB/lib/python')
#sys.path.appe... |
#!/usr/bin/env python
"""The classes in this module aid the specification of tally `units` in
:py:class:`pyne.simplesim.cards.ICellSurfTally` (see examples below). The class
focuses on the ability to specify cells and surfaces that are nested within
universes or other cells in nearly arbitrarily complex ways. Apart f... |
import numpy as np
import time
import h5py
import matplotlib.pyplot as plt
import scipy
from sklearn.model_selection import train_test_split
from parse_coverages import get_tests_matrix
import argparse
# from PIL import Image
# %matplotlib inline
# plt.rcParams['figure.figsize'] = (5.0, 4.0) # set default size of pl... |
import tkinter as tk
import subprocess
import os
import signal
from tkinter import *
from tkinter import ttk, filedialog, messagebox, colorchooser
from copy import copy, deepcopy
from time import sleep
from threading import Timer
sign = lambda x: (1, -1)[x < 0]
global colour_selected, colour_possible_mo... |
#!/usr/bin/env python
# socat tcp-listen:8002,reuseaddr,fork /dev/ttyACM0,b460800,raw,echo=0,crnl
import sys, argparse
import socket
import serial
import json
import struct
import numpy as np
import time
import multiprocessing
import matplotlib
matplotlib.use('GTKAgg')
from matplotlib import pyplot as plt
from matplo... |
'''
Deep Learning for Data Science: Assignment 2
Submitted by: <NAME> (<EMAIL>)
Description - Add another layer to NN developed in Lab1.
- Add momentum
- Additional Tests such as initialization, grid search,
- Training using Gradient Descent
'''
import numpy as np
f... |
import graphene
import graphql_jwt
from graphql_jwt.decorators import login_required
from graphene_django.types import DjangoObjectType
from graphene_django.filter import DjangoFilterConnectionField
from django.contrib.auth import get_user_model, logout
from django.conf import settings
from lims.models.user import *
... |
import numpy as np
import cv2
import itertools
import math
import random
import os
FONT = cv2.FONT_HERSHEY_SIMPLEX
def invert_frame(frame):
(H,W) = frame.shape[:2]
center = (W/2, H/2)
M = cv2.getRotationMatrix2D(center, 180, 1.0)
frame = cv2.warpAffine(frame, M, (W,H))
return frame
def bar_grap... |
import os
from collections import defaultdict
from ctypes import c_float
from itertools import chain
from typing import List, Tuple
import pyglet
from pyglet.gl import *
from pyglet.graphics.vertexdomain import create_domain, create_attribute_usage
from .wavefront_parsers import ObjectParser, WavefrontObjectFactory
f... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# zernike.py
"""
A module defining the zernike polynomials and associated functions.
Running this file as a script will output a graph of the first 15 zernike
polynomials on the unit disk.
https://en.wikipedia.org/wiki/Zernike_polynomials
http://mathworld.wolfram.com/Zern... |
#!/usr/bin/env python
#
# Copyright (C) 2017 ShadowMan
#
"""
A high-level overview of the framing is given in the following figure.
B 0 * * * * * * * 1 * * * * * * * 2 * * * * * * * 3 * * * * * * * -
| | | | |
0 | 1 | 2 |... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright 2019 <NAME> (Nagoya University)
# based on a WaveNet script by <NAME> (Nagoya University)
# (https://github.com/kan-bayashi/PytorchWaveNetVocoder)
# based on sprocket-vc script by <NAME> (Nagoya University)
# (https://github.com/k2kobayashi/sprocket)
# Apache ... |
import discord
import random
from helpcommands import *
from elo import *
from datetime import datetime
from random import shuffle,randint
client = discord.Client()
busyChannels = []
game = discord.Game(name="Perudo")
diefaces = 6 #Number of faces on a die
startingdice = 5 #H... |
import os
from collections import namedtuple
from typing import Dict
import numpy as np
import pytest
from scipy.sparse.csgraph._min_spanning_tree import minimum_spanning_tree
import meio.gsm.dag_gsm as dag_gsm
import meio.gsm.tree_gsm as tree_gsm
from meio.gsm.common_test_utils import (solution_policies_equal, setup... |
"""CDMS database objects"""
from __future__ import print_function
from .error import CDMSError
from . import cdmsobj
from . import cdurlparse
# import internattr
import os
import re
import string
import sys
from .CDMLParser import CDMLParser
from .cdmsobj import CdmsObj
from .dataset import Dataset
try:
import ld... |
import time
import gym, numpy as np
import pygame, pymunk, logging, math, random
# imports for DQNAgent
import numpy as np
from keras.models import Sequential
from keras.layers import Dense, Dropout, Conv2D, MaxPooling2D, Activation, Flatten
from tensorflow.keras.optimizers import Adam
from keras.callbacks import Tens... |
import enum
from typing import Iterable, Optional, Tuple
from matplotlib.axes import Axes
from matplotlib.figure import Figure
from database import BLOCKCHAIN, Database
import matplotlib.colors as mcolors
import matplotlib.pyplot as plt
import numpy as np
import csv
class ViewMode(enum.Enum):
ASCII_HISTOGRAM = "a... |
#!/usr/bin/python
DESC = '''Synthetic multipathway graph model
By: NP
Pending (AA):
visualize: https://stackoverflow.com/questions/35109590/how-to-graph-nodes-on-a-grid-in-networkx
'''
import argparse
import csv
import logging
import math
import matplotlib.pyplot as plt
import networkx as nx
impor... |
import numpy as np
import gym, gym.spaces
import time
import os
from collections import OrderedDict
import yaml
EPS = 1e-5
def parse_config(config):
with open(config, 'r') as f:
config_data = yaml.load(f)
return config_data
class ToyEnv:
def __init__(self,
config_file,
... |
"""
Menú principal y vistas referentes a los datos tomados por la estación de datos biométricos.
Autores:
<NAME>
<NAME>
"""
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from os import system, name
import sys
import mysql.connector
from statistics import mean
def conexion_sql():
conexi... |
from pyglet import event
from pyglet.gl import glClearColor, GL_TRIANGLES
from pyglet.window import key, Window
from pyglet.shapes import Rectangle
from pyglet.text import Label, caret
from pyglet.text.document import FormattedDocument
from pyglet.text.layout import IncrementalTextLayout, ScrollableTextLayout
from sett... |
from __future__ import print_function
import math
import time
import uuid
import hashlib
import copy
import base64
import urllib.request
import tornado.web
import tornado.websocket
import tornado.ioloop
import tornado.httpclient
import tornado.gen
import tornado.escape
import setting
import tree
import node
import l... |
from scipy.optimize import brute, minimize
import pkg_resources
from ..utils.utils import cart2mu
import numpy as np
from dipy.utils.optpkg import optional_package
numba, have_numba, _ = optional_package("numba")
SPHERES_PATH = pkg_resources.resource_filename(
'dmipy', 'data/spheres'
)
__all__ = [
'GlobalBru... |
import sys
import textwrap
import argparse
import networkx as nx
from config import *
import re
import os
import math
import random
import numpy as np
def parse_node_name(node_name, max_router, max_host):
try:
val = int(node_name[:-1])
if(node_name[-1] == 'r'):
if(val > max_router):
... |
import argparse
import logging
import math
import random
from argparse import ArgumentParser, ArgumentTypeError, FileType
import ignite
import torch
from ignite.engine import Engine, Events, State, create_supervised_evaluator, create_supervised_trainer
from ignite.handlers import EarlyStopping, Timer
from ignite.metri... |
"""Plotting for manuscript figures."""
import matplotlib
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import fit
from models import calc_cs, calc_ffs, calc_ge_gm, calc_rho, dipole_ffs, get_b2, hbarc
matplotlib.rcParams["text.usetex"] = True
matplotlib.rcParams["font.size"] = 13
matplotlib.r... |
import os
import re
import ai_info
import global_config
import collections
import glob
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from sklearn import linear_model
from sklearn.metrics import mean_squared_error
from read_data.utils import *
from read_data.perf import *
from analyze_interferen... |
import inspect
from abc import ABCMeta, abstractmethod
from copy import deepcopy as _deepcopy, copy as _copy
import sympy as sp
import wrapt
import itertools
from utils.func_utils import get_cached_func_spec, make_function
from structdict import StructDict, OrderedStructDict
import numpy as np
from numpy.lib.stride_t... |
#### test_BMPS_code.py ####
# 5/18/2019
#This file contains the unit tests for the B\"armann, Martin, Pokutta, &
#Schenider Online_IO algorithm methods. See the "Validation/Usage" subsection
#(first part) of the "Online Gradient Descent for Online Inverse Optimization"
#section for full details/explanation regarding... |
#! /usr/bin/python
# -*- coding: utf-8 -*-
#
# tkinter example for VLC Python bindings
# Copyright (C) 2015 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 ... |
#!/usr/bin/env python
# <NAME> 2019
import os
import glob
import shutil
import sys
import json
import errno
import numpy as np
import netCDF4 as nc
# Add dvm-dos-tem directory to path so that we can import various scripts,
# classes from the calibration directory, and the calibration targets.
# Assumes that this sc... |
#import numpy as np
import cupy as cp
from ArraysCollection import ArraysCollection
import functools
import math
class DirectionalFilterBank():
""" Class that perform a directional filter bank, which means one step of the curvelet transform for one scale.
The procedure was taken from the article the unifor... |
import numpy as np
import os
import subprocess
import shutil
import multiprocessing
import sys
import copy
from collections import OrderedDict
from pyfoamsetup.coreLibrary import *
import pyfoamsetup.coreLibrary.CaseSetup as CaseSetup
class PropellerSimulation(CaseSetup.CaseSetup):
def __init__(self, runName, c, D, ... |
# -*- coding: utf-8 -*-
from openerp.osv import osv,fields
from openerp import models, fields, api, _
class CambioParaleloDetalle(models.Model):
_name="cambio.paralelo.detalle"
_order = "contador asc"
paralelod_id =fields.Many2one('cambio.paralelo',string="Relacion")
contador = fields.Integer(string="... |
import pymysql
import os
import datetime
from prettytable import PrettyTable
con = pymysql.connect('localhost','root','','Bank5')
cur = con.cursor()
def signup() :
os.system('clear')
now = str(datetime.datetime.now())
name = input("\nEnter Your Name -: ");
address = input("\nEnter Your Address -: ")
date = input("... |
from pathlib import Path
from timeit import default_timer as timer
import h5py
import numpy as np
import torch
from methods.utils.data_utilities import (_segment_index, load_dcase_format,
to_metrics2020_format)
from torch.utils.data import Dataset, Sampler
from tqdm import tqd... |
'''
-----------------------
| WAKIS solver module |
-----------------------
Functions for WAKIS solver
Functions:
---------
- run_WAKIS(): main routine
- calc_long_WP(): obtains Wake potential WP(x,y,s) form Ez(x,y,z,t) field
- calc_trans_WP(): obtains transverse Wake potential WPx(s), WPy(s) from WP(x,y,s)
- calc_lo... |
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.nn import init
from torch.utils.data import DataLoader, Dataset, TensorDataset
import random
import os
from evaluation import *
from mayavi import mlab
from mayavi.tools import pipeline
import pandas as pd
import numpy as np
def init_weight... |
import numpy as np
import os
import cv2
import re
import csv
import glob
import random
import pickle
from geometry.transformation import *
import tensorflow as tf
from scipy import interpolate
import argparse
import random
import numpy
import sys
import threading, time
from utils.tum_associate import *
fx = 517.3
fy =... |
# -*- coding: utf-8 -*-}
import logging
import math
import os
import json
from urllib.parse import urlparse
from flask import g as flask_g, abort
from flask import (request, current_app, Response,
stream_with_context)
from flask_babel import gettext
from flask_restful import Resource
from py4j.protocol import Py4J... |
import unittest
import sys
from fudge import reactionSuite
from brownies.BNL.inter.report import *
from xData.unittest import TestCaseWithIsClose as TestCaseWithExtras
TEST_DATA_PATH, this_filename = os.path.split(os.path.realpath(__file__))
VERBOSE = '-v' in sys.argv or '--verbose' in sys.argv
DOPLOTS = '-p' in sys.a... |
import matplotlib.pyplot as plt
import numpy as np
import os
import torch
from data_process import label_to_init_vector
from plotting import image_fancy
from settings import BETA, GAUSSIAN_STDEV, DIR_OUTPUT
import matplotlib as mpl
mpl.rcParams["mathtext.default"]
mpl.rcParams["text.usetex"] = False
mpl.rcParams["te... |
from construct import *
import hexdump
import os
class EnvironmentVariable(object):
def __init__(self):
self.name = ""
self.value = ""
def environment_variable(self, current_machine):
list_env_var = []
for ve in current_machine.Win32_environment():
env_var = Enviro... |
import argparse
import json
import os
from collections import defaultdict
from sklearn.metrics import log_loss
from torch import topk
from training import losses
from training.datasets.classifier_dataset import DeepFakeClassifierDataset
from training.losses import WeightedLosses
from training.tools.config import load... |
# Copyright (c) 2012-2013 ARM Limited
# All rights reserved.
#
# The license below extends only to copyright in the software and shall
# not be construed as granting a license to any other intellectual
# property including but not limited to intellectual property relating
# to a hardware implementation of the functiona... |
# -*- coding: utf-8 -*-
# Copyright (C) 2009-2020 Mag. <NAME>. All rights reserved
# Glasauergasse 32, A--1130 Wien, Austria. <EMAIL>
# ****************************************************************************
# This module is part of the package _MOM.
#
# This module is licensed under the terms of the BSD 3-Clause ... |
import numpy as np
import matplotlib.pyplot as plt
import accretion_code as ac
import file_tools as flt
from scipy.interpolate import interp1d
import dedalus.public as de
import file_tools as flt
def mag(x): return np.log10(np.abs(x)+1e-16)
import mpmath as mp
li2_obj = np.frompyfunc(lambda x: float(mp.polylog(2,x)),1... |
import zipfile,zlib
import chardet
import shutil
import string
import time
import sys
import os
import hashlib
import json
import re
import tempfile
import socket,requests
import platform
# for subprocesses
import subprocess
# List drive
def getDrivers():
available_drives = ['%s:' % d for d in string.ascii_uppercas... |
"""A Python implementation of the Simulated Annealing kernel."""
from six import iteritems
import math
import time
import importlib
from rig.place_and_route.place.utils import \
add_resources, subtract_resources, overallocated
import warnings
class PythonKernel(object):
"""An implementation of the Simul... |
from django.core.exceptions import PermissionDenied
from django.utils.dateparse import parse_datetime
from django.utils.translation import gettext_lazy as _
from django.views.generic import RedirectView
from apps.ota.models import DeviceVersionAttribute
from apps.property.views import *
from apps.report.views import B... |
# !/usr/bin/python
# -*- coding: utf-8 -*-
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
#
# The MIT License (MIT)
#
# Copyright (c) 2017 <NAME> (jorgegomes83 at hotmail dot com)
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and as... |
#(c) 2016 by Authors
#This file is a part of ABruijn program.
#Released under the BSD license (see LICENSE file)
"""
This module provides repeat graph parsing/serializing functions,
(as output by repeat graph construction module)
as well as some basic operations
"""
from __future__ import division
from typing import ... |
# implicit imports are cleaner and faster to import, rather than discord.ext.commands.command
from discord.ext.commands.core import guild_only
from src.data_clusters.configuration.server_vars import server
from discord import Member, Embed, channel
from discord.ext.commands import Cog, command, cooldown, BucketType
fro... |
import logging
from tqdm import tqdm
import os
import jieba
from collections import Counter
import numpy as np
from algo.model.model_config import BertBilstmCrfConfig
from algo.model.msra_preprocessing import msra_preprocessing
from algo.models import ClassifyTag
from algo.model.model_config import FastTextConfig
def... |
#!/usr/local/bin/python3
import sys
import re
import readgedcom
# Output DNA matches in a tree view in Graphviz DOT format.
# Given a GEDCOM with people having an event of type defined below
# and an optional note containing the cM value.
# The person for whom the matches are compared should have a note or val... |
import netCDF4 as nc
import numpy as np
import os
def build_url(yyyy,mm,dd,hh):
return f'http://172.16.31.10:8080/opendap/opendap/wrf5/d03/archive/{yyyy}/{mm}/{dd}/wrf5_d03_{yyyy}{mm}{dd}Z{hh}00.nc'
def read_netcdf4_files(wrf,scan):
try:
model = nc.Dataset(wrf)
radar_scan = nc.Da... |
# -*- coding: utf-8 -*-
"""File for base geometry class built using the Geomdl class"""
import numpy as np
class Geometry2D:
'''
Base class for 2D domains
Input: geomData - dictionary containing the geomety information
Keys: degree_u, degree_v: polynomial degree in the u and v directions
ctrl... |
import numpy as np
import datetime, logging
import katpoint
import mosaic.coordinate as coord
from mosaic.interferometer import InterferometryObservation
from mosaic.tile import createTiling
from mosaic.plot import plotPackedBeam, plotBeamContour, plotBeamWithFit, plot_interferometry, plot_overlap
from mosaic.beamshape... |
import json
import logging
import math
import time
import Math
import RPi.GPIO as GPIO
from websocket_server import WebsocketServer
from Background_Thread import Background_Thread
moving_left = False
moving_right = False
moving_forward = False
moving_backward = False
# Current Value Variables
current_latitude: floa... |
# encoding: utf-8
from __future__ import unicode_literals
"""Convienent utilities."""
# ## Imports
import sys
from codecs import iterencode
from inspect import isfunction, isclass
from operator import methodcaller
from collections import deque, namedtuple
from collections.abc import Sized, Iterable
from pkg_resour... |
# coding: utf-8
import os
from datetime import date
from django.core.management import setup_environ
try:
from scielomanager import settings
except ImportError:
BASE_PATH = os.path.abspath(os.path.join(os.path.dirname(__file__), '..', '..'))
BASE_PATH_APP = os.path.abspath(os.path.join(os.path.dirname(__f... |
#!/usr/bin/python
#####
# assesses drivers of variance of nir-v using PROSAIL canopy modeling
#####
import numpy as np
import pyprosail
import random
import scipy
import math
import spectral as spectral
import matplotlib.pyplot as plt
from sklearn import tree
from sklearn import metrics
from sklearn.model_selection im... |
"""
This is a sample python script to act as a websocket client inorder to stream
data from Aruba Central Streaming API. Only one topic/subject can be streamed
with this script. However multiple websocket connections or multiple
instances of this script can be run with different topics.
For Presence Topic, the script ... |
"""Repair 'Missing File' errors in Photos caused by moving referenced files to a different drive
Thanks to <NAME> (@dgleich, https://github.com/dgleich) who contributed key portions of the code.
"""
import itertools
import os
import pathlib
import plistlib
import sqlite3
import subprocess
import sys
import time
from ... |
from django.contrib.gis.geos import *
from django.contrib.gis.measure import D
from procyon.starsystemmaker.space_helpers import *
from django.contrib.gis.db import models
from procyon.starcatalog.models import Star, StarType, StarLuminosityType
import json
class StarModel(models.Model):
"""
Additional data a... |
# Minimal script for generating images using pre-trained the GANformer
# Ignore all future warnings
# from warnings import simplefilter
# simplefilter(action = "ignore", category = FutureWarning)
#
# import os
# import argparse
# import numpy as np
# from tqdm import tqdm
#
import sys
from training import misc
from t... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# ==============================================================================
#
# Authors: <NAME> <<EMAIL>>
#
# Copyright (c) 2017 <NAME> . All Rights Reserved.
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associ... |
import csv
import logging
from abc import ABC, abstractmethod
from typing import Any, Dict, List, Tuple, Union
import pandas as pd
from pulp import LpMaximize, LpProblem, LpVariable, lpSum, PULP_CBC_CMD
from dfs import constraints
from dfs import data_frame_utils, pulp_utils
from dfs import file_utils
from dfs.except... |
import numpy as np
import abmvisum.tools.utilities as utilities
from abmvisum.engines.choice_engine import Choice2D
def run_mode_choice(v, config, zoneNo_to_zoneInd, logging, rand):
imped_para_dict = config.impedance_expr
modes_interchangeable = dict(v.Net.Modes.GetMultipleAttributes(["Name", "Interchangeabl... |
from django import forms
from crispy_forms.helper import FormHelper
from crispy_forms.layout import Layout, Fieldset, ButtonHolder, Submit, HTML, Field, Row,Hidden
from crispy_forms.bootstrap import FormActions,InlineRadios,PrependedText, InlineField,StrictButton
from perspectivesx.models import Template, TemplateItem,... |
from datetime import datetime, timedelta
from collections import defaultdict
from django.http import Http404, HttpResponse
from django.shortcuts import render, redirect, get_object_or_404
from django.core.urlresolvers import reverse
from django.contrib.auth.models import User
from django.conf import settings
from djan... |
# Copyright 2021 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import absolute_import
from argparse import Action, ArgumentTypeError, Namespace, _ActionsContainer
from pex import pex_warnings
from pex.argparse import HandleBoolAction... |
import visa
import time
import math
import pdb
import sys
import numpy as np
import matplotlib.pyplot as plt
import re
import os
import keyboard
def HelpAndExit():
print("Usage: ", sys.argv[0], " [-b BeginF] [-e EndF] [-p Points/Decade] [-f FILE_Prefix]\
\noptional: [-n] Don't plot after gathering data\
\noption... |
import re
import sys
import warnings
import traceback
import subprocess
from io import StringIO
from pathlib import Path
from functools import partial
from multiprocessing import cpu_count
from typing import Any, Callable, Dict, List, Optional, Tuple, Union
import numpy
import requests
from pandas import DataFrame, is... |
# Copyright (C) 2018 TU Dresden
# Licensed under the ISC license (see LICENSE.txt)
#
# Authors: <NAME>
from mocasin.gui.utils import platformOperations, listOperations
class mappingInformation:
"""Data object that holds the necessary information to draw a mapping.
:ivar Mapping __mMappingObject: The actual m... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.