gt stringclasses 1
value | context stringlengths 2.49k 119k |
|---|---|
# -*- coding: utf-8 -*-
"""
unit tests for misc module
"""
from .client_test import _mocked_session
import unittest
import json
import requests_mock
from nose.tools import raises
from datetime import timedelta
from tests import skipIfPYpy, using_pypy
import warnings
if not using_pypy:
import pandas as pd
from... | |
"""Profile Command-Line Utilities for DP.LA Service Hub Aggregator Feed"""
__author__ = "Jeremy Nelson, Mike Stabile"
__author__ = "Jeremy Nelson"
import csv
import datetime
import logging
import os
import uuid
import sys
import click
import rdflib
import requests
PROJECT_BASE = os.path.abspath(os.path.dirname(__f... | |
import pytest
from boltons.dictutils import OMD
from boltons.iterutils import (first,
remap,
default_enter,
default_exit,
get_path)
from boltons.namedutils import namedtuple
isbool = lambda x:... | |
#!/usr/bin/env python
import json
import logging
import time
import unittest
import urllib
import urllib2
import MySQLdb
from vtproto import topodata_pb2
import environment
import utils
import tablet
from mysql_flavor import mysql_flavor
from protocols_flavor import protocols_flavor
tablet_62344 = tablet.Tablet(62... | |
# This file is part of Peach-Py package and is licensed under the Simplified BSD license.
# See license.rst for the full text of the license.
def optional_rex(r, rm, force_rex=False):
assert r in {0, 1}, "REX.R must be 0 or 1"
from peachpy.x86_64.operand import MemoryAddress
from peachpy.x86_64.registe... | |
#!/usr/bin/python
# Written by Andrea Kahn & Emily Silgard
# Last updated Aug. 15, 2014
'''
This module contains a Date class (a wrapper for python's datetime class that takes into account the possibility of fuzzy dates), as well as methods for the processing of date expressions in text.
'''
import logging
import re... | |
# -*- coding: UTF-8 -*-
# pylint: disable=protected-access
import unittest
from datetime import date, time
from landscape.finance import database, dates
from landscape.finance.quotes import futures
TEST_DB_NAME = 'test.db'
class BaseFuturesTestCase(unittest.TestCase):
def setUp(self):
database.drop_db... | |
# -*- coding: utf-8 -*-
import unittest
import datetime
import random
import authorize
from dateutil.relativedelta import relativedelta
from decimal import Decimal
from trytond.tests.test_tryton import (
USER, CONTEXT, POOL,
ModuleTestCase, with_transaction
)
import trytond.tests.test_tryton
from trytond.trans... | |
# Copyright 2016 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 agre... | |
import logging
from functools import total_ordering
from typing import Tuple, NamedTuple, Dict, Callable, Set, Any, List
import numpy
import itertools
from decimal import Decimal
from datetime import datetime
import json
import pandas
class QuoteEncoder(json.JSONEncoder):
def default(self, o):
if isinst... | |
# Copyright 2014: Mirantis 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 b... | |
# MIT License
# Copyright (c) 2017 MassChallenge, Inc.
from django.urls import reverse
from impact.v0.api_data.startup_list_data import StartupListData as Data
from impact.tests.api_test_case import APITestCase
from impact.tests.factories import (
IndustryFactory,
ProgramFactory,
ProgramStartupStatusFacto... | |
# -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2015-2018 CERN.
#
# Invenio is free software; you can redistribute it and/or modify it
# under the terms of the MIT License; see LICENSE file for more details.
"""Module tests."""
import time
from cachelib import RedisCache, SimpleCache
from f... | |
# Copyright (c) 2009-2010, Cloud Matrix Pty. Ltd.
# All rights reserved; available under the terms of the BSD License.
"""
esky.util: misc utility functions for esky
"""
from __future__ import with_statement
from __future__ import absolute_import
import sys
import errno
LOCAL_HTTP_PORT = 8000
# Since esky ap... | |
#encoding:utf-8
from __future__ import unicode_literals
from django import forms
from django.utils.translation import ugettext_lazy as _
from django.contrib.auth import authenticate
from userena import settings as userena_settings
from userena.compat import sha_constructor
from userena.models import UserenaSignup
fro... | |
# 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... | |
from __future__ import unicode_literals
import os
import pkgutil
import sys
from collections import OrderedDict, defaultdict
from importlib import import_module
import django
from django.apps import apps
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.core.manageme... | |
#!/usr/bin/env python
import ray
from ray import tune
from ray.tune.schedulers import PopulationBasedTraining
from ray.tune.trial import ExportFormat
import argparse
import os
from filelock import FileLock
import random
import torch
import torch.nn as nn
import torch.nn.parallel
import torch.optim as optim
import tor... | |
# Copyright 2015 Google Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | |
# encoding: utf-8
"""Unit test suite for docx.image.jpeg module"""
from __future__ import absolute_import, print_function
import pytest
from docx.compat import BytesIO
from docx.image.constants import JPEG_MARKER_CODE, MIME_TYPE
from docx.image.helpers import BIG_ENDIAN, StreamReader
from docx.image.jpeg import (
... | |
import os
import sys
import PIL.Image
import hashlib
from _version import __version__
from datetime import datetime
from app import app, basic_auth, db
from forms import AlbumAuthenticateForm, CreateAlbumForm, EditAlbumForm
from flask import redirect, request, render_template, session, Response, abort, url_for
from wer... | |
# Copyright (c) 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 ... | |
#!/usr/bin/env python
# -*- coding: utf8 -*-
__version__ = '$Id: schema_pg.py 3307 2017-11-29 06:18:57Z mn $'
# export PostgreSQL schema to text
# usable to compare databases that should be the same
#
# PostgreSQL schema info:
# http://www.alberton.info/postgresql_meta_info.html
#
# https://code.activestate.com/recipe... | |
# Copyright 2011 James McCauley
# Copyright 2008 (C) Nicira, 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 ap... | |
from .optimizer import Optimizer
import numpy as np
import time
import sys
from multiprocessing import Pool
class ParticleVector2SGD(Optimizer):
"""
Stochastic gradient descent optimization for Particle Vector networks
"""
def __init__(self, alpha=0.01, beta=0.0, gamma=0.9, n_epochs=1, mini_batch_s... | |
#!/usr/bin/env python
#
# Copyright (c) Greenplum Inc 2010. All Rights Reserved.
#
from gppylib.commands.base import *
from gppylib.commands.gp import *
from optparse import Option, OptionGroup, OptionParser, OptionValueError, SUPPRESS_USAGE
from time import strftime, sleep
import bisect
import copy
import datetime
im... | |
import datetime
from django.db import models
from django.db.models.signals import post_save
from django.dispatch import receiver
from django.urls import reverse
from django.utils.text import slugify
from fastly.utils import purge_url
from markupfield.fields import MarkupField
from users.models import User
class El... | |
# 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 2014 ETH Zurich
#
# 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, sof... | |
<<<<<<< HEAD
<<<<<<< HEAD
"""Something just to look at via pydoc."""
import types
class A_classic:
"A classic class."
def A_method(self):
"Method defined in A."
def AB_method(self):
"Method defined in A and B."
def AC_method(self):
"Method defined in A and C."
def AD_method... | |
import inspect
import re
import sys
import types
from pythoscope.compat import any
from pythoscope.util import compact, get_self_from_method
from bytecode_tracer import BytecodeTracer, rewrite_function,\
has_been_rewritten, rewrite_lnotab, code_rewriting_importer
# Pythons <= 2.4 surround `exec`uted code with a... | |
######################################
## PyStory Storyboard Manager ##
## commands.py ##
## Copyright 2012 Michael D. Reiley ##
######################################
## **********
## Permission is hereby granted, free of charge, to any person obtaining a copy
## of this software and assoc... | |
# coding: utf-8
"""
Cloudbreak API
Cloudbreak is a powerful left surf that breaks over a coral reef, a mile off southwest the island of Tavarua, Fiji. Cloudbreak is a cloud agnostic Hadoop as a Service API. Abstracts the provisioning and ease management and monitoring of on-demand clusters. SequenceIQ's Cloud... | |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'Student_Main_Window.ui'
#
# Created by: PyQt4 UI code generator 4.11.4
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
try:
_fromUtf8 = QtCore.QString.fromUtf8
except AttributeError:
def _fr... | |
from __future__ import absolute_import
import sys
if sys.version_info[0] != 2:
import queue
from itertools import zip_longest
else:
# 3.x renames
from itertools import izip_longest as zip_longest
import Queue as queue
import MySQLdb as mysql
from MySQLdb.cursors import DictCursor
from .database im... | |
# Copyright 2013 - Mirantis, Inc.
# Copyright 2015 - StackStorm, 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... | |
"""
homeassistant.components.light.hue
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Support for Hue lights.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/light.hue/
"""
import json
import logging
import os
import socket
from datetime import timedelta
from urllib.... | |
# Copyright (c) 2014 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 ... | |
# NOTE: parts of this file were taken from scipy's doc/source/conf.py. See
# scikit-bio/licenses/scipy.txt for scipy's license.
import glob
import sys
import os
import re
import datetime
# Force matplotlib to not use any Xwindows backend.
import matplotlib
matplotlib.use('Agg')
import sphinx
import sphinx.ext.autosu... | |
'''
Copyright (c) 2016, Battelle Memorial Institute
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. Redistributions of source code must retain the above copyright notice, this
list of conditions a... | |
#
# Copyright (c) SAS Institute Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in w... | |
#!/usr/bin/python3
#
# Copyright (C) 2010, 2011, 2012, 2013 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:
#
# 1. Redistributions of source code must retain the above copyright not... | |
# -*- test-case-name: txweb2.test.test_metafd -*-
##
# Copyright (c) 2011-2014 Apple Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licens... | |
__author__ = 'sstober'
import logging
log = logging.getLogger(__name__)
import os
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.gridspec as gridspec
import mne
from mne.io import read_raw_edf
from mne.channels import rename_channels
from mne.preprocessing import ICA, read_ica
from mne.viz.top... | |
# Copyright 2012 VMware, Inc.
#
# All Rights Reserved
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | |
"""Base Command class, and related routines"""
import sys
import os
import socket
import urllib2
import urllib
from cStringIO import StringIO
import traceback
import time
from pip.log import logger
from pip.baseparser import parser, ConfigOptionParser, UpdatingDefaultsHelpFormatter
from pip.exceptions import Installat... | |
# Copyright 2013 Intel 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 require... | |
#+
# Copyright 2015 iXsystems, Inc.
# All rights reserved
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted providing that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and t... | |
import urllib
import random
import io
import discord
import wap
from PIL import Image, ImageDraw, ImageFont
from xml.etree import ElementTree
from jshbot import utilities, data, configurations, plugins, logger
from jshbot.exceptions import ConfiguredBotException
from jshbot.commands import (
Command, SubCommand,... | |
# -*- coding: utf-8 -*-
# Generated by Django 1.9.5 on 2016-05-02 07:45
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
('image', '0001_initial'),
('manag... | |
# Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | |
# Copyright 2014
# The Cloudscaling Group, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | |
"""Small plotting-related utility functions."""
from __future__ import division
import colorsys
import warnings
import numpy as np
from scipy import stats
import pandas as pd
import matplotlib.colors as mplcol
import matplotlib.pyplot as plt
from distutils.version import LooseVersion
pandas_has_categoricals = LooseVe... | |
from __future__ import absolute_import, division, print_function
import pytest
pd = pytest.importorskip('pandas')
import pandas.util.testing as tm
import numpy as np
import dask.array as da
import dask.dataframe as dd
from dask.dataframe.utils import assert_eq
_BASE_UFUNCS = ['conj', 'exp', 'log', 'log2', 'log10',... | |
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
import frappe
from frappe import _
from frappe.boot import get_allowed_pages
@frappe.whitelist()
def get(module):
"""Returns data (sections, list of reports, counts) to render m... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Utility functions."""
import numpy as np
import pickle
from PIL import Image
import os
import logging
import scipy
import scipy.misc
import sys
import pkg_resources
import json
import imp
def make_equal(features, ys):
"""Make sure the classes are equally distribu... | |
""" report test results in JUnit-XML format, for use with Hudson and build integration servers.
Output conforms to https://github.com/jenkinsci/xunit-plugin/blob/master/src/main/resources/org/jenkinsci/plugins/xunit/types/model/xsd/junit-10.xsd
Based on initial code from Ross Lawley.
"""
import py
import os
import re... | |
"""Adds support for generic thermostat units."""
import asyncio
import logging
import math
import voluptuous as vol
from homeassistant.components.climate import PLATFORM_SCHEMA, ClimateEntity
from homeassistant.components.climate.const import (
ATTR_PRESET_MODE,
CURRENT_HVAC_COOL,
CURRENT_HVAC_HEAT,
C... | |
"""This pipeline removes any need for the database backend
but does not support that additional functionality"""
# Copyright (C) 2014 Taylor Turpen
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundat... | |
# encoding: utf-8
# pylint:disable=too-many-arguments
"""A comparison proxy and Ops factory to help build nested inquiries.
For internal construction only.
"""
from __future__ import unicode_literals
from copy import copy
from collections import Iterable
from functools import reduce
from operator import __and__, __... | |
# -*- coding: utf-8 -*-
from operator import attrgetter
from django.core.exceptions import ImproperlyConfigured
from django.conf.urls import url, patterns, include
from django.contrib.formtools.wizard.views import normalize_name
from django.db.models import signals
from django.template.defaultfilters import slugify
fr... | |
# Copyright 2013, Big Switch 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 page
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... | |
#!/usr/bin/env python
import os
try:
__IPYTHON__
import sys
del sys.argv[1:]
except:
pass
import srwl_bl
import srwlib
import srwlpy
import math
import srwl_uti_smp
def set_optics(v, names=None, want_final_propagation=True):
el = []
pp = []
if not names:
names = ['CRL', 'CRL_Watchp... | |
# 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 ... | |
"""Test the Vultr switch platform."""
import unittest
import requests_mock
import pytest
import voluptuous as vol
from components.switch import vultr
from components import vultr as base_vultr
from components.vultr import (
ATTR_ALLOWED_BANDWIDTH, ATTR_AUTO_BACKUPS, ATTR_IPV4_ADDRESS,
ATTR_COST_PER_MONTH, ATTR... | |
from __future__ import division
from __future__ import unicode_literals
from __future__ import print_function
from __future__ import absolute_import
# Standard imports
from future import standard_library
standard_library.install_aliases()
from builtins import *
from past.utils import old_div
import logging
from datetim... | |
"""
Tests for correlation operations
"""
from unittest import TestCase
import numpy as np
import xarray as xr
import pandas as pd
from scipy.stats import pearsonr
from cate.ops.correlation import pearson_correlation_scalar, pearson_correlation
from ..util.test_monitor import RecordingMonitor
class TestPearsonScala... | |
"""
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, software
distrib... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from abc import ABCMeta, abstractmethod
from collections.abc import Iterable, Iterator, Sequence
from operator import itemgetter
import re
import numpy as np
class Tokenizer(metaclass=ABCMeta):
@abstractmethod
def tokenize(self, document):
raise NotImpl... | |
import itertools
import novaclient.exceptions
import os
import paramiko
import pprint
import socket
import sys
import time
import yaml
from novaclient.v1_1 import client
from config import get_config
from parser import get_parser
class Devstork(object):
def __init__(self, config):
"""
Inits the... | |
import pytest
import pytz
import numpy as np
from datetime import datetime, date, timedelta
import pandas as pd
import pandas.util.testing as tm
import pandas.core.indexes.period as period
from pandas.compat import text_type, iteritems
from pandas.compat.numpy import np_datetime64_compat
from pandas._libs import tsl... | |
"""Test the Foscam config flow."""
from unittest.mock import patch
from libpyfoscam.foscam import (
ERROR_FOSCAM_AUTH,
ERROR_FOSCAM_CMD,
ERROR_FOSCAM_UNAVAILABLE,
ERROR_FOSCAM_UNKNOWN,
)
from homeassistant import config_entries, data_entry_flow, setup
from homeassistant.components.foscam import config... | |
# Modified work:
# -----------------------------------------------------------------------------
# Copyright (c) 2015 Preferred Infrastructure, Inc.
# Copyright (c) 2015 Preferred Networks, Inc.
# -----------------------------------------------------------------------------
# Original work of _roi_pooling_slice, forwa... | |
"""
ERP analysis EEG submodule.
"""
from .eeg_data import eeg_select_electrodes
from .eeg_data import eeg_to_df
from .eeg_data import eeg_to_all_evokeds
import numpy as np
import pandas as pd
import mne
# ==============================================================================
# ============================... | |
# -*- coding: utf-8 -*-
# File: training.py
import copy
import pprint
import re
from abc import ABCMeta, abstractmethod
from contextlib import contextmanager
import six
import tensorflow as tf
from ..compat import tfv1
from ..tfutils.common import get_tf_version_tuple
from ..tfutils.gradproc import ScaleGradient
from... | |
import pytest
from flex.constants import (
OBJECT,
STRING,
INTEGER,
)
from flex.error_messages import MESSAGES
from flex.exceptions import ValidationError
from flex.loading.definitions.schema import schema_validator
from tests.utils import (
assert_path_not_in_errors,
assert_message_in_errors,
)
... | |
# 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... | |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# This file is part of pyunicorn.
# Copyright (C) 2008--2015 Jonathan F. Donges and pyunicorn authors
# URL: <http://www.pik-potsdam.de/members/donges/software>
# License: BSD (3-clause)
"""
Provides classes for analyzing spatially embedded complex networks, handling
multiva... | |
# Copyright 2018 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 -*-
"""
Copyright (c) 2015, Jairus Martin.
Distributed under the terms of the MIT License.
The full license is in the file COPYING.txt, distributed with this software.
Created on Aug 28, 2015
"""
from atom.api import Typed, Instance, Int
from enaml.application import timed_call
from qtpy.QtWidgets i... | |
import IPython
import numpy as np
import os
import time
from shutil import copyfile
from influence.inceptionModel import BinaryInceptionModel
from influence.binaryLogisticRegressionWithLBFGS import BinaryLogisticRegressionWithLBFGS
import influence.experiments
from influence.dataset import DataSet
import tensorflow ... | |
"""Support for Netgear LTE modems."""
import asyncio
from datetime import timedelta
import logging
from typing import Final
import aiohttp
import attr
import eternalegypt
import voluptuous as vol
from homeassistant.const import (
CONF_HOST,
CONF_MONITORED_CONDITIONS,
CONF_NAME,
CONF_PASSWORD,
CONF... | |
import py
from rpython.rtyper.lltypesystem import lltype, llmemory
from rpython.rtyper.lltypesystem.llarena import (arena_malloc, arena_reset,
arena_reserve, arena_free, round_up_for_allocation, ArenaError,
arena_new_view, arena_shrink_obj, arena_protect, has_protect)
from rpython.rtyper.lltypesystem.llmemory ... | |
#!/usr/bin/env vpython
# Copyright 2020 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 mock
import os
import shutil
import tempfile
import unittest
import merge_js_lib as merger
class MergeJSLibTest(unittest.Tes... | |
"""Test Times of the Day Binary Sensor."""
from datetime import datetime, timedelta
from unittest.mock import patch
import pytest
from homeassistant.const import STATE_OFF, STATE_ON
import homeassistant.core as ha
from homeassistant.helpers.sun import get_astral_event_date, get_astral_event_next
from homeassistant.se... | |
from __future__ import absolute_import
import six
from sentry.integrations.example.integration import AliasedIntegrationProvider
from sentry.models import (
ExternalIssue,
Group,
GroupStatus,
GroupLink,
Integration,
OrganizationIntegration,
)
from sentry.testutils import TestCase
class Issue... | |
# -*- coding: utf-8 -*-
'''
Production Configurations
- Use djangosecure
- Use Amazon's S3 for storing static files and uploaded media
- Use mailgun to send emails
- Use Redis on Heroku
- Use sentry for error logging
- Use opbeat for error reporting
'''
from __future__ import absolute_import, unicode_literals
fro... | |
#
# randpool.py : Cryptographically strong random number generation
#
# Part of the Python Cryptography Toolkit
#
# Distribute and use freely; there are no restrictions on further
# dissemination and usage except those imposed by the laws of your
# country of residence. This software is provided "as is" without
# war... | |
import logging
from dateutil import parser
from django.core.validators import MaxValueValidator, MinValueValidator
from django.contrib.postgres.fields import ArrayField
from django.db import connection, models
from django.db.models import Count, Q
from django.urls import reverse
from django.utils.crypto import get_rand... | |
#!/usr/bin/env python
import sys
import re
import pprint
import os
try:
import boto.ec2
except ImportError, e:
print "Missing boto module. Install with: sudo pip install boto"
print "If you don't have pip, do this first: sudo easy_install pip"
exit(2)
try:
import requests
except ImportError, e:
... | |
"""Micropayment channel API for a lightning node.
Interface:
API -- the Blueprint returned by serverutil.api_factory
CHANNEL_OPENED -- a blinker signal sent when a channel is opened.
Arguments:
- address -- the url of the counterparty
init(conf) - Set up the database
create(url, mymoney, theirmoney)
- Open a channel... | |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright 2015 clowwindy
# Copyright 2016 Howard Liu
#
# 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/LICEN... | |
#!/usr/bin/env python
#
# Copyright (c) 2016 Alexander Lokhman <alex.lokhman@gmail.com>
#
# 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... | |
# Copyright (c) 2010-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 agree... | |
#!/usr/bin/env python
import xml.etree.ElementTree as ET
class brocade_port_profile(object):
"""Auto generated class.
"""
def __init__(self, **kwargs):
self._callback = kwargs.pop('callback')
def port_profile_name(self, **kwargs):
"""Auto Generated Code
"""
... | |
"""Support for Yamaha Receivers."""
import logging
import requests
import rxv
import voluptuous as vol
from homeassistant.components.media_player import PLATFORM_SCHEMA, MediaPlayerEntity
from homeassistant.components.media_player.const import (
MEDIA_TYPE_MUSIC,
SUPPORT_NEXT_TRACK,
SUPPORT_PAUSE,
SUP... | |
# Copyright (c) 2013-2019 Philip Hane
# 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. Redistributions of source code must retain the above copyright notice,
# this list of conditions and... | |
# *****************************************************************************
# Copyright (c) 2020, 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 sou... | |
"""
Remote control for Cozmo
============================
Based on remote_control_cozmo.py for cozmo SDK:
https://developer.anki.com
Created by: Anki
Edited by: GrinningHermit
Code from example file is separated in 2 functionalities:
- viewer / robot camera
- keyboard command handling <-- this is where you are
==... | |
# -*- coding: utf-8 -*-
from vilya.libs import api_errors
from vilya.libs.text import get_mentions_from_text
from vilya.models.project import CodeDoubanProject
from vilya.models.pull import PullRequest, add_pull, merge_pull, close_pull
from vilya.models.ticket import Ticket
from vilya.models.consts import LINECOMMENT_... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.