gt stringclasses 1
value | context stringlengths 2.49k 119k |
|---|---|
# -*- coding: utf-8 -*-
"""
gaema.auth
~~~~~~~~~~
Implementations of various third-party authentication schemes.
All the classes in this file are class Mixins designed to be used with
web.py RequestHandler classes. The primary methods for each service are
authenticate_redirect(), authorize_red... | |
# Copyright (C) 2010 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 ... | |
# 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... | |
# Copyright 2012 OpenStack Foundation.
# All Rights Reserved
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... | |
import logging
import sys
import os
import boto3
import click
from botocore.exceptions import ClientError, BotoCoreError, ProfileNotFound
from cfn_sphere import StackActionHandler
from cfn_sphere import __version__
from cfn_sphere.aws.cfn import CloudFormation
from cfn_sphere.aws.kms import KMS
from cfn_sphere.excepti... | |
# Copyright 2018 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... | |
from toolz.functoolz import (thread_first, thread_last, memoize, curry,
compose, pipe, complement, do, juxt)
from toolz.functoolz import _num_required_args
from operator import add, mul, itemgetter
from toolz.utils import raises
from functools import partial
from toolz.compatibility import ... | |
import sys
from local_config import config
locals().update(config)
sys.path.append("../../")
import os
from cv_bridge import CvBridge, CvBridgeError
import sys
import std_msgs.msg
from sensor_msgs.msg import Image
import rospy
import threading
import signal
import cv2
import numpy as np
import configparser
import cs... | |
import os.path as op
import numpy as np
from numpy.testing import (assert_array_almost_equal, assert_almost_equal,
assert_array_equal, assert_allclose,
assert_array_less)
import pytest
from scipy.signal import resample as sp_resample, butter, freqz, sosfreqz
from ... | |
import os
import subprocess
from StringIO import StringIO
import pycurl
from bs4 import BeautifulSoup
from RequestHandler import RequestHandler
class MotifAuthorizationManager(object):
URL_AUTH_STEP1 = "https://auth.motifinvesting.com/authenticate"
URL_AUTH_STEP2 = "https://trader.motifinvesting.com/two-facto... | |
"""Tests for cam module."""
import socket
from collections import OrderedDict
from unittest.mock import MagicMock, patch
import pytest
from leicacam.cam import CAM, bytes_as_dict, tuples_as_bytes, tuples_as_dict
# pylint: disable=redefined-outer-name, unnecessary-pass,
def flush():
"""Flush the socket."""
... | |
# -*- coding: utf-8 -*-
# Copyright (c) 2010-2016, MIT Probabilistic Computing Project
#
# 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/LICENS... | |
# Copyright 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/LICENSE-2... | |
# -*- coding: utf-8 -*-
import re
import copy
import lxml.cssselect
import lxml.etree
import parslepy.funcs
class Selector(object):
"""
Class of objects returned by :class:`.SelectorHandler` instances'
(and subclasses) :meth:`~.SelectorHandler.make` method.
"""
def __init__(self, selector):
... | |
# Copyright (c) 2016-present, Facebook, 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... | |
from __future__ import unicode_literals, division, absolute_import
from builtins import * # pylint: disable=unused-import, redefined-builtin
from future.moves.xmlrpc import client as xmlrpc_client
import os
import mock
from flexget.plugins.clients.rtorrent import RTorrent
torrent_file = os.path.join(os.path.dirnam... | |
# 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 agreed to in... | |
""" path.py - An object representing a path to a file or directory.
Example:
from path import path
d = path('/home/guido/bin')
for f in d.files('*.py'):
f.chmod(0755)
This module requires Python 2.2 or later.
URL: http://www.jorendorff.com/articles/python/path
Author: Jason Orendorff <jason.orendorff\x40g... | |
"""Copyright 2021 Google LLC.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, sof... | |
# 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 itertools import combinations
import numpy as np
from pyparsing import alphas, Combine, Literal, Optional, nums, Word
from pgmpy.models import BayesianNetwork, MarkovNetwork
from pgmpy.factors.discrete import TabularCPD, DiscreteFactor
class UAIReader(object):
"""
Class for reading UAI file format fro... | |
# Copyright 2012 the V8 project authors. 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 conditi... | |
# -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals, division
import warnings
from psd_tools.utils import be_array_from_bytes
from psd_tools.constants import Compression, ChannelID, ColorMode, ImageResourceID
from psd_tools import icc_profiles
try:
from PIL import Image
if hasattr... | |
# Copyright (c) 2016 - 2017, Intel Corporation.
#
# 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 agre... | |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2011,2012 Nicira, 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/... | |
# 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... | |
'''
matrix2tree.py - build tree from a distance matrix
==================================================
:Author: Andreas Heger
:Release: $Id$
:Date: |today|
:Tags: Python
Purpose
-------
.. todo::
describe purpose of the script.
Usage
-----
Example::
python matrix2tree.py --help
Type::
python mat... | |
import numpy
import six
import chainer
from chainer.backends import cuda
from chainer import function
from chainer import utils
from chainer.utils import collections_abc
from chainer.utils import type_check
def _logsumexp(a, xp, axis=None):
vmax = xp.amax(a, axis=axis, keepdims=True)
if xp is numpy:
... | |
#!/usr/bin/python2.7
# -*- coding: utf-8
from utils import Utils
import json
import logging
import random
import config
logger = logging.getLogger(__name__)
class Botnet:
ut = Utils()
def __init__(self, player):
self.username = player.username
self.password = player.password
self.uh... | |
#!/usr/bin/python
#
# Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | |
'''
chop.py
Takes a list of input ingredient names. Chops each ingredient, and adds the
resulting model to the current blend or a new blend
Thomas Storey
2016
'''
import sys
import argparse
import bpy
import numpy as np
import os
import bmesh
from math import *
from mathutils import *
import random
def createMesh(... | |
from Cookie import SimpleCookie
from pprint import pformat
from urllib import urlencode
from django.utils import datastructures
class HttpRequest(object): # needs to be new-style class because subclasses define "property"s
"A basic HTTP request"
def __init__(self):
self.GET, self.POST, self.COOKIES, se... | |
#!/usr/bin/env python
"""Launchpad to github bug migration script.
There's a ton of code from Hydrazine copied here:
https://launchpad.net/hydrazine
Usage
-----
This code is meant to port a bug database for a project from Launchpad to
GitHub. It was used to port the IPython bug history.
The code is meant to be use... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import re
from comic_dl import globalFunctions
import json
import os
import logging
import base64
"""A HUGE thanks to @abcfy2 for his amazing implementation of the ac.qq.com APIs.
Original code for ac.qq.com : https://github.com/abcfy2/getComic/
"""
class AcQq(object):
... | |
#!/bin/env python
import numpy as np
from openff.toolkit.typing.engines.smirnoff.forcefield import ForceField
# Function definitions for parsing sections within parameter file
def _parse_nonbon_line( line ):
"""Parse an AMBER frcmod nonbon line and return relevant parameters in a dictionary. AMBER uses rmin_half ... | |
# 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... | |
# coding=utf-8
# Copyright 2022 The Google Research 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 applicab... | |
'''
Copyright 2016, EMC, Inc.
Author(s):
George Paulos
This script installs RackHD from GitHub source onto blank Ubuntu 14 or 16 OS via Ansible installer.
This script performs the following functions:
- loads prerequisite packages git, ansible, etc.
- downloads RackHD source to management server from repos sp... | |
# Copyright 2014 Cisco Systems, Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requir... | |
"""
This tutorial introduces denoising auto-encoders (dA) using Theano.
Denoising autoencoders are the building blocks for SdA.
They are based on auto-encoders as the ones used in Bengio et al. 2007.
An autoencoder takes an input x and first maps it to a hidden representation
y = f_{\theta}(x) = s(Wx+b), paramete... | |
# -*- coding: utf-8 -*-
import json
import time
import mock
import pytest
from py_zipkin.exception import ZipkinError
from py_zipkin.zipkin import ZipkinAttrs
from webtest import TestApp as WebTestApp
from .app import main
from tests.acceptance.test_helper import generate_app_main
@pytest.mark.parametrize(['set_pos... | |
"""
Copyright (c) 2020 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
import copy
from collections import Counter
import pytest
from ruamel.yaml import... | |
from __future__ import unicode_literals
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.test import TestCase
from django.utils import six
from .mode... | |
# Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from django.template import RequestContext
from django.shortcuts import render_to_response
from django.http import HttpResponseRedirect
from django.utils.http import urlencode
from paypal.pro.forms import PaymentForm, ConfirmForm
from paypal.pro.models import PayPalNVP
fro... | |
#!/usr/bin/env/python
# -*- coding: utf-8 -*-
###
### Author: Chris Iatrou (ichrispa@core-vector.net)
### Version: rev 13
###
### This program was created for educational purposes and has been
### contributed to the open62541 project by the author. All licensing
### terms for this source is inherited by the terms and... | |
# This file is part of the ISIS IBEX application.
# Copyright (C) 2012-2016 Science & Technology Facilities Council.
# All rights reserved.
#
# This program is distributed in the hope that it will be useful.
# This program and the accompanying materials are made available under the
# terms of the Eclipse Public License... | |
__name__ = "rfeed"
__version__ = (1, 0, 0)
__author__ = "Santiago L. Valdarrama - https://blog.svpino.com"
_generator = __name__ + " v" + ".".join(map(str, __version__))
_docs = "https://github.com/svpino/rfeed/blob/master/README.md"
import itertools
import sys
from xml.sax import saxutils
if sys.version_info[0] == 3... | |
import modules.utils as utils
import numpy as np
import cv2
import scipy
import keras
from modules.logging import logger
import modules.utils as utils
import random
import tensorflow as tf
import keras
from keras import models
from keras import layers
from keras.layers import convolutional
from keras.layers import cor... | |
# ----------------------------------------------------------------------------
# Copyright (c) 2013--, scikit-bio development team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file COPYING.txt, distributed with this software.
# --------------------------------------------... | |
#!/usr/bin/env python
# Copyright 2017 The Forseti Security 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
#
#... | |
## @file
# process rule section generation
#
# Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.<BR>
#
# This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License
# which accompanies this distribution. The full text of the licen... | |
import unittest
from unittest import mock
from betfairlightweight.resources.baseresource import BaseResource
from betfairlightweight.streaming.cache import (
OrderBookCache,
OrderBookRunner,
UnmatchedOrder,
MarketBookCache,
RunnerBookCache,
Available,
RaceCache,
)
from tests.tools import cr... | |
from django.shortcuts import render
from rest_framework.views import APIView
from rest_framework.response import Response
from api.models import Photo, AlbumAuto, AlbumUser, Face, Person, AlbumDate, AlbumPlace, AlbumThing, LongRunningJob, get_or_create_person
from django.db.models import Count
from django.db.models i... | |
#!/usr/bin/env python
import boto
import sys
from boto.s3.connection import S3Connection
from boto.s3.key import Key
import json
import time
import command
import os
#from boto.exception import S3ResponseError
def get_s3_conn(key_id, key_secret, token):
s3 = S3Connection(aws_access_key_id=key_id,
... | |
import json
import sys
from ..exceptions import JSONRPCInvalidRequestException
from ..jsonrpc2 import (
JSONRPC20Request,
JSONRPC20BatchRequest,
JSONRPC20Response,
JSONRPC20BatchResponse,
)
if sys.version_info < (2, 7):
import unittest2 as unittest
else:
import unittest
class TestJSONRPC20Re... | |
'''
This script serves as a Kivy Garden page generator. It looks for all existing
Kivy-Garden flowers via GitHub API, creates a nice grid with their screenshots
(or flower js fallback if not available) and links to their GitHub repository.
Usage:
Render html output:
python generate.py
Rebuild html f... | |
# ----------------------------------------------------------------------------
# pyglet
# Copyright (c) 2006-2007 Alex Holkner
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistribu... | |
# Copyright 2019 Fortinet, 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 later version.
#
# This program is distributed in the... | |
# -*- coding: utf-8 -*-
# Copyright 2020 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 o... | |
from django import forms
from django.db.models import Count
from dcim.models import Site, Device, Interface, Rack, IFACE_FF_VIRTUAL
from tenancy.forms import bulkedit_tenant_choices
from tenancy.models import Tenant
from utilities.forms import (
APISelect, BootstrapMixin, BulkImportForm, CommentField, CSVDataField... | |
# -*- coding: utf-8 -*-
"""
pygments.lexers._mql_builtins
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Builtins for the MqlLexer.
:copyright: Copyright 2006-2015 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
types = (
'AccountBalance',
'AccountCompany',
'AccountCredit... | |
#!BPY
'''
Nothing fancy
Just wrapping the Existing OBJ exporter in Blender 2.49 to do the obj export and conversion to three.js in one go
'''
"""
Name: 'three.js(slim) (.js)...'
Blender: 249
Group: 'Export'
Tooltip: 'Save a three.js File'
"""
__author__ = "Campbell Barton, Jiri Hnidek, Paolo Ciccone,George Profenza,Al... | |
# -*- coding: utf-8 -*-
# Copyright 2020 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... | |
""" Created by Max 10/4/2017 """
from __future__ import division
import random
import math
from typing import Dict, Tuple, List
class CrossValidation:
def __init__(self, folds, learner):
"""
Constructor
:param folds: num folds
:param learner: the k-NN algorithm to use.
""... | |
#
# 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
# ... | |
"""
Generate a C++ DICOM dictionary from a text file.
This program will read a text file generated from the DICOM data
element regsistry table (DICOM Chapter 6 part 6) and will generate
a hash table that can be used for dictionary lookups.
Usage: python makedict.py nemadict.txt > vtkDICOMDictHash.cxx
Usage: python ma... | |
# flake8: noqa
import os
import sys
from collections import OrderedDict, defaultdict
from fnmatch import fnmatch
from importlib import import_module
import django
from django.core.management.base import BaseCommand, CommandError
import django.template
from django.template import Context
from django.utils import six
f... | |
# -*- coding: utf-8 -*-
import sys
import unittest2
from unipath import Path
sys.path.append(Path(__file__).ancestor(2))
from scrapy.selector import Selector
from utils import get_response
from localfinance.parsing.zone import DepartmentZoneParser
class DepartmentFinance2008ParsingTestCase(unittest2.TestCase):
... | |
"""
mbed SDK
Copyright (c) 2011-2013 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 wr... | |
# encoding: utf-8
"""
exabgp.py
Created by Thomas Mangin on 2009-08-30.
Copyright (c) 2009-2015 Exa Networks. All rights reserved.
"""
import os
import sys
import platform
import syslog
import string
from exabgp.logger import Logger
from exabgp.version import version
# import before the fork to improve copy on writ... | |
"""Useful utilities for higher level polynomial classes. """
from sympy import S, sympify, Integer, Rational, Symbol, Add, Mul, Pow, ask
from sympy.polys.polyerrors import PolynomialError, GeneratorsNeeded
_gens_order = {
'a': 301, 'b': 302, 'c': 303, 'd': 304,
'e': 305, 'f': 306, 'g': 307, 'h': 308,
'i'... | |
# pylint: disable=wrong-or-nonexistent-copyright-notice
"""Code to interact with GitHub API to label and auto-merge pull requests."""
import datetime
import json
import os
import sys
import time
import traceback
from typing import Callable, Optional, List, Any, Dict, Set, Union
from google.cloud import secretmanager_... | |
#
# 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... | |
# 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... | |
# 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 ... | |
import os
import unittest
import sys
if sys.version < '3':
from StringIO import StringIO
else:
from io import StringIO # NOQA
try:
import __builtin__
except ImportError:
import builtins
__builtin__ = builtins # NOQA
# Make sure we'll find the required files...
sys.path.append(os.path.join(os.pat... | |
# coding=utf-8
# Licensed Materials - Property of IBM
# Copyright IBM Corp. 2017,2018
"""
Testing support for streaming applications.
********
Overview
********
Allows testing of a streaming application by creation conditions
on streams that are expected to become valid during the processing.
`Tester` is designed to... | |
from sympy.categories.diagram_drawing import _GrowableGrid, ArrowStringDescription
from sympy.categories import (DiagramGrid, Object, NamedMorphism,
Diagram, XypicDiagramDrawer, xypic_draw_diagram)
from sympy import FiniteSet
def test_GrowableGrid():
grid = _GrowableGrid(1, 2)
#... | |
# python 2to3
try:
from StringIO import StringIO
except ImportError:
from io import StringIO
# system
import zlib
import hashlib
import logging
import os
import urllib3
import petl
from datetime import datetime, timedelta
# sqlalchemy
from sqlalchemy import Column
from sqlalchemy import Integer
from sqlalchem... | |
"""
===========
Basic Units
===========
"""
import six
import math
import numpy as np
import matplotlib.units as units
import matplotlib.ticker as ticker
from matplotlib.axes import Axes
from matplotlib.cbook import iterable
class ProxyDelegate(object):
def __init__(self, fn_name, proxy_type):
self.pr... | |
import argparse
import os
import sys
from io import StringIO
from tabulate import tabulate
from . import __version__, __homepage__
from .csdgen import ZakSpace, Csd
from .parse import parse_pch2
from .patch import Patch
from .resources import get_template_module_path, ProjectData
from .udo import UdoTemplate, UdoTemp... | |
import numpy as np
import cv2
import os
import copy
import time
from skimage import morphology
from scipy import weave
import sys
from igraph import *
import itertools
##########
##PART 1##
##########
cap = cv2.VideoCapture('input.mp4')
imageWidth = int(cap.get(cv2.cv.CV_CAP_PROP_FRAME_WIDTH))
imageHeight = int(cap.g... | |
"""Implementation of the WebSocket protocol.
`WebSockets <http://dev.w3.org/html5/websockets/>`_ allow for bidirectional
communication between the browser and server.
WebSockets are supported in the current versions of all major browsers,
although older versions that do not support WebSockets are still in use
(refer ... | |
"""
Basic unit commitment to some mix-integer linear/quadratic programming problem
@author: Zhao Tianyang
@e-mail: zhaoty@ntu.edu.sg
@date:20 Mar 2018
Note: The mathematical model is taken from the following references.
[1]Tight and Compact MILP Formulation of Start-Up and Shut-Down Ramping in Unit Commitment
Due to t... | |
"""
mbed SDK
Copyright (c) 2011-2013 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 wr... | |
"""Defines the unit tests for the :mod:`colour.models.rgb.ictcp` module."""
import numpy as np
import unittest
from itertools import permutations
from colour.models.rgb import (
RGB_to_ICtCp,
ICtCp_to_RGB,
XYZ_to_ICtCp,
ICtCp_to_XYZ,
)
from colour.utilities import domain_range_scale, ignore_numpy_erro... | |
import tensorflow as tf
import numpy as np
import math
import os
from zimpy.networks.base_neural_network import BaseNeuralNetwork, ConfigurationContext, HyperParametersContext
class SingleLayerHyperParametersContext(HyperParametersContext):
def __init__(
self,
hidden_layer_neuron_count=51... | |
# 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... | |
#!/usr/bin/python
# File created on Nov 27 Jan 2012
from __future__ import division
import threading
import time
from multiprocessing import Process
__author__ = "Kishori M Konwar, Niels W. Hanson"
__copyright__ = "Copyright 2013, MetaPathways"
__credits__ = ["r"]
__version__ = "1.0"
__maintainer__ = "Kishori M Konwa... | |
###############################################################################
##
## Copyright (C) 2011-2014, NYU-Poly.
## 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 for... | |
"""
Object classes for recording and plotting time-series data.
This module defines a set of DataRecorder object types for recording
time-series data, a set of Trace object types for
specifying ways of generating 1D-vs-time traces from recorded data,
and a TraceGroup object that will plot a set of traces on stacked,
a... | |
# Copyright 2017 The UAI-SDK 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... | |
import os
import logging
import urllib
import csv
from StringIO import StringIO
import datetime
import time
import jinja2
from flask import make_response, jsonify, render_template, Response
import flask.ext.assets
from webassets.ext.jinja2 import AssetsExtension
from webassets import Environment as AssetsEnvironment
... | |
"""
The ``fluent_contents_tags`` module provides two template tags for rendering placeholders:
It can be loaded using:
.. code-block:: html+django
{% load fluent_contents_tags %}
A placeholder which is stored in a :class:`~fluent_contents.models.PlaceholderField` can
be rendered with the following syntax:
.. co... | |
"""DHCPv4 address release process"""
# pylint: disable=invalid-name,line-too-long
import pytest
import srv_control
import misc
import srv_msg
@pytest.mark.v4
@pytest.mark.release
@pytest.mark.parametrize("backend", ['memfile', 'mysql', 'postgresql'])
def test_v4_release_success(backend):
misc.test_setup()
... | |
from __future__ import print_function
from __future__ import absolute_import
from __future__ import unicode_literals
import numpy as np
from SimPEG import EM
import matplotlib.pyplot as plt
import matplotlib.ticker as ticker
import matplotlib
import matplotlib.gridspec as gridspec
matplotlib.rcParams['font.size'] = 12... | |
# coding=utf-8
"""
This code was generated by
\ / _ _ _| _ _
| (_)\/(_)(_|\/| |(/_ v1.0.0
/ /
"""
from twilio.base import deserialize
from twilio.base import values
from twilio.base.instance_context import InstanceContext
from twilio.base.instance_resource import InstanceResource
from twilio.base.... | |
"""
jTDS/MSSQL database backend for Django.
Django uses this if the DATABASE_ENGINE setting is empty (None or empty string).
Each of these API functions, except connection.close(), raises
ImproperlyConfigured.
"""
try:
# Force the database driver to load
from java.lang import Class
cls = Class.forName("... | |
# -*- coding: utf-8 -*-
import authorize
from authorize.exceptions import AuthorizeInvalidError, \
AuthorizeResponseError
from trytond.pool import PoolMeta, Pool
from trytond.pyson import Eval
from trytond.model import fields
__all__ = [
'PaymentGatewayAuthorize', 'AddPaymentProfile',
'AuthorizeNetTransact... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.