gt stringclasses 1
value | context stringlengths 2.49k 119k |
|---|---|
# -*- coding: utf-8 -*-
#
# Copyright 2012-2015 Spotify AB
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | |
"""
Python implementation of the TIIP (Thin Industrial Internet Protocol) protocol.
"""
import json
from datetime import datetime as dt
from datetime import timedelta as td
import dateutil.parser as parser
# Python3 compability fixes
import sys
PY3 = sys.version_info > (3,)
if PY3:
long = int
unicode = str... | |
# Copyright 2014 Dirk Pranke. 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... | |
import json
import math
import numpy
from colorful.fields import RGBColorField
from django.conf import settings
from django.contrib.gis.db import models
from django.contrib.gis.gdal import Envelope, OGRGeometry, SpatialReference
from django.contrib.postgres.fields import ArrayField
from django.db.models import Max, M... | |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'chat_client1.ui'
#
# Created: Thu Jul 30 16:47:54 2015
# by: PyQt4 UI code generator 4.9.3
#
# WARNING! All changes made in this file will be lost!
from PyQt4.QtCore import *
from PyQt4.QtGui import *
import sys, socket
from thread imp... | |
# Bits are stored in ascending order.
# Remember: As bitvector is a mutable type, a __hash__ method is not
# appropriate.
from array import array
from collections import defaultdict
from itertools import islice, chain, repeat, izip_longest
__all__ = ["bitvector"]
class bitvector(object):
def __init__(se... | |
#!/usr/bin/env python
"""
* *******************************************************
* Copyright (c) VMware, Inc. 2014, 2016. All Rights Reserved.
* SPDX-License-Identifier: MIT
* *******************************************************
*
* DISCLAIMER. THIS PROGRAM IS PROVIDED TO YOU "AS IS" WITHOUT
* WARRANTIES OR COND... | |
# Copyright (C) 2016 Google Inc.
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
"""This module contains a class for handling request queries."""
# flake8: noqa
import collections
import datetime
import functools
import operator
import flask
import sqlalchemy as sa
from ggrc import d... | |
#!/usr/bin/env python
import argparse
import shutil
import os
import time
import csv
import json
import random
from PIL import (Image, ImageOps)
import numpy as np
from sklearn.cross_validation import train_test_split
from sklearn.utils import shuffle
import plyvel
from caffe_pb2 import Datum
import utils
def parse... | |
# coding=utf8
import sublime
import os
import re
import shutil
class Object():
pass
def expandVars(path):
for k, v in list(os.environ.items()):
path = path.replace('%'+k+'%', v).replace('%'+k.lower()+'%', v)
return path
def escapeCMDWindows(string):
return string.replace('^', '^^')
BINARY = re.compile('\.(psd... | |
# Copyright 2013 Locaweb.
# 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 appli... | |
"""Support for Denon AVR receivers using their HTTP interface."""
from collections import namedtuple
import logging
import voluptuous as vol
from homeassistant.components.media_player import (
MediaPlayerDevice, PLATFORM_SCHEMA)
from homeassistant.components.media_player.const import (
MEDIA_TYPE_CHANNEL, ME... | |
from async_geocoder import AsyncGeocoder
import asyncio
from shapely.geometry import Point, LineString
import json
import sys
import logging
import re
logging.basicConfig(stream=sys.stdout, level=logging.DEBUG)
log = logging.getLogger()
class ElasticGeocoder(AsyncGeocoder):
"""
Implements AsyncGeocoder with ... | |
# -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Deleting model 'Indicator'
db.delete_table(u'survey_indicator')
# Deleting field 'Question.indica... | |
#!/usr/bin/python
"""
Author : Abraham Cabrera
Date : Sunday July 10, 2016.
Description : Yahoo weather json object respresentation.
"""
import pprint
import os
import urllib2
import urllib
import json
from alarm.plugin import CustomPluginBase
from gtts import gTTS
class YahooWeatherPlugin(CustomPlugin... | |
# -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'Note.order'
db.add_column(u'catalog_note', 'order',
... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import kivy
from kivy.app import App
from flat_kivy.flatapp import FlatApp
import mc_objects
from mc_data import minecraft, minekampf, basemetals
from flat_kivy.font_definitions import style_manager
from flat_kivy.uix.flatcheckbox import FlatCheckBox
from kivy.uix.screenman... | |
"""
A question generator.
Author: Mengye Ren Email: mren@cs.toronto.edu
Usage:
python question_generator.py -parser_path {Stanford parser path} \
-sentence {Single sentence} \
-list {List of sentences} \
-parsed_fil... | |
# -*- coding: utf-8 -*-
from cms import constants
from cms.apphook_pool import apphook_pool
from cms.forms.widgets import UserSelectAdminWidget
from cms.models import (Page, PagePermission, PageUser, ACCESS_PAGE,
PageUserGroup, titlemodels)
from cms.utils.conf import get_cms_setting
from cms.utils.i18n import get_... | |
##for Raleigh & Grant
##who contributed more than they know
################################################################################
############################## WHEEL OF FORTUNE ################################
################################################################################
import random
im... | |
"""
ui views
"""
import json
import logging
from urllib.parse import urlencode
from django.conf import settings
from django.contrib.auth.decorators import login_required
from django.urls import reverse
from django.shortcuts import Http404, redirect, render
from django.utils.decorators import method_decorator
from djan... | |
# Copyright 2012 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 ... | |
from jsonrpc import ServiceProxy
import sys
import string
# ===== BEGIN USER SETTINGS =====
# if you do not set these you will be prompted for a password for every command
rpcuser = ""
rpcpass = ""
# ====== END USER SETTINGS ======
if rpcpass == "":
access = ServiceProxy("http://127.0.0.1:9332")
else:
access = Ser... | |
def pr_iterator(array):
pr = None
for i in array:
yield i, pr
pr = i
def ex(ex):
raise ex
import math
class Calculator():
__slots__ = ("operations", "special")
default_operations = {
",": (1, lambda x, y: (x, y)),
"+": (3, lambda x, y: x + y),
"-": (3,... | |
import os
from mock import Mock
from conans.client.generators import MakeGenerator
from conans.model.build_info import CppInfo
from conans.model.conan_file import ConanFile
from conans.model.env_info import EnvValues
from conans.model.ref import ConanFileReference
from conans.model.settings import Settings
from conan... | |
# Copyright 2015 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 required by applicabl... | |
import collections
import contextlib
import errno
import hashlib
import json
import os
import io
import re
import shutil
import signal
import stat
import struct
import tarfile
import tempfile
import zipfile
import fcntl
from django import forms
from django.conf import settings
from django.core.files.storage import Fil... | |
import argparse
import os
import sys
import numpy as np
import matplotlib.pyplot as plt
from perf.errsim import *
def plot_x_vs_pmf(params, show=True, fpath=None):
def plot(ax, x, param, **plotargs):
if param['pb'] is None:
param['pb'] = param['pe']
label = 'BSC pe={pe} m={m} n={n}... | |
# Copyright 2008-2009 WebDriver committers
# Copyright 2008-2009 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... | |
# Copyright (C) 2015, Red Hat, Inc.
# All rights reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modif... | |
import json
import re
from django.core.cache import cache
from django.test import SimpleTestCase
from corehq.util.es.elasticsearch import ConnectionError
from corehq.apps.es.tests.utils import es_test
from unittest.mock import patch
from openpyxl import load_workbook
from couchexport.export import get_writer
from co... | |
"""
fs.multifs
==========
A MultiFS is a filesystem composed of a sequence of other filesystems, where
the directory structure of each filesystem is overlaid over the previous
filesystem. When you attempt to access a file from the MultiFS it will try
each 'child' FS in order, until it either finds a path that exists o... | |
#!/usr/bin/env python
"""
Copyright 2014, BlinkMobile
"""
import argparse
import time
import sys
import re
import os
import tempfile
import simplejson
import boto.s3
import boto.ses
def main():
"""
This is designed to take MIME emails stored in S3,
and sends a new email with a signed URL to that email fil... | |
# Copyright (c) 2018 PaddlePaddle 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 applicabl... | |
#!/usr/bin/env python
# __BEGIN_LICENSE__
# Copyright (c) 2009-2013, United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration. All
# rights reserved.
#
# The NGT platform is licensed under the Apache License, Version 2.0 (the
# "License"); you may not use ... | |
#----------------------------------------------------------------------
#
# Author: Laszlo Nagy
#
# Copyright: (c) 2005 by Szoftver Messias Bt.
# Licence: BSD style
#
#
#----------------------------------------------------------------------
import os
import md5
import urllib
import urllib2
import mimetypes
#... | |
"""
Project related model.
"""
from string import capwords
from zope.interface import implementer
from sqlalchemy import (
Column,
String,
Boolean,
Unicode,
Integer,
ForeignKey,
desc,
UniqueConstraint,
and_,
cast,
Text,
Index,
)
from sqlalchemy.orm import relationship, ... | |
import datetime
import re
from urllib import urlencode
from xmlrpclib import Fault, loads
from backlinks.models import InboundBacklink
from backlinks.tests.xmlrpc import TestClientServerProxy
from django import template
from django.contrib.auth.models import User
from django.test import TestCase, Client
from committe... | |
# Copyright 2018 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | |
# -*- coding: utf-8 -*-
"""
sphinx.directives.code
~~~~~~~~~~~~~~~~~~~~~~
:copyright: Copyright 2007-2016 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import sys
import codecs
from difflib import unified_diff
from docutils import nodes
from docutils.parsers.rst import ... | |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2006-2009 Edgewall Software
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
# are also available at http://genshi.edgewall.org/wiki/License.
#
# This software consist... | |
"""
PynamoDB attributes
"""
import six
import json
from base64 import b64encode, b64decode
from delorean import Delorean, parse
from pynamodb.constants import (
STRING, NUMBER, BINARY, UTC, DATETIME_FORMAT, BINARY_SET, STRING_SET, NUMBER_SET,
DEFAULT_ENCODING
)
class Attribute(object):
"""
An attribut... | |
"""
homeassistant.bootstrap
~~~~~~~~~~~~~~~~~~~~~~~
Provides methods to bootstrap a home assistant instance.
Each method will return a tuple (bus, statemachine).
After bootstrapping you can add your own components or
start by calling homeassistant.start_home_assistant(bus)
"""
import os
import sys
import logging
imp... | |
from __future__ import unicode_literals
import datetime
from django.contrib import admin
from django.contrib.admin.options import IncorrectLookupParameters
from django.contrib.admin.templatetags.admin_list import pagination
from django.contrib.admin.views.main import ChangeList, SEARCH_VAR, ALL_VAR
from django.contri... | |
"""The ClimaCell integration."""
from __future__ import annotations
from datetime import timedelta
import logging
from math import ceil
from typing import Any
from pyclimacell import ClimaCellV3, ClimaCellV4
from pyclimacell.const import CURRENT, DAILY, FORECASTS, HOURLY, NOWCAST
from pyclimacell.exceptions import (
... | |
# Copyright 2013-2015 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 w... | |
# -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Removing unique constraint on 'Submission', fields ['question', 'user']
db.delete_unique('cms_saq_submissi... | |
#!../../../../virtualenv/bin/python3
# -*- coding: utf-8 -*-
# NB: The shebang line above assumes you've installed a python virtual environment alongside your working copy of the
# <4most-4gp-scripts> git repository. It also only works if you invoke this python script from the directory where it
# is located. If these... | |
# Kubeflow Pipeline with Katib component.
# In this example you will create Katib Experiment using Bayesian optimization algorithm.
# As a Trial template you will use Kubeflow MPIJob with Horovod mnist training container.
# After that, you will compile a Kubeflow Pipeline with your Katib Experiment.
# Use Kubeflow Pip... | |
"""
Test code for the python version of HdrHistogram.
Ported from
https://github.com/HdrHistogram/HdrHistogram (Java)
https://github.com/HdrHistogram/HdrHistogram_c (C)
Written by Alec Hothan
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the Licen... | |
import re
import datetime
from pyramid.i18n import TranslationString as _
from colander import (
deferred,
SchemaNode,
String,
OneOf,
Range,
Sequence,
Length,
ContainsOnly,
Int,
Decimal,
Boolean,
Regex,
Email,
Date,
DateTime,
Mapping,
drop,
)
from . ... | |
##################################################
#
# GP4_Test.py - Base class for development tests
#
##################################################
import sys, unittest
sys.path.append("/home/gwatson/Work/GP4/src")
try:
from GP4.GP4_CompilerHelp import compile_string
from GP4.GP4_Runtime import R... | |
"""Standalone Authenticator."""
import argparse
import collections
import logging
import socket
import threading
import OpenSSL
import six
import zope.interface
from acme import challenges
from acme import standalone as acme_standalone
from certbot import errors
from certbot import interfaces
from certbot.plugins i... | |
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,... | |
# -*- coding: utf-8 -*-
from __future__ import print_function
import pytest
from pandas.compat import range, lrange
import numpy as np
from pandas import DataFrame, Series, Index, MultiIndex
from pandas.util.testing import assert_frame_equal
import pandas.util.testing as tm
from pandas.tests.frame.common import Te... | |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 Nicira Networks, 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.apac... | |
import pyqtgraph as pg
from pyqtgraph.Qt import QtGui, QtCore
from neuroanalysis.miesnwb import MiesNwb
from ..signal import SignalBlock
from .sweep_view import SweepView
from .analyzer_view import AnalyzerView
from ...util.merge_lists import merge_lists
class MiesNwbExplorer(QtGui.QSplitter):
"""Widget for list... | |
import itertools
from collections import namedtuple
from terml.nodes import Term, Tag, coerceToTerm
try:
basestring
except NameError:
basestring = str
class QTerm(namedtuple("QTerm", "functor data args span")):
"""
A quasiterm, representing a template or pattern for a term tree.
"""
@property... | |
#!/usr/bin/python
#
# Copyright 2016 Andreas Moser <grrrrrrrrr@surfsup.at>
#
# 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... | |
r"""wamp is a module that provide classes that extend any
WAMP related class for the purpose of vtkWeb.
"""
import inspect, types, string, random, logging, six, json, re, base64
from threading import Timer
from twisted.web import resource
from twisted.python import log
from twisted.internet ... | |
#!/usr/bin/env python3
# Copyright (c) 2014-2016 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Helpful routines for regression testing."""
from base64 import b64encode
from binascii import hexlify,... | |
# -*- coding: utf-8 -*-
import flask
from functools import wraps
import logging
import database
import importscan
import attacks
#-----------------------------------------------------------------------------
# WEB SERVER
#-----------------------------------------------------------------------------
app = flask.Flas... | |
'''
@author: shylent
'''
from tftp.datagram import (ACKDatagram, ERRORDatagram, OP_DATA, OP_ERROR, ERR_ILLEGAL_OP,
ERR_DISK_FULL, OP_ACK, DATADatagram, ERR_NOT_DEFINED,)
from tftp.util import SequentialCall
from twisted.internet import reactor
from twisted.internet.defer import maybeDeferred
from twisted.internet.p... | |
#!/usr/bin/env python
import os
import math
import pdb,glob
import numpy as np
from scipy.io import loadmat,savemat
from scipy.sparse import csr_matrix
import matplotlib.pyplot as plt
from scipy.interpolate import spline
from scipy.interpolate import interp1d
from scipy.interpolate import InterpolatedUnivariateSpline
f... | |
# Copyright (C) 2011, 2012 Nippon Telegraph and Telephone Corporation.
# Copyright (C) 2011, 2012 Isaku Yamahata <yamahata 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
#
... | |
import datetime
from django.template import Template
from django.forms.formsets import formset_factory
from material import Layout, Row, Column, Fieldset, Span2, Span3, Span5, Span6, Span10
from material.fields import FormSetField
from . import demo as forms
COUNTRY_CHOICES = (
('', 'Country'), (244, 'Aaland Is... | |
"""Tests for the Abode config flow."""
from unittest.mock import patch
from abodepy.exceptions import AbodeAuthenticationException
from abodepy.helpers.errors import MFA_CODE_REQUIRED
from homeassistant import data_entry_flow
from homeassistant.components.abode import config_flow
from homeassistant.components.abode.c... | |
from pandac.PandaModules import *
from toontown.toonbase.ToonBaseGlobal import *
from direct.directnotify import DirectNotifyGlobal
from direct.interval.IntervalGlobal import *
from direct.task import Task
from math import *
from direct.distributed.ClockDelta import *
from toontown.golf import GolfGlobals
from pandac.P... | |
#! /usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright 2022 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 requi... | |
#
# Copyright (c) 2013 Canonical Ltd.
#
# This file is part of: SST (selenium-simple-test)
# https://launchpad.net/selenium-simple-test
#
# 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 Licens... | |
# Copyright 2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"). You may not
# use this file except in compliance with the License. A copy of the License
# is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" file acc... | |
# -*- coding: utf-8 -*-
'''
Generate Pillar data from Django models through the Django ORM
:maintainer: Micah Hausler <micah.hausler@gmail.com>
:maturity: new
Configuring the django_orm ext_pillar
=====================================
To use this module, your Django project must be on the salt master server with
da... | |
# This file consists of testing for functions that generate messages/strings
# and convert data into another format
import sys
sys.path.append('../..')
# Libraries
# Standard library
import unittest
from unittest.mock import patch
from random import randint
# Local
import helper_random as r
from helper_mock import (ge... | |
# 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 json
import os
import subprocess
from urllib2 import urlopen
import ccmlib.common as common
from dtest import warning
from distutils.version import LooseVersion
JOLOKIA_JAR = os.path.join('lib', 'jolokia-jvm-1.2.3-agent.jar')
CLASSPATH_SEP = ';' if common.is_win() else ':'
JVM_OPTIONS = "jvm.options"
def jo... | |
#
# Created as part of the StratusLab project (http://stratuslab.eu),
# co-funded by the European Commission under the Grant Agreement
# INFSO-RI-261552."
#
# Copyright (c) 2013, SixSq Sarl
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the Lice... | |
"""Viessmann ViCare climate device."""
from contextlib import suppress
import logging
from PyViCare.PyViCare import PyViCareNotSupportedFeatureError, PyViCareRateLimitError
import requests
import voluptuous as vol
from homeassistant.components.climate import ClimateEntity
from homeassistant.components.climate.const i... | |
#!/usr/bin/env python
# -- Content-Encoding: UTF-8 --
"""
MQTT client utility: Tries to hide Paho client details to ease MQTT usage.
Reconnects to the MQTT server automatically.
This module depends on the paho-mqtt package (ex-mosquitto), provided by the
Eclipse Foundation: see http://www.eclipse.org/paho
:author: Th... | |
import os.path
import numpy
#from regions import Segmentation, Region, Contact
from sys import stderr
def ReadRegionsFile ( regions_file_path, dmap, smod = None) :
print "Reading regions ---"
try :
e = numpy.fromfile ( regions_file_path, numpy.double )
except :
print "could not read:", ... | |
import os
import copy
from random import choice
from string import letters
from kivy.animation import Animation
from kivy.app import App
from kivy.base import EventLoop
from kivy.config import Config
from kivy.clock import Clock
from kivy.graphics import Color, BorderImage
from kivy.properties import StringProperty, N... | |
# -*- coding: utf-8 -*-
"""
Tests of neo.io.blackrockio
"""
# needed for python 3 compatibility
from __future__ import absolute_import
try:
import unittest2 as unittest
except ImportError:
import unittest
from numpy.testing import assert_equal
import numpy as np
import quantities as pq
from neo.io.blackroc... | |
# -*- coding: utf-8 -*-
"""
Created on Wed Jan 4 12:22:44 2017
@author: a.sancho.asensio
"""
import argparse
import base64
import json
from keras.models import model_from_json
from keras.preprocessing.image import ImageDataGenerator, array_to_img, img_to_array
import re, sys
import os
import glob
import numpy as np
... | |
# Copyright (C) 2010-2011 gevent contributors. See LICENSE for details.
# Get the standard Python httplib as __httplib__, ensuring we get a version
# that hasn't already been modified by monkey patching of any of its members.
# HTTPSConnection must use the standard HTTPConnection because libevent-http
# does not curre... | |
#!/usr/bin/env python
from datetime import datetime
import json
from fabric.api import local, require, settings, task
from fabric.state import env
from termcolor import colored
import app_config
# Other fabfiles
import ap
import assets
import daemons
import data
import instagram
import issues
import liveblog
import ... | |
from __future__ import unicode_literals
from six.moves.builtins import str
from six.moves.builtins import object
from six import with_metaclass
# -*- coding: utf-8 -*-
import pytz
from django.contrib.contenttypes import fields
from django.db import models
from django.db.models.base import ModelBase
from django.db.mode... | |
# -*- coding: utf-8 -*-
"""
IDL Ref:
https://thrift.apache.org/docs/idl
"""
from __future__ import absolute_import
from ply import yacc
from .lexer import tokens, lexer # noqa
from .model import (
BASE_TYPE_MAPS,
Field,
Function,
IdentifierValue,
ListType,
MapType,
Service,
SetT... | |
#!/usr/bin/env python
#
# Copyright 2007 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2010 OpenStack LLC.
# 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/... | |
"""
Component that will help set the microsoft face for verify processing.
For more details about this component, please refer to the documentation at
https://home-assistant.io/components/image_processing.microsoft_face_identify/
"""
import asyncio
import logging
import voluptuous as vol
from homeassistant.core impo... | |
# Copyright 2019 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
import itertools
import json
import logging
import os
from dataclasses import dataclass
from typing import List, Set, Tuple, cast
from pants.backend.python.python_artifact import PythonAr... | |
# Copyright (c) 2016 Huawei Technologies Co., Ltd.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# ... | |
"""archvyrt ubuntu provisioner module"""
# stdlib
import logging
import os
# archvyrt
import archvyrt.tools as tools
from .base import LinuxProvisioner
LOG = logging.getLogger(__name__)
class UbuntuProvisioner(LinuxProvisioner):
"""
Ubuntu Provisioner
"""
def _install(self):
"""
Ubu... | |
# 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... | |
from __future__ import unicode_literals
import json
import mimetypes
import os
import re
import sys
from copy import copy
from importlib import import_module
from io import BytesIO
from django.conf import settings
from django.core.handlers.base import BaseHandler
from django.core.handlers.wsgi import ISO_8859_1, UTF_... | |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
This module tests some of the methods related to YAML serialization.
Requires `pyyaml <https://pyyaml.org/>`_ to be installed.
"""
from io import StringIO
import pytest
import numpy as np
from astropy.coordinates import SkyCoord, EarthLocation, An... | |
"""Test the Dyson fan component."""
import unittest
from unittest import mock
from homeassistant.components.dyson import DYSON_DEVICES
from homeassistant.components.fan import dyson
from tests.common import get_test_home_assistant
from libpurecoollink.const import FanSpeed, FanMode, NightMode, Oscillation
from libpure... | |
import os
import pytest
from golem.cli import commands, messages
from golem.core import file_manager
from golem.gui.user_management import Users
class TestRunCommand:
@pytest.mark.slow
def test_golem_run_project_param_is_missing(self, project_session, capsys):
project_session.activate()
com... | |
"""Unit tests for reviewbot.tools.rbsecretscanner."""
from __future__ import unicode_literals
import six
from reviewbot.tools.rbsecretscanner import SecretScannerTool
from reviewbot.tools.testing import (BaseToolTestCase,
ToolTestCaseMetaclass,
... | |
"""Media Player component to integrate TVs exposing the Joint Space API."""
from __future__ import annotations
from typing import Any
from haphilipsjs import ConnectionFailure
import voluptuous as vol
from homeassistant import config_entries
from homeassistant.components.media_player import (
DEVICE_CLASS_TV,
... | |
import datetime
from nose.tools import eq_, ok_
import mock
from django.conf import settings
from django.contrib.auth.models import Group
from django.utils import timezone
from funfactory.urlresolvers import reverse
from airmozilla.main.models import (
Event,
EventTweet,
Location,
Approval
)
from .b... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.