gt stringclasses 1
value | context stringlengths 2.49k 119k |
|---|---|
# -*- coding: utf-8 -*-
# pylint: disable=C,R,W
"""Utility functions used across Superset"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from builtins import object
from datetime import date, datetime, time, timede... | |
import os
import numpy.testing as npt
from nose import SkipTest
from nose.tools import raises
import numpy as np
from statsmodels.distributions.mixture_rvs import mixture_rvs
from statsmodels.nonparametric.kde import KDEUnivariate as KDE
import statsmodels.sandbox.nonparametric.kernels as kernels
from scipy import stat... | |
import simuPOP as sim
from simuPOP.utils import Exporter
Wild=sim.Population(
size=[1000,1000],
ploidy=2,
loci=[17,2,11,5,7,5,3,3,14,15,5,8,16,13,6,6,2,8,4,6,6,5,3,9,5,8,4,4],
lociPos=[
4.9,21.4,23.9,26.0,34.1,34.4,48.9,50.8,78.6,82.4,118.2,119.9,120.1,122.3,131.1,136.1,151.3,
24.7,43.3,
... | |
import os, sys, logging, datetime, multiprocessing, icebridge_common, shutil
import threading, time
import flight_list # Contains AN_FLIGHTS and GR_FLIGHTS
#===============================================================================
# Constants
COMPLETED_DATES_FILE = '/u/smcmich1/icebridge/upload_software/comp... | |
# Copyright 2014 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 itertools
import logging
import os
import posixpath
from devil.android import device_errors
from devil.android import device_temp_... | |
# Copyright 2015 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 ... | |
#
# 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 us... | |
import numpy as np
import tables as tb
class Particle(tb.IsDescription):
ADCcount = tb.Int16Col() # signed short integer
TDCcount = tb.UInt8Col() # unsigned byte
grid_i = tb.Int32Col() # integer
grid_j = tb.Int32Col() # integer
idnumb... | |
# 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... | |
# Copyright 2006 James Tauber and contributors
# Copyright (C) 2009, 2010 Luke Kenneth Casson Leighton <lkcl@lkcl.net>
# Copyright (C) 2010 Serge Tarkovski <serge.tarkovski@gmail.com>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
#... | |
# This work was created by participants in the DataONE project, and is
# jointly copyrighted by participating institutions in DataONE. For
# more information on DataONE, see our web site at http://dataone.org.
#
# Copyright 2009-2019 DataONE
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you ma... | |
# Copyright (c) 2011 Zadara Storage Inc.
# Copyright (c) 2011 OpenStack 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.... | |
# -*- coding:utf-8 -*-
"""
This module is pending deprecation as of Django 1.6 and will be removed in
version 1.8.
"""
from importlib import import_module
import json
import re
import unittest as real_unittest
import warnings
from django.apps import apps
from django.test import _doctest as doctest
from django.test im... | |
# 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/py.test
import binascii
import ctypes as c
import hashlib
import os
import random
import curve25519
import ecdsa
import pytest
def bytes2num(s):
res = 0
for i, b in enumerate(reversed(bytearray(s))):
res += b << (i * 8)
return res
curves = {"nist256p1": ecdsa.curves.NIST256p, "secp25... | |
###############################################################################
##
## Copyright 2011-2013 Tavendo GmbH
##
## 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:... | |
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
"""
Provides a command container for additional tox commands, used in "tox.ini".
COMMANDS:
* copytree
* copy
* py2to3
REQUIRES:
* argparse
"""
from glob import glob
import argparse
import inspect
import os.path
import shutil
import sys
__author__ = "Jens Engel"... | |
# Copyright 2012 OpenStack 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 or agreed to in... | |
# This program lets up to three players play Travel Bingo! Each player is assigned
# a grid-card with random items commonly seen from a car, and the first player
# to reach the chosen bingo goal will win. Players can keep playing until they choose to stop.
import random
def loadItems() :
'''Read file of potential... | |
# Copyright 2016, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the f... | |
import copy
import bson
import datetime
import pymongo.errors
from . import consistencychecker
from . import containerutil
from .. import config
from .. import util
from ..web.errors import APIStorageException, APIConflictException, APINotFoundException
log = config.log
# TODO: Find a better place to put this until... | |
#
# @file tools/sdk/python/MotionSDK.py
# @author Luke Tokheim, luke@motionnode.com
# @version 2.2
#
# Copyright (c) 2015, Motion Workshop
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1... | |
# Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Generates JavaScript source files from a mojom.Module."""
import mojom.generate.generator as generator
import mojom.generate.module as mojom
import mojom... | |
__author__ = 'Sarath'
from pyNN import *
import time
from pyNN.optimization.optimization import *
from pyNN.util.Initializer import *
import pickle
class DeepCorrNet1(object):
def init(self, numpy_rng, theano_rng=None, l_rate=0.01, optimization="sgd", tied=False, n_visible_left=None, n_visible_right=None, n_hidd... | |
# Copyright (c) 2010 Infrae / Technical University Delft. All rights reserved.
# See also LICENSE.txt
from collections import defaultdict
from lxml import etree
from fcrepo.utils import rdfxml2dict, dict2rdfxml
class typedproperty(property):
def __init__(self, fget, fset=None, fdel=None, doc=None, pytype=No... | |
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
"""Client and server classes corresponding to protobuf-defined services."""
import grpc
from wandb.proto import wandb_internal_pb2 as wandb_dot_proto_dot_wandb__internal__pb2
from wandb.proto import wandb_server_pb2 as wandb_dot_proto_dot_wandb__ser... | |
###############################################################################
#
# 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... | |
# LayerMapping -- A Django Model/OGR Layer Mapping Utility
"""
The LayerMapping class provides a way to map the contents of OGR
vector files (e.g. SHP files) to Geographic-enabled Django models.
For more information, please consult the GeoDjango documentation:
http://geodjango.org/docs/layermapping.html
"""
impo... | |
# Author: Travis Oliphant
# 2003
#
# Feb. 2010: Updated by Warren Weckesser:
# Rewrote much of chirp()
# Added sweep_poly()
from __future__ import division, print_function, absolute_import
import numpy as np
from numpy import asarray, zeros, place, nan, mod, pi, extract, log, sqrt, \
exp, cos, sin, polyval, po... | |
# -*- coding: utf-8 -*-
'''
Copyright (C) 2008 10gen Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License, version 3,
as published by the Free Software Foundation.
This program is distributed in the hope that it wil... | |
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
# Copyright 2013 Red Hat, Inc.
# Copyright (c) 2012 Rackspace Hosting
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use ... | |
#!/usr/local/bin/python
# tabview.py -- View a tab-delimited file in a spreadsheet-like display.
# Contributed by A.M. Kuchling <amk@amk.ca>
#
# The tab-delimited file is displayed on screen. The highlighted
# position is shown in the top-left corner of the screen; below it are
# shown the contents of that cell.
#
# ... | |
import sys, getopt, re, datetime
import xml.etree.ElementTree as etree
import yaml
from os import listdir, rename
from os.path import isdir, isfile, join, splitext, abspath, exists
# namespace for METS
NS = { 'METS' : 'http://www.loc.gov/METS/' }
RPT_LINES = []
HELP = '''\nSYNOPSIS
python3 reseqr.py -h -s -x -c... | |
"""Python library to enable Axis devices to integrate with Home Assistant."""
# PYTHON RTSP INSPIRATION
# https://github.com/timohoeting/python-mjpeg-over-rtsp-client/blob/master/rtsp_client.py
# https://github.com/perexg/satip-axe/blob/master/tools/multicast-rtp
import asyncio
from collections import deque
import lo... | |
# -*- coding: utf-8 -*-
from datetime import datetime
from dyn.compat import force_unicode
from dyn.tm.errors import DynectInvalidArgumentError
from dyn.tm.session import DynectSession
from dyn.tm.utils import APIList, Active, unix_date
__author__ = 'jnappi'
__all__ = ['get_all_dnssec', 'DNSSECKey', 'DNSSEC']
def g... | |
from datetime import datetime
from zeit.brightcove.convert import Video as BCVideo
from zeit.content.video.video import Video as CMSVideo
import mock
import pytz
import zeit.brightcove.testing
import zeit.cms.tagging.testing
import zeit.cms.testing
import zeit.content.video.playlist
class VideoTest(zeit.cms.testing.F... | |
from pandac.PandaModules import getConfigShowbase
from direct.directnotify.DirectNotifyGlobal import directNotify
from direct.showbase.PythonUtil import fastRepr
import sys
import types
import traceback
notify = directNotify.newCategory("ExceptionVarDump")
config = getConfigShowbase()
reentry = 0
def _varDump__init_... | |
from django.conf import settings
from django.core.urlresolvers import reverse
from django.contrib.gis.db import models
from django.contrib.gis.measure import D
from django.db.utils import IntegrityError
from django.template.defaultfilters import slugify
from django.utils.translation import ugettext_lazy as _
from djang... | |
'''
This package provides a function and a base class:
unify and AbstractSegmentation.
unify(data_sets, directory, size=None, segmentation_size=None, crop=False,
min_frequency=None, min_coverage=None, synonyms=None,
test_limit=None, single_process=False, verbose=False):
unify creates a stadnard fo... | |
from os.path import join
from datetime import datetime
from django.conf import settings
from django.db import models
from django.db.models import Q
from django.utils.translation import ugettext_lazy as _, get_language
from django.core.urlresolvers import reverse
from django.contrib.sites.models import Site
from django.... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Software License Agreement (BSD License)
#
# Copyright (c) 2014, Ocean Systems Laboratory, Heriot-Watt University, UK.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the follow... | |
# Copyright 2014 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.
"""Helper functions useful when writing scripts that integrate with GN.
The main functions are ToGNString and FromGNString which convert between
serialized ... | |
from __future__ import print_function, division
import inspect
from sympy.core.cache import cacheit
from sympy.core.singleton import S
from sympy.core.sympify import _sympify
from sympy.logic.boolalg import Boolean
from sympy.utilities.source import get_class
from contextlib import contextmanager
class AssumptionsC... | |
import logging
import json
import datetime
import pytz
from rdr_service.lib_fhir.fhirclient_1_0_6.models import fhirdate
from rdr_service.lib_fhir.fhirclient_1_0_6.models.backboneelement import BackboneElement
from rdr_service.lib_fhir.fhirclient_1_0_6.models.domainresource import DomainResource
from rdr_service.lib_fh... | |
# -*- coding: utf-8 -*-
# Copyright (C) 2012, Almar Klein
#
# Visvis is distributed under the terms of the (new) BSD License.
# The full license can be found in 'license.txt'.
""" Module baseFigure
Defines the AxisContainer and Axes classes, as well as the Legend class used
by the Axes.
"""
import OpenGL.GL as gl
... | |
"""QuizReports API Version 1.0.
This API client was generated using a template. Make sure this code is valid before using it.
"""
import logging
from datetime import date, datetime
from .base import BaseCanvasAPI
from .base import BaseModel
class QuizReportsAPI(BaseCanvasAPI):
"""QuizReports API Version 1.0."""
... | |
#!/usr/bin/python
#
# offcputime Summarize off-CPU time by stack trace
# For Linux, uses BCC, eBPF.
#
# USAGE: offcputime [-h] [-p PID | -u | -k] [-U | -K] [-f] [duration]
#
# Copyright 2016 Netflix, Inc.
# Licensed under the Apache License, Version 2.0 (the "License")
#
# 13-Jan-2016 Brendan Gregg Cre... | |
import collections
import ctypes
import re
import numpy as np
from numba.core import errors, types
from numba.core.typing.templates import signature
# re-export
from numba.core.cgutils import is_nonelike # noqa: F401
numpy_version = tuple(map(int, np.__version__.split('.')[:2]))
FROM_DTYPE = {
np.dtype('b... | |
# Copyright (c) 2012-2013, Mark Peek <mark@peek.org>
# All rights reserved.
#
# See LICENSE file for full license.
from . import AWSHelperFn, AWSObject, AWSProperty, FindInMap, Ref
from .validators import boolean, integer, integer_range, network_port
class Tag(AWSHelperFn):
def __init__(self, key, value):
... | |
# Copyright 2012 Big Switch 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.apache.org/licenses/LICENSE-2.0
#
# Unless... | |
# orm/descriptor_props.py
# Copyright (C) 2005-2014 the SQLAlchemy authors and contributors <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""Descriptor properties are more "auxiliary" properties
that exist as configu... | |
import os.path
import numpy as np
import numpy.ma as ma
from itertools import product
from utils import RNG, Stopwatch, print_inline, width_format
from metrics import accuracy_score
class TrainTestSplitter(object):
"""
A generic class for splitting data into (random) subsets.
Parameters
----------
... | |
'''
Created on Aug 16, 2016
@author: grastogi
'''
import unittest
from ansible.module_utils.network.avi.ansible_utils import \
cleanup_absent_fields, avi_obj_cmp
class TestAviApiUtils(unittest.TestCase):
def test_avi_obj_cmp(self):
obj = {'name': 'testpool'}
existing_obj = {
'lb_... | |
## statprof.py
## Copyright (C) 2012 Bryan O'Sullivan <bos@serpentine.com>
## Copyright (C) 2011 Alex Fraser <alex at phatcore dot com>
## Copyright (C) 2004,2005 Andy Wingo <wingo at pobox dot com>
## Copyright (C) 2001 Rob Browning <rlb at defaultvalue dot org>
## This library is free software; you can redistribute ... | |
from pandaepl import Model, MovingObject, Avatar, VideoLogQueue, Camera
from panda3d.core import Point3, TransparencyAttrib
from load_models import load_models, get_model
import moBananas as mB
import random
from sys import stdout
from math import sin, cos, radians
def check_repeat(trial_num, original_list):
# us... | |
# This program is public domain
# Author: Paul Kienzle
# Initial version: William Ratcliff
"""
ICP data reader.
summary(filename) - reads the header information
read(filename) - reads header information and data
"""
import numpy as N
import datetime,sys
# Try using precompiled matrix loader
print "*** icpformat 1... | |
import os
import oscar
# Path helper
location = lambda x: os.path.join(
os.path.dirname(os.path.realpath(__file__)), x)
DEBUG = os.environ.get('DEBUG', 'true') != 'false'
SQL_DEBUG = DEBUG
ALLOWED_HOSTS = [
'latest.oscarcommerce.com',
'master.oscarcommerce.com'
]
# This is needed for the hosted version... | |
#
# 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
# ... | |
# 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... | |
# Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | |
# Copyright (c) 2013 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Handle version information related to Visual Stuio."""
import errno
import os
import re
import subprocess
import sys
import gyp
import glob
def JoinPath(*arg... | |
# Copyright (c) 2015 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
#
# ... | |
# Copyright 2010 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... | |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import common.models.base
import django.db.models.deletion
import django.utils.timezone
from django.conf import settings
import common.fields
import uuid
class Migration(migrations.Migration):
dependencies =... | |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright 2015 clowwindy
#
# 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 b... | |
# Copyright 2013 IBM Corp.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agree... | |
# -*- coding: utf-8 -*-
# Copyright (C) 2014 Yahoo! 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... | |
#!/usr/bin/python
# Raspberry Pi and Sense Hat Stock Symbol Price Ticker
# A simple stock ticker price change monitor of today's positive or negative change using the Sense Hat
# Shows a red/green solid color 8x8 matrix up/down arrow and stock price ticker
import atexit
import datetime
import decimal
import errno
imp... | |
import random
import itertools
import numpy as np
import tensorflow as tf
from read_data import DataSet
from tensorflow.contrib.rnn import BasicLSTMCell
from tensorflow.python.ops.rnn import dynamic_rnn
from mytensorflow import get_initializer
from rnn import get_last_relevant_rnn_output, get_sequence_length
from n... | |
# coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..compat import (
compat_urllib_parse_urlparse,
)
from ..utils import (
ExtractorError,
int_or_none,
remove_end,
)
class NFLIE(InfoExtractor):
IE_NAME = 'nfl.com'
_VALID_URL = r'''(?x)
... | |
from peewee import *
from .base import DatabaseTestCase
from .base import IS_CRDB
from .base import IS_CRDB_NESTED_TX
from .base import IS_SQLITE
from .base import ModelTestCase
from .base import db
from .base import new_connection
from .base import skip_if
from .base import skip_unless
from .base_models import Regist... | |
import pytest
from graphene import Node
from saleor.checkout import calculations
from saleor.checkout.utils import add_variant_to_checkout
from saleor.payment import ChargeStatus, TransactionKind
from saleor.payment.models import Payment
from tests.api.utils import get_graphql_content
@pytest.fixture()
def checkout_... | |
# Copyright 2011 OpenStack Foundation
# Copyright 2011 Ilya Alekseyev
#
# 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
#
#... | |
'''
Created on April 8, 2015
@author: ehenneken
'''
from future import standard_library
standard_library.install_aliases()
from builtins import zip
from builtins import range
from flask import current_app, request
import sys
import time
import os
import urllib.request, urllib.parse, urllib.error
import itertools
#impo... | |
'''
Created on Mar 12, 2011
Based on XParser from May 19, 2005
XParser
@author: shkwok
'''
#from xparser import XNode
from . import XNode
from io import StringIO
from urllib2 import urlopen
''' XParser class
First, instantiate an object:
xparser = XParser ()
Then get input data from either a file openInputFile(... | |
#
# File: tests.py
# Purpose: test the python extensions for the video sequence reader/writer
# Author: Vlad Morariu
#
# Copyright (c) 2009-2013 Vlad Morariu
#
# 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 ... | |
"""
gdalinfo tests/gis_tests/data/rasters/raster.tif:
Driver: GTiff/GeoTIFF
Files: tests/gis_tests/data/rasters/raster.tif
Size is 163, 174
Coordinate System is:
PROJCS["NAD83 / Florida GDL Albers",
GEOGCS["NAD83",
DATUM["North_American_Datum_1983",
SPHEROID["GRS 1980",6378137,298.2572221010002... | |
#!/usr/bin/env python
#
# A library that provides a Python interface to the Telegram Bot API
# Copyright (C) 2015-2022
# Leandro Toledo de Souza <devs@python-telegram-bot.org>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser Public License as published by
#... | |
from typing import Iterable, Optional, Sequence, Union, cast
import pytz
from dateutil.parser import parse as dateparser
from django.core import validators
from django.core.exceptions import ValidationError
from django.http import HttpRequest, HttpResponse
from django.utils.timezone import now as timezone_now
from dja... | |
# Copyright (c) 2011 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 ... | |
# Copyright 2014 Hewlett-Packard Development Company, L.P.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2... | |
from __future__ import absolute_import
# Copyright (c) 2010-2017 openpyxl
import re
from openpyxl.compat import unicode
from openpyxl.descriptors.serialisable import Serialisable
from openpyxl.descriptors import (
Alias,
Typed,
Set,
Float,
DateTime,
NoneSet,
Bool,
Integer,
String,
... | |
# -*- coding: utf-8 -*-
from __future__ import print_function
from datetime import datetime, time
import numpy as np
import pytest
import pytz
from pandas.compat import PY2, product
import pandas as pd
from pandas import (
DataFrame, DatetimeIndex, Index, MultiIndex, Series, Timestamp, date_range,
period_r... | |
# 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... | |
# Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | |
# Copyright (c) Pymatgen Development Team.
# Distributed under the terms of the MIT License.
"""
Module implementing classes and functions to use Zeo++
by Maciej Haranczyk.
If using this module, cite the following paper on Zeo++:
T.F. Willems, C.H. Rycroft, M. Kazi, J.C. Meza, and M. Haranczyk,
Algorithms and tools f... | |
import pytest
from django.contrib.auth.models import Permission, Group
from core.models import Event, User
from pictures.models import StockPicture
from sponsor.models import Donor
@pytest.fixture(autouse=True)
def enable_db_access_for_all_tests(db):
pass
@pytest.fixture()
def user(db, django_user_model, djan... | |
"""This nodule defines helper functions to deal with native calls."""
import hashlib
import logging
from typing import List, Union
from ethereum.utils import ecrecover_to_pub
from py_ecc.secp256k1 import N as secp256k1n
import py_ecc.optimized_bn128 as bn128
from rlp.utils import ALL_BYTES
from mythril.laser.ethereu... | |
# -*- test-case-name: twisted.web.test.test_xml -*-
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Micro Document Object Model: a partial DOM implementation with SUX.
This is an implementation of what we consider to be the useful subset of the
DOM. The chief advantage of this library is ... | |
import json
import datetime
from django.core.urlresolvers import reverse
from django.http import Http404, HttpResponse
from django.shortcuts import render, get_object_or_404, redirect
from django.template import loader, Context
from django.contrib.sites.models import Site
from django.contrib.auth.decorators import lo... | |
#!/usr/bin/python
# -*- coding: UTF-8 -*-
# Copyright 2016, 2015, 2014, 2013, 2012 Pavel Kostelnik
# Copyright 2017, 2018 Michael Schwager
# 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 Lice... | |
import unittest
import responses
import json as json
import consulalerting.plugins as plugins
import consulalerting.settings as settings
import consulalerting.utilities as utilities
import consulalerting.ConsulHealthStruct as ConsulHealthStruct
from mock import patch, MagicMock, Mock
from requests import HTTPError
AL... | |
import logging
from urllib.parse import urljoin
import requests
from moneybird.authentication import Authentication
VERSION = '0.1.3'
logger = logging.getLogger('moneybird')
class MoneyBird(object):
"""
Client for the MoneyBird API.
:param authentication: The authentication method to use.
"""
... | |
"""
Support for Denon Network Receivers.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/media_player.denon/
"""
import logging
import telnetlib
import voluptuous as vol
from homeassistant.components.media_player import (
PLATFORM_SCHEMA, SUPPORT_NE... | |
from __future__ import print_function, division
from sympy.core.add import Add
from sympy.core.expr import Expr
from sympy.core.mul import Mul
from sympy.core.relational import Equality
from sympy.sets.sets import Interval
from sympy.core.singleton import S
from sympy.core.symbol import Symbol
from sympy.core.sympify ... | |
# 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... | |
'''
This module contains high-level functions and classes useful for solving a wide variety of
economic models.
'''
from HARKutilities import getArgNames, NullFunc
from copy import deepcopy
import numpy as np
#PNG addition 2016-06-30
from __main__ import settings
def distanceMetric(thing_A,thing_B):
'''
A ... | |
import collections
import copy
import hashlib
import os
import pathlib
import shutil
import subprocess
import tempfile
import yaml
from supriya import (
BinaryOperator,
CalculationRate,
ParameterRate,
UnaryOperator,
sclang,
)
from supriya.system import SupriyaObject
from .bases import BinaryOpUGe... | |
###################################################
# ldp python module (ldp.py)
# use: import ldp (in your script)
# A set of functions to make it easier to interface
# with Embedded Adventures' 80x8 led matrix LDP-8008
# By Pete Goss 14/1/2014
###################################################
# connect Raspberry P... | |
# Copyright 2020 The StackStorm Authors.
# Copyright 2019 Extreme Networks, 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 ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.