gt stringclasses 1
value | context stringlengths 2.49k 119k |
|---|---|
# coding: utf-8
"""
OpenAPI spec version:
Generated by: https://github.com/swagger-api/swagger-codegen.git
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
... | |
# Copyright 2019, 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing... | |
"""Base class for sparse matrices"""
from __future__ import division, print_function, absolute_import
__all__ = ['spmatrix', 'isspmatrix', 'issparse',
'SparseWarning','SparseEfficiencyWarning']
import sys
import numpy as np
from scipy._lib.six import xrange
from .sputils import isdense, isscalarlike, isintl... | |
"""
Python client for BaseX.
Works with BaseX 7.x (but not with BaseX 8.0 and later)
Documentation: http://docs.basex.org/wiki/Clients
(C) BaseX Team 2005-12, Arjen van Elteren
BSD License
"""
import hashlib, socket, array
import threading
class SocketInputReader(object):
def __init__(self, sock):
... | |
from math import sqrt
import warnings
import numbers
import numpy as np
from sklearn.utils.extmath import randomized_svd, squared_norm
import scipy.sparse as sp
class Sparse_NMF():
def __init__(self, n_components=2, init=None,
tol=1e-4, max_iter=200,
alpha=0.01, beta=0.01):
... | |
"""Module that reads BGEN files."""
# This file is part of pybgen.
#
# The MIT License (MIT)
#
# Copyright (c) 2017 Louis-Philippe Lemieux Perreault
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the ... | |
# orm/descriptor_props.py
# Copyright (C) 2005-2013 the SQLAlchemy authors and contributors <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""Descriptor properties are more "auxiliary" properties
that exist as configu... | |
from mongoengine import *
import datetime
import urllib
import simplejson as json
import urllib.request as request
from time import mktime
from django.contrib.auth.models import User
from reader.learn import predict_articles
class Source(Document):
title = StringField(required=True)
alias = StringField(requir... | |
# Default Django settings. Override these with settings in the module
# pointed-to by the DJANGO_SETTINGS_MODULE environment variable.
# This is defined here as a do-nothing function because we can't import
# django.utils.translation -- that module depends on the settings.
gettext_noop = lambda s: s
#################... | |
'''
Build a simple neural machine translation model
'''
import theano
import theano.tensor as tensor
from theano.sandbox.rng_mrg import MRG_RandomStreams as RandomStreams
import cPickle as pkl
import numpy
import copy
import os
import warnings
import sys
import time
from scipy import optimize, stats
from collections... | |
# Copyright 2015 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... | |
"""
fs.mountfs
==========
Contains MountFS class which is a virtual filesystem which can have other filesystems linked as branched directories.
For example, lets say we have two filesystems containing config files and resources respectively::
[config_fs]
|-- config.cfg
`-- defaults.cfg
[resources_fs]
... | |
#!/usr/bin/env python
# Solution to http://www.gchq.gov.uk/press_and_media/news_and_features/Pages/Directors-Christmas-puzzle-2015.aspx
from z3 import *
from PIL import Image
size=25
rules = [
[7,3,1,1,7],
[1,1,2,2,1,1],
[1,3,1,3,1,1,3,1],
[1,3,1,1,6,1,3,1],
[1,3,1,5,2,1,3,1],
[1,1,2,1,1],
[7,1,1,1,1,1,7],
[3,3],
[1... | |
import pytest
from pytest import approx
import os
import pandas as pd
import numpy as np
import calliope
import calliope.exceptions as exceptions
from calliope.core.attrdict import AttrDict
from calliope.preprocess import time
from calliope.test.common.util import build_test_model as build_model
from calliope.test.c... | |
# 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 unde... | |
"""Identity related views."""
from __future__ import unicode_literals
from django.shortcuts import render
from django.template.loader import render_to_string
from django.utils.translation import ugettext as _, ungettext
from django.views import generic
from django.views.decorators.csrf import ensure_csrf_cookie
from... | |
# Copyright 2013-2014 MongoDB, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writin... | |
"""Class to hold all cover accessories."""
import logging
from pyhap.const import (
CATEGORY_GARAGE_DOOR_OPENER,
CATEGORY_WINDOW,
CATEGORY_WINDOW_COVERING,
)
from homeassistant.components.cover import (
ATTR_CURRENT_POSITION,
ATTR_CURRENT_TILT_POSITION,
ATTR_POSITION,
ATTR_TILT_POSITION,
... | |
# We can test part of the module without zlib.
try:
import zlib
except ImportError:
zlib = None
import zipfile, os, unittest, sys, shutil, struct
from StringIO import StringIO
from tempfile import TemporaryFile
from random import randint, random
import test.test_support as support
from test.test_support impo... | |
"""Substitute for unittest
If a class inherits Tester, calling its method run() on an instance runs alls
the methods starting with "test_". Before running the method, executes method
setUp() if present.
If the test failed, print the exception, and the line in the script where the
exception happened.
"""
import re
im... | |
# coding: utf-8
# Copyright (c) Pymatgen Development Team.
# Distributed under the terms of the MIT License.
from __future__ import unicode_literals, division, print_function
import os
import tempfile
import shutil
from pymatgen.util.testing import PymatgenTest
from monty.functools import lazy_property
from pymatgen.... | |
#!/usr/bin/env python
#
# Copyright 2007 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | |
# -*- coding: utf-8 -*-
"""
Created on Tue Oct 6 15:34:12 2015
@author: Numan Laanait -- nlaanait@gmail.com
"""
from __future__ import division, print_function, absolute_import
from skimage.feature import match_descriptors, register_translation
from skimage.measure import ransac
from skimage.transform import warp, S... | |
# -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
#
# FreeType high-level python API - Copyright 2011-2015 Nicolas P. Rougier
# Distributed under the terms of the new BSD license.
#
# -----------------------------------------------------------------------------
""... | |
import json
import collections
import operator
from datetime import timedelta
from django.core import mail
from django.http import HttpRequest
from django.template.loader import render_to_string
from django.utils import timezone
from django.test import TestCase
from django.contrib.auth.models import AnonymousUser
fro... | |
from __future__ import print_function
from __future__ import absolute_import
from __future__ import unicode_literals
from ipywidgets import *
from SimPEG import Mesh, Maps, EM, Utils
# from pymatsolver import PardisoSolver
import matplotlib.pyplot as plt
import numpy as np
from PIL import Image
from scipy.constants im... | |
# Copyright 2022 The Flax 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 agreed to in wri... | |
"""
Built-in pipeline
"""
import time
import logging
import logging.config
import shutil
import os
import matplotlib
matplotlib.use('Agg')
# supress PCA unpickle userwarning
# Cat: TODO: this is dangersous, may wish to fix the problem in cluster.py
# import warnings
# warnings.filterwarnings("ignore", category=UserWa... | |
import logging
import json
import dropbox
import time
import copy
import threading
import re
from StringIO import StringIO
from datetime import datetime, timedelta
from django.contrib.auth.decorators import login_required
from django.utils.decorators import method_decorator
from django.contrib import messages
from dj... | |
# Copyright 2014 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 a... | |
# -*- coding: utf-8 -*-
# Copyright 2022 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | |
from __future__ import absolute_import
from __future__ import with_statement
from celery.datastructures import (
ExceptionInfo,
LRUCache,
LimitedSet,
AttributeDict,
DictAttribute,
ConfigurationView,
DependencyGraph,
)
from celery.utils.compat import THREAD_TIMEOUT_MAX
from celery.tests.util... | |
# Copyright (C) 2010-2012 Yaco Sistemas (http://www.yaco.es)
# Copyright (C) 2009 Lorenzo Gil Sanchez <lorenzo.gil.sanchez@gmail.com>
#
# 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
#
# ... | |
#
# 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... | |
#!/usr/bin/env python
# -- Content-Encoding: UTF-8 --
"""
Forker configuration broker.
A simple servlet handling GET and DELETE commands to provide a raw JSON
configuration for the requested isolate, if available.
The stored configurations should be the ones given by a monitor requesting to
start an isolate.
A confi... | |
# -*- coding: utf-8 -*-
from operator import attrgetter
from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType
from pyangbind.lib.yangtypes import RestrictedClassType
from pyangbind.lib.yangtypes import TypedListType
from pyangbind.lib.yangtypes import YANGBool
from pyangbind.lib.yangtypes import YANGListTy... | |
"""Base class for all the objects in Diofant."""
from collections import defaultdict
from collections.abc import Mapping
from itertools import zip_longest
from ..utilities import ordered
from .cache import cacheit
from .compatibility import iterable
from .decorators import _sympifyit
from .evaluate import evaluate
fr... | |
import random
import zlib
import base64
from django.db import models
from django.db.models import get_model
from django.conf import settings
from django.contrib.contenttypes import generic
from django.contrib.contenttypes.models import ContentType
from django.utils.translation import ugettext_lazy as _
from please_re... | |
import cv2
import numpy as np
import pyscreenshot as ImageGrab
from tkinter import *
from Xlib import display
import mss
import os
import pyxhook
import serial
import threading
import serial.tools.list_ports
import ctypes
import glob
from PIL import ImageTk, Image
import sys
with open(os.devnull, 'w') as f: ###shutting... | |
from django.db.utils import DatabaseError
try:
import thread
except ImportError:
import dummy_thread as thread
from contextlib import contextmanager
from django.conf import settings
from django.db import DEFAULT_DB_ALIAS
from django.db.backends import util
from django.db.transaction import TransactionManageme... | |
# coding=utf-8
# Copyright 2020 The HuggingFace Team. 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... | |
# 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... | |
# 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 ... | |
# -*- coding: utf-8 -*-
# Copyright 2020 Green Valley Belgium NV
#
# 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... | |
import windows.security
from windows.security import SecurityDescriptor
from .pfwtest import *
import ctypes
# CC -> Create-Child -> 1
# GR -> Generic read -> 0x80000000L
# AN -> Anonymous -> S-1-5-7
TEST_SDDL = [
"O:ANG:AND:(A;;RPWPCCDCLCSWRCWDWOGA;;;S-1-0-0)(D;;RPWPCCDCLCSWRCWDWOGA;;;S-1-0-0)",
"O:ANG:AND:(A;;GR;... | |
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sb
from sklearn.ensemble import GradientBoostingClassifier, GradientBoostingRegressor
from sklearn.ensemble.partial_dependence import partial_dependence
from sklearn.preprocessing import LabelEncoder
from .print_message import Prin... | |
r"""
Study and StudyPerson objects (:mod:`qiita_db.study`)
=====================================================
.. currentmodule:: qiita_db.study
This module provides the implementation of the Study and StudyPerson classes.
The study class allows access to all basic information including name and
pmids associated wi... | |
# Copyright (c) 2013 Spotify AB
#
# 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, s... | |
from threading import Thread
from ..decorators import vendor_required
from app import os, create_app
import app
import boto
from config import Config
from flask import (
render_template,
abort,
redirect,
flash,
url_for,
send_from_directory,
jsonify,
request
)
import json
from flask.ext.l... | |
# encoding: utf-8
import os
import fcntl
from select import select
from collections import namedtuple
from evdev import _input, _uinput, ecodes, util
from evdev.events import InputEvent
#--------------------------------------------------------------------------
class EvdevError(Exception):
pass
#--------------... | |
"""Unit tests for raw_wind_io.py."""
import unittest
import numpy
import pandas
from gewittergefahr.gg_io import raw_wind_io
TOLERANCE = 1e-6
# The following constants are used to test _check_data_source.
FAKE_PRIMARY_DATA_SOURCE = 'foo'
FAKE_SECONDARY_DATA_SOURCE = 'bar'
# The following constants are used to test
... | |
import array
import gc
import os
from math import sqrt
from rubikscolorresolver.base import (
LabColor,
RubiksColorSolverGenericBase,
Square,
lab_distance,
html_color,
rgb2lab,
)
from rubikscolorresolver.tsp_solver_greedy import solve_tsp
from rubikscolorresolver.permutations import (
even_c... | |
# -*- coding: utf-8 -*-
#
# Copyright (c) 2016 Intel Corp.
#
"""
Test the node_power plugin implementation.
"""
import unittest
import time
import os
import json
from ....os_remote_access.mock.os_remote_access import OsRemoteAccessMock
from ....utilities.utilities import Utilities, SubprocessOutput
from ....plugin.mana... | |
# Databricks notebook source
# MAGIC %md
# MAGIC ScaDaMaLe Course [site](https://lamastex.github.io/scalable-data-science/sds/3/x/) and [book](https://lamastex.github.io/ScaDaMaLe/index.html)
# COMMAND ----------
# MAGIC %md
# MAGIC # U-Net model for image segmentation
# MAGIC
# MAGIC This is a modified version of T... | |
import os
import re
import json
import base64
import logging
import datetime
import time
import copy
import decimal
import cgi
import numpy
import pymongo
from lib import config, util, util_litecoin
D = decimal.Decimal
def get_market_price(price_data, vol_data):
assert len(price_data) == len(vol_data)
asser... | |
#!/usr/bin/env python
# Zed Attack Proxy (ZAP) and its related class files.
#
# ZAP is an HTTP/HTTPS proxy for assessing web application security.
#
# Copyright 2017 ZAP Development Team
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License... | |
import unittest
from mock import Mock, MagicMock, patch, call
from test_treeSetUp import TreeSetUp, node1FEMmembers, node1XFEMmembers, node2FEMmembers, node3FEMmembers, node3XFEMmembers, node5XFEMmembers, node10FEMmembers, node10XFEMmembers
from trees import TreeNode, createTreeFromDbKeys, nodesPerLevel, tracePath, cre... | |
"""
Some models for pulling data from Trac.
Initially generated by inspectdb then modified heavily by hand, often by
consulting http://trac.edgewall.org/wiki/TracDev/DatabaseSchema.
These are far from perfect: many (most?) Trac tables have composite primary
keys, which Django can't represent. This means a lot of buil... | |
# Copyright 2013 IBM Corp.
# 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 app... | |
# Copyright 2011 Piston Cloud Computing, 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
#
# Unle... | |
__author__ = 'Henri Bunting'
import sys
import numpy as np
from pypet.parameter import BaseParameter
import unittest
try:
import brian2
from brian2.units.stdunits import mV, mA, kHz, ms
from pypet.brian2.parameter import Brian2Parameter, Brian2Result, get_unit_fast
except ImportError:
brian2 = None
... | |
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | |
# --------------------------------------------------------
# Deformable Convolutional Networks
# Copyright (c) 2017 Microsoft
# Licensed under The MIT License [see LICENSE for details]
# Written by Yuwen Xiong, Xizhou Zhu
# --------------------------------------------------------
import cPickle
import mxnet as mx
from... | |
"""ACME Identifier Validation Challenges."""
import abc
import functools
import hashlib
import logging
import socket
from cryptography.hazmat.primitives import hashes
import OpenSSL
import requests
from acme import errors
from acme import crypto_util
from acme import fields
from acme import jose
from acme import othe... | |
# Copyright 2015 Jarrod N. Bakker
#
# 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 writ... | |
# 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... | |
# -*- coding: utf-8 -*-
# Copyright 2022 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | |
# Copyright 2012 NEC Corporation
# 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 b... | |
#
# Copyright 2014 Quantopian, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wr... | |
#!/usr/bin/python
import unittest
import math
import random
import rarfile
import os, sys
import subprocess
try:
subprocess.Popen("rar", stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell = True)
except:
print >> sys.stderr, "You do not have the 'rar' binary, please install!"
sys.exit(1)
class PyarrCheck(uni... | |
# Copyright 2013 dotCloud inc.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed t... | |
'''
Created on Feb 20, 2013
@author: Maribel Acosta
@author: Fabian Floeck
'''
from wmf import dump
from difflib import Differ
from time import time
from structures.Revision import Revision
from structures.Paragraph import Paragraph
from structures.Sentence import Sentence
from structures.Word import Word
from str... | |
# Copyright 2011 OpenStack Foundation
# Copyright 2012 Red Hat, 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/... | |
import sh
import os
import json
import zipfile
__version__ = '0.0.2'
DEFAULT_PACKER_PATH = 'packer'
class Packer():
"""Packer interface using the `sh` module (http://amoffat.github.io/sh/)
"""
def __init__(self, packerfile, exc=None, only=None, vars=None,
vars_file=None, exec_path=DEFAU... | |
"""Summary
"""
#
# Wrappers for Types in NVL
#
#
from ctypes import *
class WeldType(object):
"""Summary
"""
def __str__(self):
"""Summary
Returns:
TYPE: Description
"""
return "type"
def __hash__(self):
"""Summary
Returns:
T... | |
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Test case for L{twisted.protocols.loopback}.
"""
from __future__ import division, absolute_import
from zope.interface import implementer
from twisted.python.compat import _PY3, intToBytes
from twisted.trial import unittest
from twisted.tria... | |
# -*- encoding: utf-8 -*-
#
# Copyright 2015-2016 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applic... | |
# Copyright 2011 OpenStack Foundation.
# 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 compliance w... | |
# Copyright (c) 2006,2007 Mitch Garnaat http://garnaat.org/
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modi... | |
"""
Virtuoso kernel for Jupyter.
Inspired by https://github.com/takluyver/bash_kernel
"""
from ipykernel.kernelbase import Kernel
from IPython.display import HTML, Image
from ipykernel import (
get_connection_file, get_connection_info, connect_qtconsole
)
import signal
from .shell import VirtuosoShell, VirtuosoExc... | |
# -*- coding: utf-8 -*-
# Copyright (c) 2013-2014 Simon Jagoe
# All rights reserved.
#
# This software may be modified and distributed under the terms
# of the 3-clause BSD license. See the LICENSE.txt file for details.
from __future__ import absolute_import, unicode_literals
from argparse import Namespace
from conte... | |
# 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... | |
"""
Simulation with Analytic FDEM Solutions
=======================================
Here, the module *SimPEG.electromagnetics.analytics.FDEM* is used to simulate
harmonic electric and magnetic field for both electric and magnetic dipole
sources in a wholespace.
"""
##################################################... | |
# encoding: utf-8
"""
Tests of the AnalogSignal class
"""
from __future__ import division
try:
import unittest2 as unittest
except ImportError:
import unittest
from neo.core.analogsignal import AnalogSignal
import numpy
import quantities as pq
import pickle
from neo.test.tools import assert_arrays_almost_equ... | |
# stdlib
from typing import List
# third party
import pytest
# syft absolute
import syft as sy
from syft.experimental_flags import flags
np = pytest.importorskip("numpy")
@pytest.mark.vendor(lib="numpy")
@pytest.mark.parametrize("arrow_backend", [False, True])
def test_remote_numpy_array(
arrow_backend: str, r... | |
"""Module for reading, writing, compressing and converting files.
Please note, some of the functions in this module were created and tested using
VTK 5. VTK 6 introduced a number of backwards-incompatible changes, including
replacing 'SetInput()' with 'SetInputData()' and 'SetInputConnection'.
"""
import glob
import ... | |
import pytz
from django.apps import apps
from django.db import models
from django.core.exceptions import ObjectDoesNotExist
from framework.analytics import increment_user_activity_counters
from osf.models.node_relation import NodeRelation
from osf.models.nodelog import NodeLog
from osf.models.tag import Tag
from websit... | |
from tastypie.resources import ModelResource, ALL, ALL_WITH_RELATIONS
from tastypie import fields
from tastypie.authentication import ApiKeyAuthentication, SessionAuthentication, MultiAuthentication
from tastypie.authorization import DjangoAuthorization
from tastypie.validation import Validation
from tastypie.exception... | |
#!/usr/bin/python
# Copyright (C) 2014 Harun Emektar
#
# 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... | |
# 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.
# Copyright 2011 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not... | |
import re
import os
import time
import urllib
import urllib2
import urlparse
import cStringIO
import collections
import pkg_resources
from setuptools.package_index import PackageIndex
from pkgtools.pypi import PyPIXmlRpc, PyPIJson, real_name
from pyg.core import Version, args_manager
from pyg.utils import name, ext, ... | |
# -*- coding: utf-8 -*-
import logging
import httplib as http
import math
from itertools import islice
from flask import request
from modularodm import Q
from modularodm.exceptions import ModularOdmException, ValidationValueError
from framework import status
from framework.utils import iso8601format
from framework.mo... | |
"""
NetLogger interactions with the Python logging module.
"""
__rcsid__ = "$Id: logutil.py 772 2008-05-23 22:59:22Z dang $"
import logging
import logging.handlers
import optparse
import os
import sys
import time
import traceback
import types
from Pegasus.netlogger import nlapi
from Pegasus.netlogger.nlapi import Lev... | |
import itertools
import math
import numpy as np
from scipy import ndimage as ndi
from scipy.ndimage import filters as ndif
from collections import OrderedDict
from ..exposure import histogram
from .._shared.utils import assert_nD, warn
from ..transform import integral_image
from .. import util
from skimage import dtype... | |
#!/usr/bin/env/python
# Copyright 2020 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.
"""Functions for interacting with llvm-profdata
This script is taken from the chromium build tools and is synced
manually on an as-need... | |
"""
FormWizard class -- implements a multi-page form, validating between each
step and storing the form's state as HTML hidden fields so that no state is
stored on the server side.
"""
import cPickle as pickle
from django import forms
from django.conf import settings
from django.contrib.formtools.utils import securit... | |
import ast
import copy
import os
import sys
import unittest
from vistrails.core.configuration import ConfigurationObject, ConfigField, ConfigPath, ConfigURL, get_vistrails_persistent_configuration, get_vistrails_temp_configuration
from vistrails.core.modules.vistrails_module import Module, NotCacheable, ModuleError
fr... | |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django import forms
from django.conf import settings
from django.contrib.auth import password_validation
from django.utils.translation import ugettext as _, ugettext_lazy
from modoboa.core.password_hashers import get_dovecot_schemes
from modoboa.co... | |
"""This module contains classes for creating ELFI graphs (`ElfiModel`).
The ElfiModel is a directed acyclic graph (DAG), whose nodes represent
parts of the inference task, for example the parameters to be inferred,
the simulator or a summary statistic.
https://en.wikipedia.org/wiki/Directed_acyclic_graph
"""
import ... | |
#!/usr/bin/python
import numpy as np
import matplotlib.pyplot as plt
import scipy.special as spc
'''
We have oribtals
Phi_1 = c_a * chi_a + c_b * chi_b
Phi_2 = c_c * chi_c + c_d * chi_d
where chi_i are gaussian type basis functions
and c_i are expansion coefficients
electron density of molecular orbitals R... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.