gt
stringclasses
1 value
context
stringlengths
2.49k
119k
#!/usr/bin/env python2 # -*- coding: utf-8 -*- """ This module provides API class definition to define observables. Classes ------- * :class:`Observable`: main object to define observables. """ from __future__ import print_function import collections import warnings import inspect import dill import re from copy im...
import errno import logging import sys import warnings from socket import error as SocketError, timeout as SocketTimeout import socket try: # Python 3 from queue import LifoQueue, Empty, Full except ImportError: from Queue import LifoQueue, Empty, Full import Queue as _ # Platform-specific: Windows fr...
from __future__ import annotations from . import ProgressiveTest from progressivis.core import aio from progressivis import Print from progressivis.table.stirrer import Stirrer from progressivis.linalg import ( Unary, Binary, ColsBinary, Reduce, func2class_name, unary_module, make_unary, ...
import datetime from django.core.urlresolvers import reverse from django.shortcuts import render_to_response from django.template import RequestContext from django.http import HttpResponseRedirect # , HttpResponse from billing import CreditCard, get_gateway, get_integration from billing.gateway import CardNotSupport...
#!/usr/bin/env python import os import tempfile import psycopg2 import json from hashlib import md5 from copy import deepcopy from collections import defaultdict from wextractor.loaders.loader import Loader class PostgresLoader(Loader): def __init__(self, connection_params, schema=None): super(PostgresL...
# coding=utf-8 # Copyright 2014 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import (absolute_import, division, generators, nested_scopes, print_function, unicode_literals, with_statement) import logging impor...
import os import re import sys import imp import copy import glob import atexit import tempfile try: set except NameError: from sets import Set as set __all__ = ['Configuration', 'get_numpy_include_dirs', 'default_config_dict', 'dict_append', 'appendpath', 'generate_config_py', 'get_cmd'...
import string INDENT = ' ' KEYWORDS = ['auto', 'break', 'case', 'char', 'const', 'continue', 'default', 'do', 'double', 'else', 'enum', 'extern', 'float', 'for...
# 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...
# Copyright 2019 ARM Limited # # 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...
LICENSE = """\ Copyright (c) 2014 Ian Good <ian.good@rackspace.com> 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, modif...
#!/usr/bin/env python import sys import os import wx import random import math import images import wx.lib.mixins.listctrl as listmix from wx.lib.embeddedimage import PyEmbeddedImage try: dirName = os.path.dirname(os.path.abspath(__file__)) except: dirName = os.path.dirname(os.path.abspath(sys.argv[0])) sy...
"""DNS Authenticator using RFC 2136 Dynamic Updates.""" import logging from typing import Any from typing import Callable from typing import Optional import dns.flags import dns.message import dns.name import dns.query import dns.rdataclass import dns.rdatatype import dns.tsig import dns.tsigkeyring import dns.update ...
"""Test the various means of instantiating and invoking tools.""" import gzip import io import sys import time import types import unittest import operator from http.client import IncompleteRead import cherrypy from cherrypy import tools from cherrypy._cpcompat import ntou from cherrypy.test import helper, _test_deco...
# Copyright 2016, Google 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: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the f...
# Author: Eric Larson <larson.eric.d@gmail.com> # # License: BSD-3-Clause import os import os.path as op import numpy as np from numpy.testing import (assert_allclose, assert_array_equal, assert_array_less) import matplotlib.pyplot as plt import pytest from mne import (read_dipole, read_fo...
#!/usr/bin/python import argparse import sys import os import time import traceback import sys import ctypes import subprocess from subprocess import Popen, PIPE import os from optparse import OptionParser from biokbase.workspace.client import Workspace import MySQLdb as mdb desc1 = ''' NAME gwas_GeneList2Networ...
from __future__ import unicode_literals import re import json from .common import InfoExtractor from .gigya import GigyaBaseIE from ..compat import compat_HTTPError from ..utils import ( extract_attributes, ExtractorError, strip_or_none, float_or_none, int_or_none, merge_dicts, str_or_none...
from a10sdk.common.A10BaseClass import A10BaseClass class ReceiveCfg(A10BaseClass): """This class does not support CRUD Operations please use parent. :param receive: {"default": 0, "type": "number", "description": "Advertisement reception", "format": "flag"} :param version: {"enum": ["1", "2", "1-2"...
#!/usr/bin/env python """Collection filters. Example usage: Filter('time', low, high) .bounds(ring) .eq('time', value) .lt('time', value) """ # Using lowercase function naming to match the JavaScript names. # pylint: disable=g-bad-name # Our custom instance/static decorator is not recognized by li...
# 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...
# Licensed under a 3-clause BSD style license - see LICENSE.rst from __future__ import absolute_import, division, print_function import copy import os import matplotlib import matplotlib.pyplot as plt import matplotlib.gridspec as gridspec import matplotlib.patheffects as PathEffects from matplotlib.patches import Circ...
"""Functional tests for slice op.""" import tensorflow.python.platform import numpy as np import tensorflow as tf class SliceTest(tf.test.TestCase): def _testEmpty(self, use_gpu): inp = np.random.rand(4, 4).astype("f") for k in xrange(4): with self.test_session(use_gpu=use_gpu): a = tf.const...
from bpy import data, types from .. import constants, logger from .constants import MULTIPLY, WIRE, IMAGE def _material(func): def inner(name, *args, **kwargs): if isinstance(name, types.Material): material = name else: material = data.materials[name] return fun...
from configparser import RawConfigParser from binascii import hexlify from itertools import islice import errno import os import shutil import struct import sys from zlib import crc32 from .hashindex import NSIndex from .helpers import Error, IntegrityError, read_msgpack, write_msgpack, unhexlify from .locking import ...
# hw1.py # Name: Connor Durkin # netID : cwd28 # Date: 29 September 2015 # Class: CPSC 458 # Instructor: Prof. Stephen Slade import random import numpy import json # initialize some useful global variables global in_play in_play = False global outcome outcome = " start game" score = 0 # define globals for cards SUIT...
"""JSON API implementation for aiohttp.""" import inspect from collections import MutableMapping, Sequence __author__ = """Vladimir Bolshakov""" __email__ = 'vovanbo@gmail.com' __version__ = '0.37.0' def setup_app_registry(app, registry_class, config): """Set up JSON API application registry.""" from .commo...
# -*- coding: utf-8 -*- # Copyright (c) 2015, Vispy Development Team. # Distributed under the (new) BSD License. See LICENSE.txt for more info. from __future__ import division import re from ... import gloo class Compiler(object): """ Compiler is used to convert Function and Variable instances into rea...
"""Authentication views""" from urllib.parse import quote import requests from django.conf import settings from django.core import mail as django_mail from django.contrib.auth import get_user_model, update_session_auth_hash from django.shortcuts import render, redirect from social_core.backends.email import EmailAuth ...
# Copyright 2015 DataStax, 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, s...
# # 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...
# Lint as: python2, python3 # 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 # ...
# This file is part of khmer, https://github.com/dib-lab/khmer/, and is # Copyright (C) 2014-2015, Michigan State University. # Copyright (C) 2015-2016, The Regents of the University of California. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the fol...
#Copyright ReportLab Europe Ltd. 2000-2012 #see license.txt for license details #history http://www.reportlab.co.uk/cgi-bin/viewcvs.cgi/public/reportlab/trunk/reportlab/graphics/widgetbase.py __version__=''' $Id: widgetbase.py 3959 2012-09-27 14:39:39Z robin $ ''' __doc__='''Base class for user-defined graphical widget...
#! /usr/bin/env python """Generate C code from an ASDL description.""" # TO DO # handle fields that have a type but no name import os, sys, traceback import asdl TABSIZE = 8 MAX_COL = 80 def get_c_type(name): """Return a string for the C name of the type. This function special cases the default types prov...
#!/usr/bin/env python3 # Copyright (c) 2014-2016 The Gtacoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # Test descendant package tracking code from test_framework.test_framework import GtacoinTestFramework f...
# Copyright (c) 2018, NVIDIA 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 by applic...
#!/usr/local/bin/python """ Copyright (c) 2010-2013, GhostBSD. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistribution's of source code must retain the above copyright notice, this list of ...
""" Transformer in Transformer (TNT) in PyTorch A PyTorch implement of TNT as described in 'Transformer in Transformer' - https://arxiv.org/abs/2103.00112 The official mindspore code is released and available at https://gitee.com/mindspore/mindspore/tree/master/model_zoo/research/cv/TNT """ import math import torch i...
""" :codeauthor: Jayesh Kariya <jayeshk@saltstack.com> """ import json import salt.modules.nftables as nftables import salt.utils.files from salt.exceptions import CommandExecutionError from tests.support.mixins import LoaderModuleMockMixin from tests.support.mock import MagicMock, mock_open, patch from tests.supp...
"""Test UniFi config flow.""" import aiounifi from homeassistant import data_entry_flow from homeassistant.components.unifi.const import ( CONF_ALLOW_BANDWIDTH_SENSORS, CONF_BLOCK_CLIENT, CONF_CONTROLLER, CONF_DETECTION_TIME, CONF_IGNORE_WIRED_BUG, CONF_POE_CLIENTS, CONF_SITE_ID, CONF_S...
# Copyright 2016 by Raytheon BBN Technologies Corp. All Rights Reserved. import ast import os import sys from copy import deepcopy from pyqgl2.ast_qgl2 import is_concur, is_seq from pyqgl2.ast_util import ast2str, NodeError from pyqgl2.find_channels import find_all_channels class SingleSequence(object): """ ...
from datetime import datetime import logging import shutil from subprocess import Popen, PIPE import os import pandas as pd import numpy as np from pandas.errors import EmptyDataError import re BLAST_TABLE_COLS = ''' qseqid stitle pident length mismatch gapopen qstart qend sstart send evalue bitscore qlen slen sseq ...
#! /usr/bin/env python ## NB: not all commands work ## """Cascaded queue administration. londiste.py INI pause [NODE [CONS]] setadm.py INI pause NODE [CONS] """ import optparse import os.path import Queue import sys import threading import time import skytools from skytools import UsageError, DBError from pgq.ca...
import numpy as np import networkx as nx import matplotlib.pyplot as plt import matplotlib as mpl #mpl.rc('text', usetex=True) DIR = '/Users/jltoole/Documents/Projects/geo_social/' class Model(): def __init__(self, u, l, c, s, a): self.NUSERS = u self.NLOCS = l self.NCONTACTS = c self.NSTEPS = s self.G =...
r""" django-rollbar middleware There are two options for installing the Rollbar middleware. Both options require modifying your settings.py file. The first option is to use 'rollbar.contrib.django.middleware.RollbarNotifierMiddleware' which will report all exceptions to Rollbar including 404s. This middlware should b...
# This file is part of Indico. # Copyright (C) 2002 - 2021 CERN # # Indico is free software; you can redistribute it and/or # modify it under the terms of the MIT License; see the # LICENSE file for more details. import warnings from datetime import date, time from sqlalchemy import and_, or_ from sqlalchemy.dialects...
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright (c) 2017 F5 Networks Inc. # GNU General Public License v3.0 (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = { 'status': ['preview'], 'supp...
from __future__ import absolute_import from __future__ import division from __future__ import print_function import gzip import os import re import sys import tarfile from six.moves import urllib import tensorflow as tf from preprocessing import preprocess_utility as ult from datasets.imagenet_dataset import Imagene...
import abc import inspect import itertools import os import yaml from termcolor import cprint from gym import spaces from gym_mupen64plus.envs.mupen64plus_env \ import Mupen64PlusEnv, ControllerState, IMAGE_HELPER import numpy as np ############################################### class MarioKartEnv(Mupen64PlusEnv): ...
# 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...
"""Support for HomematicIP Cloud devices.""" from __future__ import annotations import logging from pathlib import Path from homematicip.aio.device import AsyncSwitchMeasuring from homematicip.aio.group import AsyncHeatingGroup from homematicip.aio.home import AsyncHome from homematicip.base.helpers import handle_con...
from tilequeue.process import Source from tilequeue.query.fixture import make_fixture_data_fetcher from tilequeue.query.pool import DBConnectionPool from tilequeue.query.postgres import make_db_data_fetcher from tilequeue.query.rawr import make_rawr_data_fetcher from tilequeue.query.split import make_split_data_fetcher...
import socket import errno import sys import os import json import time from joueur.serializer import serialize, deserialize import joueur.error_code as error_code from joueur.game_manager import GameManager import joueur.ansi_color_coder as color EOT_CHAR = chr(4) # Client: A singleton module that talks to the serv...
from decimal import Decimal from six import text_type from six.moves.urllib.parse import urlencode from datetime import datetime from ssl import SSLError from suds import WebFault from suds.client import Client from authorize.data import Address, CreditCard from authorize.apis.transaction import parse_response from a...
# -*- coding: utf-8 -*- from sir.helpers.SQLite3Helper import SQLite3Helper from sir.helpers.FSHelper import FSHelper import sir.variables.api import sir.variables.views import sir.analytics.api import sir.analytics.views import sir.api.views import sir.pmacct_data.api from flask import Flask, request, g, jsonify...
import sys import argparse import numpy as np def parseArgument(): # Parse the input parser =\ argparse.ArgumentParser(description = "Make a differential interaction matrix for regions in a bed file based on 2 long-distance interaction matrix files") parser.add_argument("--bedFileName", required=True, help='Be...
#!/usr/bin/env python3 # Copyright 2021 The CFU-Playground Authors # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by a...
""" Handles logic for parsing log requests into a readable format """ __author__ = "Ryan Faulkner" __date__ = "November 9th, 2012" __license__ = "GPL (version 2 or later)" import sys import urlparse import re import logging import json import gzip import user_metrics.config.settings as projSet # CONFIGURE THE LO...
from django import forms from django.contrib.contenttypes.forms import generic_inlineformset_factory from django.contrib.contenttypes.models import ContentType from django.core.exceptions import FieldError from django.db import IntegrityError, models from django.db.models import Q from django.test import SimpleTestCase...
""" ## Some Python Tricks Some of my fav short Python tricks. No real theme, just added if brief and cool. Code comes with test samples (see the _@test_ entries, below). ## Code for Demonstrations and Tesing ### Demo Trapping a set of demos. If called with no arguments, it runs all the trapped demos. If called...
import hashlib import itertools import logging import time from datetime import datetime, timedelta from urlparse import urlparse from django.conf import settings from django.contrib.auth.models import User from django.core.cache import cache from django.core.exceptions import ValidationError, ObjectDoesNotExist from ...
import sys import time import shutil import os import subprocess import schedule import pyshark import pdb from datetime import datetime class HoneyCopy(object): def __init__(self): # Path where the Virtual Box Vms managed by vagrant are stored self.vboxpath = os.environ["HOME"]+"/VirtualBox VMs/"...
# needs access to libtcc and math.h # TODO: *get tcc errors (currently something like 'Unknown error 3217941984', # this makes debugging painful) # *currently the compiled function accepts too many arguments silently # *implement multi-dimensional functions for frange # *list co...
#=============================================================================== # Copyright 2007 Matt Chaput # # 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/li...
# 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 ResModel_pyramid import tensorflow as tf import numpy as np import re from yolo.net.net import Net class YoloTinyNet(Net): def __init__(self, common_params, net_params, test=False): """ common params: a params dict net_params : a params dict """ super(YoloTinyNet, self).__init__(commo...
import enum import errno import hashlib import json import logging import os import re import sys import time from contextlib import contextmanager from datetime import datetime, timedelta from itertools import count from pathlib import Path from subprocess import STDOUT, CalledProcessError, check_output, check_call im...
import datetime as dt from functools import partial import inspect import pytest import numpy as np import pandas as pd from pandas.util.testing import assert_index_equal, assert_series_equal, assert_frame_equal from numpy.testing import assert_equal assert_series_equal_strict = partial(assert_series_equal, check_dty...
import codecs import os import sys import re import errno from .exceptions import ExceptionPexpect, EOF, TIMEOUT from .expect import Expecter, searcher_string, searcher_re PY3 = (sys.version_info[0] >= 3) text_type = str if PY3 else unicode class _NullCoder(object): """Pass bytes through unchanged.""" @static...
#!/usr/bin/env python # # Copyright (c) 2013 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import collections import copy import json import os import pipes import re import subprocess import sys import bb_utils sys.pa...
#!/usr/bin/env python # Copyright 2018, Google 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: # # * Redistributions of source code must retain the above copyright # notice, this list o...
# 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...
"""Define tests for the Brother Printer config flow.""" import json from brother import SnmpError, UnsupportedModel from homeassistant import data_entry_flow from homeassistant.components.brother.const import DOMAIN from homeassistant.config_entries import SOURCE_USER, SOURCE_ZEROCONF from homeassistant.const import ...
from pydev_imports import xmlrpclib import sys import traceback from pydevd_constants import USE_LIB_COPY try: if USE_LIB_COPY: import _pydev_Queue as _queue else: import Queue as _queue except: import queue as _queue try: from pydevd_exec import Exec except: from pydevd_exec2 im...
# Copyright 2014 - Mirantis, Inc. # Copyright 2015 - StackStorm, 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 # # Unl...
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2011 Ken Pepple # 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 # # U...
"""A set of helper functions to work with the astropy module.""" import functools import random import string import tempfile import subprocess import collections from itertools import cycle, islice, chain, combinations, zip_longest import scipy import numpy as np from astropy.table import Table, join from astropy.coo...
# Copyright 2012 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 by a...
""" Phoenix LICENSE 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, merge, publish,...
#pylint: disable=R0904 # $Filename$ # $Authors$ # Last Changed: $Date$ $Committer$ $Revision-Id$ # # Copyright (c) 2003-2011, German Aerospace Center (DLR) # # All rights reserved. #Redistribution and use in source and binary forms, with or without #modification, are permitted provided that the following conditions ar...
# 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 -*- # File: config.py import os from ..compat import tfv1 from ..callbacks import ( JSONWriter, MergeAllSummaries, MovingAverageSummary, ProgressBar, RunUpdateOps, ScalarPrinter, TFEventWriter) from ..dataflow.base import DataFlow from ..input_source import InputSource from ..tfutils.sesscreat...
# Copyright (c) 2013 NTT DOCOMO, 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 requ...
from __future__ import absolute_import from __future__ import unicode_literals import docker import pytest from .. import mock from .. import unittest from compose.const import IS_WINDOWS_PLATFORM from compose.const import LABEL_CONFIG_HASH from compose.const import LABEL_ONE_OFF from compose.const import LABEL_PROJE...
""" SublimeHighlight. Licensed under MIT. Copyright (C) 2012 Andrew Gibson <agibsonsw@gmail.com> 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 limitatio...
import sys from . import api, model COMMON_TYPES = { 'FILE': model.unknown_type('FILE', '_IO_FILE'), 'bool': '_Bool', } for _type in model.PrimitiveType.ALL_PRIMITIVE_TYPES: if _type.endswith('_t'): COMMON_TYPES[_type] = _type del _type _CACHE = {} def resolve_common_type(commontype): t...
#!/usr/bin/env python # -*- coding:utf-8 -*- """Helper function to append a preference path inside the user home""" import os import sys import time from collections import OrderedDict def escapeString(s): s = s.replace("\033", "\\033") # s = s.replace("\n","\\n") # s = s.replace("\t","\\t") # s = ...
""" Spectral Algorithm for Nonlinear Equations """ from __future__ import division, absolute_import, print_function import collections import numpy as np from scipy.optimize import OptimizeResult from scipy.optimize.optimize import _check_unknown_options from .linesearch import _nonmonotone_line_search_cruz, _nonmon...
from __future__ import unicode_literals from datetime import date from django.db.models.query_utils import InvalidQuery from django.test import TestCase, skipUnlessDBFeature from .models import Author, Book, Coffee, Reviewer, FriendlyAuthor class RawQueryTests(TestCase): fixtures = ['raw_query_books.json'] ...
import numpy def check(y,x,matrix): boxX = 0 boxY = 0 if (y > 2): boxY = 3 if (y > 5): boxY = 6 if (x > 2): boxX = 3 if (x > 5): boxX = 6 list = [] for i in range(0, 9): if (i != y and matrix[i][x] != 0 and matrix[i][x] not in list): ...
# Copyright (c) 2008-2010 Twisted Matrix Laboratories. # See LICENSE for details. """ Tests for implementations of L{IReactorTCP}. """ __metaclass__ = type import socket from zope.interface import implements from zope.interface.verify import verifyObject from twisted.internet.test.reactormixins import ReactorBuild...
# 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 ...
# Class interface to the CD module. import cd, CD class Error(Exception): pass class _Stop(Exception): pass def _doatime(self, cb_type, data): if ((data[0] * 60) + data[1]) * 75 + data[2] > self.end: ## print 'done with list entry',`self.listindex` raise _Stop func, arg = self.callbacks[cb_type] if func: f...
#!/usr/bin/env python # -*- coding: utf-8 -*- # # try_quantopian.py import datetime import os import pg8000 import urlparse from flask import Flask, g, render_template, request \ ,flash , redirect \ ,session, url_for from flask.ext.pymongo import PyMongo import database #from time import strftime app = Flask(__na...
# 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...
import os import signal import uuid from Queue import Queue from contextlib import closing import psycopg2 import pytest from pgshovel.administration import create_set from pgshovel.interfaces.common_pb2 import ( Column, Row, ) from pgshovel.interfaces.configurations_pb2 import ReplicationSetConfiguration fro...
""" Classes allowing "generic" relations through ContentType and object-id fields. """ from django.core.exceptions import ObjectDoesNotExist from django.db import connection from django.db.models import signals from django.db import models from django.db.models.fields.related import RelatedField, Field, ManyToManyRel ...
"""Sends commands to multiple devices""" import wx import os from pydispatch import dispatcher import json from ObjectListView import ObjectListView, ColumnDefn from scripts import mdc_gui class SendCommandConfig(mdc_gui.MultiSend): def __init__(self, parent, device_list, dxlink_model): mdc_gui.MultiSend...
#!/usr/bin/python # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. # The directories end up in the debug info, so the easy way of getting # a reproducible build is to r...