gt stringclasses 1
value | context stringlengths 2.49k 119k |
|---|---|
# Copyright 2014 Novo Nordisk Foundation Center for Biosustainability, DTU.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requi... | |
# Default Django settings. Override these with settings in the module
# pointed-to by the DJANGO_SETTINGS_MODULE environment variable.
# This is defined here as a do-nothing function because we can't import
# django.utils.translation -- that module depends on the settings.
gettext_noop = lambda s: s
#################... | |
import datetime
import json
from nose.tools import ok_, eq_, assert_raises
import mock
from django.conf import settings
from django.utils import timezone
from django.core.exceptions import ImproperlyConfigured
from django.core.urlresolvers import reverse
from airmozilla.base.tests.testbase import Response
from airmo... | |
#
# Settings.py -- Simple class to manage stateful user preferences.
#
# This is open-source software licensed under a BSD license.
# Please see the file LICENSE.txt for details.
#
import os
import re
import ast
import numpy as np
from . import Callback
from . import Bunch
unset_value = "^^UNSET^^"
regex_assign = re... | |
#!/usr/bin/env python2
#import all the libraries and elements that we need
import time
import datetime
import sys
import pigpio
import string
import CloudFunctions
#setup a pi object
pi = pigpio.pi()
#define global variables defaults
LOCATION = "CAXX0518" #location of the weather we want
CITY = "Vancouver" #loc... | |
# coding=utf-8
"""
oauthlib.oauth2.rfc6749.errors
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Error used both by OAuth 2 clients and provicers to represent the spec
defined error responses for all four core grant types.
"""
from __future__ import unicode_literals
import json
from oauthlib.common import urlencode, add_params_to_ur... | |
#!/usr/bin/env python
"""
This module contains the :class:`Analysis` class, which is used for creating
optimized, repeatable data processing workflows. An analysis can be created
from a function or any other callable object. Dependent analyses can then be
created using the :meth:`Analysis.then` method. Each function m... | |
# Copyright (c) 2012-2015 Netforce Co. Ltd.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publ... | |
# 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... | |
import plenario
import weather
import metar
from metar.metar import Metar, ParserError
from plenario.database import task_session as session, task_engine as engine, Base
from sqlalchemy import Table, select, func, and_, distinct
from sqlalchemy import event
from sqlalchemy.engine import Engine
import sys
#import grequ... | |
"""
ACE parser
From wotsit.org and the SDK header (bitflags)
Partial study of a new block type (5) I've called "new_recovery", as its
syntax is very close to the former one (of type 2).
Status: can only read totally file and header blocks.
Author: Christophe Gisquet <christophe.gisquet@free.fr>
Creation date: 19 jan... | |
# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0
# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt
"""Base test case class for coverage.py testing."""
import contextlib
import datetime
import functools
import os
import random
import re
import shlex
import sys
im... | |
#!/usr/bin/env python
from __future__ import with_statement
import logging
import optparse
import os
import os.path
import re
import shutil
import subprocess
import sys
import itertools
version_info = (0, 2, 6)
__version__ = '.'.join(map(str, version_info))
logger = logging.getLogger()
if sys.version_info < (2, 6)... | |
#!/usr/bin/env python
# Copyright 2016 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.
'''Tracing controller class. This class manages
multiple tracing agents and collects data from all of them. It also
manages the clock ... | |
# 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... | |
##################################################################
# BrundleFuzzClient.py
# The core (Python) reads the feedback information from
# the PinTool (C++) from the shared memory
##################################################################
import sys
import os
import mmap
import subprocess
from array ... | |
# coding: utf-8
# Copyright (c) Pymatgen Development Team.
# Distributed under the terms of the MIT License.
"""
Enumerator with the libxc identifiers.
This is a low level object, client code should not interact with LibxcFunc directly
but use the API provided by the Xcfunc object defined in core.xcfunc.py.
Part of thi... | |
#!/usr/bin/env python
# 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.
"""A tool to scan source files for unneeded grit includes.
Example:
cd /work/chrome/src
tools/resources/list_unused_grit_header.py... | |
# 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 a... | |
# ==============================================================================
# Copyright 2018-2020 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://ww... | |
#!/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.
"""Unit tests for gclient.py.
See gclient_smoketest.py for integration tests.
"""
import Queue
import copy
import logging
import ... | |
"""Support for sensors through the SmartThings cloud API."""
from __future__ import annotations
from collections import namedtuple
from collections.abc import Sequence
from pysmartthings import Attribute, Capability
from pysmartthings.device import DeviceEntity
from homeassistant.components.sensor import (
STATE... | |
#!/usr/bin/env python3
# vi:nu:et:sts=4 ts=4 sw=4
''' Build the Library
'''
# This is free and unencumbered software released into the public domain.
#
# Anyone is free to copy, modify, publish, use, compile, sell, or
# distribute this software, either in source code form or as a compiled
# binary, for any p... | |
# 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... | |
"""
Title: Multiclass semantic segmentation using DeepLabV3+
Author: [Soumik Rakshit](http://github.com/soumik12345)
Date created: 2021/08/31
Last modified: 2021/09/1
Description: Implement DeepLabV3+ architecture for Multi-class Semantic Segmentation.
"""
"""
## Introduction
Semantic segmentation, with the goal to as... | |
import copy
import json
from time import sleep
from mock import patch, MagicMock
from cqlengine import Model, columns, SizeTieredCompactionStrategy, LeveledCompactionStrategy
from cqlengine.exceptions import CQLEngineException
from cqlengine.management import get_compaction_options, drop_table, sync_table, get_table_se... | |
# This file is part of Indico.
# Copyright (C) 2002 - 2022 CERN
#
# Indico is free software; you can redistribute it and/or
# modify it under the terms of the MIT License; see the
# LICENSE file for more details.
from indico.modules.events.abstracts.models.abstracts import AbstractState
from indico.util.i18n import _,... | |
# 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... | |
# -*- coding: utf-8 -*-
'''
.. module:: audiochan.utils.cascadicts
:platform: Unix, Windows
:synopsis: Implementation of Cascading dict collection. CascaDicts implement something like inheritance on dictionary level.
Example::
In [2]: a = CascaDict({'level':0, 'name':'root'})
In [3]: b = a.cascade({... | |
# Protocol Buffers - Google's data interchange format
# Copyright 2008 Google Inc. All rights reserved.
# https://developers.google.com/protocol-buffers/
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redi... | |
#
# Copyright 2015 Horde Software Inc.
#
import math
import json
from PySide import QtGui, QtCore
from port import InputPort, OutputPort, IOPort
class NodeTitle(QtGui.QGraphicsWidget):
__color = QtGui.QColor(25, 25, 25)
__font = QtGui.QFont('Decorative', 14)
__font.setLetterSpacing(QtGui.QFont.Percentag... | |
# Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | |
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
from collections import namedtuple
import torch
import numpy as np
from fairseq import utils
DecoderOut = namedtuple('IterativeRefinementD... | |
from __future__ import absolute_import
import base64
import logging
import math
from datetime import datetime
from django.db import models
from django.db.models import Count
from django.utils.encoding import smart_unicode
from django.utils.translation import ugettext_lazy as _
from sentry.conf import settings
from ... | |
"""
This module runs a convergence history for a hybridized-DG
discretization of a model elliptic problem (detailed in the main
function). The method used is the LDG-H method.
"""
from firedrake import *
from firedrake.petsc import PETSc
from firedrake import COMM_WORLD
import numpy as np
import pandas as pd
def run... | |
from django.db import models
import yaml
import os.path
import logging
import gzip
import numpy as np
import qmpy
import qmpy.db.custom as custom
from qmpy.utils import *
import bokeh.plotting as bkp
from bokeh.models import HoverTool, Span
logger = logging.getLogger(__name__)
# class Orbital(models.Model):
# n... | |
from enum import Enum
from math import cos, sin, pi, floor
from Data import get_uids
from Data.Areas import CompositeArea, EdgeLoopArea, AreaType, Edge
from Data.Edges import EdgeType
from Data.Events import ChangeEvent
from Data.Objects import IdObject, NamedObservableObject, MetaDataObject
from Data.Parameters impor... | |
# encoding: utf8
from django.test import TestCase, override_settings
from django.db.migrations.autodetector import MigrationAutodetector
from django.db.migrations.questioner import MigrationQuestioner
from django.db.migrations.state import ProjectState, ModelState
from django.db.migrations.graph import MigrationGraph
f... | |
# yellowbrick.regressor.influence
# Visualize the influence and leverage of individual instances on a regression model.
#
# Author: Benjamin Bengfort <benjamin@bengfort.com>
# Created: Sun Jun 09 15:21:17 2019 -0400
#
# Copyright (C) 2019 The scikit-yb developers
# For license information, see LICENSE.txt
#
# ID: in... | |
#!/usr/bin/env python
#
# Copyright 2007 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | |
#!/usr/bin/python
#
# Copyright (c) 2018 Yuwei Zhou, <yuwzho@microsoft.com>
#
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
... | |
# coding: utf-8
"""
Pagination serializers determine the structure of the output that should
be used for paginated responses.
"""
from __future__ import unicode_literals
import warnings
from base64 import b64decode, b64encode
from collections import namedtuple
from django.core.paginator import Paginator as DjangoPagi... | |
#!/usr/bin/python
#coding=utf-8
"""****************************************************************************
Copyright (c) 2013 cocos2d-x.org
http://www.cocos2d-x.org
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), t... | |
"""Compressed Block Sparse Row matrix format"""
from __future__ import division, print_function, absolute_import
__docformat__ = "restructuredtext en"
__all__ = ['bsr_matrix', 'isspmatrix_bsr']
from warnings import warn
import numpy as np
from .data import _data_matrix, _minmax_mixin
from .compressed import _cs_m... | |
# Copyright 2014 The Oppia Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... | |
# Copyright 2012 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... | |
# 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... | |
# -*- coding: utf-8 -*-
"""
Copyright (C) 2017 Sebastian Golasch (plugin.video.netflix)
Copyright (C) 2018 Caphm (original implementation module)
Methods to execute requests to Netflix API
SPDX-License-Identifier: MIT
See LICENSES/MIT.md for more information.
"""
from __future__ import absolute_imp... | |
import math
import numpy as np
class ValNodes(object):
def __init__(self):
self.type_node = ValNodes
#For future work to define common properties
self.no_outer = True
class MonoNodeVal(ValNodes):
def __init__(self, name, operand, operator):
super(MonoNodeVal, self).__... | |
#
# CORE
# Copyright (c)2011-2012 the Boeing Company.
# See the LICENSE file included in this distribution.
#
# author: Jeff Ahrenholz <jeffrey.m.ahrenholz@boeing.com>
#
'''
mobility.py: mobility helpers for moving nodes and calculating wireless range.
'''
import sys, os, time, string, math, threading
import heapq
from... | |
import csv
from pyportfolio.utils.misc import get_required_args
import pandas as pd
fieldnames = [
'account',
'amount',
'price',
'commission',
'currency_name',
'equity_ticker',
'security_type',
'underlying_security_type',
'underlying_equity_ticker',
'option_strike',
'option_... | |
# coding=utf-8
# Copyright (c) 2015 EMC Corporation.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#... | |
#!/usr/bin/env python
# Copyright (c) 2014-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under both the Apache 2.0 license (found in the
# LICENSE file in the root directory of this source tree) and the GPLv2 (found
# in the COPYING file in the root directory of this source tree)... | |
# test_utils.py
# Copyright (C) 2008, 2009 Michael Trier (mtrier@gmail.com) and contributors
#
# This module is part of GitPython and is released under
# the BSD License: http://www.opensource.org/licenses/bsd-license.php
import tempfile
import time
from unittest.case import skipIf
import ddt
from git.cmd import das... | |
from twisted.trial import unittest
import json
import tempfile
import configparser
from io import StringIO
from opennsa import config, setup
from opennsa.config import Config
from . import db
ARUBA_DUD_CONFIG_NO_DATABASE = """
[service]
domain=aruba.net
logfile=
rest=true
port=4080
tls=false
[dud]
"""
ARUBA_DUD_C... | |
"""
We perform uniqueness checks explicitly on the serializer class, rather
the using Django's `.full_clean()`.
This gives us better separation of concerns, allows us to use single-step
object creation, and makes it possible to switch between using the implicit
`ModelSerializer` class and an equivalent explicit `Seria... | |
from __future__ import absolute_import
from pyswagger.spec import base
import unittest
import six
import copy
class GrandChildObj(six.with_metaclass(base.FieldMeta, base.BaseObj)):
__swagger_fields__ = {
'name': ''
}
class GrandChildContext(base.Context):
__swagger_ref_object__ = GrandChildObj
... | |
# 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... | |
#!/usr/bin/python
# Copyright (c) 2011 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.
import copy
import gyp.input
import optparse
import os.path
import re
import shlex
import sys
import traceback
# Default debug modes for GYP
de... | |
import copy
import math
import matplotlib.pyplot as plt
import numpy as np
import os
import scipy as sp
import subprocess
import sys
import pandas as pd
from TransferFunctions import LinearTF, TanhTF, ReLuTF
class NeuralNet:
"""
Neural net classifier with one hidden layer
"""
def __init__(self, X, y,... | |
# TODO: the line slicer should listen to all 2DREFRESH events, get the data and slice it
# before pushing a new 1D data update.
#
# TODO: NEED MAJOR REFACTOR
#
import numpy as np
from sas.qtgui.Plotting.Slicers.Arc import ArcInteractor
from sas.qtgui.Plotting.Slicers.RadiusInteractor import RadiusInteractor
from ... | |
# Village People, 2017
import torch
from torch.multiprocessing import Queue
import time
from termcolor import colored as clr
from pig_chase.common import ENV_ACTIONS
from agents import get_agent
import numpy as np
import queue as Queue
def print_info(message):
print(clr("[QUEUE_TRAIN] ", "magenta") + message)
... | |
# -*- coding: utf-8 -*-
from functools import wraps
import hashlib
from flask import request, make_response, jsonify, url_for, \
Response, g, render_template, current_app, abort
from .rate_limit import RateLimit
def returns_json(f):
@wraps(f)
def decorated_function(*args, **kwargs):
r = f(*arg... | |
""" (disabled by default) support for testing pytest and pytest plugins. """
import gc
import sys
import traceback
import os
import codecs
import re
import time
import platform
from fnmatch import fnmatch
import subprocess
import py
import pytest
from py.builtin import print_
from _pytest.main import Session, EXIT_OK... | |
#
# 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... | |
from __future__ import print_function, division, absolute_import
from io import BytesIO
import pytest
pd = pytest.importorskip('pandas')
dd = pytest.importorskip('dask.dataframe')
from toolz import partition_all, valmap, partial
from dask import compute
from dask.async import get_sync
import dask.dataframe.csv
from... | |
# -*- coding: utf-8 -*-
r"""OCSPscrape.
Description:
ocspscrape update:
Gets a list of responders to scrape from the OCSPdash, scrapes
them, then uploads the results.
ocspscrape genkey:
Generates an EC key pair for signing submissions and registers
with the OCSPdash server.
... | |
"""Module implementing tools to generate graphs and connectivity matrices.
Generally, ``gen_...`` functions return generatively-created objects, while
``get_...`` return graphs corresponding to passed in membership vectors.
Use ``sample_connection_matrix`` to generate binary connectivity matrices
sampled from matrice... | |
"""
Views for indicators and related models (results, periodic targets) as well as indicator summaries (Program page)
"""
import copy
import json
import logging
from datetime import datetime, timedelta
from decimal import Decimal
import uuid
import dateparser
from weasyprint import HTML, CSS
from django.template.def... | |
#!/usr/bin/python
"""
<Program Name>
milestones-checker.py
<Started>
January 12, 2008
<Author>
ivan@cs.washington.edu
Ivan Beschastnikh
<Purpose>
Used as a cronscript that will check if any of the strike
forces personnel are late on their milestones sprints
<Usage>
python milestones-checker
"""
im... | |
from django.conf import settings
from django.core.files.storage import default_storage
from django.utils.translation import ugettext
from rest_framework import serializers
import olympia.core.logger
from olympia import amo
from olympia.access import acl
from olympia.access.models import Group
from olympia.amo.templat... | |
# syn1.py
# Ronald L. Rivest
# August 5, 2017
# python3
"""
Routines to generate synthetic elections of "type 1".
Called from syn.py.
"""
"""
e is of type multi.Election
synpar is an object of type syn.Syn_Parameters
"""
import copy
import numpy as np
import audit_orders
import election_spec
import outcomes
import ... | |
# 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 2013 Metamarkets 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... | |
# -*- coding: utf-8 -*-
#
# 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
... | |
# coding: utf-8
from __future__ import division, unicode_literals
from pymatgen.util.testing import PymatgenTest
from pymatgen.core.periodic_table import Element, Specie
from pymatgen.core.composition import Composition
from pymatgen.core.operations import SymmOp
from pymatgen.core.structure import IStructure, Struct... | |
# -*- coding: utf-8 -*-
from django.conf import settings
from django.core.exceptions import ValidationError
from rest_framework import serializers
from intranet import models
from intranet.utils import get_consumed_days_for_user, get_requested_days_for_user
import datetime
import calendar
class PickleField(serial... | |
import argparse
import copy
from itertools import product
try:
# import lxml.etree as et
import xml.etree.cElementTree as et
except ImportError:
import xml.etree.ElementTree as et
import numpy as np
from scipy.misc import imread, imsave
import cv2
fov = 50.0 * 2 * np.pi / 360.0
f = 1 / (2 * np.tan(fov /... | |
# Copyright 2020 The TensorFlow Quantum 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... | |
# Copyright 2016 rpaas 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 time
import datetime
import os
import requests
from hm import config
NGINX_LOCATION_INSTANCE_NOT_BOUND = '''
location / {
return 404 "Instance not bou... | |
from __future__ import unicode_literals
from moto.core.responses import BaseResponse
from .models import autoscaling_backends
class AutoScalingResponse(BaseResponse):
@property
def autoscaling_backend(self):
return autoscaling_backends[self.region]
def create_launch_configuration(self):
... | |
#!/usr/bin/env python
"""Bootstrap setuptools installation
To use setuptools in your package's setup.py, include this
file in the same directory and add this to the top of your setup.py::
from ez_setup import use_setuptools
use_setuptools()
To require a specific version of setuptools, set a download
mirror, ... | |
from history import History
import nose
from nose.tools import (assert_equal, assert_is, assert_is_none, assert_raises,
assert_true, assert_in, assert_not_in)
from bluesky.examples import (motor, simple_scan, det, sleepy, wait_one,
wait_multiple, motor1, motor2, con... | |
# 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 (t... | |
"""The ClimaCell integration."""
from __future__ import annotations
from datetime import timedelta
import logging
from math import ceil
from typing import Any
from pyclimacell import ClimaCellV3, ClimaCellV4
from pyclimacell.const import CURRENT, DAILY, FORECASTS, HOURLY, NOWCAST
from pyclimacell.exceptions import (
... | |
# See https://zulip.readthedocs.io/en/latest/subsystems/events-system.html for
# high-level documentation on how this system works.
import atexit
import copy
import logging
import os
import random
import signal
import sys
import time
import traceback
from collections import deque
from dataclasses import asdict
from typ... | |
# Copyright (C) 2002, Thomas Hamelryck (thamelry@binf.ku.dk)
# This code is part of the Biopython distribution and governed by its
# license. Please see the LICENSE file that should have been included
# as part of this package.
"""
Base class for Residue, Chain, Model and Structure classes.
It is a simple container ... | |
# Copyright (c) 2014 Adafruit Industries
# Author: Tony DiCola
# 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/python
import logging
import os
import re
import sys
import threading
import time
import traceback
from datetime import datetime
from functools import wraps
from logging import StreamHandler
from cloudshell.core.logger.interprocess_logger import MultiProcessingLog
from cloudshell.core.logger.qs_config_parse... | |
# pylint: disable=g-bad-file-header
# Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENS... | |
# MySQL Connector/Python - MySQL driver written in Python.
# Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved.
# MySQL Connector/Python is licensed under the terms of the GPLv2
# <http://www.gnu.org/licenses/old-licenses/gpl-2.0.html>, like most
# MySQL Connectors. There are special exceptio... | |
#!/usr/bin/env python
import wx
#----------------------------------------------------------------------
class TestPage(wx.Panel):
def __init__(self, parent, onNextPage, colour=None, title=None, text=None, extra=None):
wx.Panel.__init__(self, parent)
vbox = wx.BoxSizer(wx.VERTICAL)
if co... | |
__author__ = 'Michael Isik'
from pybrain.rl.learners.blackboxoptimizers.evolution.filter import Filter, SimpleMutation
from pybrain.rl.learners.blackboxoptimizers.evolution.variate import CauchyVariate
from pybrain.rl.learners.blackboxoptimizers.evolution.population import SimplePopulation
from pybrain.tools.va... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""shadow_plotter: custom plotting utility for SHADOW3_
.. _SHADOW3: https://github.com/srio/shadow3
.. _Orange-Shadow: https://github.com/lucarebuffi/Orange-Shadow
.. _ShadowOui: https://github.com/lucarebuffi/ShadowOui
TODO
----
- check compatibility with ShadowOui_ a... | |
from __future__ import unicode_literals
import itertools
import boto
from boto.exception import EC2ResponseError
import sure # noqa
from moto import mock_ec2
from nose.tools import assert_raises
@mock_ec2
def test_add_tag():
conn = boto.connect_ec2('the_key', 'the_secret')
reservation = conn.run_instances(... | |
"""
This module implements connections for MySQLdb. Presently there is
only one class: Connection. Others are unlikely. However, you might
want to make your own subclasses. In most cases, you will probably
override Connection.default_cursor with a non-standard Cursor class.
"""
from MySQLdb import cursors
from _mysql... | |
# 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... | |
# Copyright (c) 2008, Aldo Cortesi. All rights reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify,... | |
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
Program to (re)categorize images at commons.
The program uses commonshelper for category suggestions.
It takes the suggestions and the current categories. Put the categories through
some filters and adds the result.
The following command line parameters are supported:
-o... | |
# -*- coding: utf-8 -*-
# pylint: disable=W0141,W0622
"""Read environment variables, with casting and optional defaults.
A set of functions to read environment variables and cast them into the correct
python datatypes. Also performs basic error handling.
"""
try:
import builtins
except ImportError:
import __b... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.