gt stringclasses 1
value | context stringlengths 2.49k 119k |
|---|---|
import csv
import random
import StringIO
from django.core.mail import send_mass_mail
from django.db.models import Q
from django.http import HttpResponse
from django.http import HttpResponseBadRequest, HttpResponseNotAllowed
from django.shortcuts import render, redirect, get_object_or_404
from django.template import Co... | |
"""
Unified interfaces to root finding algorithms.
Functions
---------
- root : find a root of a vector function.
"""
__all__ = ['root']
import numpy as np
ROOT_METHODS = ['hybr', 'lm', 'broyden1', 'broyden2', 'anderson',
'linearmixing', 'diagbroyden', 'excitingmixing', 'krylov',
'df-... | |
# -*- coding: utf-8 -*-
"""
Standard Markov Chain Monte Carlo updates.
"""
__authors__ = 'Matt Graham'
__copyright__ = 'Copyright 2015, Matt Graham'
__license__ = 'MIT'
import numpy as np
import warnings
def metropolis_step(x_curr, log_f_curr, log_f_func, prng, prop_sampler,
prop_scales):
""... | |
"""views for the :mod:`grid` app"""
from django.conf import settings
from django.contrib.auth.decorators import login_required, permission_required
from django.contrib.auth.models import User
from django.contrib import messages
from django.core.cache import cache
from django.core.urlresolvers import reverse
from dja... | |
import json
import os
import decimal
import bson
import itertools
import datetime
import numpy
from numpy.ma import MaskedArray
from numpy.ma.core import MaskedConstant
from pymongo import ASCENDING
from bdo_platform.settings import DATASET_DIR
from aggregator.models import Dataset as AgDataset, Variable as AgVariab... | |
from __future__ import annotations
from typing import cast
import warnings
import numpy as np
from pandas._libs.lib import (
NoDefault,
no_default,
)
from pandas._libs.missing import is_matching_na
import pandas._libs.testing as _testing
from pandas.core.dtypes.common import (
is_bool,
is_categorica... | |
import warnings
import hashlib
import pymongo
import re
from pymongo.read_preferences import ReadPreference
from bson import ObjectId
from bson.dbref import DBRef
from mongoengine import signals
from mongoengine.common import _import_class
from mongoengine.base import (
DocumentMetaclass,
TopLevelDocumentMeta... | |
"""
Wrap the internal caffe C++ module (_caffe.so) with a clean, Pythonic
interface.
"""
from collections import OrderedDict
from itertools import izip_longest
import numpy as np
from ._caffe import Net, SGDSolver
import caffe.io
# We directly update methods from Net here (rather than using composition or
# inherita... | |
from django.contrib.contenttypes.generic import GenericForeignKey
from django.core.exceptions import ValidationError
from django.core.urlresolvers import reverse, resolve, NoReverseMatch, Resolver404
from django.db import models
from django.utils.translation import ugettext_lazy as _, ugettext
import settings
def _g... | |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2014 IBM Corporation
# Copyright 2015 Lenovo
#
# 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/LI... | |
# Copyright 2012-2017 The Meson development team
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agree... | |
import settings
import helpers
import glob
import pandas
import ntpath
import numpy
import cv2
import os
CUBE_IMGTYPE_SRC = "_i"
def save_cube_img(target_path, cube_img, rows, cols):
assert rows * cols == cube_img.shape[0]
img_height = cube_img.shape[1]
img_width = cube_img.shape[1]
res_img = numpy.z... | |
import logging
logging.basicConfig(level=logging.DEBUG)
#logging.basicConfig(filename='dev-match-new.log',level=logging.DEBUG)
import numpy as np
from scipy import stats
from scipy.spatial.distance import cosine, euclidean
import random
class Match:
def __init__(self, crowd, alpha = 1.8, group_size_limit = 4, mat... | |
# Copyright 2008-2015 Nokia Solutions and Networks
#
# 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... | |
##########################################################################
#
# Copyright (c) 2013, 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:
#
# * Red... | |
# Waitrose web scraper
__author__ = 'robdobsn'
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
import selenium.webdriver.support.ui as webdriverui
from selenium.webdriver.support.wait import WebDriverWait
from selenium.webdriver.common.by import By
from selenium.common.exceptions import... | |
# Copyright 2018 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 -*-
from __future__ import unicode_literals
import os
import tempfile
from wsgiref.util import FileWrapper
from django import forms
from django.conf.urls import url
from django.contrib import admin
from django.contrib.admin import BooleanFieldListFilter
from django.contrib.admin.views.main import ... | |
import os
import torch
import torch.nn as nn
import torch.optim as optim
import torch.nn.functional as F
import numpy as np
from word_model import WordModel
from utils.eval_utils import compute_eval_metric
from models.layers import multi_nll_loss
from utils import constants as Constants
from collections import Counter... | |
import pprint
from unittest import TestCase
from dogpile.cache.api import CacheBackend, CachedValue, NO_VALUE
from dogpile.cache import make_region, register_backend, CacheRegion, util
from dogpile.cache.proxy import ProxyBackend
from . import eq_, is_, assert_raises_message, io, configparser
import time, datetime
impo... | |
# -*- coding: utf-8 -*-
#
# 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
... | |
from ScrollText import ScrollText
from Tkinter import *
from PrologFrame import PrologFrame
from Prolog import PrologException
from FastIndex import FastIndex
import ErrDialog
import re
import AnnotationColours
#import Colour
import parser
def startCompare(x, y):
(xLine, xCol) = x[1].split('.')
(yLine, yCol... | |
from jsonrpc import ServiceProxy
import sys
import string
# ===== BEGIN USER SETTINGS =====
# if you do not set these you will be prompted for a password for every command
rpcuser = ""
rpcpass = ""
# ====== END USER SETTINGS ======
if rpcpass == "":
access = ServiceProxy("http://127.0.0.1:8332")
else:
access = Ser... | |
# -*- coding: utf-8 -*-
# pylint: disable=fixme
"""Sonos Music Services interface.
This module provides the MusicService class and related functionality.
"""
from __future__ import absolute_import, unicode_literals
import logging
import requests
from xmltodict import parse
from .. import discovery
from ..compat ... | |
# Test fixture methods to be called from app context so we can access the db
from pebbles.models import (
User, Group, GroupUserAssociation, BlueprintTemplate, Blueprint,
Plugin, Notification, Instance)
from pebbles.tests.base import db
def primary_test_setup(namespace):
""" Setup taken from FlaskApiTest... | |
# Copyright 2020 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... | |
from copy import deepcopy
import os
from collections import defaultdict
from classytags.tests import DummyParser, DummyTokens
from django.conf import settings
from django.contrib.auth.models import AnonymousUser
from django.contrib.sites.models import Site
from django.core import mail
from django.core.exceptions impo... | |
# Copyright (c) 2010 Cloud.com, Inc
# Copyright (c) 2012 Cloudbase Solutions Srl
#
# 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.... | |
import numpy as np
import matplotlib.pyplot as plt
from math import sqrt, cos, sin, pi
from time import clock
from copy import deepcopy
class Blob:
def __init__(self,x,y,r):
self.x = x
self.y = y
self.r = r
self.path = [(x,y)]
def addToPath(self,nx,ny):
self.path.append... | |
# /usr/bin/env python
# coding=utf-8
# Copyright 2010 Jonathan Bowman
#
# 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... | |
import traceback
from _pydev_bundle.pydev_is_thread_alive import is_thread_alive
from _pydev_imps._pydev_saved_modules import threading
from _pydevd_bundle.pydevd_constants import get_current_thread_id, IS_IRONPYTHON, NO_FTRACE, IS_WINDOWS
from _pydevd_bundle.pydevd_dont_trace_files import DONT_TRACE
from _pydevd_bund... | |
from functools import partial
from collections import namedtuple, defaultdict
import struct
from zorro.util import cached_property
try:
from .shm import ShmPixbuf
except ImportError:
import warnings
warnings.warn('Shm is not available, expect poor performance.')
try:
from .pixbuf import Pixbuf
except... | |
from visual import *
from visual.graph import *
from scipy.integrate import odeint
from fuzzy import *
from cart import *
from world import *
import fuzzy.storage.fcl.Reader
import numpy as np
import scipy as sp
import visual.controls as cntrl
global angles
global position
isPaused = False
isStarted = False
def u... | |
from datetime import timedelta
from django.urls import reverse
from django.utils import timezone
from workshops.models import Person
from workshops.tests.base import TestBase
class TestEmptyDuplicates(TestBase):
"""Tests to return empty context variables when no matches found."""
def setUp(self):
s... | |
import copy
import datetime as dt
import io
import sys
import numpy as np
import thalesians.tsa.checks as checks
import thalesians.tsa.conversions as conversions
import thalesians.tsa.utils as utils
def format_q_time(thing):
if isinstance(thing, dt.datetime) or isinstance(thing, dt.time):
hour = thing.ho... | |
#!/usr/bin/env python3
# This script tests different configurations of Ramulator using several traces.
# After making changes to the source code, run this script to make sure your changes do not break Ramulator
# in terms of simulation accuracy (i.e., cycles to complete a given trace), simulation speed, and system mem... | |
# ext/orderinglist.py
# Copyright (C) 2005-2021 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: https://www.opensource.org/licenses/mit-license.php
"""A custom list that manages index/position information for contained
elements... | |
# Copyright (c) 2013 - 2020 Adam Caudill and Contributors.
# This file is part of YAWAST which is released under the MIT license.
# See the LICENSE file or go to https://yawast.org/license/ for full license details.
import secrets
from typing import List, cast, Dict
from urllib.parse import urljoin, urlparse, urlun... | |
# coding=utf-8
import json
import logging
import sys
import networkx
import pytest
from bireus.client.download_service import DownloadError
from bireus.client.repository import ClientRepository, CheckoutError
from bireus.server.repository_manager import RepositoryManager
from bireus.shared import *
from bireus.shared... | |
import inspect, textwrap
import codegen as cg
import os
_rank = 0
namespaces = {}
RESERVED = frozenset(['None'])
def makedir(directory):
if not os.path.exists(directory):
os.makedirs(directory)
class SubModule(object):
def __init__(self):
self.methods = []
self.enums = []
s... | |
"""
Copyright (c) 2015 Red Hat, Inc
All rights reserved.
This software may be modified and distributed under the terms
of the BSD license. See the LICENSE file for details.
"""
from __future__ import absolute_import, unicode_literals, print_function
import os
import re
import pytest
import inspect
import json
import ... | |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2013 Metacloud, 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
#
... | |
# Copyright 2013-2015 University of Warsaw
#
# 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 agree... | |
# Copyright (c) 2017, Henrique Miranda
# All rights reserved.
#
# This file is part of the yambopy project
#
from yambopy import *
from netCDF4 import Dataset
class YamboStaticScreeningDB():
"""
Class to handle static screening databases from Yambo
This reads the databases ``ndb.em1s*``
There :mat... | |
# Copyright 2015 Hewlett-Packard Development Company, L.P.
# Copyright 2020 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/licens... | |
from stomp import exception as exc
from kombu_stomp import transport
from kombu_stomp.utils import mock
from kombu_stomp.utils import unittest
class MessageTests(unittest.TestCase):
def setUp(self):
self.raw_message = {
'content-encoding': 'utf-8',
'content-type': 'application/jso... | |
from .common import random_str, check_subject_in_rb
from rancher import ApiError
from .conftest import wait_until, wait_for, DEFAULT_TIMEOUT
import pytest
import time
import kubernetes
rb_resource = 'rolebinding'
def test_create_cluster_template_with_revision(admin_mc, remove_resource):
cluster_template = creat... | |
#!/usr/bin/env python3
# Copyright (c) 2014-2020 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Helpful routines for regression testing."""
from base64 import b64encode
from binascii import unhexlif... | |
# 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 (c) 2006-2013 Regents of the University of Minnesota.
# For licensing terms, see the file LICENSE.
import traceback
import conf
import g
from grax.access_level import Access_Level
from gwis.exception.gwis_nothing_found import GWIS_Nothing_Found
from item import item_base
from item import item_user_access... | |
from unittest import TestCase
import simplejson as json
from mock import patch, PropertyMock, Mock
from pyqrllib.pyqrllib import bin2hstr
from qrl.core.misc import logger
from qrl.core.AddressState import AddressState
from qrl.core.txs.TokenTransaction import TokenTransaction
from qrl.core.txs.Transaction import Tran... | |
# 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 applicable ... | |
#!/usr/bin/env python
# Licensed to Cloudera, Inc. under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. Cloudera, Inc. licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you ma... | |
#!/usr/bin/env python
# encoding: utf-8
"""
Pbxproj.py
Working with the pbxproj file format is a pain in the ass.
This object provides a couple basic features for parsing pbxproj files:
* Getting a dependency list
* Adding one pbxproj to another pbxproj as a dependency
Version 1.0.
History:
1.0 - October 20, 2010:... | |
from django.http import Http404, HttpResponse
from django.shortcuts import render, redirect, get_object_or_404
from django.core.exceptions import ValidationError, PermissionDenied
from django.contrib import messages
from django.contrib.contenttypes.models import ContentType
from django.contrib.auth.decorators import pe... | |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# ======================================================================
# Copyright 2016 Julien LE CLEACH
#
# 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 Lice... | |
# Documented in https://zulip.readthedocs.io/en/latest/subsystems/sending-messages.html#soft-deactivation
import logging
from collections import defaultdict
from typing import Any, DefaultDict, Dict, List, Optional, Union
from django.conf import settings
from django.db import transaction
from django.db.models import M... | |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright 2010 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 require... | |
#!/usr/bin/env python
# portions copyright 2001, Autonomous Zones Industries, Inc., all rights...
# err... reserved and offered to the public under the terms of the
# Python 2.2 license.
# Author: Zooko O'Whielacronx
# http://zooko.com/
# mailto:zooko@zooko.com
#
# Copyright 2000, Mojam Media, Inc., all rights reserv... | |
#
# 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... | |
# 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 2011 Yesudeep Mangalapilly <yesudeep@gmail.com>
# Copyright 2012 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.o... | |
# -*- coding: utf-8 -*-
"""
A minimalist klout API interface. Use of this API
requires klout *developer key*. You can get registered and
get a key at
<http://klout.com/s/developers/v2>
Supports Python >= 2.5 and Python 3
====================
Quickstart
====================
Install the PyPi package::
pip i... | |
"""
990.ro XBMC Addon
Copyright (C) 2012-2014 krysty
https://code.google.com/p/krysty-xbmc/
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
... | |
"""All constants related to the ZHA component."""
import enum
import logging
from typing import List
import bellows.zigbee.application
from zigpy.config import CONF_DEVICE_PATH # noqa: F401 # pylint: disable=unused-import
import zigpy_cc.zigbee.application
import zigpy_deconz.zigbee.application
import zigpy_xbee.zigb... | |
# 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... | |
# Copyright 2010-2011 OpenStack Foundation
# Copyright 2014 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/license... | |
import MySQLdb, MySQLdb.cursors
import config
from bottle import route, run, template, debug, view, static_file, request
import time
import urllib
import urllib2
from bs4 import BeautifulSoup
import re
@route('/js/<filename>')
def js_static(filename):
return static_file(filename, root='./static/js')
@route('/im... | |
#! /usr/bin/env python
# $Header$
'''Simple CGI dispatching.
'''
import os, sys
from BaseHTTPServer import BaseHTTPRequestHandler, HTTPServer
from pysphere.ZSI import TC, EvaluateException, FaultFromZSIException, \
SoapWriter, Fault, FaultFromException, UNICODE_ENCODING, ParsedSoap, \
ParseException
from pysph... | |
#
# cocos2d
# http://cocos2d.org
#
# Particle Engine done by Phil Hassey
# http://www.imitationpickles.org
#
import sys
import os
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..'))
import pyglet
from pyglet.gl import *
from cocos.director import *
from cocos.menu import *
from cocos.scene import *
fro... | |
# Copyright 2015 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... | |
#!/usr/bin/python
# -*- coding: UTF-8 -*-
#Usage: python DTMF.py SomeSound.wav
#currently only tested with 16bit wav files that were sampled at 44.1kHz
#You might want to convert this file http://upload.wikimedia.org/wikipedia/commons/b/b4/DTMF_all_16.ogg to a 16bit wav file with a sample rate of 44.1kHz to test deco... | |
# Copyright 2013 IBM Corp.
#
# 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 agree... | |
import glob
import sh
import subprocess
from multiprocessing import cpu_count
from os import environ, utime
from os.path import dirname, exists, join
from pathlib import Path
from shutil import copy2
from pythonforandroid.logger import info, warning, shprint
from pythonforandroid.patching import version_starts_with
f... | |
"""
<Program Name>
ed25519_keys.py
<Author>
Vladimir Diaz <vladimir.v.diaz@gmail.com>
<Started>
September 24, 2013.
<Copyright>
See LICENSE for licensing information.
<Purpose>
The goal of this module is to support ed25519 signatures. ed25519 is an
elliptic-curve public key signature scheme, its main s... | |
# Copyright 2014 Open vStorage 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 applicable law or agreed to in writ... | |
#!/usr/bin/env python
"""
NAME: mprun.py
==============
DESCRIPTION
===========
Take a CMD that requires one INPUT and one OUTPUT files and run
the CMD on a set of files via multiple processes simultaneously.
INSTALLATION
============
1. Download mprun.py
2. Run
USAGE
=====
python mprun.py -p 8 "cat {{INPUT}} | wc -... | |
"""
*******************************************************************************
* Ledger Blue
* (c) 2016 Ledger
*
* 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.... | |
import logging
from .document import Documents
from .edge import Edges
from .index import Index
from .exceptions import InvalidCollectionId, CollectionIdAlreadyExist, \
InvalidCollection
from .aql import AQLQuery
logger = logging.getLogger(__name__)
__all__ = ("Collection", "Collections")
class Collections(obj... | |
# -*- coding: utf-8 -*-
#
# Copyright (c) 2015, Alcatel-Lucent Inc, 2017 Nokia
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyrigh... | |
# -*- coding: utf-8 -*-
"""
Contains all core validation functions.
"""
import os
import re
import socket
import logging
import tempfile
import traceback
import basedefs
from . import utils
from .setup_controller import Controller
from .exceptions import ParamValidationError
__all__ = ('ParamValidationError', 'va... | |
# Pretty-printer commands.
# Copyright (C) 2010-2017 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any la... | |
from sympy.core import Basic, S, Function, diff, Number, sympify, Tuple
from sympy.core.relational import Equality, Relational
from sympy.logic.boolalg import Boolean
from sympy.core.sets import Set
from sympy.core.symbol import Dummy
class ExprCondPair(Tuple):
"""Represents an expression, condition pair."""
... | |
from __future__ import unicode_literals
from collections import deque
from djblets.util.compat.django.template.loader import render_to_string
from reviewboard.reviews.errors import DepthLimitExceededError
#: The maximum depth limit of any action instance.
MAX_DEPTH_LIMIT = 2
#: The mapping of all action IDs to th... | |
from enum import IntEnum
from couchbase.exceptions import CouchbaseException
from typing import *
class MixedAuthException(CouchbaseException):
"""
Cannot use old and new style auth together in the same cluster
"""
pass
class NoBucketException(CouchbaseException):
"""
Operation requires at ... | |
#FIXME Service changes?
#FIXME redo model serialization API
#FIXME Notifiers
#FIXME ACLs
#FIXME locks
#FIXME isDirty
#FIXME SingleUserMode
#Represents a single Trike model
class TModel(object):
def __init__(self):
self.objects = TObjectSet(self)
self.changes = TChangeSet(self)
self.branches ... | |
# Copyright (c) 2014 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 requi... | |
#!/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 nested workflows
==========================
The fmri_spm.py integrates several interfaces to perform a first
and second level analysis on a tw... | |
import pytest
from openshift_checks.docker_image_availability import DockerImageAvailability, DEPLOYMENT_IMAGE_INFO
@pytest.fixture()
def task_vars():
return dict(
openshift_is_atomic=False,
openshift_is_containerized=False,
openshift_service_type='origin',
openshift_deployment_ty... | |
from collections.abc import Iterable
from loguru import logger
from flexget import plugin
from flexget.config_schema import one_or_more
from flexget.entry import Entry
from flexget.event import event
from flexget.utils.cached_input import cached
logger = logger.bind(name='from_imdb')
class FromIMDB:
"""
Th... | |
import unittest
import numpy as np
from pgmpy.factors import Factor
from pgmpy.models import FactorGraph
from pgmpy.models import MarkovModel
from pgmpy.models import JunctionTree
from pgmpy.tests import help_functions as hf
import numpy as np
import unittest
from pgmpy.exceptions import CardinalityError
from pgmpy.ex... | |
# Copyright 2017 Capital One Services, 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... | |
#
# 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
# ... | |
# 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 ... | |
"""Data Equivalence Tests"""
from __future__ import print_function
# Author: Teon Brooks <teon.brooks@gmail.com>
#
# License: BSD (3-clause)
import inspect
import os.path as op
import shutil
import warnings
from nose.tools import assert_equal, assert_raises, assert_true
import numpy as np
from numpy.testing import (... | |
#!/Users/toma/python278i/bin/python
# Tom Anderson
# Thermal simulation prototype
# Sun Jul 13 22:30:26 PDT 2014
#
# Thermonous pertains to stimulation by heat.
# The literal ancient Greek is hot minded.
#
# Thermonice is like spice. Thermospice.
#
# TODO:
# Make the spice netlist generation use a string buffe... | |
"""
plot_points.py
Class instance used to plot information over a set of points.
"""
# Load the needed packages
import numpy as np
import os
import pyart
from matplotlib.backends.backend_qt4agg import FigureCanvasQTAgg
from matplotlib.backends.backend_qt4agg import NavigationToolbar2QT as \
NavigationToolbar
from... | |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 Red Hat, Inc.
# 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
#
# ... | |
"""
An API consists of a number of endpoints. Typically a model in a database has one API with two endpoints.
The API handles the CRUD operations for that model. The first endpoint is used to list a model's objects, the
second returns a specific object by ID.
The first endpoint (the list endpoint) allows for its resul... | |
# 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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.