gt stringclasses 1
value | context stringlengths 2.49k 119k |
|---|---|
# Copyright (C) 2003-2005 Peter J. Verveer
#
# 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 and the following d... | |
# This is the vgg benchmark for CIFAR 10
import torch
from logical.vggpremade import vgg11
import torchvision.transforms as transforms
import torchvision.datasets
from torch.utils.data.dataloader import DataLoader
import torch.nn as nn
import torch.nn.functional as F
from torch.nn.parameter import Parameter
import tim... | |
"""Test the Risco config flow."""
import pytest
import voluptuous as vol
from homeassistant import config_entries, data_entry_flow
from homeassistant.components.risco.config_flow import (
CannotConnectError,
UnauthorizedError,
)
from homeassistant.components.risco.const import DOMAIN
from tests.async_mock imp... | |
"""
Core visualization operations based on PyVista.
Actual implementation of _Renderer and _Projection classes.
"""
# Authors: Alexandre Gramfort <[email protected]>
# Eric Larson <[email protected]>
# Guillaume Favelier <[email protected]>
# Joan Massich <mailsik... | |
# Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | |
"""Functions for parsing the parameter data files"""
import yaml
import pkgutil
from flavio.classes import *
from flavio.statistics.probability import *
from flavio._parse_errors import errors_from_string
import flavio
import re
from flavio.measurements import _fix_correlation_matrix
from math import sqrt
from particl... | |
# member/views.py
import json
import requests
import rethinkdb as r
from rethinkdb.errors import RqlDriverError
from flask import g, Blueprint, render_template, request, \
url_for, redirect, abort, flash
import stathat
from monitors import Monitor
from users import User
from forms import ChangePassForm
member_... | |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
import pytest
import numpy as np
from numpy.testing import assert_allclose, assert_array_almost_equal_nulp
from astropy.stats.biweight import (biweight_location, biweight_scale,
biweight_midvariance, biweight_midcovariance,
... | |
import pytest, py, sys, os
from _pytest import runner
from py._code.code import ReprExceptionInfo
class TestSetupState:
def test_setup(self, testdir):
ss = runner.SetupState()
item = testdir.getitem("def test_func(): pass")
l = [1]
ss.prepare(item)
ss.addfinalizer(l.pop, col... | |
# -*- test-case-name: vumi.transports.twitter.tests.test_twitter -*-
from twisted.python import log
from twisted.internet.defer import inlineCallbacks
from txtwitter.twitter import TwitterClient
from txtwitter import messagetools
from vumi.transports.base import Transport
from vumi.config import ConfigBool, ConfigText... | |
# filemerge.py - file-level merge handling for Mercurial
#
# Copyright 2006, 2007, 2008 Olivia Mackall <[email protected]>
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2 or any later version.
from __future__ import absolute_import
import contextlib
... | |
# Copyright 2017 The TensorFlow 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 applica... | |
#!/usr/bin/env python2.7
# -*- coding:utf-8 -*-
# Copyright (c) 2015, Galaxy Authors. All Rights Reserved
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
#
# Author: [email protected]
# Date: 2015-04-20
import argparse
import json
import sys
import os
import trace... | |
# Copyright 2015 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 applicable law or agreed... | |
from _ebcf_alexa import incoming_types
import pytest
VALID_INTENT_LAMBDA_EVENT = {
"session": {
"new": False,
"sessionId": "SessionId.10809a6f-e431-42f6-8d02-1d71ffab2251",
"application": {
"applicationId": "amzn1.ask.skill.d6f2f7c4-7689-410d-9c35-8f8baae37969"
},
"attributes": {},
"use... | |
# Copyright 2012 Hewlett-Packard Development Company, L.P.
#
# 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... | |
# Copyright 2012 OpenStack Foundation.
# 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 requ... | |
"""
********************************************************************************
* Name: handoff.py
* Author: Nathan Swain and Scott Christensen
* Created On: August 11, 2015
* Copyright: (c) Brigham Young University 2015
* License: BSD 2-Clause
**********************************************************************... | |
"""
tests the pysat meta object and code
"""
import pysat
import pandas as pds
from nose.tools import assert_raises, raises
import nose.tools
import pysat.instruments.pysat_testing
import numpy as np
class TestBasics:
def setup(self):
"""Runs before every method to create a clean testing setup."""
... | |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | |
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# ... | |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (c) 2012 OpenStack Foundation.
# 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.... | |
from __future__ import absolute_import, unicode_literals
import logging
import json
from dash.orgs.views import OrgPermsMixin
from django.contrib import messages
from django.contrib.auth.decorators import login_required
from django.core.urlresolvers import reverse
from django.db import transaction
from django.db.mod... | |
from __future__ import absolute_import, unicode_literals, print_function
from io import BytesIO # Yes, there is an io module in Python 2
import cgi
import codecs
import gzip
import operator
import os
import re
import warnings
try:
from collections import OrderedDict
except ImportError: # pragma: no cover
# so... | |
from __future__ import division
import numpy as np
from scipy.linalg import toeplitz
from scipy.fftpack import fftshift, fft2, ifftshift, fft
from scipy.linalg import hankel
from stingray import lightcurve
import stingray.utils as utils
__all__ = ["Bispectrum"]
class Bispectrum(object):
"""Makes a :class:`Bis... | |
"""
concat routines
"""
import numpy as np
from pandas import compat, DataFrame, Series, Index, MultiIndex
from pandas.core.index import (_get_combined_index,
_ensure_index, _get_consensus_names,
_all_indexes_same)
from pandas.core.categorical import (_fact... | |
import configparser
import datetime
import os
import random
import re
import time
import unittest
import dateutil
from TM1py.Exceptions import TM1pyException
from TM1py.Objects import Cube, Dimension, Hierarchy, Process
from TM1py.Services import TM1Service
config = configparser.ConfigParser()
config.read(os.path.jo... | |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compli... | |
"""
Unit test for SLSQP optimization.
"""
from __future__ import division, print_function, absolute_import
from numpy.testing import (assert_, assert_array_almost_equal, TestCase,
assert_allclose, assert_equal, run_module_suite)
import numpy as np
from scipy.optimize import fmin_slsqp, mini... | |
"""Append module search paths for third-party packages to sys.path.
****************************************************************
* This module is automatically imported during initialization. *
****************************************************************
In earlier versions of Python (up to 1.5a3), scripts or... | |
#!/usr/bin/env python
import argparse
import atexit
import copy
import os
import shutil
import socket
import subprocess
import sys
import tempfile
import warnings
try:
import django
except ImportError as e:
raise RuntimeError(
'Django module not found, reference tests/README.rst for instructions.'
... | |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# 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, either version 3 of the License, or
# (at your option) any later version.
#
... | |
#!/usr/bin/env python
"""
pr_parser.py: SCRIPTS that analyse pr information and write parsed pr information
(especially the multi-relate-pr) to post-build proprerties for downstream job.
"""
import argparse
import sys
import os
import github
import collections
import random
from github import Github
from manifest i... | |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | |
"""
raven.contrib.flask
~~~~~~~~~~~~~~~~~~~
:copyright: (c) 2010-2012 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from __future__ import absolute_import
try:
from flask_login import current_user
except ImportError:
has_flask_login = False
else:
has_f... | |
"""
Contains rich-text related classes.
"""
import re
from django.utils.html import escape
from wagtail.wagtailcore import hooks
from wagtail.wagtailcore.models import Page
from wagtail.wagtailcore.rich_text import EMBED_HANDLERS
from wagtail.wagtailcore.whitelist import Whitelister
from wagtail.wagtaildocs.models im... | |
#
# Some tests for NSDecimal (C type) and NSDecimalNumber (Objective-C class)
#
from PyObjCTools.TestSupport import *
from Foundation import *
import operator
import objc
import sys
try:
long
except NameError:
long = int
if 0:
class TestNSDecimal (TestCase):
def testConstants(self):
se... | |
# Copyright 2021 Google LLC
#
# 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 to in writing, ... | |
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the... | |
"""Shared class to maintain Plex server instances."""
import logging
import plexapi.myplex
import plexapi.playqueue
import plexapi.server
from requests import Session
import requests.exceptions
from homeassistant.components.media_player import DOMAIN as MP_DOMAIN
from homeassistant.const import CONF_TOKEN, CONF_URL, ... | |
"""
Component wrappers are created by the ``start`` command after the associated
component's server has been started.
"""
import os
import sys
import time
import logging
import traceback
from functools import partial
from cStringIO import StringIO
import xml.etree.cElementTree as ElementTree
from xml.sax.saxutils impo... | |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | |
from app.api.models.LXDModule import LXDModule
from app.lib.conf import MetaConf
from app.api.utils.firebaseAuthentication import firebaseLogin
from app import __metadata__ as meta
import logging
import requests
import subprocess
import shutil
import os
import yaml
import tarfile
logging = logging.getLogger(__name__)
... | |
import platform
import unittest
import os
from nose.plugins.attrib import attr
from parameterized.parameterized import parameterized
from conans.model.version import Version
from conans.client.build.cmake import CMake
from conans.test.utils.tools import TestClient
conanfile_py = """
from conans import ConanFile
cla... | |
from .finder.core import FinderFactory
from .parser import DoxygenParserFactory, CacheFactory
from .renderer.rst.doxygen import DoxygenToRstRendererFactoryCreatorConstructor, \
RstContentCreator, RenderContext
from .renderer.rst.doxygen.filter import FilterFactory, GlobFactory
from .renderer.rst.doxygen.target imp... | |
import argparse
import os
import re
from pathlib import Path
from typing import Optional
import py.path
import pytest
from _pytest.config import ExitCode
from _pytest.config import UsageError
from _pytest.main import resolve_collection_argument
from _pytest.main import validate_basetemp
from _pytest.pytester import T... | |
from __future__ import absolute_import
import random
import requests
from typing import Any, Dict, List, Optional, SupportsInt, Text, Union, Type
from version import ZULIP_VERSION
from zerver.models import PushDeviceToken, Message, Recipient, UserProfile, \
UserMessage, get_display_recipient, receives_offline_not... | |
############################################################
#
# Written by Alexander Liptak (Summer Student 2017)
# Date: August 2017
# E-Mail: [email protected]
# Phone: +44 7901 595107
#
# Tested with McStas 2.4
#
############################################################
import os
import sys
... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Feature extraction routines."""
import numpy as np
import scipy.signal
import librosa.core
import librosa.util
from . import cache
# -- Chroma -- #
@cache
def logfsgram(y=None, sr=22050, S=None, n_fft=4096, hop_length=512, **kwargs):
'''Compute a log-frequency sp... | |
# Databricks notebook source
# MAGIC %md
# MAGIC ## Problem formulation
# MAGIC A common problem in computer vision is estimating the fundamental matrix based on a image pair. The fundamental matrix relates corresponding points in stereo geometry, and is useful as a pre-processing step for example when one wants to pe... | |
# -*- coding: utf-8 -*-
"""
Implements two storage providers for `LockManager`.
Two alternative lock storage classes are defined here: one in-memory
(dict-based), and one persistent low performance variant using shelve.
See wsgidav.lock_manager.LockManager
See `Developers info`_ for more information about the WsgiDA... | |
from datetime import datetime, timezone
from enum import Enum, IntEnum, unique
from json import dumps as json_dumps
from json import loads as json_loads
from typing import Dict, List
from attr import define
from bson import CodecOptions
from hypothesis import given
from hypothesis.strategies import (
binary,
c... | |
#!/usr/bin/env python
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
#
# The contents of this file are subject to the Mozilla Public License
# Version 1.1 (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.mozil... | |
from __future__ import annotations
import atexit
import copy
import dataclasses
import enum
import json
import logging
import os
import sys
import time
import tkinter
from pathlib import Path
from tkinter import messagebox, ttk
from typing import Any, Callable, Iterator, List, Type, TypeVar, overload
import dacite
fr... | |
# Copyright (c) 2016 Mirantis, 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 requir... | |
"""
Code generator script to make the Cython BLAS and LAPACK wrappers
from the files "cython_blas_signatures.txt" and
"cython_lapack_signatures.txt" which contain the signatures for
all the BLAS/LAPACK routines that should be included in the wrappers.
"""
from collections import defaultdict
from operator import itemge... | |
# Copyright 2013 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... | |
import conf.managers
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import django.db.models.manager
class Migration(migrations.Migration):
initial = True
dependencies = [
("sites", "0002_alter_domain_unique"),
migrations.swappable_d... | |
###############################################################################
##
## Copyright (C) 2011-2014 Tavendo GmbH
##
## 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
##
## h... | |
import json
from indra.sources import sparser
from indra.sources.sparser.processor import _fix_agent
from indra.statements import Agent, Phosphorylation, Complex
from nose.plugins.attrib import attr
# ############################
# XML processing tests
# ############################
def test_invalid_xml():
sp = s... | |
from __future__ import print_function
from __future__ import division
import tensorflow as tf
import numpy as np
import model
'''
[[ 0.03945358 -0.0444226 ]
[ 0.02318096 0.00571191]
[ 0.00215099 0.00061758]
[-0.04630127 -0.03907587]
[ 0.02477768 -0.02004011]
[ 0.00562305 0.03217997]
[ 0.0229703 -0.03174545]... | |
from sympy import (abc, Add, cos, Derivative, diff, exp, Float, Function,
I, Integer, log, Mul, oo, Poly, Rational, S, sin, sqrt, Symbol, symbols,
Wild, pi, meijerg
)
from sympy.utilities.pytest import XFAIL
def test_symbol():
x = Symbol('x')
a, b, c, p, q = map(Wild, 'abcpq')
e = x
assert e.... | |
##########################################################################
#
# Copyright (c) 2009-2012, Image Engine Design Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redis... | |
from typing import NamedTuple
import numpy as np
from . import is_scalar_nan
def _unique(values, *, return_inverse=False):
"""Helper function to find unique values with support for python objects.
Uses pure python method for object dtype, and numpy method for
all other dtypes.
Parameters
------... | |
import time
import datetime
import traceback
import multiprocessing
import urllib2
import xml.sax
import redis
import random
import pymongo
import re
import requests
import dateutil.parser
import isodate
import urlparse
from django.conf import settings
from django.db import IntegrityError
from django.core.cache import ... | |
from __future__ import absolute_import, division, print_function, unicode_literals
import json
import random
import re
import requests
import six
from tornado import gen, httpclient, ioloop, websocket
from .util import add_future
class RdioWebClient(object):
SERVER = "www.rdio.com"
API_VERSION = "1"
cli... | |
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... | |
from collections import defaultdict
from hashlib import sha1
from itertools import chain
from operator import itemgetter
import os
from os import listdir
import sys
from funcy import (merge, imap, group_by, is_mapping, repeat,
constantly, icat, autocurry)
from dxr.filters import LINE
from dxr.index... | |
import asyncio, discord, os, re, psutil, platform, time, sys, fnmatch, subprocess, speedtest, json, struct, shutil, tempfile
from PIL import Image
from discord.ext import commands
from Cogs import Utils, Settings, DisplayName, ReadableTime, GetImage, ProgressBar, UserTime, Message, DL
try:
from urllib.pa... | |
import sh
import glob
import os.path
from contextlib import ExitStack
from . import util
class Error(Exception):
"""Base class for exceptions in this module."""
pass
class InvalidConfigError(Error):
"""Exception raised when there is a critical configuration error.
Attributes:
message -- expla... | |
#!/usr/bin/env python
from __future__ import print_function
import os
import re
import sys
import json
import time
import binascii
import tarfile
import atexit
import logging
logger = logging.getLogger('knlog')
logger.setLevel(logging.INFO)
hdr = logging.FileHandler('/tmp/upload/fastdick.log', encoding='utf-8')
format... | |
#!/usr/bin/env python
#==============================================================================
#title :lml-prepare.py
#description :Prepares a SOS database to receive observation data.
# Inserts sensor (procedure), resulttemplate, featureofinterest,
# based on statio... | |
# Copyright 2013 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 collections
from metrics import Metric
from telemetry.core import bitmap
from telemetry.value import scalar
class SpeedIndexMetric(Metric):
"""Th... | |
#
# Author: Travis Oliphant 2002-2011 with contributions from
# SciPy Developers 2004-2011
#
from functools import partial
from scipy import special
from scipy.special import entr, logsumexp, betaln, gammaln as gamln
from scipy._lib._util import _lazywhere, rng_integers
from numpy import floor, ceil, log, e... | |
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | |
# Copyright (c) 2008 The Board of Trustees of The Leland Stanford Junior University
# Copyright (c) 2011, 2012 Open Networking Foundation
# Copyright (c) 2012, 2013 Big Switch Networks, Inc.
# See the file LICENSE.pyloxi which should have been included in the source distribution
# Automatically generated by LOXI from ... | |
from django.contrib.auth.models import User
from django.contrib.auth import authenticate, login
from django.contrib.messages.storage.fallback import FallbackStorage
from django.http import HttpRequest
from django.test import TestCase
from campaigns.models import *
from campaigns.forms import *
from campaigns.views impo... | |
"""
Interact with the world:
- swing the arm, sneak, sprint, jump with a horse, leave the bed
- look around
- dig/place/use blocks
- use the held (active) item
- use/attack entities
- steer vehicles
- edit and sign books
By default, the client sends swing and look packets like the vanilla client.
This can be disabled ... | |
import copy
from os.path import join
import pytest
from jinja2 import Environment, FileSystemLoader
from invoke import UnexpectedExit
from cosmo_tester.framework.util import (generate_ca_cert,
generate_ssl_certificate)
from .cfy_cluster_manager_shared import (
CLUSTER_MANA... | |
#!/usr/bin/env python
# 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.
"""This script runs an automated Cronet performance benchmark.
This script:
1. Sets up "USB reverse tethering" which allow network tra... | |
#!/usr/bin/python3
'''
Manga-Mania
------------
Author: Koushtav Chakrabarty <TheIllusionistMirage>
Email: koushtav at fleptic dot eu
This code is licensed under the MIT license. Please see
`LICENSE` file for more info.
'''
import sys
import os
from pathlib import Path
from ... | |
# =============================================================================
# fabfile.py
#
# Copyright (c) 2016, Cisco Systems
# All rights reserved.
#
# # Author: Klaudiusz Staniek
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following cond... | |
# Code in this file is copied and adapted from
# https://github.com/openai/evolution-strategies-starter.
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from collections import namedtuple
import gym
import numpy as np
import os
import pickle
import time
im... | |
from ct.models import UnitStatus, NEED_HELP_STATUS, NEED_REVIEW_STATUS, DONE_STATUS, Lesson
from core.common.mongo import c_chat_context
from ..models import Message
def help_egde_decision(self, edge, fsmStack, request, useCurrent=False, **kwargs):
fsm = edge.fromNode.fsm
additionals = Message.objects.filter(... | |
"""
Stability evaluation
Original source:
https://github.com/hooshmandshr/yass_visualization/blob/master/src/stability/stability_evaluation.py
"""
import numpy as np
from scipy.optimize import linear_sum_assignment
from scipy.spatial.distance import pdist, squareform, cdist
from tqdm import tqdm
from yass.geometry ... | |
"""Metric Something by Something."""
import datetime
import pandas as pd
from pyiem.util import get_autoplot_context, get_sqlalchemy_conn
from pyiem.plot import figure_axes
from pyiem.exceptions import NoDataFound
from sqlalchemy import text
VDICT = {
"dwpf": "Air Dew Point Temp [F]",
"tmpf": "Air Temperature... | |
# Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | |
"""
Sublime Text Scheme template.
Converts scheme to css provides templating for
additonal so that they can access the colors.
Licensed under MIT
Copyright (c) 2015 - 2016 Isaac Muse <[email protected]>
----------------------
TextMate theme to CSS.
https://manual.macromates.com/en/language_grammars#naming_conven... | |
# Copyright 2012 OpenStack 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
#
# Unless required by applicable law or agreed to in... | |
## mostly refactored stuff from gcmdr ###
import urllib2, re, os
from shutil import rmtree
from subprocess import Popen, call
def get_study_opentreeapi(studyid, studyloc):
call = "http://api.opentreeoflife.org/v2/study/" + studyid
req = urllib2.Request(call)
res = urllib2.urlopen(req)
fl = open(study... | |
"""
Base file upload handler classes, and the built-in concrete subclasses
"""
from io import BytesIO
from django.conf import settings
from django.core.files.uploadedfile import (
InMemoryUploadedFile, TemporaryUploadedFile,
)
from django.utils.module_loading import import_string
__all__ = [
'UploadFileExcep... | |
# flake8: noqa
from __future__ import unicode_literals
from .abc import ABCIE
from .abc7news import Abc7NewsIE
from .abcnews import (
AbcNewsIE,
AbcNewsVideoIE,
)
from .academicearth import AcademicEarthCourseIE
from .acast import (
ACastIE,
ACastChannelIE,
)
from .addanime import AddAnimeIE
from .adob... | |
"""Support for Google Play Music Desktop Player."""
import json
import logging
import socket
import time
import voluptuous as vol
from websocket import _exceptions, create_connection
from homeassistant.components.media_player import PLATFORM_SCHEMA, MediaPlayerDevice
from homeassistant.components.media_player.const i... | |
#! /usr/bin/python
from datetime import datetime
from optparse import make_option
from sys import stderr
from django.core.exceptions import ValidationError
from django.core.management.base import BaseCommand
from django.conf import settings
from cyder.base.eav.models import Attribute
from cyder.base.utils import get... | |
#!/usr/bin/env python2.7
import pprint
import sys
import os
sys.path.append(os.path.dirname(os.path.dirname(__file__)))
import json
import datetime
import time
import logging
from random import randrange
from shared import liburl_wrapper
from shared.liburl_wrapper import safe_pushtx
from shared.fastproto import (... | |
"""Classes for defining instructions."""
from __future__ import absolute_import
from . import camel_case
from .types import ValueType
from .operands import Operand
from .formats import InstructionFormat
try:
from typing import Union, Sequence, List, Tuple, Any, TYPE_CHECKING # noqa
from typing import Dict # n... | |
"""
Tests for structural time series models
Author: Chad Fulton
License: Simplified-BSD
"""
from __future__ import division, absolute_import, print_function
import numpy as np
import pandas as pd
import os
import warnings
from statsmodels.datasets import macrodata
from statsmodels.tsa.statespace import structural
fr... | |
# coding=utf-8
r"""
This code was generated by
\ / _ _ _| _ _
| (_)\/(_)(_|\/| |(/_ v1.0.0
/ /
"""
from tests import IntegrationTestCase
from tests.holodeck import Request
from twilio.base.exceptions import TwilioException
from twilio.http.response import Response
class AuthRegistrationsCredenti... | |
import logging
from glfw import *
from OpenGL.GL import *
import numpy as np
# create logger for the context of this function
logger = logging.getLogger(__name__)
import time
from pyglui import ui
from pyglui.cygl.utils import init
from pyglui.cygl.utils import RGBA
from pyglui.pyfontstash import fontstash as fs
w... | |
"""Internal utilties; not for external use
"""
import contextlib
import functools
import itertools
import os.path
import re
import warnings
from enum import Enum
from typing import (
AbstractSet,
Any,
Callable,
Collection,
Container,
Dict,
Hashable,
Iterable,
Iterator,
Mapping,
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.