gt stringclasses 1
value | context stringlengths 2.49k 119k |
|---|---|
'''
Roulette
========
:class:`Roulette` provides a rolling way of selecting values like in iOS
and android date pickers.
Dependencies
------------
*. the garden package ``kivy.garden.tickline``. Use ``garden install tickline``
to install it like any other garden package.
*. the garden package ``kivy.garden.roul... | |
"""Support for climate devices through the SmartThings cloud API."""
import asyncio
import logging
from typing import Iterable, Optional, Sequence
from pysmartthings import Attribute, Capability
from homeassistant.components.climate import DOMAIN as CLIMATE_DOMAIN, ClimateDevice
from homeassistant.components.climate.... | |
import logging
import engineio
import six
from . import base_manager
from . import packet
class Server(object):
"""A Socket.IO server.
This class implements a fully compliant Socket.IO web server with support
for websocket and long-polling transports.
:param engineio_options: A ``dict`` with optio... | |
# Copyright 2013 eBay Inc.
# Copyright 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/LIC... | |
# Copyright (c) 2009-2012, Andrew McNabb
# Copyright (c) 2013, Kristoffer Gronlund
from errno import EINTR
from subprocess import Popen, PIPE
import os
import signal
import sys
import time
import traceback
from psshlib import askpass_client
BUFFER_SIZE = 1 << 16
try:
bytes
except NameError:
bytes = str
cl... | |
#
# 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... | |
import argparse
import datetime
import imutils
import numpy as np
import time
import csv
import cv2
import os.path
import math
from PyQt4.QtCore import QObject, pyqtSignal, pyqtSlot
xyreturn = None
switch = 0
crp_lst = []
p1 = (0,0)
p2 = (1,1)
geo = 0
def divide_frame(event,x,y,flags,param):
global xyreturn, swi... | |
from calendar_layout import *
#from update import *
from Tkinter import *
import sqlite3
import matrices
import numpy as np
import auto
import export
import random
import datetime as datetime
import urllib2
from bs4 import BeautifulSoup
import csv
import sys
import globalvars
# Menu and Frame Functions
def doNothing... | |
# Copyright (C) 2014 Nippon Telegraph and Telephone 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 appli... | |
"""Mailcap file handling. See RFC 1524."""
import os
__all__ = ["getcaps","findmatch"]
# Part 1: top-level interface.
def getcaps():
"""Return a dictionary containing the mailcap database.
The dictionary maps a MIME type (in all lowercase, e.g. 'text/plain')
to a list of dictionaries corresponding to ... | |
from app.api.models.LXDModule import LXDModule
import logging
logging = logging.getLogger(__name__)
class LXCContainer(LXDModule):
def __init__(self, input):
self.data = {}
self.remoteHost = '127.0.0.1'
if not input.get('name'):
logging.error('Container name is required for an... | |
__all__ = ['XunleiClient']
import urllib
import urllib2
import cookielib
import re
import time
import os.path
import json
from ast import literal_eval
def retry(f):
#retry_sleeps = [1, 1, 1]
retry_sleeps = [1, 2, 3, 5, 10, 20, 30, 60] + [60] * 60
def withretry(*args, **kwargs):
for second in retry_sleeps:
tr... | |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2010-2011 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... | |
#
# 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... | |
from gusto import *
from firedrake import (FunctionSpace, as_vector,
VectorFunctionSpace,
PeriodicIntervalMesh,
ExtrudedMesh,
SpatialCoordinate, exp,
pi, cos, Function,
conditional, ... | |
#!/usr/bin/env python
###########################################################
# WARNING: Generated code! #
# ************************** #
# Manual changes may get lost if file is generated again. #
# Only code inside the [MANUAL] tags will be kept. ... | |
# 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
import time
import wx
import images
#-------------------------------------------------------------------
class MyFrame(wx.Frame):
def __init__(self, parent, id, log):
wx.Frame.__init__(self, parent, id, 'Playing with menus', size=(500, 250))
self.log = log
self.Cent... | |
# Copyright (c) 2015 Hewlett-Packard Development Company, L.P.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable... | |
from bcrypt import gensalt
from bcrypt import hashpw
from datetime import date
from datetime import datetime
from functools import reduce
from sqlalchemy import BigInteger
from sqlalchemy import CheckConstraint
from sqlalchemy import Column
from sqlalchemy import Date
from sqlalchemy import DateTime
from sqlalchemy imp... | |
""" ietf_restconf_monitoring
This module contains monitoring information for the
RESTCONF protocol.
Copyright (c) 2016 IETF Trust and the persons identified as
authors of the code. All rights reserved.
Redistribution and use in source and binary forms, with or
without modification, is permitted pursuant to, and su... | |
from __future__ import absolute_import, division
from django.conf import settings
from django.core import urlresolvers
from django.db import connection
from django.db.models import Sum
from django.db.models.query import QuerySet
from django.http import HttpResponseNotFound, HttpRequest, HttpResponse
from django.templa... | |
# Copyright (C) 2013 Nippon Telegraph and Telephone 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 appli... | |
import warnings
from unittest.mock import patch
import pytest
import geopy.geocoders
from geopy.exc import ConfigurationError
from geopy.geocoders import Nominatim
from geopy.point import Point
from test.geocoders.util import BaseTestGeocoder
class BaseTestNominatim(BaseTestGeocoder):
# Common test cases for No... | |
# File: CeTestBeds.py ; This file is part of Twister.
# version: 3.005
# Copyright (C) 2012-2014, Luxoft
# Authors:
# Andreea Proca <aproca@luxoft.com>
# Andrei Costachi <acostachi@luxoft.com>
# Cristi Constantin <crconstantin@luxoft.com>
# Licensed under the Apache License, Version 2.0 (the "License");
# ... | |
# 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... | |
from ionotomo import *
import numpy as np
import pylab as plt
def test_turbulent_realisation(plot=True):
xvec = np.linspace(-100,100,100)
zvec = np.linspace(0,1000,1000)
M = np.zeros([100,100,1000])
TCI = TriCubic(xvec,xvec,zvec,M)
print("Matern 1/2 kernel")
cov_obj = Covariance(tci=TCI)
si... | |
#!/usr/bin/env python
import sqlite3
import logging
import argparse
import sys
import hashlib
from prettytable import from_db_cursor
# config
DATABASE = 'doorlock.db'
def create_hash(text):
h = hashlib.sha256()
h.update(text)
return h.hexdigest()
# parse arguments
parser = argparse.ArgumentParser()
parser_subs =... | |
# Copyright (c) 2014-2015 Bruno Daniel <bruno.daniel@blue-yonder.com>
# Copyright (c) 2015-2016 Claudiu Popa <pcmanticore@gmail.com>
# Copyright (c) 2016 Ashley Whetter <ashley@awhetter.co.uk>
# Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html
# For details: https://github.com/PyCQA/pylin... | |
#
# Copyright (c) 2014 Tom Carroll
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, dis... | |
# (c) 2018 Red Hat Inc.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
DOCUMENTATION = """
---
author: Ansible Networking Team
connection: httpapi
short_description: Use httpapi to run... | |
# -------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
# --------------------------------------------------------------------------
import py... | |
"""Config flow for Network UPS Tools (NUT) integration."""
import logging
import voluptuous as vol
from homeassistant import config_entries, core, exceptions
from homeassistant.const import (
CONF_ALIAS,
CONF_BASE,
CONF_HOST,
CONF_PASSWORD,
CONF_PORT,
CONF_RESOURCES,
CONF_SCAN_INTERVAL,
... | |
# coding: utf-8
"""
Kubernetes
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
OpenAPI spec version: v1.7.4
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from pprint import pformat
from six import iteritems
import re
... | |
# 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 agreed to in writing, ... | |
import logging
import os
from collections import OrderedDict
from celery.task.control import revoke
from django.conf import settings
from django.contrib.auth.models import Group
from django.db import models
from django.db.utils import OperationalError, ProgrammingError, InternalError, DataError
from django.utils.fun... | |
import sys
import subprocess
import threading
import logging
import importlib
from collections import OrderedDict, namedtuple
from django.core.management import call_command
from django.conf import settings
from django.apps import apps
from biohub.utils import module as module_util
from biohub.utils.collections impor... | |
#
# Copyright 2017-present Open Networking Foundation
#
# 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... | |
import subprocess as sp
import warnings
import numpy as np
from moviepy.video.io.ffmpeg_reader import ffmpeg_parse_infos
from moviepy.config import get_setting
from moviepy.compat import PY3, DEVNULL
import os
class FFMPEG_AudioReader:
"""
A class to read the audio in either video files or audio files
us... | |
from __future__ import unicode_literals
import os
from sprinter import lib
EMPTY = object()
bool_to_str = {
'bool': { True: 'true', False: 'false' },
't_f': { True: 't', False: 'f' },
'y_n': { True: 'y', False: 'n' },
'yes_no': { True: 'yes', False: 'no' }
}
class InputException(Exception):
pas... | |
##### PATTERN | VECTOR | PORTER STEMMER ##################################
# Copyright (c) 2010 University of Antwerp, Belgium
# Author: Tom De Smedt <tom@organisms.be>
# License: BSD (see LICENSE.txt for details).
# http://www.clips.ua.ac.be/pages/pattern
##############################################################... | |
#!/usr/bin/env python
# define some variables
from __future__ import print_function
from builtins import input
import numpy
import sys
import matplotlib
if matplotlib.get_backend() != "TKAgg":
matplotlib.use("TKAgg")
import pmagpy.pmag as pmag
import pmagpy.pmagplotlib as pmagplotlib
def main():
"""
NAME
... | |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 OpenStack LLC
# Copyright 2013 IBM Corp.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/... | |
#/************************************************************************************************************************
# Copyright (c) 2016, Imagination Technologies Limited and/or its affiliated group companies.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modificat... | |
import atexit
import datetime
from distutils.version import StrictVersion
from os import environ as env
import os
import subprocess
import sys
import seesaw
from seesaw.item import ItemInterpolation, ItemValue
from seesaw.pipeline import Pipeline
from seesaw.project import Project
from seesaw.task import LimitConcurre... | |
# 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 ... | |
"""
rgenetics datatypes
Ross Lazarus
for the rgenetics and galaxy projects
genome graphs datatypes derived from Interval datatypes
genome graphs datasets have a header row with appropriate columnames
The first column is always the marker - eg columname = rs, first row= rs12345 if the rows are snps
subsequent row val... | |
# Copyright 2008-2015 Nokia Solutions and Networks
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable l... | |
import os
import sys
from django.contrib.messages import constants as messages
from geotrek import __version__
from . import PROJECT_ROOT_PATH
def gettext_noop(s):
return s
DEBUG = False
TEMPLATE_DEBUG = DEBUG
TEST = 'test' in sys.argv
VERSION = __version__
ADMINS = (
('Makina Corpus', 'geobi@makina-corp... | |
# -*- coding: utf-8 -*-
""" Handle most tasks related to DynamoDB interaction """
import re
import sys
import time
import datetime
from boto import dynamodb2
from boto.dynamodb2.table import Table
from boto.exception import DynamoDBResponseError, JSONResponseError
from dynamic_dynamodb.log_handler import LOGGER as lo... | |
# -*- coding: utf-8 -*-
"""
cpsdirector.user
================
ConPaaS director: users and authentication handling
:copyright: (C) 2013 by Contrail Consortium.
"""
from flask import Blueprint
from flask import jsonify, helpers, request, make_response, g
import os
import hashlib
import zipfile
import... | |
'''
Stateful, singleton, paradrop daemon command center.
See docstring for NexusBase class for information on settings.
SETTINGS QUICK REFERENCE:
# assuming the following import
from paradrop.base import nexus
nexus.core.info.version
nexus.core.info.pdid
'''
import os
import yaml
import json
import ... | |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import traceback
from thrift.protocol.THeaderProtocol import THeaderProtocol
from thrift.server.TServer import TServer, TConnectionContext
from thrift.transport.THeaderT... | |
# pylint: disable=g-bad-file-header
# 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/LICENS... | |
"""
Fenced Code Extension for Python Markdown
=========================================
This extension adds Fenced Code Blocks to Python-Markdown.
>>> import markdown
>>> text = '''
... A paragraph before a fenced code block:
...
... ~~~
... Fenced code block
... ~~~
... '''
>>> ht... | |
# Licensed to the StackStorm, Inc ('StackStorm') 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 use th... | |
# -*- coding:utf-8 -*-
# Copyright (c) 2015, Galaxy Authors. All Rights Reserved
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
#
# Author: wangtaize@baidu.com
# Date: 2015-04-06
import datetime
import logging
from sofa.pbrpc import client
from galaxy import master... | |
#!/usr/bin/env python3
#
# 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.
"""Process Android resource directories to generate .resources.zip and R.txt
files."""
import argparse
import os
import shutil
... | |
"""
pygments.formatters.latex
~~~~~~~~~~~~~~~~~~~~~~~~~
Formatter for LaTeX fancyvrb output.
:copyright: Copyright 2006-2021 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from io import StringIO
from pygments.formatter import Formatter
from pygments.lexer import ... | |
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
executor_manager.py
ExecutorManager makes you configure a system to execute tasks.
Every task is not executed immediatly, but according to a politics defined in
the object configuration.
Es:
ExecutorManager.avvia(sendMail, separateEmails)
ExecutorManager.execut... | |
"""Docker runtime interface.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import io
import json
import logging
import multiprocessing
import os
import socket
import time
import docker
from treadmill import ap... | |
"""Tests for Sentry integration."""
import logging
from unittest.mock import MagicMock, Mock, patch
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,
C... | |
# 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... | |
import json
from django import forms
from django.core.exceptions import ImproperlyConfigured
from django.forms import widgets
from django.template.loader import render_to_string
from django.urls import reverse
from django.utils.translation import gettext_lazy as _
from wagtail.admin.staticfiles import versioned_stati... | |
#!/usr/bin/env python
# This file was taken from Riverbank's examples,
# which was an adaptation of the original C++ Qt's examples.
from PySide import QtCore, QtGui
import animatedtiles_rc
# PyQt doesn't support deriving from more than one wrapped class so we use
# composition and delegate the property.
class Pix... | |
"""
Created on 2015-05-30
@author: Valtyr Farshield
"""
import re
import sqlite3 as lite
from bb_common import BbCommon
class Epistatic:
def __init__(self, static_code, wh_class, stabletime, maxjump, maxmass, info):
self.static_code = static_code
self.wh_class = wh_class
self.stabletime ... | |
##########################################################################
#
# Copyright 2008-2010 VMware, 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 withou... | |
from numpy import array, asarray, dtype
from numpy.random import RandomState
from numpy.testing import assert_, assert_array_equal, assert_equal
from limix._data import conform_dataset
from pandas import DataFrame, Series
from xarray import DataArray
def test_dataset_conform_dataset():
y = array([-1.2, 3.4, 0.1]... | |
# Copyright 2008-2012 Nokia Siemens Networks Oyj
#
# 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... | |
# generate_date, was before in main.py
#Author: Len Feremans 8-Feb-2016
import os, csv, sys, random
import datetime
from datetime import timedelta
import math
from math import log
import occsimread, appliance, activitydat, appsimfun, bulbdat
def generate_data_range(iResidents, Dwell,iIrradianceThreshold,iRandomHouse,... | |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | |
# Copyright 2016 Capital One Services, LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in... | |
# Copyright (c) 2013, Intel Corporation
# 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 condit... | |
# -*- 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 field 'Household.name'
db.delete_column(u'survey_household', 'name')
# Adding field 'Hou... | |
import tty
import sys
import curses
import datetime
import locale
from decimal import Decimal
import getpass
import logging
import electrum
from electrum.util import format_satoshis
from electrum.bitcoin import is_address, COIN, TYPE_ADDRESS
from electrum.transaction import TxOutput
from electrum.wallet import Wallet
... | |
#
# Copyright 2018 Analytics Zoo 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 applicable law or agreed to... | |
#!/usr/bin/env python
"""Test the various collection objects."""
import itertools
import math
from grr.lib import aff4
from grr.lib import data_store
from grr.lib import rdfvalue
from grr.lib import test_lib
from grr.lib import utils
from grr.lib.aff4_objects import collections
from grr.lib.rdfvalues import flows as... | |
from __future__ import unicode_literals
import re
import frappe
import psycopg2
import psycopg2.extensions
from six import string_types
from frappe.utils import cstr
from psycopg2.extensions import ISOLATION_LEVEL_AUTOCOMMIT
from frappe.database.database import Database
from frappe.database.postgres.schema import Pos... | |
import pytz
from django import forms
from django.conf import settings
from django.contrib.auth.models import User, Group
from django.contrib.flatpages.models import FlatPage
from funfactory.urlresolvers import reverse
from airmozilla.base.forms import BaseModelForm
from airmozilla.main.models import (Approval, Categ... | |
# 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... | |
# 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 ... | |
# Copyright 2015 EMC Corporation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | |
from __future__ import print_function
try:
from queue import Empty # Python 3
except ImportError:
from Queue import Empty # Python 2
import time
import io
from ipykernel.kernelbase import Kernel
from datetime import datetime
import os
import os.path
import tempfile
from jupyter_client.manager import KernelM... | |
import sys
from peewee import ModelQueryResultWrapper
from peewee import NaiveQueryResultWrapper
from playhouse.tests.base import ModelTestCase
from playhouse.tests.base import skip_test_if
from playhouse.tests.base import test_db
from playhouse.tests.models import *
class TestQueryResultWrapper(ModelTestCase):
... | |
# Copyright 2014-2016 Presslabs SRL
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wri... | |
#! /usr/bin/python3
import quick2wire.i2c as twi
import os, math, time
slave = 0x60
interval = 1
#i2c command table
PARTID = 0x00; UCOEF = [0x13, 0x14, 0x15, 0x16]
REVID = 0x01; PARAW = 0x17
SEQID = 0x02; COMM = 0x18
INTCFG = 0x03; RESP = 0x20
IRQEN = 0x04; IRSTA = 0x21
H... | |
# 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 python
# encoding: utf-8
"""
The Play management
"""
import datetime
from mongokit import Document, DocumentMigration
class PlayMigration(DocumentMigration):
"""A DocumentMigration for the Play class"""
def __init__(self, *args):
DocumentMigration.__init__(self, *args)
def ... | |
'''Arsenal Pyramid WSGI application.'''
# Copyright 2015 CityGrid Media, 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
#
# Unles... | |
from __future__ import absolute_import
import logging
import threading
from collections import defaultdict, namedtuple
logger = logging.getLogger(__name__)
Offsets = namedtuple("Offsets", "local remote")
class InvalidState(Exception):
pass
class InvalidStateTransition(Exception):
pass
class MessageNo... | |
""" Module to test exec_bowtie member methods.
This module contains unit tests for exec_bowtie.py.
"""
import os
import unittest
import shutil
from src import exec_bowtie
__author__ = "YiDing Fang"
__maintainer__ = "YiDing Fang"
__email__ = "yif017@eng.ucsd.edu"
__status__ = "prototype"
# input file contents. F... | |
''' a Triangle
'''
import math
import collections
import itertools
from . import Polygon, Point, Segment, Circle
from .constants import Epsilon, Half_Pi, nearly_eq, Sqrt_3
from .exceptions import *
class Triangle(Polygon):
'''a pythonic Triangle
Implements a Triangle object in the XY plane having three
... | |
#!/usr/bin/env python
# -*- coding: utf-8; mode: python; -*-
"""Module providing abstract interface class for LSTM sense calssification.
Attributes:
LSTMBaseSenser (class):
abstract class defining interface for explicit and implicit classifier
"""
##############################################################... | |
"""
:Created: 15 August 2015
:Author: Lucas Connors
"""
from django.contrib.auth.models import User
from flamingo.tests import FlamingoTestCase, FlamingoTransactionTestCase
from users.exceptions import UserAlreadyExistsException
from users.forms import LoginForm, RegisterForm
from users.models import UserProfile
c... | |
# Copyright 2012 OpenStack Foundation
# All Rights Reserved
# Copyright (c) 2012 NEC 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/lic... | |
from __future__ import unicode_literals
from __future__ import absolute_import
import logging
from .service import Service
from .container import Container
from .packages.docker.errors import APIError
log = logging.getLogger(__name__)
def sort_service_dicts(services):
# Topological sort (Cormen/Tarjan algorithm)... | |
#fontmetrics.py - part of PDFgen - copyright Andy Robinson 1999
"""This contains pre-canned text metrics for the PDFgen package, and may also
be used for any other PIDDLE back ends or packages which use the standard
Type 1 postscript fonts.
Its main function is to let you work out the width of strings; it exposes a
s... | |
from __future__ import absolute_import
from __future__ import print_function
from subprocess import *
import collections
import pprint
import logging
import errno
import os
import re
import sys
import tempfile
from .popenwrapper import Popen
fullSelfPath = os.path.realpath(__file__)
prefix = os.path.dirname(fullSelfP... | |
# encoding: 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):
# Adding model 'ConservationFeature'
db.create_table('seak_conservationfeature', (
('name', se... | |
import os
import re
import json
import inspect
from collections import defaultdict
import yaml
from fabric.api import local, settings, hide
from libcloud.compute.types import Provider, OLD_CONSTANT_TO_NEW_MAPPING
from libcloud.compute.providers import get_driver as get_libcloud_driver
from .utils import render_templa... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.