text
stringlengths
6.04k
39.5k
#!/usr/bin/env python3 # Copyright 2014 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. """Describe the size difference of two binaries. Generates a description of the size difference of two binaries based on the differenc...
import jsonschema import numpy as np import pytest import os from pyxrf.core.yaml_param_files import ( _parse_docstring_parameters, _verify_parsed_docstring, create_yaml_parameter_file, read_yaml_parameter_file, ) def _generate_parameter_set(): """ Generates sample parameter dictionary for te...
import numpy import theano import logging from theano import tensor from blocks.bricks import ( Bias, Identity, Initializable, MLP, Tanh) from blocks.bricks.attention import SequenceContentAttention from blocks.bricks.base import application from blocks.bricks.recurrent import ( BaseRecurrent, RecurrentStack) ...
""" utils.py Core code. """ import ast import datetime import os import parsercode.decks as decks log_handle = None # How many entries in the front of the draw database rows? Afterward, it is [draw],-1,[deck] draw_database_header_size = 9 draw_database_separator = -1 def SetWorkingDirectory(base_file): """...
"""Shabadoo models for very easy regression.""" import inspect import json import typing from abc import ABC, abstractmethod from functools import wraps from random import randint import numpy as onp import numpyro import pandas as pd from jax import device_put from jax import numpy as np from jax import random from j...
import numpy as np import random from math import log2, ceil import seaborn as sns import matplotlib.pyplot as plt from matplotlib.ticker import ScalarFormatter from proglearn.forest import LifelongClassificationForest, UncertaintyForest from proglearn.sims import * from proglearn.progressive_learner import Progressi...
#!/usr/bin/env python # encoding: utf-8 # # Copyright SAS Institute # # 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 b...
############################################################################## # # Copyright (c) 2001 Zope Foundation and Contributors. # # This software is subject to the provisions of the Zope Public License, # Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. # THIS SOFTWARE IS PROVIDED "AS I...
import numpy as np from scipy.ndimage import map_coordinates from skimage.transform._warps import _stackcopy from skimage.transform import (warp, warp_coords, rotate, resize, rescale, AffineTransform, ProjectiveTransform, Simi...
""" SearchCatalog algorithm """ import abc import collections import time import numpy as np import sympy from .base import SearchAlgorithm from ..sequence import ( Sequence, Const, Integer, Arithmetic, Geometric, Power, make_fibonacci, ) from ..utils import ( affine_transformation, get_base,...
# """ Useful python tools for working with the MIRI MRS. This contains cdp8b specific code. This version of the tools uses the JWST pipeline implementation of the distortion solution to do the transformations, and hooks into offline versions of the CRDS reference files contained within this github repository. Convert...
import torch import torch.nn as nn from functools import partial import math from timm.models.vision_transformer import VisionTransformer, _cfg from timm.models.registry import register_model from timm.models.layers import trunc_normal_, DropPath, to_2tuple import pdb __all__ = [ 'deit_tiny_patch16_224', 'deit_sma...
import csv import itertools as it import os import pandas as pd import numpy as np import pathlib2 import sys from sklearn.metrics import accuracy_score, precision_score, recall_score, f1_score class BaseReporter(object): """ Base class for reporting results of baseline and EDA algorithms. """ metri...
import time import logging import json import random import threading import math from enum import Enum from time import sleep from agt import AlexaGadget from ev3dev2.led import Leds from ev3dev2.sound import Sound from ev3dev2.motor import LargeMotor, OUTPUT_A, OUTPUT_B, OUTPUT_C, MoveTank, SpeedPercent, MediumMot...
#!/usr/bin/python # -*- coding: UTF-8 -*- from urllib.parse import urlencode import json import sys import os import random import time from bs4 import BeautifulSoup import requests import pymysql from qiniu import Auth, put_file, etag, urlsafe_base64_encode import qiniu.config import urllib.request import re import th...
""" Lesson 14 - Part 5 I wanted to write the whole thing from scratch again. I like the successive build up one part at a time for the initial learning but I like to go back and stick it all together at once. Plus repition is good for learning. + - one or more times * - zero or more times ? - zero or one times ""...
import numpy as np import scipy import pandas as pd import datetime as dt import mmh3 from math import floor from sklearn import preprocessing from sklearn.feature_extraction import FeatureHasher from sklearn.feature_extraction.text import CountVectorizer, TfidfTransformer from sklearn.pipeline import Pipeline from skl...
from __future__ import print_function import tensorflow as tf # Node/Layer Types: # * Matrix # * Dimensions (height, width, depth) # * Relu # * Dropout # * Rate # * Conv # * Dimensions (height, width, channels) # * Stride (height, width) # * Padding Type (same, valid) # * Pool # * Type (max, avg) # * Si...
''' Module to store conda build settings. ''' from __future__ import absolute_import, division, print_function import copy from collections import namedtuple import math import os from os.path import abspath, expanduser, join import sys import time from .conda_interface import root_dir, root_writable, cc from .conda_...
import re import time from collections import deque from functools import partial from typing import Any, Dict, List, Tuple, Union from assertpy import assert_that, fail from lisa import ( Environment, LisaException, Logger, Node, RemoteNode, SkippedException, UnsupportedDistroException, ...
from csp import CSP, mrv, num_legal_values, dom_j_up, lcv, first_unassigned_variable, unordered_domain_values, no_inference, min_conflicts_value, random from utils import argmin_random_tie, count, first, extend import time import copy import signal from contextlib import contextmanager class TimeoutException(Exceptio...
#!/usr/bin/python # -*- coding: utf-8 -*- """Toolkit for creating, scraping and combining (wikitext) mapping lists.""" from __future__ import unicode_literals from builtins import dict from collections import OrderedDict import os import pywikibot import batchupload.common as common import batchupload.helpers as helpe...
""" Module contains functions to retrieve and process data from the database folder""" import os import numpy as np import shutil import csv import pandas as pd import pkg_resources pd.options.mode.chained_assignment = None # default='warn' ROOT = pkg_resources.resource_filename('optimol', '') DATABASE =...
""" Allows interactive generation (without many bells and whistles) via the command line Example args (many more args are available, but have defaults) --keyword-vocab ../models/ROC_title_keyword_e500_h1000_edr0.4_hdr0.1_511_lr10.pkl --keyword-model ../models/ROC_title_keyword_e500_h1000_edr0.4_hdr0.1_511_lr10.pt --st...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import html # unescape import itertools import os import sys # sys.stdin.read, argv from collections import deque from datetime import datetime from enum import Enum from threading import Lock, Thread, current_thread from time import sleep import click # edit from vk...
import os import sys import getpass import warnings import pickle import re import math import pandas as pd import numpy as np from tqdm import tqdm import datetime from dateparser import parse import pytz import time import imaplib import email import traceback import dateparser from dateutil import tz import smtp...
# Licensed under a 3-clause BSD style license - see LICENSE.rst from __future__ import absolute_import, division, print_function, unicode_literals import numpy as np from astropy.utils.decorators import lazyproperty from astropy.table import Table, Column import astropy.units as u from .butterfly import SpectrumButterf...
import logging, re, aiohttp from homeassistant.helpers import intent import homeassistant.config as conf_util from homeassistant.helpers import template, entity_registry, area_registry from homeassistant.helpers.network import get_url # 授权 from typing import Optional import homeassistant.auth.models as models from home...
import re import base64 from django.http import HttpResponse, JsonResponse, HttpResponseServerError, HttpResponseBadRequest from django.shortcuts import render from django import forms import domdiv.main from crispy_forms.helper import FormHelper from crispy_forms.layout import Submit, Layout, Div, HTML from crispy_fo...
import os # os.environ["CUDA_VISIBLE_DEVICES"] = '1' import torch # torch.multiprocessing.set_sharing_strategy('file_system') import random import numpy as np from tqdm import tqdm from torch_geometric.data import DataLoader, DataListLoader from torch_geometric.nn.data_parallel import DataParallel import sci...
import torch import torch.nn as nn from .parts import * # from torchsummary import summary """ Code was borrowed and modified from this repo: https://github.com/josedolz/HyperDenseNet_pytorch """ class HyperDenseNet_2Mod(nn.Module): def __init__(self, in_channels=2, classes=4): super(HyperDenseNet_2Mod, s...
from unittest import TestCase from seq2seq import Seq2Seq import numpy as np import tensorflow as tf import math import re import os import string class TestSeq2Seq(TestCase): def setUp(self): # clear everything that might be in the default graph from previous tests tf.reset_default_graph() ...
# Copyright (c) 2015 The MITRE Corporation. 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 copyright # notice, this list of conditions...
import curses import hashlib import os.path from events import * import events from input import CursesInput from ..shared.version import VERSION ColumnSelection = namedtuple('ColumnSelection', ['col','num']) CellSelection = namedtuple('CellSelection', ['cell']) class FreeCellGUI(object): def __init__(self, logi...
import config import os import pandas as pd import numpy as np import itertools import datetime from sklearn.metrics import mean_squared_error from scipy.signal import savgol_filter from matplotlib import pyplot as plt plt.rcParams["figure.figsize"] = (12,4) import warnings warnings.filterwarnings("ignore") class Ge...
# pygame template - skeleton for new games import pygame, sys import random import os game = False menu = True ships = False shipSpeed = 1 shipType = 'small' game_folder = os.path.dirname(__file__) img_folder = os.path.join(game_folder, 'img') font_folder = os.path.join(game_folder, 'font') snd_folder = os.path.join(g...
import operator import warnings import numpy as np from scipy.special import logsumexp from sklearn import mixture from sklearn.base import BaseEstimator from sklearn.utils import check_random_state, extmath from sklearn.utils.validation import check_is_fitted from sklearn.exceptions import ConvergenceWarning from jobl...
import click import os import sys import shutil import tmanager.core.messages.messages as msg import tmanager.utilities.commands as utl_cmds import tmanager.utilities.file_system as utl_fs from tmanager.core.config.config import Config from crontab import CronTab, CronItem from srblib import abs_path _available_automa...
import datetime import pandas as pd import numpy as np import numpy.ma as ma import matplotlib.pyplot as plt import matplotlib.dates as mdates def plot_team(team): years = [2012,2013,2014,2015,2016,2017] g = pd.read_csv("audl_elo.csv") dates = pd.to_datetime(g[(g["team_id"] == team)]["date"]) elo = g...
"""Parsers for handling different parliament documents published after 2015.""" import re from typing import List from typing import Optional from typing import Tuple from lxml import etree from fi_parliament_tools.parsing.data_structures import EmbeddedStatement from fi_parliament_tools.parsing.data_structures impor...
import pandas as pd from polzybackend.models import User, Company, UserToCompany, CompanyToCompany, Role, user_company_roles from polzybackend.utils.auth_utils import generate_token import uuid from flask_sqlalchemy import SQLAlchemy from polzybackend import create_app from ast import literal_eval import sys import io ...
# Copyright 2021 CR.Sparse Development Team # # 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed...
"""Engine actually executes the simulations code.""" from collections import namedtuple from contextlib import contextmanager import logging import numba as nb import numpy as np import pandas as pd from .util import lazy from .trace import Trace LOG = logging.getLogger(__name__) class BasicExecution: """Engin...
# pyre-strict # misc utility functions... import sys import os import json import logging import signal import threading import copy from time import sleep from datetime import datetime from contextlib import contextmanager from typing import ( Tuple, Dict, Set, Iterable, Iterator, List, Ty...
#!/usr/bin/env python # encoding: utf-8 # # @Author: <NAME>, <NAME>, and <NAME> # @Filename: core.py # @License: BSD 3-Clause # @Copyright: <NAME>, <NAME>, and <NAME> from __future__ import division from __future__ import print_function from __future__ import absolute_import import abc import distutils import os impo...
from django.db import models from django.contrib.postgres.fields import JSONField from django.core.exceptions import ValidationError from datetime import date from contacts.models import Center, Contact, Zone, Sector from config.models import SmartModel, Tag from smart_selects.db_fields import GroupedForeignKey from ...
import sys import numpy from matplotlib import pyplot import weno_coefficients import riemann class Grid1d(object): def __init__(self, nx, ng, xmin=0.0, xmax=1.0, bc="outflow"): self.ng = ng self.nx = nx self.xmin = xmin self.xmax = xmax self.bc = bc # p...
#!/usr/bin/python3 from config import * from os import path from os import makedirs import os, re import scripts.truths as truths import scripts.timing as timing import subprocess import scripts.merge as merge logic_operator = {'and':'&', 'or': '|', 'not': '!'} output_pins = 'Y' # D...
# Flask modules from werkzeug.utils import secure_filename # App modules from app import app # Processing modules import glob import numpy as np import os import pandas as pd import statistics import math from os import system from osgeo import gdal from pandas ...
import networkx as nx import matplotlib.pyplot as plt import numpy as np from tqdm import tqdm def OpenFermion_Commutativity(QubitOp_1_frozen, QubitOp_2_frozen, Comm_flag): """ Find if two PauliWords either commute or anti_commute. By default it will check if they commute. Args: QubitOp_1 ...
"""This module handles the gitlab interactions.""" from __future__ import print_function import re import os import logging import pprint from gltools.exceptions import GLToolsException, GLToolsConfigException log = logging.getLogger('gltools.localgitlab') try: import gitlab except ImportError: raise GLTo...
import datetime import logging from typing import Union from dataclasses import dataclass, field import discord from discord.ext import commands import database.database_operation as database_operation from database.database_setup import DbHandler import utils.account as account import utils.exception as exception i...
# python import lx, lxifc, modo, replay, re, os from replay import message as message """A simple example of a blessed MODO command using the commander module. https://github.com/adamohern/commander for details""" # The hardest part is going to be dealing with undos. If the user executes 2 commands, # undoes one, a...
import argparse, time, csv, os, datetime, shutil import torch from torch.autograd import Variable import torch.backends.cudnn as cudnn import torch.optim import torch.nn as nn import torch.nn.functional as F import torch.utils.data import pose_transforms from scipy.misc import imresize import numpy as np ...
import numpy as np import math import matplotlib.pyplot as plt from scipy import interpolate, integrate import hibplib as hb import hibpplotlib as hbplot import matplotlib.colors as colors # %% # Calculate HIBP beam attenuation in T-15MD tokamak def egg_fun(x, const=0.8): '''function transforms ellipse to egg-lik...
import scipy.signal import scipy.ndimage import numpy as np import pandas as pd import matplotlib.pyplot as plt import matplotlib.dates as mdates import matplotlib.colors as mcolors import matplotlib.ticker as mticker # data ingestion tools #--------------------- def get_outbreak_data_usa(filename=None, fillna=None, p...
# Copyright 2016-2021 The <NAME> at the California Institute of # Technology (Caltech), with support from the Paul Allen Family Foundation, # Google, & National Institutes of Health (NIH) under Grant U24CA224309-01. # All rights reserved. # # Licensed under a modified Apache License, Version 2.0 (the "License"); # you ...
import pygame import pygame_gui import thorpy import math import queue import random as rnd from recursiveMaze import chooseOrientation, drawHorizontal, drawVertical, recMaze from algorithms import AStar, Dijkstra, foundPath, DFS, BFS, bidirectionalPath, bidirectionalBFS, h pygame.init() # Global variables WIDTH = 800...
import copy import re from dnload.common import is_listing from dnload.common import is_verbose from dnload.glsl_block_assignment import is_glsl_block_assignment from dnload.glsl_block_control import is_glsl_block_control from dnload.glsl_block_declaration import is_glsl_block_declaration from dnload.glsl_block_functi...
import os import matplotlib.patches as mpatches import numpy as np import pkg_resources from PyQt5 import QtWidgets, QtCore, uic from PyQt5.QtCore import QSettings, QThread from PyQt5.QtWidgets import QMenu from PyQt5.Qt import Qt from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg as FigureCanvas, \ ...
#!/usr/bin/python # # Copyright 2012 Red Hat, Inc. # # 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 your option) any later version. # # This program is...
from util import * import torch from pytorch_transformers import * import logging import argparse from torch.nn.utils.rnn import pad_sequence import torch.nn.functional as F import os import math import numpy Connective_dict = {'Precedence': 'before', 'Succession': 'after', 'Synchronous': 'simultaneously', 'Reason': '...
import numpy as np from scipy.fft import rfft, rfftfreq from scipy.signal.windows import hann from .butter_filter import butter_bandpass_filter def sample_to_win(data_sample, win_length_sec, win_step_sec, sample_rate): n_samples = data_sample.shape[0] # Length of the window as number of samples n_sample...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Tue Aug 4 21:23:05 2020 Ref: https://github.com/minggg/squad/blob/master/util.py @author: qwang """ import torch import torch.nn.functional as F import os import shutil import json import pandas as pd import matplotlib.pyplot as plt import numpy as np f...
""" given the order of course listed is in ascending order places add assumption for booting the speed """ """ Notes: below approach by using search button on source page e.g. if cu10 not found, then ignore cu00 - less than half cu50 - over half cu80 - over 80 cufull - full new found: cuwarn: (/stop) <td>CRS</td><td>...
import torch import torch.nn as nn import torch.nn.functional as F eps = 1e-12 def homo_warping(src_fea, src_proj, ref_proj, depth_values): # src_fea: [B, C, H, W] # src_proj: [B, 4, 4] # ref_proj: [B, 4, 4] # depth_values: [B, Ndepth] o [B, Ndepth, H, W] # out: [B, C, Ndepth, H, W] batch, cha...
import re import networkx as nx from django.db.models import Q from django.http import JsonResponse, HttpResponse from django.shortcuts import render, get_object_or_404 from hostel.clients.models import Client, ClientSearch from hostel.common.models import Service, City, BundleVlan, Bundle from hostel.devices.models ...
from __future__ import annotations import astropy.coordinates import astropy.units import astropy.time import collections import datetime import dataclasses import erfa import functools import itertools import logging import numpy import pathlib import requests import scipy.optimize import typing from . import provider...
from __future__ import print_function import cv2 import message_filters import numpy as np import resource_retriever import rospy import tf.transformations from PIL import Image from PIL import ImageDraw from cv_bridge import CvBridge from geometry_msgs.msg import PoseStamped from sensor_msgs.msg import PointCloud2, ...
# -*- coding: utf-8 -*- """ The below functions can be used to post-process SLIM (spacer layer imaging method) mapper bitmap files created by MTM or EHD test rigs by PCS Instruments. """ import copy import math import os import os.path import sys import matplotlib.pyplot as plt import numpy as np from PIL import I...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from datetime import datetime, date from dateutil.relativedelta import relativedelta from django.contrib.sitemaps import Sitemap from django.db.models import Q from django.db.models.functions import Lower from django.http import ( Http404, HttpR...
#!/usr/bin/env python3 # -*- coding: utf8 -*- # Copyright 2019 Université de Liège # # 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 # # Un...
import os import sys caffe_root = '../mscaffe-crf/' sys.path.insert(0, caffe_root + 'python') import caffe import torch from utils import NegProb, np_softmax from PIL import Image import scipy.io as sio import numpy as np import random import time import progressbar bar = progressbar.ProgressBar() USE_WEIGHTS_CNN = '...
import time import math import os import torch import torch.nn as nn import torch.onnx from picotext.data import Corpus from picotext.model import RNNModel ''' > When we do language modeling, we will infer the labels from the text during training, so there's no need to label. The training loop expects labels however...
import csv import json import math import os import numpy as np import torch from torch import nn import matplotlib.pyplot as plt from data.data import LoadData from torch.utils.data import DataLoader from nets.molecules_graph_regression.load_net import gnn_model def print_qerror(preds_unnorm, labels_unnorm): q...
"""Utilities for inverted pendulum experiments.""" import argparse from typing import List import gpytorch import numpy as np import torch import torch.distributions import torch.nn as nn import torch.optim as optim from rllib.dataset.transforms import ActionScaler, DeltaState, MeanFunction from rllib.dataset.utilitie...
import kenlm import flair import math import torch import transformers import time class Kenlm_model(object): def __init__(self, filename): self.filename = filename def start(self): self.model = kenlm.Model(self.filename) def new_state(self): state = kenlm.State() self.model.BeginSentenceWrite(state) r...
#! -*- encoding: utf-8 import os, time, datetime, re import logging import csv from collections import namedtuple from lxml import etree from svgpathparse import parsePath logging.basicConfig(format='%(asctime)s %(levelname)-5.5s %(message)s') log = logging.getLogger(__name__) log.setLevel(logging.INFO) def pascal_...
# Copyright 2019 The TensorFlow Ranking 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 applicable law or ag...
import os import json import importlib from typing import Any, List, Tuple, AsyncIterator, Dict, Type os.environ["TF_CPP_MIN_LOG_LEVEL"] = "2" from transformers import ( AutoConfig, AutoTokenizer, EvalPrediction, TFAutoModelForSequenceClassification, TFTrainer, glue_convert_examples_to_feature...
from web import app from flask import render_template, flash, request from web.forms import SubmitForm, TeamPredForm, TeamForm from web import cursor @app.route('/') def home(): return render_template("home.html") @app.route('/index', methods=['GET']) def index(): return render_template("home.html") @ap...
# -*- coding: utf-8 -*- """This module defines functions for Dali searching Protein Data Bank.""" import re import numpy as np from prody.atomic import Atomic, AtomGroup, AtomMap from prody.proteins.pdbfile import _getPDBid from prody.measure import getRMSD, getTransformation from prody.utilities import checkCoords, c...
#!/usr/bin/env python import argparse import collections import datetime import itertools import random import sys import cloud import MySQLdb import parsedatetime as pdt import requests from lxml import etree MIN_DELAY = 20 MAX_DELAY = 120 MAX_RETRIES = 3 MIN_RETRY_DELAY = MIN_DELAY * 2 MAX_RETRY_DELAY = min(900,...
# coding=utf-8 ## initial script written by <<EMAIL>>, ## list of changes made by liangfu <<EMAIL>> : # 1. add multiplier argument # 2. add an argument to global average pooling # 3. make number of expansion filters depend on the input tensor shape # -------------------------------------------------------------- # SNI...
# Copyright 2018 The TensorFlow Probability 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 applicable law o...
# Copyright 2018 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 l...
# -*- coding: utf-8 -*- import pytest import datetime import dateutil.tz as tz import tzlocal from unittest import TestCase from nose.tools import ok_, eq_ from pysox.soxdata import ( build_soxdata, SensorData, TransducerValue, SensorMeta, MetaTransducer ) def _node_attr(node): ret = {} ...
# Copyright (c) 2019 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 appl...
from __future__ import (division, print_function) import os import time import networkx as nx import numpy as np import copy import pickle from collections import defaultdict from tqdm import tqdm import concurrent.futures import torch import torch.nn as nn import torch.utils.data import torch.optim as optim from torc...
"""distutils.fancy_getopt Wrapper around the standard getopt module that provides the following additional features: * short and long options are tied together * options have help strings, so fancy_getopt could potentially create a complete usage summary * options set attributes of a passed-in object """ im...
import json import os import shutil import subprocess import math import traceback import uuid from pathlib import Path import sys from flask import Flask, request, jsonify, send_file, after_this_request, make_response from werkzeug.utils import secure_filename import yaml import hashlib import boto3 import botocore ...
#!/usr/local/bin/python3 import re import sys import os.path re_beg_cadabra_environ = re.compile (r'^\s*\\begin{cadabra}') re_end_cadabra_environ = re.compile (r'^\s*\\end{cadabra}') re_beg_cadabra_verbatim = re.compile (r'^\s*\\CdbSetup{(.*?)action=verbatim') re_end_cadabra_verbatim = re.compile (r'^\...
import torch from mmhuman3d.core.cameras import build_cameras from mmhuman3d.models.architectures.mesh_estimator import ( ImageBodyModelEstimator, VideoBodyModelEstimator, ) from mmhuman3d.models.builder import build_body_model def test_image_body_mesh_estimator(): backbone = dict( type='ResNet',...
#------------------------------------------------------------------------------ # Libraries #------------------------------------------------------------------------------ # Standard import numpy as np import pandas as pd import cvxpy as cp from sklearn.preprocessing import PolynomialFeatures from statsmodels.tools.too...
import sys import collections import numpy as np from ..pakbase import Package from ..utils.recarray_utils import create_empty_recarray class ModflowHob(Package): """ Head Observation package class Parameters ---------- iuhobsv : int unit number where output is saved. If iuh...
# Copyright 2015 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 logging import os import pickle import re import sys from devil.android import apk_helper from devil.android import md5sum from pylib import constant...
from ms_deisotope.utils import _MappingOverAttributeProxy from .cv import Term, TermSet class ActivationInformation(object): """Describes the dissociation process used to produce an MSn scan. Attributes ---------- data : :class:`dict` Additional metadata describing the dissociation energ...
# Copyright (c) 2020, MeteoSwiss # Authors: <NAME> <<EMAIL>> # # 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 conditions and the...
# Copyright 2016 Nokia # # 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...
import logging import os import numpy as np from scipy.spatial.distance import pdist, squareform from yass.preprocessing import Preprocessor from yass.mainprocess import Mainprocessor from .preprocess.filter import butterworth from .geometry import (n_steps_neigh_channels, order_channels_by_di...