gt stringclasses 1
value | context stringlengths 2.49k 119k |
|---|---|
#!/usr/bin/python
from PyQt4.QtCore import *
from PyQt4.QtGui import *
from QXAction import *
from QXApplication import *
from QXStaticConfig import *
from QXToolBar import *
import platform
import sys
import re
import quick_ui_res
import json
class QXSingleDocMainWindow(QMainWindow):
def __init__(self,mai... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 2017, OpenCensus 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
#
# Unle... | |
# Copyright 2015 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import collections
import copy
import itertools
import threading
import time
from infra_libs.ts_mon.common import errors
def default_modify_fn(name):
de... | |
# Copyright (c) 2011 X.commerce, a business unit of eBay Inc.
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file... | |
import numpy as np
from vesper.tests.test_case import TestCase
import vesper.util.time_frequency_analysis_utils as tfa_utils
'''
TODO: Add test cases for which window size differs from DFT size,
and for which window is not rectangular.
'''
'''
TODO: Given that we need to test FFTs and spectrograms implemented
in va... | |
from __future__ import division, print_function, absolute_import
import warnings
import numpy as np
import numpy.testing as npt
from scipy import integrate
from scipy import stats
from scipy.special import betainc
from common_tests import (check_normalization, check_moment, check_mean_expect,
... | |
"""Tests for Sentry integration."""
import logging
import pytest
from homeassistant.components.sentry import get_channel, process_before_send
from homeassistant.components.sentry.const import (
CONF_DSN,
CONF_ENVIRONMENT,
CONF_EVENT_CUSTOM_COMPONENTS,
CONF_EVENT_HANDLED,
CONF_EVENT_THIRD_PARTY_PAC... | |
#!/usr/bin/env python
# Purpose : Python Boot Camp - Basemap Teaching Program 3.
# Ensure that environment variable PYTHONUNBUFFERED=yes
# This allows STDOUT and STDERR to both be logged in chronological order
import sys # platform, args, run tools
import os # platform, ... | |
# -*- coding utf-8 -*-
# classes/models/client.py
# class:: Client
from datetime import datetime, timedelta
from flask import current_app
from swtstore.classes.database import db
from swtstore.classes.models import User
from swtstore.classes import oauth
class Client(db.Model):
"""
The third-party applicati... | |
# coding: utf-8
# Copyright (c) Pymatgen Development Team.
# Distributed under the terms of the MIT License.
import numpy as np
import scipy.constants as const
from pymatgen.core.structure import Structure
from pymatgen.util.coord import get_linear_interpolated_value
from monty.json import MSONable
from monty.functoo... | |
"""Setup CLI configuration."""
# :license: MIT, see LICENSE for more details.
import webbrowser
import configparser
import json
import os.path
import requests
import click
import SoftLayer
from SoftLayer.CLI import config
from SoftLayer.CLI import environment
from SoftLayer.CLI import exceptions
from SoftLayer.CLI i... | |
# Copyright 2015 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import logging
import re
import time
from devil.android import device_errors
from devil.android import flag_changer
from devil.utils import reraiser_thread
... | |
from __future__ import unicode_literals
import uuid
from moto.core import BaseModel
from moto.core.utils import camelcase_to_underscores, unix_time
from ..constants import DECISIONS_FIELDS
from ..exceptions import (
SWFDefaultUndefinedFault,
SWFValidationException,
SWFDecisionValidationException,
)
from .... | |
from PyQt4 import Qt, QtCore, QtGui
import vqt.main as vq_main
import vqt.tree as vq_tree
import envi.threads as e_threads
import cobra.remoteapp as c_remoteapp
import vivisect.remote.server as viv_server
from vqt.basics import *
class WorkspaceListModel(vq_tree.VQTreeModel):
columns = ('Name',)
class Workspac... | |
from __future__ import unicode_literals
import sys
from django.conf import settings
from django.template import Library, Node, TemplateSyntaxError, Variable
from django.template.base import TOKEN_TEXT, TOKEN_VAR, render_value_in_context
from django.template.defaulttags import token_kwargs
from django.utils import six... | |
#!/usr/bin/env python
# coding: utf-8
DESCRIPTION="This script applies clustering"
import numpy as np
import argparse
import glob2
import logging
import re
from os.path import basename
from os.path import dirname
import sys
sys.path.append(dirname(__file__))
from my_target_counter import TargetCounter
logger = log... | |
# Copyright (c) 2016-2021 Renata Hodovan, Akos Kiss.
#
# Licensed under the BSD 3-Clause License
# <LICENSE.rst or https://opensource.org/licenses/BSD-3-Clause>.
# This file may not be copied, modified, or distributed except
# according to those terms.
from functools import cmp_to_key
from urwid import *
from .decor... | |
"""
sentry.web.forms.accounts
~~~~~~~~~~~~~~~~~~~~~~~~~
:copyright: (c) 2010-2014 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from __future__ import absolute_import
from datetime import datetime
import pytz
from django import forms
from django.conf import settin... | |
# Copyright (c) 2013 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 ... | |
"""
make openfmri distro for myconnectome
"""
import glob,os,shutil
import pickle
import json
import mvpa2.misc.fsl
def makedir(d):
""" make a directory if it doesn't already exist"""
if not os.path.exists(d):
os.makedirs(d)
def get_infodict(type,dcmhdr):
infodict={}
for k in dcmhdr.keys():
... | |
# Copyright (C) 2011, 2012 Nippon Telegraph and Telephone Corporation.
# Copyright (C) 2011, 2012 Isaku Yamahata <yamahata at valinux co jp>
# Copyright (C) 2012 Simon Horman <horms ad verge net au>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with... | |
# -*- coding: utf-8 -*-
# continued from pattern.py
# defining the basic object we will be working with
# Note: makeVideo - it doesn't work yet - i haven't yet solved the issues about opencv
# so i am outputing the slides only for the moment
# 2013-09-23
######################... | |
# https://github.com/alexalemi/segmentation/blob/master/code/splitters.py
"""
Collect the various splitting strategies in one place
"""
import numpy as np
from scipy.ndimage import generic_filter
from scipy.spatial.distance import cdist
from numpy.random import rand
import tools
####################
# C99
##########... | |
__author__ = "Andre Merzky"
__copyright__ = "Copyright 2012-2013, The SAGA Project"
__license__ = "MIT"
# From http://code.activestate.com/recipes/576693/ :
#
# Drop-in substitute for Py2.7's new collections.OrderedDict. The recipe has
# big-oh performance that matches regular dictionaries (amortized O(1)
# in... | |
# @MUNTJAC_COPYRIGHT@
# @MUNTJAC_LICENSE@
try:
from cStringIO import StringIO
except ImportError, e:
from StringIO import StringIO
from muntjac.ui.component import Event
from muntjac.ui.embedded import Embedded
from muntjac.ui.custom_component import CustomComponent
from muntjac.terminal.application_resource ... | |
"""
Support for monitoring an SABnzbd NZB client.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/sabnzbd/
"""
import logging
from datetime import timedelta
import voluptuous as vol
import homeassistant.helpers.config_validation as cv
from homeassistant... | |
__author__ = 'Jody Shumaker'
import sys
import glob
import argparse
import os.path
from utility.mouse import *
from utility.screen import *
from utility.logconfig import *
from PIL import ImageGrab, Image
import logging
import functools
import math
import operator
import time
# Level card positions. Positions are at ... | |
from unittest import TestCase
from argparse import Namespace
from mock import MagicMock, Mock, patch, ANY, call
from pyinotify import WatchManager
from testrunner.configurator import Config
from testrunner import default_config
@patch.object(Config, "get_values", autospec=True)
@patch.object(Config, "__init__", ret... | |
##
# Testing suite for select.php
#
import requests
import re
import sys
from xml.dom import minidom
from copy import copy
from . import GeoMOOSETest
class ParcelTest(GeoMOOSETest):
def setUp(self):
self.select_php = "http://" + self.host + self.geomoose_base + "/php/query.php"
self.default_params = {
"mo... | |
#!/usr/bin/python
# @lint-avoid-python-3-compatibility-imports
#
# criticalstat Trace long critical sections (IRQs or preemption disabled)
# For Linux, uses BCC, eBPF. Requires kernel built with
# CONFIG_DEBUG_PREEMPT and CONFIG_PREEMPTIRQ_EVENTS
#
# USAGE: criticalstat [-h] [-p] [-i] [-d D... | |
import copy
import itertools
import boto
import boto.ec2
import k.aws.util
import warnings
from k.aws.config import AwsCreds, connection_hash
from k.aws.config import RegionAwsCreds, region_connection_hash
def connect(creds):
"""
Connect to ec2, with user-provided options.
:param region_creds: The region name and ... | |
import time
import time
import os, os.path
import sys
import numpy
from PyQt4.QtCore import *
from PyQt4.QtGui import *
import operator
import matplotlib
from matplotlib.backends.backend_qt4agg import FigureCanvasQTAgg as FigureCanvas
from matplotlib.backends.backend_qt4agg import NavigationToolbar2QT as NavigationTool... | |
"""Migration to hybrid mode (TVShows and movies)
Revision ID: edec70effd74
Revises: b037baf33cfa
Create Date: 2021-06-13 19:03:10.107347
"""
# revision identifiers, used by Alembic.
revision = 'edec70effd74'
down_revision = 'b037baf33cfa'
from alembic import op
import sqlalchemy as sa
import cineapp.migration_types... | |
'''
This is an overarching class for the config class, the variable class, and
the model class.
It should implement a bunch of the the normal stuff that I want from all of
the models, which will allow me to transfer stuff between them nicely.
I'm going to implement a couple of my new paradigms, which should make thin... | |
# -*- coding: utf-8 -*-
# vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4
# Also if needed: retab
'''
Magnetic field line tracing
'''
# Standard python modules
from __future__ import (unicode_literals, absolute_import, \
print_function, division)
import matplotlib.pyplot as plt
from mpl... | |
# 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... | |
"""
Functional tests for Pydocweb: these go through real-use patterns with
the Django web client.
"""
import os, sys, re
from django.test import TestCase
from django.conf import settings
PASSWORD='asdfasd'
class AccessTests(TestCase):
"""
Simple tests that check that basic pages can be accessed
and they ... | |
from easyprocess import Proc, extract_version
from pyavrutils.avrsize import AvrSize
from pyavrutils.util import tmpdir, tmpfile, separate_sources, CompileError
import tempfile
from path import Path
class AvrGccCompileError(CompileError):
pass
class AvrGcc(object):
minprog = 'int main(){};'
def __init_... | |
import networkx as nx
import numpy as np
import pytest
import pyquil.simulation.matrices as qmats
from pyquil import Program
from pyquil.api import QuantumComputer
from pyquil.device import NxDevice
from pyquil.experiment import ExperimentSetting, Experiment, zeros_state
from pyquil.gates import CNOT, H, I, MEASURE, P... | |
#!/usr/bin/env python
# CREATED:2013-03-08 15:25:18 by Brian McFee <brm2132@columbia.edu>
# unit tests for librosa core (__init__.py)
#
# Run me as follows:
# cd tests/
# nosetests -v --with-coverage --cover-package=librosa
#
from __future__ import print_function
# Disable cache
import os
try:
os.environ.pop(... | |
###############################################################################
#
# The MIT License (MIT)
#
# Copyright (c) Tavendo GmbH
#
# 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 with... | |
# coding: utf-8
#
# Copyright 2014 The Oppia 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 requi... | |
# 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... | |
"""
This is a modified version of input_data.py by Google,
for generalization.
"""
import tensorflow as tf
import numpy
import pandas as pd
import jpandas as jpd
import numpy as np
import random
def placeholder_inputs(batch_size, mnist_IMAGE_PIXELS):
"""Generate placeholder variables to represent the the input te... | |
# -----------------------------------------------------------------------------
# ply: lex.py
#
# Copyright (C) 2001-2015,
# David M. Beazley (Dabeaz LLC)
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions ar... | |
import pytest
from configyaml.config.nodes import StringNode, BoolNode
from .test_loader import DummyLoader, DummyComplexLoader
def test_variable_match():
n = StringNode(value='$var', variables={'var': 'testing'})
assert n.is_valid()
assert n._value == 'testing'
assert n._as_dict() == {'value': 'tes... | |
"""
Tool for handling UnTRIM data specific to the SUNTANS model
M.Rayson
Stanford University
March 2014
"""
from sunpy import Grid, Spatial
import numpy as np
import matplotlib.pyplot as plt
import pdb
# Dictionary containing the suntans-untrim equivalent grid variables
untrim_gridvars = {\
'xp':'Mesh2_node_x',... | |
#!/usr/bin/env python2.7
# Copyright 2015, 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 lis... | |
#!/usr/bin/python
#coding: utf-8 -*-
# (c) 2016, Mathieu Bultel <mbultel@redhat.com>
# 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 = {'metadata_version': '1.1',
... | |
# Copyright 2015 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agre... | |
# Copyright (C) 2013 Nippon Telegraph and Telephone Corporation.
# Copyright (C) 2013 YAMAMOTO Takashi <yamamoto at valinux co jp>
#
# 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:... | |
"""
Oracle database backend for Django.
Requires cx_Oracle: https://oracle.github.io/python-cx_Oracle/
"""
import datetime
import decimal
import os
import platform
from contextlib import contextmanager
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.db import utils... | |
# ----------------------------------------------------------------------------
# pyglet
# Copyright (c) 2006-2008 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:
#
# * Redistributi... | |
# -*- coding: utf-8 -*-
'''
:codeauthor: :email:`Jayesh Kariya <jayeshk@saltstack.com>`
'''
# Import Python libs
from __future__ import absolute_import
# Import Salt Testing Libs
from salttesting import skipIf, TestCase
from salttesting.mock import (
NO_MOCK,
NO_MOCK_REASON,
MagicMock,
patch)
from... | |
import calendar
import time
import datetime
import yaml
from flask import (current_app, request, render_template, Blueprint, abort,
jsonify, g, session, Response)
from flask.ext.babel import gettext
from lever import get_joined
from .models import (OneMinuteShare, Block, OneMinuteType, FiveMinuteT... | |
# Copyright (c) 2013 Mirantis Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | |
# -*- coding: utf-8 -*-
#
# Cipher/PKCS1_OAEP.py : PKCS#1 OAEP
#
# ===================================================================
# The contents of this file are dedicated to the public domain. To
# the extent that dedication to the public domain is not available,
# everyone is granted a worldwide, perpetual, ro... | |
from rpython.flowspace.model import (Constant, Variable, SpaceOperation,
mkentrymap)
from rpython.rtyper.lltypesystem import lltype
from rpython.rtyper.lltypesystem.lloperation import llop
from rpython.translator.unsimplify import insert_empty_block, split_block
def fold_op_list(operations, constants, exit_early=... | |
import os
from collections import OrderedDict
from conans.client import tools
from conans.client.build.compiler_flags import architecture_flag, parallel_compiler_cl_flag
from conans.client.build.cppstd_flags import cppstd_flag, cppstd_from_settings
from conans.client.tools import cross_building
from conans.client.tool... | |
import os
import datetime
import requests as req
import json
import jmespath
import operator
from functools import reduce
from features.src.support import constants
from features.src.support.loginusers_oauth2 import LoginUsersOauth2, user_tokens
from subprocess import check_output, CalledProcessError, STDOUT
count =... | |
import numpy as np
from scipy.stats import kde
from .stats import *
__all__ = ['traceplot', 'kdeplot', 'kde2plot', 'forestplot', 'autocorrplot']
def traceplot(trace, vars=None, figsize=None,
lines=None, combined=False, grid=True):
"""Plot samples histograms and values
Parameters
----------... | |
# Modified work:
# -----------------------------------------------------------------------------
# Copyright (c) 2018 Preferred Infrastructure, Inc.
# Copyright (c) 2018 Preferred Networks, Inc.
# -----------------------------------------------------------------------------
# Original work:
# -------------------------... | |
import numpy as np
import pytest
from pandas.core.dtypes.generic import ABCIndexClass
import pandas as pd
import pandas._testing as tm
from pandas.core.arrays import integer_array
from pandas.core.arrays.integer import Int8Dtype, UInt32Dtype
def test_dtypes(dtype):
# smoke tests on auto dtype construction
... | |
from OpenGL.GL import *
from OpenGL.GLUT import *
import weakref
from glcommon import GLMultiViewportProgram
keymap = {GLUT_KEY_F1:'f1',
GLUT_KEY_F2:'f2',
GLUT_KEY_F3:'f3',
GLUT_KEY_F4:'f4',
GLUT_KEY_F5:'f5',
GLUT_KEY_F6:'f6',
GLUT_KEY_F7:'f7',
GLUT_KEY_F8:'f8',
GLUT_KEY_F9:'f9',
GL... | |
import datetime
import json
from nose.tools import ok_, eq_, assert_raises
import mock
from django.conf import settings
from django.utils import timezone
from django.core.exceptions import ImproperlyConfigured
from funfactory.urlresolvers import reverse
from airmozilla.main.models import Event, EventHitStats, Appro... | |
import types
C_TO_PY_CAST = {
'b' : 'char',
'i' : 'int',
'H' : 'uint16',
'h' : 'int16',
'B' : 'uchar',
}
# --------------------------------------------------------------------------------------------
class gen_fmt(object):
def __init__(self, fields, tp = None, bv = None, cast=None, cmt = None):
s... | |
###############################################################################
##
## Copyright (C) 2014-2015, New York University.
## 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.
##
## ... | |
import unittest
import numpy
import chainer
from chainer.backends import cuda
from chainer import functions
from chainer import gradient_check
from chainer import testing
from chainer.testing import attr
from chainer.testing import condition
from chainer import Variable
def _identiy_grid(in_shape):
mesh = numpy... | |
from functools import update_wrapper
from django.apps import apps
from django.conf import settings
from django.contrib.admin import ModelAdmin, actions
from django.contrib.auth import REDIRECT_FIELD_NAME
from django.core.exceptions import ImproperlyConfigured, PermissionDenied
from django.core.urlresolvers import NoRe... | |
# Copyright 2016 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.
# It's reasonable for unittests to be messing with protected members.
# pylint: disable=protected-access
from __future__ import print_function
import json
... | |
import xarray as xr
import numpy as np
import pytest
from xarrayutils.vertical_coordinates import (
conservative_remap,
linear_interpolation_remap,
linear_interpolation_regrid,
_strip_dim,
_coord_interp,
_regular_interp,
)
def random_broadcast(da):
# add random noise with additionial dimen... | |
#!/usr/bin/env python
import sys
import getopt
import re
import struct
import socket
import stat
import os
debug = 0
QEMUCMDTEMPLATE = """#!/bin/bash
set -u
ARCHEND=%(ARCHEND)s
IID=%(IID)i
if [[ -e ./configure.sh ]]; then
. ./configure.sh
elif [[ -e ../configure.sh ]]; then
. ../configure.sh
elif [[ -e ..... | |
# 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... | |
"""Utility functions for making arrangments / piles of objects.
Main functions are :func:`make_object_arrangement` and
:func:`make_object_pile`.
"""
from klampt import *
from klampt.math import vectorops,so3,se3
from klampt.model import collide
import random
import math
from typing import Union,List,Tuple,Sequence,Ca... | |
# -*- coding: utf-8 -*-
"""
Created on Mon Sep 11 13:16:19 2017
@author: Ashiv Dhondea
"""
import AstroFunctions as AstFn
import GeometryFunctions as GF
import TimeHandlingFunctions as THF
import math
import numpy as np
import datetime as dt
import pytz
import aniso8601
import matplotlib.pyplot as plt
from matplot... | |
__source__ = 'https://leetcode.com/problems/reverse-nodes-in-k-group/'
# https://github.com/kamyu104/LeetCode/blob/master/Python/reverse-nodes-in-k-group.py
# Time: O(n)
# Space: O(1)
# LinkedList
#
# Description: Leetcode # 25. Reverse Nodes in k-Group
#
# Given a linked list, reverse the nodes of a linked list k at ... | |
from tapiriik.settings import WEB_ROOT, STRAVA_CLIENT_SECRET, STRAVA_CLIENT_ID, STRAVA_RATE_LIMITS
from tapiriik.services.service_base import ServiceAuthenticationType, ServiceBase
from tapiriik.services.service_record import ServiceRecord
from tapiriik.database import cachedb
from tapiriik.services.interchange import ... | |
#! /usr/bin/env python
import sys, os,time, shutil, copy
sys.path.append("../../")
import numpy as np
from PyQt4 import QtCore, QtGui,QtNetwork
from grid_layout import Ui_MainWindow
from ticker_audio import Audio
from utils import Utils
from ticker_widgets import InstructionsDisplay,SentenceDisplay
from grid_conf... | |
##
# Copyright (c) 2008-2015 Apple 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 l... | |
# 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 applicable ... | |
#! /usr/bin/env python3
"""
Sets up an Ubuntu 14.04 x64 server to be a Counterblock Federated Node.
NOTE: The system should be properly secured before running this script.
This is admittedly a (bit of a) hack. In the future, most likely
utilize a cleaner, docker-based approach.
"""
import os
import sys
import re
impo... | |
# -*- coding: utf-8 -*-
"""
Sessions module for the Tornado framework.
Milan Cermak <milan.cermak@gmail.com>
This module implements sessions for Tornado. It can store
session data in files or MySQL databse, Memcached, Redis
and MongoDB.
USAGE:
======
Every session object can be handled as a dictionary:
self.se... | |
# 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/env python3
# Copyright (c) 2018 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test the Partially Signed Transaction RPCs.
"""
from decimal import Decimal
from test_framework.test_framew... | |
# Copyright 2021, Kay Hayen, mailto:kay.hayen@gmail.com
#
# Python tests originally created or extracted from other peoples work. The
# parts were too small to be protected.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the ... | |
""" Statistical methods used to define or modify position of glyphs.
References:
Wilkinson L. The Grammer of Graphics, sections 7, 7.1
Method Types:
- Bin: Partitions a space before statistical calculation
- Summary: Produces a single value comprising a statistical summary
- Region: Produces two value... | |
# Version 0.6 vom 11.05.2014
#!/usr/bin/python
# -*- coding: utf-8 -*-
import sys
import RPi.GPIO as GPIO
import os, urlparse
import time
import datetime
import ConfigParser
import smtplib
from SocketServer import ThreadingMixIn
import threading
from email.mime.text import MIMEText
from array import array
from BaseHTT... | |
# Copyright 2014 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, s... | |
import sublime
import json
from ... import utils
SIDE_COLOR = "color(#336B81 blend(var(--background) 60%))"
testbox = {"completions": {}, "documentation": {}}
def _plugin_loaded():
sublime.set_timeout_async(load)
def load():
global testbox
completions_data = load_json_data("completions")
for ke... | |
from billing import Gateway, GatewayNotConfigured
from billing.gateway import InvalidData
from billing.signals import *
from billing.utils.credit_card import InvalidCard, Visa, MasterCard, \
AmericanExpress, Discover, CreditCard
from django.conf import settings
import braintree
class BraintreePaymentsGateway(Gate... | |
#!/usr/bin/env python
# Copyright (c) 2012 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.
"""Makes sure that all files contain proper licensing information."""
import optparse
import os.path
import subprocess
import sys... | |
# -*- coding: utf-8 -*-
#
# 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
#... | |
# 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 agreed to in writing, ... | |
""" Dual ParserNode implementation """
from certbot_apache._internal import apacheparser
from certbot_apache._internal import assertions
from certbot_apache._internal import augeasparser
class DualNodeBase:
""" Dual parser interface for in development testing. This is used as the
base class for dual parser in... | |
import os
import re
from collections import defaultdict
from functools import wraps
from django.conf import settings
from django.contrib.auth.hashers import check_password, make_password
from django.contrib.postgres.fields import ArrayField
from django.db import models
from django.http import HttpResponse
from couchf... | |
import datetime
import os
import tempfile
import uuid
from django.core import validators
from django.core.exceptions import ValidationError
from django.core.files.storage import FileSystemStorage
from django.db import models
temp_storage_dir = tempfile.mkdtemp()
temp_storage = FileSystemStorage(temp_storage_dir)
cl... | |
import json
import tarfile
from .exceptions import DockerError, DockerContainerError
from .jsonstream import json_stream_result
from .multiplexed import multiplexed_result
from .utils import identical, parse_result
from .logs import DockerLog
class DockerContainers(object):
def __init__(self, docker):
s... | |
#!/usr/bin/env python
# Copyright (c) 2012 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.
"""Prepares a Chrome HTML file by inlining resources and adding references to
high DPI resources and removing references to unsuppo... | |
"""Helper classes for Google Assistant integration."""
from asyncio import gather
from collections.abc import Mapping
from typing import List
from homeassistant.core import Context, callback
from homeassistant.const import (
CONF_NAME, STATE_UNAVAILABLE, ATTR_SUPPORTED_FEATURES,
ATTR_DEVICE_CLASS, CLOUD_NEVER_... | |
'''
Created on December 25, 2016
This file is subject to the terms and conditions defined in the
file 'LICENSE.txt', which is part of this source code package.
@author: David Moss
'''
import bot
from locations.location import Location
class Intelligence:
"""
Base Intelligence Module Class / Interface
""... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.