gt stringclasses 1
value | context stringlengths 2.49k 119k |
|---|---|
# Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by app... | |
"""
Unit tests for lib/sqlcompare.py
test_lib_sqlcompare.py
Ken Kinder
2005-03-17
"""
from testing_common import *
import sqlcompare, MySQLdb
class TestSqlCompare(unittest.TestCase):
def setUp(self):
cnx = MySQLdb.connect(user='root', passwd='z0t0123')
c = cnx.cursor()
c.execute('drop database if exists unitt... | |
# Romulus.py
#
SYSTEM_STATES = [
'BASE_APPS',
'BMC_STARTING',
'BMC_READY',
'HOST_POWERING_ON',
'HOST_POWERED_ON',
'HOST_BOOTING',
'HOST_BOOTED',
'HOST_POWERED_OFF',
]
EXIT_STATE_DEPEND = {
'BASE_APPS': {
'/org/openbmc/sensors': 0,
},
'BMC_STARTING': {
'/org/... | |
from __future__ import division, print_function, absolute_import
import os
import time
import inspect
import json
import traceback
from collections import defaultdict, OrderedDict
import numpy as np
try:
import scipy.optimize
from scipy.optimize.optimize import rosen, rosen_der, rosen_hess
from scipy.opt... | |
# 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... | |
from functools import wraps
from threepio import logger
from django.utils import timezone
from rest_framework import exceptions, status
from rest_framework.decorators import detail_route
from rest_framework.exceptions import ValidationError
from rest_framework.response import Response
from rest_framework.viewsets impo... | |
# @(#)root/pyroot:$Id$
# Author: Wim Lavrijsen (WLavrijsen@lbl.gov)
# Created: 02/20/03
# Last: 11/17/14
"""PyROOT user module.
o) install lazy ROOT class/variable lookup as appropriate
o) feed gSystem and gInterpreter for display updates
o) add readline completion (if supported by python build)
o) enable some R... | |
# -*- coding: utf-8 -*-
"""
tmdbsimple.people
~~~~~~~~~~~~~~~~~
This module implements the People, Credits, and Jobs functionality
of tmdbsimple.
Created by Celia Oakley on 2013-10-31.
:copyright: (c) 2013-2017 by Celia Oakley
:license: GPLv3, see LICENSE for more details
"""
from .base import TMDB
class People(T... | |
#!/usr/bin/env python
from __future__ import print_function
import argparse
import io
import os
import platform
import re
import subprocess
import sys
class TestFailedError(Exception):
pass
def escapeCmdArg(arg):
if '"' in arg or ' ' in arg:
return '"%s"' % arg.replace('"', '\\"')
else:
... | |
import numpy as np
import tensorflow as tf
from tfsnippet.utils import (add_name_arg_doc, get_static_shape, concat_shapes,
get_shape, is_tensor_object, assert_deps,
InputSpec)
from .control_flows import smart_cond
from .assertions import assert_rank, assert_ran... | |
"""
The :mod:`sklearn.utils` module includes various utilities.
"""
from collections import Sequence
import numpy as np
from scipy.sparse import issparse
import warnings
from .murmurhash import murmurhash3_32
from .validation import (as_float_array,
assert_all_finite,
... | |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
operations = [
migrations.Create... | |
"""
This file is part of the everest project.
See LICENSE.txt for licensing, CONTRIBUTORS.txt for contributor information.
Created on Jun 1, 2012.
"""
from pyramid.compat import urlparse
import pytest
from everest.resources.utils import resource_to_url
from everest.resources.utils import url_to_resource
from everest.... | |
# -*- coding: utf-8 -*-
import inspect
import json
from unittest import TestCase
from requests import Session, Response
from mock import Mock, patch
from six import itervalues
from demands import HTTPServiceClient, HTTPServiceError
class PatchedSessionTests(TestCase):
def setUp(self):
# must patch inspe... | |
"""Base and mixin classes for nearest neighbors."""
# Authors: Jake Vanderplas <vanderplas@astro.washington.edu>
# Fabian Pedregosa <fabian.pedregosa@inria.fr>
# Alexandre Gramfort <alexandre.gramfort@inria.fr>
# Sparseness support by Lars Buitinck
# Multi-output support by Arnaud Jo... | |
import unittest
from six import BytesIO
from iterparse.parser import iterparse
from lxml.etree import XMLSyntaxError
class Iterparse(unittest.TestCase):
def assertElement(
self, element, name, text=None, num_children=0, num_attrib=0,
):
self.assertEqual(element.tag, name)
self.assertEq... | |
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
import grpc
from google.cloud.bigquery_datatransfer_v1.proto import (
datatransfer_pb2 as google_dot_cloud_dot_bigquery_dot_datatransfer__v1_dot_proto_dot_datatransfer__pb2,
)
from google.cloud.bigquery_datatransfer_v1.proto import (
transfe... | |
from __future__ import division
# PyQT4 imports
from PyQt4 import QtGui, QtCore, QtOpenGL
from PyQt4.QtOpenGL import QGLWidget
# PyOpenGL imports
import OpenGL.GL as gl
import OpenGL.arrays.vbo as glvbo
from random import choice, randint
import numpy
import wave
from math import sin
from instruments import *
impo... | |
##########
### Game logic for actually running a game
##########
from uuid import uuid4
import random
from copy import copy, deepcopy
import communication
import config
from bottle import abort
import thread
from threading import Timer
import pusher
import time
pusher.app_id = config.PUSHER_APP_ID
pusher.key = con... | |
#!/usr/bin/env python3
import argparse
import re
from biocode import utils, gff, things
"""
Example with a match extending far past a gene
DEBUG: g8713.t1:(3529) overlaps (size:2893) nucleotide_to_protein_match.158742:(6245), match target id:jgi|Copci1|10482|CC1G_12482T0, length:1764
mRNA % cov: 81.97789742136582
... | |
from sympy.core.backend import (S, sympify, expand, sqrt, Add, zeros,
ImmutableMatrix as Matrix)
from sympy import trigsimp
from sympy.core.compatibility import unicode
from sympy.utilities.misc import filldedent
__all__ = ['Vector']
class Vector(object):
"""The class used to define vectors.
It along wi... | |
# -*- coding: utf-8 -*-
from __future__ import print_function
import argparse
import copy
import errno
import os
from os.path import join, isdir
import sys
try:
try:
from inspect import signature
except ImportError:
from funcsigs import signature
from jupyter_core.paths import jupyter_conf... | |
"""Script to set up test data for a Kvoti instance.
As before we tried to do this with migrations but ran into problems
early on with custom permissions not being created.
In any case, it's probably easier/better to have a single bootstrap
script instead of a bunch of data migrations.
"""
# Must install config and s... | |
"""
sentry.search.django.backend
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:copyright: (c) 2010-2014 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from __future__ import absolute_import
import six
from django.db import router
from django.db.models import Q
from sentry.api.pag... | |
import functools
from operator import mul
import numpy
import six
import chainer
from chainer.backends import cuda
from chainer import configuration
from chainer import function_node
from chainer.functions.pooling import max_pooling_nd_kernel
from chainer.functions.pooling import pooling_nd
from chainer.utils import ... | |
# -*- coding: utf-8 -*-
# Copyright (C) 2012, Almar Klein, Ant1, Marius van Voorden
#
# This code is subject to the (new) BSD license:
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of s... | |
'''ARMA process and estimation with scipy.signal.lfilter
2009-09-06: copied from try_signal.py
reparameterized same as signal.lfilter (positive coefficients)
Notes
-----
* pretty fast
* checked with Monte Carlo and cross comparison with statsmodels yule_walker
for AR numbers are close but not identical to yule... | |
"""
:Author: Jonathan Karr <jonrkarr@gmail.com>
:Date: 2017-05-08
:Copyright: 2017, Karr Lab
:License: MIT
"""
import abc
import datanator.config
import os
import requests
import requests_cache
import shutil
import sqlalchemy
import sqlalchemy.orm
from sqlalchemy_utils.functions import database_exists, create_database... | |
#! /usr/bin/env python
# Copyright (c) 2015 Samuel Merritt <sam@swiftstack.com>
#
# 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 re... | |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
# -*- coding: utf-8 -*-
"""Functions for computing the model, objective function, etc.
"""
#
from __future__ import (absolute_import, division, print_function,
unicode_literals)
import numpy as np
def model(p, t):
"""The model... | |
import json
import os
from datetime import datetime
from moto.core import ACCOUNT_ID, BaseBackend, BaseModel, CloudFormationModel
from moto.core.exceptions import RESTError
from moto.core.utils import BackendDict
from moto.sagemaker import validators
from moto.utilities.paginator import paginate
from .exceptions import... | |
# -*- coding: utf-8 -*-
from __future__ import absolute_import
import copy
from datetime import datetime
from splash.har.log import HarLog
from splash.har.utils import format_datetime, get_duration, cleaned_har_entry
from splash.har.qt import request2har, reply2har
class HarBuilder(object):
"""
Splash-specif... | |
"""Widget showing an image."""
from typing import Optional, Union
from kivy.properties import ObjectProperty, NumericProperty, AliasProperty
from kivy.graphics import Rectangle, Color, Rotate, Scale
from mpfmc.uix.widget import Widget
MYPY = False
if MYPY: # pragma: no cover
from mpfmc.core.mc import MpfMc ... | |
#!/usr/bin/env python
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# suppressions.py
"""Post-process Valgrind suppression matcher.
Suppressions are defined as follows:
# optional one-line comment... | |
"""
The :mod:`sklearn.metrics.pairwise` submodule implements utilities to evaluate
pairwise distances or affinity of sets of samples.
This module contains both distance metrics and kernels. A brief summary is
given on the two here.
Distance metrics are a function d(a, b) such that d(a, b) < d(a, c) if objects
a and b... | |
from jsonrpc import ServiceProxy
import sys
import string
# ===== BEGIN USER SETTINGS =====
# if you do not set these you will be prompted for a password for every command
rpcuser = ""
rpcpass = ""
# ====== END USER SETTINGS ======
if rpcpass == "":
access = ServiceProxy("http://127.0.0.1:5888")
else:
access = Ser... | |
from collections.abc import Mapping
import os
import numpy as np
import pytest
import openmc
import openmc.exceptions as exc
import openmc.capi
from tests import cdtemp
@pytest.fixture(scope='module')
def pincell_model():
"""Set up a model to test with and delete files when done"""
openmc.reset_auto_ids()
... | |
# coding=utf-8
from __future__ import absolute_import, division, print_function, \
unicode_literals
from collections import OrderedDict
from typing import Any, Dict, Generator, Iterable, Mapping, Optional, \
Text, Tuple, Union
from six import iteritems, iterkeys, python_2_unicode_compatible
from filters.base... | |
"""Code coverage utilities."""
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import json
import os
import re
import time
from xml.etree.ElementTree import (
Comment,
Element,
SubElement,
tostring,
)
from xml.dom import (
minidom,
)
from . import types as... | |
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from six.moves import zip
from tabulate import tabulate
from tqdm import tqdm
import pycrfsuite
from morphine._fileresource import FileResource
class LessNoisyTrainer(pycrfsuite.Trainer):
"""
This pycrfsuite.Trainer prints information about each... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
reload(sys)
sys.setdefaultencoding('utf-8')
import os, csv
COV = None
if os.environ.get('FLASK_COVERAGE'):
import coverage
COV = coverage.coverage(branch=True, include='app/*')
COV.start()
if os.path.exists('.env'):
print('Importing environment ... | |
# engine/strategies.py
# Copyright (C) 2005-2015 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
"""Strategies for creating new instances of Engine types.
These are semi-priva... | |
import filecmp
from io import StringIO
from pathlib import Path
from unittest import TestCase
from unittest.mock import patch
from mlx.warnings import warnings_wrapper
TEST_IN_DIR = Path(__file__).parent / 'test_in'
TEST_OUT_DIR = Path(__file__).parent / 'test_out'
class TestIntegration(TestCase):
def setUp(se... | |
"""
The Python parts of the Jedi library for VIM. It is mostly about communicating
with VIM.
"""
import traceback # for exception output
import re
import os
import sys
from shlex import split as shsplit
try:
from itertools import zip_longest
except ImportError:
from itertools import izip_longest as zip_longes... | |
#!/usr/bin/env python
import os
import shutil
import glob
import time
import sys
import subprocess
import string
from optparse import OptionParser, make_option
SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
PKG_NAME = os.path.basename(SCRIPT_DIR)
PARAMETERS = None
XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=u... | |
from apollo.choices import PRICE_LIST_PRE_RELEASE
from apollo.viewmixins import LoginRequiredMixin, ActivitySendMixin, StaffRequiredMixin
from applications.price_list.forms import ActivityPriceListItemForm, PriceListForm, PriceListItemEquipmentForm, \
PriceListItemServiceForm, TimePriceListItemForm, UnitPriceListIt... | |
from datetime import timedelta
from optparse import make_option
from random import choice, shuffle, randint
from django.contrib.auth.models import User
from django.core.management import call_command
from django.core.management.base import BaseCommand
from django.utils import timezone
from django.utils.text import slu... | |
#!/usr/bin/python
import dateutil.parser
import json
import MySQLdb
import MySQLdb.cursors
import subprocess
import random
import traceback
import twitter
class UserCard:
def __init__(self,user):
self.user = user
self.tiles = []
self.goals = {}
self.refreshFromDB()
return
def hasCard(self):
return len(... | |
# coding: utf-8
# Copyright Luna Technology 2015
# Matthieu Riviere <mriviere@luna-technology.com>
import json
import os.path
import cbs
from django.core.exceptions import ImproperlyConfigured
from luna_django_commons.settings.mixins import (
AssetsSettings,
DebugToolbarSettings,
EmailSettings,
Sta... | |
# Copyright 2012 Grid Dynamics
# Copyright 2013 Inktank Storage, Inc.
# Copyright 2014 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.or... | |
"""Weight Boosting
This module contains weight boosting estimators for both classification and
regression.
The module structure is the following:
- The ``BaseAdaBoost`` base class implements a common ``fit`` method
for all the estimators in the module. Regression and classification
only differ from each other in... | |
#!/usr/bin/env python
#
# Copyright 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.
"""This test covers a resharding scenario of an already sharded keyspace.
We start with shards -80 and 80-. We then split 80- into 80-c0 and ... | |
import os, random, requests
import psycopg2
import urllib.parse
from random import randint, choice, shuffle
from urllib.parse import urlparse
from flask import Flask, session
from flask_restful import Resource, Api
from flask_assistant import Assistant, ask, tell, event, context_manager, request
from flask_assistant... | |
# -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
import time
import inspect
import logging
import warnings
import six
import requests
from wechatpy.constants import WeChatErrorCode
from wechatpy.utils import json, get_querystring
from wechatpy.session.memorystorage import MemoryStorage... | |
# Copyright 2014 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... | |
# Copyright 2013 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 ... | |
# Copyright 2010 Jacob Kaplan-Moss
# Copyright 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/lic... | |
"""Stdout, stderr and argv support for unicode."""
##############################################
# Support for unicode in windows cmd.exe
# Posted on Stack Overflow [1], available under CC-BY-SA 3.0 [2]
#
# Question: "Windows cmd encoding change causes Python crash" [3] by Alex [4],
# Answered [5] by David-Sarah Hopwo... | |
"""Base estimator class."""
# Copyright 2015-present The Scikit Flow 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/LIC... | |
import datetime
import logging
import os
import shutil
import tempfile
from contextlib import suppress
from django.conf import settings
from django.contrib.sessions.backends.base import (
VALID_KEY_CHARS, CreateError, SessionBase, UpdateError,
)
from django.contrib.sessions.exceptions import InvalidSessionKey
from... | |
# 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, ... | |
#!/usr/bin/env python
# -*- coding: latin-1 -*-
#
# Copyright 2016-2021 Blaise Frederick
#
# 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... | |
#
# xmpp.py
#
# Copyright (c) 2013 Horatiu Eugen Vlad
#
# 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, m... | |
#!/usr/bin/env python
# Copyright (c) 2009, Willow Garage, 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
# n... | |
import graphene
from django.db.models import QuerySet
from django.utils import six
from django.utils.decorators import classonlymethod
from django.shortcuts import _get_queryset
from graphene.utils.props import props
from graphene_django.registry import get_global_registry
from .types import FormError
from .utils impor... | |
# -*- coding: utf-8 -*-
# Copyright 2013 Red Hat, 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
... | |
import struct
import json
import logging
import binascii
import math
from collections import OrderedDict
from bitcoin.core import key
from functools import reduce
from itertools import groupby
from bitstring import BitArray, BitStream, ConstBitStream, ReadError
logger = logging.getLogger(__name__)
from counterpartyl... | |
# Lint as: python3
# 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 ... | |
# Copyright 2014 ARM Limited
#
# Licensed under the Apache License, Version 2.0
# See LICENSE file for details.
# standard library modules, , ,
import string
import os
import logging
import re
import itertools
from collections import defaultdict
from collections import OrderedDict
# bsd licensed - pip install jinja2
... | |
# 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... | |
#!/usr/bin/python
# Copyright (c) 2014 Hewlett-Packard Development Company, L.P.
#
# This module 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 Foundation, either version 3 of the License, or
# (at your option) any late... | |
###########################################################################
##
## Copyright (C) 2006-2010 University of Utah. All rights reserved.
##
## This file is part of VisTrails.
##
## This file may be used under the terms of the GNU General Public
## License version 2.0 as published by the Free Software Foundati... | |
# Copyright 2017--2022 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"). You may not
# use this file except in compliance with the License. A copy of the License
# is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" fi... | |
#
# Copyright SAS Institute
#
# 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 os,sys,re
import numpy as np
import pandas as pd
import warnings
warnings.filterwarnings('ignore')
#sys.path.append(os.path.abspath('../../new/'))
from predictions_library import *
myHOME = os.path.abspath('..')
start, end = "\033[1m", "\033[0;0m" # this is to print bold
def initialize_notebook_and_load_datas... | |
import collections
import itertools
from hindley_milner import TypeVariable
from hindley_milner import ListType
from hindley_milner import unify
from type_system import typeof
from type_system import Typeclass
from type_system import Hask
from type_system import build_instance
from typeclasses import Show
from typec... | |
"""\
aug-cc-pV6Z basis set for use with PyQuante
Apr 7 2010 Jussi Lehtola
This program is part of the PyQuante quantum chemistry program suite.
PyQuante version 1.2 and later is covered by the modified BSD
license. Please see the file LICENSE that is part of this
distribution.
"""
basis_data = {1: [('S',
... | |
# 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
# This document is part of Pelagos Data
# https://github.com/skytruth/pelagos-data
# =========================================================================== #
#
# The MIT License (MIT)
#
# Copyright (c) 2014 SkyTruth
#
# Permission is hereby granted, free of charge, to any person obtain... | |
"""
Iterative fit Deep Neural Network
Created: Hector Mendoza
"""
import numpy as np
import scipy.sparse as sp
from HPOlibConfigSpace.configuration_space import ConfigurationSpace
from HPOlibConfigSpace.conditions import EqualsCondition, InCondition
from HPOlibConfigSpace.hyperparameters import UniformFloatHyperpar... | |
# Copyright 2012 Nebula, Inc.
# Copyright 2014 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... | |
# core.py
#
# Copyright (c) 2009 Stephen Day
#
# This module is part of Creoleparser and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
#
import re
import genshi.builder as bldr
__docformat__ = 'restructuredtext en'
escape_char = '~'
esc_neg_look = '(?<!' + re.escape(escape_... | |
#!/usr/bin/env python
"""This is a generic environment reader."""
# =============================================================================
#
# FILE: process_dc_env.py
#
# USAGE: process_dc_env.py
#
# DESCRIPTION: customer appName specific that will drop the indexes
# identified... | |
"""Test the songpal config flow."""
import copy
from unittest.mock import patch
from homeassistant.components import ssdp
from homeassistant.components.songpal.const import CONF_ENDPOINT, DOMAIN
from homeassistant.config_entries import SOURCE_IMPORT, SOURCE_SSDP, SOURCE_USER
from homeassistant.const import CONF_HOST, ... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Partially based on AboutMessagePassing in the Ruby Koans
#
from runner.koan import *
class AboutAttributeAccess(Koan):
class TypicalObject:
pass
def test_calling_undefined_functions_normally_results_in_errors(self):
typical = self.TypicalObj... | |
# 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... | |
#!/usr/bin/env python
#
# Copyright (c) 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.
"""Provisions Android devices with settings required for bots.
Usage:
./provision_devices.py [-d <device serial number>]
"""
... | |
import os
import hashlib
import requests
import tempfile
import mimetypes
import numpy as np
from PIL import Image
from io import BytesIO
from fnmatch import fnmatch
from datetime import datetime
from . import config
API_URL = 'https://api.abraia.me'
tempdir = tempfile.gettempdir()
def file_path(f, userid):
r... | |
#!/usr/bin/env python
import datetime
from datetime import timedelta
import json
import os
import random
import string
import httplib2
from flask import (
Flask, Response, jsonify, make_response, render_template, request, session)
from oauth2client.client import flow_from_clientsecrets, FlowExchangeError
from ... | |
# 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 2017 HOMEINFO - Digitale Informationssysteme 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 without restriction, including without limitation the rights
# to use, copy, mo... | |
#!/usr/bin/env python
# Licensed to Cloudera, Inc. under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. Cloudera, Inc. licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you ma... | |
import json
from django.core import exceptions, serializers
from django.forms import Form
from . import PostgreSQLTestCase
from .models import HStoreModel
try:
from django.contrib.postgres import forms
from django.contrib.postgres.fields import HStoreField
from django.contrib.postgres.validators import K... | |
from canvasapi.canvas_object import CanvasObject
from canvasapi.exceptions import RequiredFieldMissing
from canvasapi.paginated_list import PaginatedList
from canvasapi.util import combine_kwargs, obj_or_id
class Module(CanvasObject):
def __str__(self):
return "{} ({})".format(self.name, self.id)
def... | |
import re
class Program:
def __init__(self):
self.name = ""
self.weight = 0
self.stacked_program_names = []
self.stacked_programs = []
self.stack_weight = 0
def __str__(self):
return ("Program{name=" + self.name
+ ", weight=" + str(self.weight)
... | |
# Copyright (C) 2014, 2015, Hitachi, Ltd.
#
# 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 ... | |
"""
Support for Clementine Music Player as media player.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/media_player.clementine/
"""
import asyncio
from datetime import timedelta
import logging
import time
import voluptuous as vol
import homeassistant... | |
# 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 datetime
import functools
import logging
import os
import shutil
import tempfile
import threading
from devil import base_error
from devil.android imp... | |
"""pypyr step that runs another pipeline from within the current pipeline."""
import logging
import shlex
from pypyr.context import Context
from pypyr.errors import (ContextError,
ControlOfFlowInstruction,
KeyInContextHasNoValueError,
KeyNotI... | |
#!/usr/bin/env python
#
# Copyright 2012 Facebook
#
# 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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.