text stringlengths 3.07k 22.1k |
|---|
import numpy as np
from sklearn.discriminant_analysis import LinearDiscriminantAnalysis
from sklearn.discriminant_analysis import QuadraticDiscriminantAnalysis
from sklearn.linear_model import LogisticRegression
from sklearn.linear_model import LinearRegression
from matplotlib import pyplot as plt
import seaborn as sns... |
#!/usr/bin/env python
# (c) 2013, <NAME> <<EMAIL>,
# <NAME> <<EMAIL>>,
# <NAME> <<EMAIL>>
#
# This file is part of Ansible.
#
# Ansible 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, eith... |
import difflib
import pandas as pd
from django.contrib import messages
from django.http import HttpResponseRedirect, HttpResponse
from django.shortcuts import render, redirect
from django.contrib.auth.decorators import login_required
from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger
from django.... |
'''
Created on Oct 3, 2010
@author: Mark V Systems Limited
(c) Copyright 2010 Mark V Systems Limited, All rights reserved.
'''
import gc, sys, traceback, logging, os
from arelle import ModelXbrl, Validate, DisclosureSystem
from arelle.PluginManager import pluginClassMethods
def initialize(cntlr):
modelManager = M... |
import pyglet
import pyglet.gl as gl
import numpy as np
import tempfile
import platform
import collections
from .. import rendering
from ..transformations import Arcball
# smooth only when fewer faces than this
_SMOOTH_MAX_FACES = 100000
class SceneViewer(pyglet.window.Window):
def __init__(self,
... |
#!/usr/bin/env python
import sys
import argparse
from mvpa2.suite import *
from mvpa2.generators.partition import NFoldPartitioner, FactorialPartitioner
from mvpa2.generators.permutation import AttributePermutator
import nibabel
from itertools import *
from os.path import join as pjoin
def shuffle_sa(ds, sa='conditio... |
from sklearn.metrics import make_scorer, f1_score
from itertools import islice
import pandas as pd
import itertools
import sys
def sklearn_grid_search(X, y, search_type, param_grid, scoring, **kwargs):
"""
Search over specified parameter values for every estimator. It runs either GridSearchCV or RandomizedSea... |
# -*- coding: utf-8 -*-
# Copyright 2016 Open Permissions Platform Coalition
# 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... |
# Copyright (c) <NAME>, 2007
__docformat__ = 'reStructuredText'
__all__ = ['GaussianProcess', 'GPEvaluation', 'GPSubmodel']
import pymc as pm
import copy
import numpy as np
from .Realization import Realization
__all__ = ['GaussianProcess', 'GPEvaluation', 'GPSubmodel']
def gp_logp(x, M, C, mesh, f_eval, M_obs, C... |
import argparse
import textwrap
from collections import defaultdict
from copy import deepcopy
from traceback import print_exc
from typing import Sequence
import sys
def group_arguments(args, group_names):
"""Group arguments into given groups + None group for all others"""
groups = defaultdict(list)
group... |
# -*- coding: utf-8 -*-
from django.core.cache import cache
import os
import time
from cms.models import Page
from cms.api import create_page, create_title, add_plugin
from cms.test_utils.testcases import SettingsOverrideTestCase
from cms.test_utils.util.context_managers import SettingsOverride
from django.utils impo... |
# Copyright 2008-2015 Nokia Networks
# Copyright 2016- Robot Framework Foundation
#
# 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
... |
import numpy as np
from tuning.cyMINoncyclic import mc_mean_grad_noncyclic # poisson model
from tuning.cyMINoncyclic import mc_mean_grad_gaussian, mc_mean_grad_gaussian_inhomo, \
mc_mean_grad_gaussian_inhomo_no_corr # gaussian models
import matplotlib.pyplot as plt
#============Gradient Ascent and helper functions fo... |
# -*- coding: utf-8 -*-
# Copyright 2021 Huawei Technologies Co., Ltd
#
# 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... |
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
from torchtext import data, datasets
import time, sys
import nmt.transformer as transformer
import nltk
import os
import sacrebleu
class Batch:
"Object for holding a batch of data with mask during training."
def __init__(se... |
#!/usr/bin/env python
import datetime
import argparse
from egcg_core import util
from cached_property import cached_property
from EPPs.common import StepEPP, RestCommunicationEPP
reporting_app_date_format = '%d_%m_%Y_%H:%M:%S'
class StepPopulator(StepEPP, RestCommunicationEPP):
metrics_mapping = {}
endpoint ... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import pandas as pd
import tensorflow as tf
import numpy as np
import matplotlib.pyplot as plt
import pickle
import os
from sklearn.preprocessing import MinMaxScaler, QuantileTransformer
from sklearn.model_sele... |
import numpy as np
import scipy as sp
import warnings
import scipy.sparse.linalg
from ..kernels.high_level.laplace import Laplace_Layer_Apply, \
Laplace_Layer_Singular_Apply, Laplace_Layer_Form, \
Laplace_Layer_Singular_Form
from ..misc.gmres_counter import Gmres_Counter
from ..pairing import Pairing
c... |
#!/usr/bin/env python3
import cmd, readline
import shlex
from terminaltables import AsciiTable
from colorclass import Color
from api import RHAPI
from algo import RHAlgo
from util import sigint, shprint
from discordTracker import RHDiscord
from threading import Thread
def errorDec(func):
def wrapper(*args,**kwarg... |
import numpy as np
import numpy.matlib
from . import ridge_segment
from . import ridge_orient
def walkonce(im, mask, dfim, start, step, Td):
sp = []
current =0
path = np.array([start])
while True:
temp = path[current,:]
ori = dfim[int(temp[0]), int(temp[1])]
current = current + 1
path ... |
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
"""Tests of nonlinear transforms."""
import os
import shutil
from subprocess import check_call
import pytest
import numpy as np
import nibabel as nb
from nitransforms.base import TransformError
from nitran... |
#!/usr/bin/env python
import argparse
import pandas as pd
import matplotlib.pyplot as plt
from pandas.plotting import register_matplotlib_converters
register_matplotlib_converters()
def read_json(fname):
df = pd.read_json(fname, lines=True, convert_dates=['time'], date_unit='ms')
df['conference_id'] = df['co... |
import os
import numpy as np
import importlib
from photogrammetry_importer.types.point import Point
from photogrammetry_importer.blender_utility.logging_utility import log_report
from photogrammetry_importer.utility.type_utility import is_float, is_int
class _DataSemantics:
def __init__(self):
self.x_idx... |
"""Constructs HistFactory workspaces in JSON format."""
import json
import logging
import pathlib
from typing import Any, Dict, List, Optional, Union
import pyhf
from cabinetry import configuration
from cabinetry import histo
log = logging.getLogger(__name__)
class WorkspaceBuilder:
"""Collects functionality... |
# -*- coding: utf-8 -*-
"""
Fejér proposed two quadrature rules very similar to :ref:`clenshaw_curtis`.
The only difference is that the endpoints are set to zero. That is, Fejér only
used the interior extrema of the Chebyshev polynomials, i.e. the true
stationary points. This makes this a better method for performing q... |
# Copyright 2014-2015 ARM Limited
#
# Licensed under the Apache License, Version 2.0
# See LICENSE file for details.
from .lib import lazyregex #pylint: disable=unused-import
from .lib import errors #pylint: disable=unused-import
# NOTE: argcomplete must be first!
# argcomplete, pip install argcomplete, tab-completio... |
import seaborn as sns
import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
from config import LEGENDS, HEATMAP_LIST, GLUCOSE_LIST, GLUCOSE_LIST_AUC, NORMAL_LIST
from pandas.plotting import parallel_coordinates
def curveplots(df, parameter=None):
"""
Will plot the curves for OGTT.
Paramet... |
from collections import OrderedDict
from itertools import product
import numpy as np
import scipy.sparse as ssp
from scipy.special import binom, logsumexp, logit
from pymoreg.core.misc import get_rng, power_set
from pymoreg.metrics.score import BGe
from pymoreg.structure.graph_generation import random_dag, random_mbc... |
# encoding: utf-8
#
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
# You can obtain one at http://mozilla.org/MPL/2.0/.
#
# Author: <NAME> (<EMAIL>)
#
from __future__ import absolute_import, division, unicode_literals
... |
# -*- coding:utf-8 -*-
# almost storen from https://github.com/andreif/codegen
import ast
BINOP_SYMBOLS = {}
BINOP_SYMBOLS[ast.Add] = '+'
BINOP_SYMBOLS[ast.Sub] = '-'
BINOP_SYMBOLS[ast.Mult] = '*'
BINOP_SYMBOLS[ast.Div] = '/'
BINOP_SYMBOLS[ast.Mod] = '%'
BINOP_SYMBOLS[ast.Pow] = '**'
BINOP_SYMBOLS[ast.LShift] = '<<'
... |
import numpy as np
import random
import time
from math import gcd
import networkx as nx
import matplotlib.pyplot as plt
from utils import distance
class VanillaFairletDecomposition(object):
"""
Computes vanilla fairlet decomposition that ensures fair clusters. It might not give the optimal cost value.
"""
def __... |
#!/usr/bin/env python
from __future__ import print_function
import logging
from regress import *
from loaddata import *
from load_data_live import *
from util import *
from pandas.stats.moments import ewma
def wavg(group):
b = group['pbeta']
d = group['log_ret']
w = group['mkt_cap_y'] / 1e6
print("M... |
"""
This module contains class definitions for open ai gym environments.
"""
import random
# Alternative for grayscale and resize
from skimage import color
from skimage.transform import resize
from minesweeper_env import MinesweeperEnv
import numpy as np
class BaseEnvironment(object):
"""A base environment cl... |
import unittest
import nose2
import wdl_parser.parse
class TestVariableDefinition(unittest.TestCase):
@classmethod
def setUpClass(cls):
"""
final line contains a badly spaced and formatted call that is technically
correct and would validate.
:return:
"""
cls.d... |
"""
Converts a Python dictionary or other native data type into a valid XML string.
Supports item (`int`, `float`, `long`, `decimal.Decimal`, `bool`, `str`, `unicode`, `datetime`, `none` and other
number-like objects) and collection (`list`, `set`, `tuple` and `dict`, as well as iterable and
di... |
import find_mxnet
import mxnet as mx
import numpy as np
import logging
logging.basicConfig(level=logging.DEBUG)
import argparse
from collections import namedtuple
from skimage import io, transform
from skimage.restoration import denoise_tv_chambolle
parser = argparse.ArgumentParser(description='neural style')
parser.... |
import numpy as np
import tensorflow as tf
from tensorflow.keras.layers import *
# Resources consulted:
# https://arxiv.org/abs/1804.02767
# https://github.com/pjreddie/darknet/blob/master/cfg/yolov3.cfg
# https://github.com/zzh8829/yolov3-tf2/blob/master/yolov3_tf2/models.py
# https://github.com/zzh8829/yolov3-tf2/bl... |
import numpy as np
import theano
import theano.tensor as tt
from collections.abc import Iterable, ByteString
from warnings import warn
from copy import copy
from theano.tensor.raw_random import RandomStateType
def param_supp_shape_fn(ndim_supp, ndims_params, dist_params, rep_param_idx=0, param_shapes=None):
"""... |
import torch
import torch.nn as nn
import math
import torch.nn.functional as F
from torch.autograd import Variable
import numpy as np
def make_model():
return IPUDN()
class MeanShift(nn.Conv2d):
def __init__(self, rgb_range, rgb_mean=(0.4488, 0.4371, 0.4040), rgb_std=(1.0, 1.0, 1.0), sign=-1):
super(MeanShift, se... |
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn; seaborn.set()
import openpyxl
from openpyxl import load_workbook
import os.path
from collections import Counter
from statsmodels.distributions.empirical_distribution import ECDF
def percentile(n, name = None):
def percentile_(... |
'''
Generic whole-system tests for end-to-end model training with bnpy.
Usage
------
>>> python runtests.py
'''
import sys
import numpy as np
import unittest
from nose.plugins.attrib import attr
import bnpy
def arg2name(aArg):
if isinstance(aArg, dict):
aName = aArg['name']
elif isinstance(aArg, st... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sat Oct 24 15:00:30 2020
@author: jesper
"""
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.colors as colors
import seaborn as sn
class Table():
# Makes a table at the end of a season
def __init__(self):
... |
#!/usr/bin/python2
#
# Copyright 2016 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Runs an experiment with the benchmark metrics on a pair of CWP data sets.
A data set should contain the files with the pairwise in... |
#!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
import os
from typing import Dict, List, Union
import torch
import torch.jit
import torch.nn as nn
from pytext.common.constants import Stage
from pytext.config.component import Component, ComponentType
from pytext.config.doc... |
"""AUCR yara plugin route page handler."""
# coding=utf-8
import udatetime
import logging
from sqlalchemy import or_
from flask_babel import get_locale
from flask import Blueprint, render_template, request, redirect, url_for, flash, current_app, g
from flask_login import login_required, current_user
from aucr_app impor... |
import os
import sys
import shutil
import tempfile
from typing import List, Type, Optional
from io import StringIO
from unittest.mock import MagicMock
from django.dispatch import receiver # type: ignore
from django.test import SimpleTestCase, override_settings # type: ignore
import sms
from sms import send_sms
fr... |
import logging
import os
from pathlib import Path
import torch
import torch.nn as nn
from torch.optim import Adam
from torch.optim.lr_scheduler import LambdaLR
from tqdm import trange
from config import Config
from nere.data_helper import DataHelper
from nere.evaluator import Evaluator
class BaseTrainer(object):
... |
# coding=utf-8
# Copyright 2019 The Meta-Dataset 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 ... |
import json
import yaml
import re
from copy import deepcopy
from json.decoder import JSONDecodeError
from jsonpath_rw import jsonpath, parse
class RuleProperties(object):
@property
def name(self):
return self.__name
@name.setter
def name(self, name):
if isinstance(name, str):
... |
import sklearn
from sklearn.cluster import KMeans
from sklearn.decomposition import PCA
from sklearn.model_selection import train_test_split
import numpy as np
import pandas as pd
ground_truth_data_df = pd.DataFrame([
('agde', '<NAME>',13,'M',36930),
('altamira','<NAME>',26,'M',97835),
('amanda', 'Mme <NAME>',17,'F... |
"""
Module of utility functions for scaling.
"""
from __future__ import annotations
import logging
from math import acos
import numpy as np
from scipy.spatial.transform import Rotation
import dxtbx.flumpy as flumpy
from cctbx import miller
from dials.array_family import flex
from dials.util.normalisation import q... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# checkOntology.py
# --- import -----------------------------------
# import from standard lib
import logging
from pprint import pformat
# import from other lib
# > conda forge
# import from my project
import icp2edd.setupcfg as setupcfg
import icp2edd.timing
from icp2ed... |
import time
import random
import argparse
import json
import os
import sys
import warnings
BASE_DIR = os.path.dirname(
os.path.dirname(os.path.dirname(os.path.dirname(
os.path.abspath(__file__)))))
sys.path.append(BASE_DIR)
warnings.filterwarnings('ignore')
from thop import profile
from thop import clever... |
# -*- coding: utf-8 -*-
###############################################################################
# Primative Offline QRV-Complex Identifier
##########################################
# Adapted from rpeakdetect.py from:
# https://github.com/tru-hy/rpeakdetect
#
# Adapted by <NAME>
################################... |
# -*- coding: utf-8 -*-
from collections import defaultdict
from itertools import count
from ethereum.utils import encode_hex
from ethereum.abi import encode_abi, encode_single
from raiden import messages
from raiden.utils import isaddress, make_address, pex
from raiden.blockchain.net_contract import NettingChannelCo... |
# coding: utf-8
# !/usr/bin/python
import sys
import time, datetime
import json
from random import Random
from flask import session
from api.utils import Utils
from config import CONST
from config.CONST import *
__author__ = 'Xiejiadong'
__site__ = 'xiejiadong.com'
checkFirstWeekDate = 0
checkReminder = 1
YES = 0
N... |
"""
Copyright 2020 The Magma Authors.
This source code is licensed under the BSD-style license found in the
LICENSE file in the root directory of this source tree.
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES O... |
# coding=utf-8
# Copyright 2019 The 11731(Transformer-TPU) 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 a... |
"""Grid example."""
from flow.controllers import GridRouter, IDMController, RLController
from flow.controllers.routing_controllers import MinicityRouter
from flow.core.params import SumoParams, EnvParams, InitialConfig, NetParams
from flow.core.params import VehicleParams, PersonParams
from flow.core.params import Traf... |
# Copyright (c) 2005-2007 The Regents of The University of Michigan
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met: redistributions of source code must retain the above copyright
# notice, this ... |
# mondrian2.py
import random
# A very small number for comparing floats properly
EPS = 1.e-12
class Vector:
""" A lightweight vector class in two-dimensions. """
def __init__(self, x, y):
self.x, self.y = x, y
def __add__(self, other):
return Vector(self.x + other.x, self.y + other.y)
... |
'''
Winzip 11
@author: <NAME> <<EMAIL>>
@copyright: Copyright (c) 2008 <NAME>
@license: BSD License
All rights reserved. This program and the accompanying materials are made
available under the terms of The BSD License which accompanies this
distribution, and is available at
U{http://www.opensource.org/licenses/bsd-l... |
"""
Created on Fri June 1 2015
FAST Model
Adapted from Yu Xie IDL Fast Radiative Transfer Model
@author: <NAME>
This Fast All-sky Radiation Model for Solar applications (FARMS) was developed
by <NAME> (<EMAIL>). Please contact him for more information.
Literature
----------
[1] <NAME>, <NAME>, <NAME>, "A Fast All-sky... |
import pathlib
import re
import sys
import tarfile
from functools import cached_property
from frozendict import frozendict
import jinja2
from packaging import version
from aio.run import runner
from envoy.base import utils
from envoy.base.utils import IProject, Project
# TODO(phlax): Move all of this to pytooling
... |
from collections import defaultdict
from datetime import timedelta
import json
from django import template
from django.utils.safestring import mark_safe
from django.template.defaultfilters import urlizetrunc
from django.utils.translation import gettext as _
from django.utils.html import format_html
from django.utils i... |
import pytest
from cutadapt.align import (
Aligner,
PrefixComparer,
SuffixComparer,
hamming_sphere,
edit_environment,
SEMIGLOBAL,
edit_distance,
naive_edit_environment,
)
from cutadapt.adapters import Where
from utils import binomial
# convenience function (to avoid having to instant... |
import logging
import re
import sys
# import this module to dump colories DEBUG level logging on stdout
#
# includes thread info by default, so can be useful for some
# quick thread debugging (hahaha...)
#
# TODO: add a Filter or LoggingAdapter that adds a record attribute for parent pid
# (and maybe thread gro... |
import logging
from collections import namedtuple
from enum import Enum
from casbin.rbac import RoleManager as RM
Link = namedtuple("Link", ["user", "role"])
class MatchOrder(Enum):
STR_PATTERN = 0
PATTERN_STR = 1
PATTERN_PATTERN = 2
class Role:
def __init__(self, name):
self.name = name
... |
# -*- coding: utf-8 -*-
''' Data Transforms Module
This module contains functions for transforming PV power data, including time-axis standardization and
2D-array generation
'''
from datetime import timedelta
import numpy as np
import pandas as pd
from scipy.signal import argrelextrema
from sklearn.neighbors.kde imp... |
#!/usr/bin/env python
from __future__ import print_function
from icecube import icetray, dataclasses, phys_services, clsim
from I3Tray import I3Units
import numpy
import scipy
import scipy.interpolate
import scipy.integrate
def setup_converter(useGeant4=False):
# make a converter
if useGeant4:
ppcCo... |
# coding=utf-8
# C extractor for code2vec
#
# Copyright 2019 Carnegie Mellon University. All Rights Reserved.
#
# NO WARRANTY. THIS CARNEGIE MELLON UNIVERSITY AND SOFTWARE ENGINEERING INSTITUTE MATERIAL IS FURNISHED ON AN "AS-IS" BASIS. CARNEGIE MELLON UNIVERSITY MAKES NO WARRANTIES OF ANY KIND, EITHER EXPRESSED OR IMP... |
# Copyright IBM Corp. 2016 All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... |
#!/usr/bin/python3
#
# taker.py: EtherDelta API client in python using websocket
# =========================================================
#
# This example will connect to EtherDelta's WebSocket API,
# query the market, get the order book, get recent trades,
# and then it will perform a buy order of 0.0001 ETH worth
... |
"""Write GSD files from GMSO topologies."""
from __future__ import division
import warnings
import numpy as np
import unyt as u
from unyt.array import allclose_units
from gmso.core.bond import Bond
from gmso.exceptions import NotYetImplementedWarning
from gmso.formats.formats_registry import saves_as
from gmso.utils... |
from __future__ import print_function, division, absolute_import
import array
import sys
import numpy as np
from numba import unittest_support as unittest
from numba import jit
from .support import TestCase, compile_function, MemoryLeakMixin
@jit(nopython=True)
def len_usecase(buf):
return len(buf)
@jit(nopy... |
# Copyright 2021 Ocean Protocol Foundation
# SPDX-License-Identifier: Apache-2.0
#
import json
import lzma
import os
import pathlib
import time
import uuid
from pathlib import Path
import artifacts
import ipfshttpclient
from eth_utils import remove_0x_prefix
from jsonsempai import magic # noqa: F401
from ocean_lib.a... |
import os
import json
import fiona
import rasterio
import pandas as pd
import geopandas as gpd
from shapely.geometry import Point
import datetime
import calendar
from dateutil.relativedelta import relativedelta
# --------------------------------------------------
# spatial functions
def envelope_to_scale(env):
... |
from __future__ import print_function
import struct
import os
import re
from datetime import datetime, timedelta
import numpy as np
from viscid import grid
from viscid.readers import vfile
from viscid.readers import openggcm
from viscid.compat import OrderedDict
# raise NotImplementedError("fortbin reader is not at... |
# -*- coding: utf-8 -*-
import numpy as np
import os
import argparse
import time
import torch
import torch.nn as nn
import torch.backends.cudnn as cudnn
import torchvision.transforms as trn
import torchvision.datasets as dset
import torch.nn.functional as F
from tqdm import tqdm
from models.allconv import AllConvNet
fr... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# #########################################################################
# Copyright (c) 2015-2019, UChicago Argonne, LLC. All rights reserved. #
# #
# Copyright 2015-2019. UChicago Argonne, LLC.... |
# -*- test-case-name: nevow.test.test_appserver -*-
# Copyright (c) 2004-2008 Divmod.
# See LICENSE for details.
"""
A web application server built using twisted.web
"""
import cgi
from urllib import unquote
from zope.interface import implements, classImplements
import twisted.python.components as tpc
from twisted.... |
# Author: <NAME>
# E-mail: <EMAIL>
"""Segmented fitting of a biexponential decay signal. While a section of
the signal is fitted as a monoexponential curve, the remainig is fitted as a
biexponenctial. The signal was simulated using parameters found on literature
for healthy and pathologic regions of a human brain. ... |
# Authors: <NAME> <<EMAIL>>
#
# Copyright (c) Schneider Electric Industries, 2020. All right reserved.
from abc import ABCMeta
from inspect import currentframe, getmodule
from six import with_metaclass
try:
from typing import Type, Union, Tuple, Iterable, Mapping, Optional, Any
from valid8.common_syntax imp... |
"""Module to set the hosts configs from cluster config.
.. moduleauthor:: <NAME> <<EMAIL>>
"""
import logging
from copy import deepcopy
from compass.config_management.utils import config_reference
from compass.utils import util
class ConfigMapping(object):
"""Class to merge cluster config ref to host config ... |
from datetime import datetime
from sqlalchemy import (
Column,
Integer,
BigInteger,
String,
DateTime,
Boolean,
Enum,
Index,
func,
text,
ForeignKey,
MetaData
)
from sqlalchemy.orm import relationship
from sqlalchemy.event import listens_for
from sqlalchemy.dialects.postgr... |
# %% [markdown]
# # Imports
import json
import os
import warnings
from operator import itemgetter
from pathlib import Path
import pickle
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import seaborn as sns
from joblib import Parallel, delayed
from joblib.parallel import Parallel, delayed
from sk... |
# -*- coding: utf-8 -*-
"""
This file is covered by the LICENSING file in the root of this project.
"""
class HTTP_HEADER:
"""Http header that hackathon server api requires
Attributes:
TOKEN: token for current login user to access the hackathon server APIs with @token_required
HACKATHON_NAME:... |
import asyncio
import os
from datetime import datetime, timedelta, timezone
from os.path import isfile
import discord
from discord.ext import commands
from dotenv import load_dotenv
from util.badargs import BadArgs
from util.create_file import create_file_if_not_exists
from util.json import read_json, write_json
from... |
"""Project Data-types."""
from dataclasses import dataclass, field
from typing import List, Tuple, Type, TypeVar, Union
import numpy as np
import torch
from torch import Tensor
Array = Union[np.ndarray, torch.Tensor]
Index = Union[np.ndarray, torch.Tensor, int]
State = Union[int, float, Array]
Action = Union[int, flo... |
'''
I'm trying to regress a multidimensional polynomial out of the theoretical power
spectra C_l(r,s,tau). I believe this is all done in scikit-learn (a little bit
of googling got me there) and I have done this with a simple example.
'''
import numpy as np
import matplotlib.pyplot as plt
# Table 8, PlanckTTTEEE+SIMlo... |
# -*- coding: utf-8 -*-
# Based on code from the vispy project
# Distributed under the (new) BSD License. See LICENSE.txt for more info.
"""Data downloading and reading functions
"""
from math import log
import os
from os import path as op
import sys
import shutil
import time
from . import appdata_dir, resource_dirs... |
# ----------------------------------------------------------------------------
# pyglet
# Copyright (c) 2006-2008 <NAME>
# Copyright (c) 2008-2019 pyglet contributors
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following c... |
#<NAME>
#University of Utah
#March 18, 2012
#BDD_ite.py
##############################################################################
#Implementation of the efficient 'ite' method of building a BDD discussed
#in Bryan et al's paper "Efficient Implementation of a BDD Package".
#
#I believe this approach deserves it's ... |
"""
TAKEN FROM https://github.com/eth-ait/spl/blob/master/visualization/fk.py
"""
"""
SPL: training and evaluation of neural networks with a structured prediction layer.
Copyright (C) 2019 ETH Zurich, <NAME>, <NAME>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Gener... |
# encoding: utf-8
"""
Objects related to layout of rendered text, such as TextFitter.
"""
from __future__ import absolute_import, print_function
from PIL import ImageFont
class TextFitter(tuple):
"""
Value object that knows how to fit text into given rectangular extents.
"""
def __new__(cls, line_... |
import tempfile
from copy import deepcopy
from pathlib import Path
from reportlab.lib import colors
from reportlab.lib.enums import TA_CENTER, TA_JUSTIFY, TA_LEFT, TA_RIGHT
from reportlab.lib.pagesizes import A4
from reportlab.lib.styles import ParagraphStyle, getSampleStyleSheet
from reportlab.lib.units import cm
fro... |
#!/usr/bin/env python
from __future__ import print_function, division
from time import time
import argparse
import gc
import json
import os
import shutil
import re
import sys
import tempfile
from . import db_sqlite3 as db
from . import defs
from . import env
from . import util
log = util.get_logger("update")
class ... |
# -*- cpy-indent-level: 4; indent-tabs-mode: nil -*-
# ex: set expandtab softtabstop=4 shiftwidth=4:
#
# Copyright (C) 2008,2009,2010,2011,2012,2013,2014,2015,2016,2017 Contributor
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# Y... |
import typing
import numpy as np
def get_trainer_class_from_model(parameter):
"""
>>> from IPython.lib.pretty import pprint
>>> from pb_bss.distribution.cacgmm import (
... ComplexAngularCentralGaussian,
... )
>>> get_trainer_class_from_model(ComplexAngularCentralGaussian).__name__
'C... |
# Copyright 2021, <NAME>.
#
# Developed as a thesis project at the TORSEC research group of the Polytechnic of Turin (Italy) under the supervision
# of professor <NAME> and engineer <NAME> and with the support of engineer <NAME>.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this f... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.