gt
stringclasses
1 value
context
stringlengths
2.49k
119k
#!/usr/bin/python # # Copyright 2018 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 ag...
#!/usr/bin/env python3 # Blackjack # Uses object oriented programming methodology # NOTES # Deck is fully simulated, cards will not come up twice but deck needs shuffling after each turn (use shuffle(deck)) import random import time from random import shuffle def pause(): """Defines a pause to help the game flow...
""" This module provides the Template class for creating data-bound templates. """ from browser import timer try: from ..utils.events import EventMixin except: from circular.utils.events import EventMixin class PrefixLookupDict(dict): """ Helper class for looking up data allowing a single...
import gzip import json import logging import os import tempfile import zipfile import pytest import retrying import test_helpers from dcos_test_utils.diagnostics import Diagnostics from dcos_test_utils.helpers import check_json __maintainer__ = 'mnaboka' __contact__ = 'dcos-cluster-ops@mesosphere.io' # Expected la...
import datetime import copy import unicode_helpers import json import logging from util import cached_property from util import dict_from_dir from totalimpactwebapp import db logger = logging.getLogger("ti.aliases") def clean_id(nid): try: nid = nid.strip(' "').strip() nid = unicode_helpers.remo...
import cinder.compute.nova as nova from cinder.image import image_utils from oslo.config import cfg from cinder import exception from cinder.i18n import _ from cinder.openstack.common import excutils from cinder.openstack.common import fileutils from cinder.openstack.common import log as logging from cinder.openstack.c...
# Copyright (c) 2012 Eliot Eshelman # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in...
# Licensed under a 3-clause BSD style license - see LICENSE.rst from __future__ import absolute_import, division, print_function import os import numpy as np from astropy.wcs import WCS from astropy.io import fits from astropy import units as u from astropy.coordinates import SkyCoord try: from astropy.extern impor...
# Copyright (C) 2013-2015 MetaMorph Software, Inc # Permission is hereby granted, free of charge, to any person obtaining a # copy of this data, including any software or models in source or binary # form, as well as any drawings, specifications, and documentation # (collectively "the Data"), to deal in the Data witho...
""" Testing for Multi-layer Perceptron module (sklearn.neural_network) """ # Author: Issam H. Laradji # License: BSD 3 clause import pytest import sys import warnings import re import numpy as np import joblib from numpy.testing import ( assert_almost_equal, assert_array_equal, assert_allclose, ) from ...
#!/usr/bin/python import re import sys import os import platform is_windows = platform.system().lower().startswith("win") import subprocess import shutil from markdown2 import * from datetime import * from multiprocessing import Process from utils import * from jira import * from docbook import * try: from xml.etree...
""" Utility functions to check the availability of dependencies and suggest how it may be installed """ import sys # Only really old versions of Python don't have sys.hexversion. We don't # support them. The logging module was introduced in Python 2.3 if not hasattr(sys, 'hexversion') or sys.hexversion < 0x20300F0: ...
import numpy from palm.util import n_choose_k from palm.route_collection import RouteCollectionFactory class Route(object): ''' A generic route class for AggregatedKineticModels. Routes represent transitions between states in such models. Parameters ---------- id_str : string Identifie...
# Copyright (c) 2019 Manfred Moitzi # License: MIT License # created 2019-02-14 import pytest import ezdxf from ezdxf.lldxf.const import DXFAttributeError, DXF12, DXFValueError from ezdxf.lldxf.tagwriter import TagCollector from ezdxf.entities import DXFEntity, is_graphic_entity, Insert from ezdxf.lldxf.extendedtags i...
# -*- coding: utf-8 -*- # # Copyright 2012-2015 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...
from django.conf import settings from django.test import Client, TestCase from factory.django import DjangoModelFactory from .models import Ingredient, Recipe, RecipeIngredientRelationship from .forms import RecipeIngredientRelationshipFormSet, IngredientForm, RecipeForm from .views import vary_recipe from django.forms...
# -*- coding: utf-8 -*- import functools import datetime import mock from factory import SubFactory from factory.fuzzy import FuzzyDateTime, FuzzyAttribute, FuzzyChoice from mock import patch, Mock import factory import pytz from factory.django import DjangoModelFactory from django.utils import timezone from django.d...
import uuid from gevent import monkey from mock import MagicMock monkey.patch_all() from vnc_api.vnc_api import KeyValuePair, KeyValuePairs from kube_manager.common.kube_config_db import NamespaceKM, PodKM, ServiceKM from kube_manager.tests.vnc import test_case from kube_manager.tests.vnc.db_mock import DBBaseKM from...
# -*- coding: utf-8 -*- ''' Simple returner for CouchDB. Optional configuration settings are listed below, along with sane defaults. couchdb.db: 'salt' couchdb.url: 'http://salt:5984/' ''' import logging import time import urllib2 import json log = logging.getLogger(__name__) # Define the module's virtua...
""" The ``mlflow.onnx`` module provides APIs for logging and loading ONNX models in the MLflow Model format. This module exports MLflow Models with the following flavors: ONNX (native) format This is the main flavor that can be loaded back as an ONNX model object. :py:mod:`mlflow.pyfunc` Produced for use by ge...
#!/usr/bin/python import MySQLdb from stemming.porter2 import stem import math from textblob import TextBlob as tb import math import string import operator from testingMajorSimilarity import majorRelations idfcache = {} def tf(word, blob): return float(blob.words.count(word))/ float(len(blob.words)) def n_con...
import re, os import json import commands from termcolor import colored from sqlupdater.parser import HiveDatabaseParser from sqlupdater.utils import open_file, FileLock class Executor(object): def update_lock(self, project): current_commit = str(project.repo.head.commit) working_dir = project.rep...
from __future__ import unicode_literals from __future__ import absolute_import import logging from pypuppetdb.utils import json_to_datetime log = logging.getLogger(__name__) class Event(object): """This object represents an event. :param node: The hostname of the node this event fired on. :param status...
#!/usr/bin/env python import asyncio import getopt import logging import os import sys from typing import Dict, List, Optional, Tuple, cast import tomodachi from tomodachi.config import parse_config_files from tomodachi.launcher import ServiceLauncher try: if ModuleNotFoundError: pass except Exception: ...
''' HaloTools HOD Simulation ''' import numpy as np import pyfof #haltools functions from halotools.sim_manager import CachedHaloCatalog from halotools.empirical_models import PrebuiltHodModelFactory from halotools.mock_observables import tpcf from halotools.empirical_models.factories.mock_helpers import three_dim_pos_...
%matplotlib inline import sys, os, codecs, shutil, re, math, csv import datetime as dt import xlsxwriter import pandas as pd import numpy as np import collections import openpyxl import seaborn as sns from openpyxl.drawing.image import Image import matplotlib.pyplot as plt import matplotlib.dates as mdates #Please cha...
from __future__ import unicode_literals import datetime import json import sys import time from email.header import Header try: from urllib.parse import urlparse except ImportError: from urlparse import urlparse from django.conf import settings from django.core import signals from django.core import signing f...
# 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...
import hmac import json from urllib.parse import urlencode import requests from django.conf import settings from django.core.exceptions import ObjectDoesNotExist from django.http import Http404, HttpResponse, HttpResponseRedirect from django.shortcuts import render from django.urls import reverse from django.utils.cry...
# 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 # d...
import numpy as np from scipy import constants from scipy.optimize import curve_fit import os from numpy.polynomial import polynomial as poly from scipy.special import lambertw # use absolute file path so tests work path_const = os.path.join(os.path.dirname(__file__), '..', 'constants') def AM15G_resample(wl): '...
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright 2014 The Plaso Project Authors. # Please see the AUTHORS file for details on individual 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 L...
# Copyright (c) 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. """Functions specific to handle goma related info. """ import base64 import datetime import getpass import glob import gzip import json import os import...
# Copyright 2013 Devsim 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, s...
# Author: Bichen Wu (bichen@berkeley.edu) 08/25/2016 """Image data base class for kitti""" import cv2 import os import numpy as np import subprocess from dataset.imdb import imdb from utils.util import bbox_transform_inv, batch_iou class kitti(imdb): def __init__(self, image_set, data_path, mc): imdb.__init_...
""" Generate Documentation for armacode to ReadTheDocs. Since this requires Rhino libraries, sphinx can not parse the module. This is a work around to export all documentation to .rst files. Dependencies: - Python27. Remember to set PATH Environment System variables - pip - Sphinx - Sphinxcontrib-napol...
import numpy as np import pandas as pd from .common import ( _contains_datetime_like_objects, is_np_datetime_like, is_np_timedelta_like, ) from .pycompat import dask_array_type def _season_from_months(months): """Compute season (DJF, MAM, JJA, SON) from month ordinal""" # TODO: Move "season" acce...
# 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...
# stdlib import urlparse import time import re import pprint import urllib # project from checks import AgentCheck # 3rd party import simplejson as json import requests EVENT_TYPE = SOURCE_TYPE_NAME = 'rabbitmq' QUEUE_TYPE = 'queues' NODE_TYPE = 'nodes' MAX_DETAILED_QUEUES = 200 MAX_DETAILED_NODES = 100 ALERT_THRESH...
import theano import theano.tensor as T import mlbase.network as N import h5py import numpy as np import mlbase.layers.activation as act import mlbase.loaddata as l from mlbase.layers import * import mlbase.cost as cost from skimage.measure import block_reduce def test_generative(): import mlbase.cost as cost ...
# Copyright 2014 Netflix, 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...
from itertools import product import pickle import numpy as np from scipy.sparse import (bsr_matrix, coo_matrix, csc_matrix, csr_matrix, dok_matrix, lil_matrix) from sklearn import metrics from sklearn.model_selection import train_test_split from sklearn.model_selection import cross_val_scor...
""" Base tools for handling various kinds of data structures, attaching metadata to results, and doing data cleaning """ import numpy as np from pandas import DataFrame, Series, TimeSeries from scikits.timeseries import time_series from scikits.statsmodels.tools.decorators import (resettable_cache, cac...
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # MIT License. See license.txt from __future__ import unicode_literals """ Boot session from cache or build Session bootstraps info needed by common client side activities including permission, homepage, default variables, system defaults etc """ im...
############################################################################### ## ## Copyright (C) 2006-2011, University of Utah. ## All rights reserved. ## Contact: contact@vistrails.org ## ## This file is part of VisTrails. ## ## "Redistribution and use in source and binary forms, with or without ## modification, ...
import asyncio from contextlib import suppress import errno import logging from multiprocessing.queues import Empty import os import psutil import shutil import threading import uuid import warnings import weakref import dask from dask.system import CPU_COUNT from tornado.ioloop import IOLoop, PeriodicCallback from to...
# 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...
# Copyright 2020 The StackStorm Authors. # Copyright 2019 Extreme Networks, 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 ...
# coding=utf-8 # Copyright 2021 The HuggingFace Team 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 clone of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable...
""" Video Link: https://youtu.be/1s-Tj65AKZA """ from seleniumbase import __version__ from seleniumbase import BaseCase class HackTests(BaseCase): def test_all_your_base_are_belong_to_us(self): # First make sure that seleniumbase 1.65.0 or newer is installed version = __version__.split(".") ...
# # Copyright (c) 2008-2015 Citrix Systems, 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 l...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # for python 3.5 or earlier import os import fcntl import string import codecs import socket import ctypes import argparse import contextlib from concurrent import futures _libc = ctypes.CDLL('libc.so.6', use_errno=True) class _sockaddr_alg(ctypes.Structure): _fiel...
# 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 2012 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Copyright 2012 Cisco Systems, Inc. # Copyright 2012 NEC Corporation # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use...
# 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 appl...
# Copyright (c) 2008, Aldo Cortesi. All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify,...
"""@file vad_timings_processor.py contains the VadTimingsProcessor class""" import os import subprocess import StringIO import scipy.io.wavfile as wav import numpy as np import processor import gzip from nabu.processing.feature_computers import feature_computer_factory class VadTimingsProcessor(processor.Processor)...
######## # Copyright (c) 2015 GigaSpaces Technologies Ltd. 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...
""" Implements the wrapper for the Astropy test runner in the form of the ``./setup.py test`` distutils command. """ import os import glob import shutil import subprocess import sys import tempfile from setuptools import Command class FixRemoteDataOption(type): """ This metaclass is used to catch cases whe...
# -*- coding: utf-8 -*- # # Copyright (C) 2008-2014 Edgewall Software # All rights reserved. # # This software is licensed as described in the file COPYING, which # you should have received as part of this distribution. The terms # are also available at http://trac.edgewall.org/wiki/TracLicense. # # This software consi...
#!/usr/bin/env python3 # This file is part of the MicroPython project, http://micropython.org/ # The MIT License (MIT) # Copyright (c) 2019 Damien P. George import os import subprocess import sys import argparse sys.path.append("../tools") import pyboard # Paths for host executables CPYTHON3 = os.getenv("MICROPY_CP...
#!/usr/bin/env python ######################################################################################### # # Motion correction of dMRI data. # # Inspired by Xu et al. Neuroimage 2013. # # Details of the algorithm: # - grouping of DW data only (every n volumes, default n=5) # - average all b0 # - average DWI data...
# Copyright (c) 2016, Facebook, Inc. # All rights reserved. # # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. An additional grant # of patent rights can be found in the PATENTS file in the same directory. from __future__ import absolute_...
#!/usr/bin/env python # emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*- # vi: set ft=python sts=4 ts=4 sw=4 et: """ ========================== fMRI: SPM Auditory dataset ========================== Introduction ============ The fmri_spm_auditory.py recreates the classical workflow described in ...
""" Tools to for cryoscope analysis Brian Tarasinski Dec 2017 Edited by Adriaan Rol """ from typing import Union import numpy as np import matplotlib.pyplot as plt import matplotlib.ticker from pycqed.analysis.tools.plotting import (set_xlabel, set_ylabel, flex_colormesh_plot...
"""This is the Bokeh charts interface. It gives you a high level API to build complex plot is a simple way. This is the ChartObject class, a minimal prototype class to build more chart types on top of it. It provides the mechanisms to support the shared chained methods. """ #-------------------------------------------...
from graph_generator import * from mystruct import * import numpy as np import math def objective_function(edges): """transform to graph edges to a quadratic objective function""" ##larger one x = [edge.prim2.locs[edge.loc2][1][0] if edge.tp == 'h' else edge.prim2.locs[edge.loc2][0][0] for edge in edges] ...
# -*- coding: utf-8 -*- """Test utilities.""" # # (C) Pywikibot team, 2013-2014 # # Distributed under the terms of the MIT license. # from __future__ import print_function, unicode_literals __version__ = '$Id$' # import os import re import subprocess import sys import time import traceback from warnings import warn ...
# Copyright (C) 2017 Google Inc. # Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file> """Audit model.""" from ggrc import db from ggrc.models.deferred import deferred from ggrc.models.mixins import ( Timeboxed, Noted, Described, Hyperlinked, WithContact, Titled, Slugged, CustomAttrib...
# 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 ...
# 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...
# 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 ...
#!/usr/bin/env python """Tests for grr.lib.aff4_objects.filestore.""" import os import StringIO import time from grr.lib import action_mocks from grr.lib import aff4 from grr.lib import config_lib from grr.lib import flow from grr.lib import rdfvalue from grr.lib import test_lib from grr.lib import utils from grr.lib...
# 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 t...
""" sphinx.domains ~~~~~~~~~~~~~~ Support for domains, which are groupings of description directives and roles describing e.g. constructs of one programming language. :copyright: Copyright 2007-2019 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ import copy from ...
#!/usr/bin/python import gzip import numpy as np import sys, os, inspect currentdir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe()))) parentdir = os.path.dirname(currentdir) sys.path.insert(0,parentdir) import common import config as cfg def fileToDictionary(inputFile, indexColumn)...
# -*- coding: utf-8 -*- from pexpect import pxssh import getpass import argparse # import os import csv import re __version__ = "0.3.3.6" """ Handle imput paramaters """ parser = argparse.ArgumentParser(description='''My Description. \ And what a lovely description it is. ''', epilog="""All's well that end...
#!/usr/bin/env python3 # Copyright (c) 2016-2018 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test label RPCs. RPCs tested are: - getaccountaddress - getaddressesbyaccount/getaddressesbyla...
# Copyright (c) 2014 Mirantis 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 writing, so...
import unittest import math import numpy as np import numpy.testing import ROOT ROOT.PyConfig.IgnoreCommandLineOptions = True from parspec import SpecBuilder from parspec import Source from parspec import ParSpec def logPoisson(k, v, s): vv = np.array(k, dtype=float) vv[vv<1] = 1 vv += s return -0.5...
# encoding: utf-8 import csv import json import os.path from time import time from itertools import chain from collections import defaultdict from six.moves import StringIO, xrange import six from gevent import wsgi from flask import Flask, make_response, request, render_template from . import runners from .cache im...
"""Base Command class, and related routines""" from __future__ import absolute_import, print_function import logging import logging.config import optparse import os import platform import sys import traceback from pip._internal.cli import cmdoptions from pip._internal.cli.command_context import CommandContextMixIn f...
# 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 ...
"""Component for wiffi support.""" from datetime import timedelta import errno import logging from wiffi import WiffiTcpServer from homeassistant.config_entries import ConfigEntry from homeassistant.const import CONF_PORT, CONF_TIMEOUT from homeassistant.core import HomeAssistant, callback from homeassistant.exceptio...
# Copyright (C) 2013 Hewlett-Packard Development Company, L.P. # 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/LICEN...
#!/usr/bin/env python3 """ Create dynamic report for foodlog with daily summary only. How To Use This Module ====================== 1. Import it: ``from daysummary import Summary`` 2. Summarize: summary = Summary(dbfile, start_date, end_date) 3. The Summary object has these attributes: Summary.days: ...
#!/usr/bin/env python # Copyright (c) 2011-2018, wradlib developers. # Distributed under the MIT License. See LICENSE.txt for more info. """ Read Rainbow ^^^^^^^^^^^^ .. autosummary:: :nosignatures: :toctree: generated/ read_rainbow """ # standard libraries from __future__ import absolute_import import sys ...
# Copyright (c) 2013 VMware, 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 b...
from sympy import (Symbol, symbols, factorial, factorial2, binomial, rf, ff, gamma, polygamma, EulerGamma, O, pi, nan, oo, zoo, simplify, expand_func, C, S, Product) from sympy.functions.combinatorial.factorials import subfactorial from sympy.utilities.pytest import XFAIL, raises ...
#Module containing frequently used physics constants and functions import math import numpy as np import matplotlib as mpl import matplotlib.pyplot as plt from matplotlib.colors import ListedColormap #%% #============================================================================== # Fundamental constants #=========...
from __future__ import print_function from future import standard_library standard_library.install_aliases() from builtins import str from datetime import datetime import logging from urllib.parse import urlparse from time import sleep from airflow import hooks, settings from airflow.models import BaseOperator, TaskIn...
import os import time import traceback import xmlrpclib from copy import copy from celery import chain, task from django.core.cache import cache from django.template.loader import render_to_string from django.utils import timezone from functools import wraps from empressx import states from empressx.retinue.conf impo...
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright (c) 2012 NetApp, 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.or...
# Copyright 2016 Amazon.com, Inc. or its affiliates. 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. A copy of # the License is located at # # http://aws.amazon.com/apache2.0/ # # or in the "license" file accompa...
"""Aiohttp test utils.""" import asyncio from contextlib import contextmanager import json as _json import re from unittest import mock from urllib.parse import parse_qs from aiohttp import ClientSession from aiohttp.streams import StreamReader from yarl import URL from aiohttp.client_exceptions import ClientResponse...
#!/usr/bin/env python3 # Copyright (c) 2014 Wladimir J. van der Laan # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. ''' A script to check that the executables produced by gitian only contain certain symbols and are only linked aga...
import re from django.contrib.auth.models import User from django import forms from crispy_forms.helper import FormHelper from crispy_forms.layout import Submit from sideloader.db import models class BaseModelForm(forms.ModelForm): helper = FormHelper() helper.form_class = 'form-horizontal' helper.label...
# # Copyright (c) 2012 Patrice Munger # This file is part of pynetdicom, released under a modified MIT license. # See the file license.txt included with this distribution, also # available at http://pynetdicom.googlecode.com # from DIMSEparameters import * from DULparameters import * from dicom.dataset import Da...
# -------------------------------------------------------- # Fast R-CNN # Copyright (c) 2015 Microsoft # Licensed under The MIT License [see LICENSE for details] # Written by Ross Girshick # -------------------------------------------------------- from __future__ import print_function import os, pdb import xml.dom.min...
import time import numpy as np from scipy.integrate import odeint from scipy.interpolate import interp1d from . import util as UT from . import sfh as SFH def Evolve(shcat, theta, testing=False): ''' ''' # meta data nsnap0 = shcat['metadata']['nsnap0'] ngal = len(shcat['m.sham']) shcat ...