gt stringclasses 1
value | context stringlengths 2.49k 119k |
|---|---|
# This file contains test code for the formatting of parsed statements back to
# make file "source." It essentially verifies to to_source() functions
# scattered across the tree.
import glob
import logging
import os.path
import unittest
from pymake.data import Expansion
from pymake.data import StringExpansion
from py... | |
# Copyright 2012 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
#
# Unless required by... | |
# Compute the date of Easter according to various calendars.
#
# Reference: http://www.newadvent.org/cathen/05480b.htm
#
# Note that the table at the end of the section "Inaccuracy of the Metonic
# Cycle" has a misprint: all "+1" indications on or after year 4500 should be
# 100 years later than shown. (The text above... | |
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# d... | |
# -*- coding: utf-8 -*-
#
# 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
#... | |
"""Test the Smappee component config flow module."""
from http import HTTPStatus
from unittest.mock import patch
from homeassistant import data_entry_flow, setup
from homeassistant.components import zeroconf
from homeassistant.components.smappee.const import (
CONF_SERIALNUMBER,
DOMAIN,
ENV_CLOUD,
ENV_... | |
"""
dogleg algorithm with rectangular trust regions for least-squares minimization.
The description of the algorithm can be found in [Voglis]_. The algorithm does
trust-region iterations, but the shape of trust regions is rectangular as
opposed to conventional elliptical. The intersection of a trust region and
an init... | |
#!/usr/bin/env python3
import json
import logging
import os
import re
from enum import Enum
from http import HTTPStatus
from http.server import BaseHTTPRequestHandler, HTTPServer
from socketserver import ThreadingMixIn
from urllib.error import HTTPError, URLError
from urllib.parse import parse_qsl, urlparse
from urlli... | |
# Copyright 2010-present Basho Technologies, 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 a... | |
"Implements Model"
import numpy as np
from .costed import CostedConstraintSet
from ..nomials import Monomial
from .prog_factories import _progify_fctry, _solve_fctry
from .gp import GeometricProgram
from .sgp import SequentialGeometricProgram
from ..small_scripts import mag
from ..tools.autosweep import autosweep_1d
fr... | |
"""
This module is executed in remote subprocesses and helps to
control a remote testing session and relay back information.
It assumes that 'py' is importable and does not have dependencies
on the rest of the xdist code. This means that the xdist-plugin
needs not to be installed in remote environm... | |
"""
Form classes
"""
from __future__ import unicode_literals
from collections import OrderedDict
import copy
import datetime
import warnings
from django.core.exceptions import ValidationError, NON_FIELD_ERRORS
from django.forms.fields import Field, FileField
from django.forms.utils import flatatt, ErrorDict, ErrorLi... | |
# -*- coding: utf-8 -*-
import gsxws
from django.forms.models import modelform_factory
from django.forms.models import inlineformset_factory
from django.utils.translation import ugettext as _
from django.contrib.auth.decorators import permission_required
from django.shortcuts import render, redirect, get_object_or_... | |
"""Utility functions for plotting M/EEG data
"""
from __future__ import print_function
# Authors: Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr>
# Denis Engemann <denis.engemann@gmail.com>
# Martin Luessi <mluessi@nmr.mgh.harvard.edu>
# Eric Larson <larson.eric.d@gmail.com>
# ... | |
"""Support for Toon van Eneco devices."""
from functools import partial
import logging
from typing import Any, Dict
from toonapilib import Toon
import voluptuous as vol
from homeassistant.const import CONF_PASSWORD, CONF_SCAN_INTERVAL, CONF_USERNAME
from homeassistant.core import callback
from homeassistant.helpers i... | |
from __future__ import absolute_import, division, print_function
import unittest
import numpy as np
import datashape
import blaze
from blaze.datadescriptor import ddesc_as_py
from blaze.tests.common import MayBePersistentTest
from blaze import (append,
DyND_DDesc, BLZ_DDesc, HDF5_DDesc)
from blaze.py2help impor... | |
'''
cytest - A module to compare Curry output.
'''
from __future__ import print_function
import cStringIO
import os
import re
import shutil
import subprocess
import sys
import tokenize
import unittest
# OK to change the next value.
VERBOSE = True
if VERBOSE:
def log(*args):
sys.stdout.write('[INFO]: ')
... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Plotting macros for XAFS data sets and fits
===========================================
Function Description of what is plotted
---------------- -----------------------------------------------------
plot_mu() mu(E) for XAFS data group in various for... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# pylint: disable-msg=C0103
################################################################################
# Copyright (c) 2006-2017 Franz Inc.
# All rights reserved. This program and the accompanying materials are
# made available under the terms of the MIT License wh... | |
"""
Adaptive numerical evaluation of SymPy expressions, using mpmath
for mathematical functions.
"""
import sympy.mpmath.libmp as libmp
from sympy.mpmath import make_mpc, make_mpf, mp, mpc, mpf, nsum, quadts, quadosc
from sympy.mpmath import inf as mpmath_inf
from sympy.mpmath.libmp import (bitcount, from_int, from_ma... | |
r"""JSON (JavaScript Object Notation) <http://json.org> is a subset of
JavaScript syntax (ECMA-262 3rd edition) used as a lightweight data
interchange format.
:mod:`simplejson` exposes an API familiar to users of the standard library
:mod:`marshal` and :mod:`pickle` modules. It is the externally maintained
version of ... | |
# -------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
# --------------------------------------------------------------------------
"""Miscell... | |
# Copyright 2012 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 ag... | |
from __future__ import division
from pandas.tools.plotting import scatter_matrix
import matplotlib.pyplot as plt
from libtbx.utils import Sorry
import scipy.optimize as op
import collect_ncs_files
import seaborn as sns
import pandas as pd
import numpy as np
import sys
import os
class Explore_data(object):
def __in... | |
# coding: utf-8
"""
Qc API
Qc API # noqa: E501
The version of the OpenAPI document: 3.0.0
Contact: cloudsupport@telestream.net
Generated by: https://openapi-generator.tech
"""
import pprint
import re # noqa: F401
import six
from telestream_cloud_qc.configuration import Configuration
class... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Generated from FHIR 4.0.0-a53ec6ee1b (http://hl7.org/fhir/StructureDefinition/MedicinalProductAuthorization) on 2019-05-07.
# 2019, SMART Health IT.
from . import domainresource
class MedicinalProductAuthorization(domainresource.DomainResource):
""" The regulat... | |
"""CAP Collector tests base classes."""
__author__ = "arcadiy@google.com (Arkadii Yakovets)"
import os
import re
from django.conf import settings
from django.contrib.auth.models import Group
from django.contrib.auth.models import User
from django.test import Client
from django.test import LiveServerTestCase
from dja... | |
# -*- 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... | |
import calendar
import datetime
import re
import sys
import urllib
import urlparse
from email.Utils import formatdate
from airy.utils.encoding import smart_str, force_unicode
from airy.utils.functional import allow_lazy
ETAG_MATCH = re.compile(r'(?:W/)?"((?:\\.|[^"])*)"')
MONTHS = 'jan feb mar apr may jun jul aug se... | |
from __future__ import print_function
import os
import logging
from . import shutitfile
def setup_docker_pattern(shutit,
skel_path,
skel_delivery,
skel_domain,
skel_module_name,
skel_shutitfiles... | |
# Copyright (c) 2016-present, Facebook, 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... | |
import logging
import os
import numpy as np
import ray.ray_constants as ray_constants
logger = logging.getLogger(__name__)
class RayParams:
"""A class used to store the parameters used by Ray.
Attributes:
redis_address (str): The address of the Redis server to connect to. If
this addre... | |
#!/usr/bin/env python
# vim: ai ts=4 sts=4 et sw=4 encoding=utf-8
from __future__ import with_statement
import re, datetime
import math
import pytz
import codecs
import gsmcodecs
import threading
MSG_LIMITS = {
# 'encoding', (max_normal, max_csm)
'gsm': (160,152),
'ucs2': (70,67)
}
MAX_CSM_SEGMENTS = 25... | |
# This file is part of Indico.
# Copyright (C) 2002 - 2019 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 __future__ import unicode_literals
import pytz
from sqlalchemy import DDL, orm
from sqlalchemy.diale... | |
import redash.models
from redash.models import db
from redash.utils import gen_query_hash, utcnow
from redash.utils.configuration import ConfigurationContainer
from redash.permissions import ACCESS_TYPE_MODIFY
class ModelFactory(object):
def __init__(self, model, **kwargs):
self.model = model
self... | |
# -*- coding: utf-8 -*-
"""
pygments.lexers.erlang
~~~~~~~~~~~~~~~~~~~~~~
Lexers for Erlang.
:copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
from pygments.lexer import Lexer, RegexLexer, bygroups, words, do_insertions, \
... | |
# Copyright 2019, OpenCensus Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in w... | |
"""
Tests for Factor terms.
"""
from functools import partial
from itertools import product
from nose_parameterized import parameterized
from unittest import TestCase
from toolz import compose
from numpy import (
apply_along_axis,
arange,
array,
datetime64,
empty,
eye,
log1p,
nan,
o... | |
import datetime
from django.conf import settings
from django.core.exceptions import FieldError
from django.db.backends.utils import truncate_name
from django.db.models.constants import LOOKUP_SEP
from django.db.models.query_utils import select_related_descend, QueryWrapper
from django.db.models.sql.constants import (S... | |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import os
import pdb
import pickle
import time
import random
import keras
import numpy as np
import tensorflow as tf
from tensorflow.python.platform import app
from tens... | |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2011 OpenStack Foundation.
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
... | |
# 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... | |
# -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Removing unique constraint on 'ColumnMapping', fields ['super_organization', 'c... | |
#!/usr/bin/python
# CGI SimpleFileUpload WebServer Ver. 0.1.5
# Author: Srinivas Gowda
# Email: srinivas@solancer.com
import string,cgi,time, re
import json
import math
import time
from os import curdir, sep
from BaseHTTPServer import BaseHTTPRequestHandler, HTTPServer
import os # os. path
CWD = os.path.abspath('.... | |
import tensorflow as tf # neural network for function approximation
import gym # environment
import numpy as np # matrix operation and math functions
from gym import wrappers
import gym_morph # customized environment for cart-pole
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import time
star... | |
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:9248")
else:
access = Ser... | |
##########################################################################
#
# Copyright (c) 2010, Image Engine Design 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:
#
# * Redistribu... | |
# coding=utf-8
# Copyright 2022 The TensorFlow Datasets 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 appl... | |
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... | |
import functools
from django import http
from django.conf import settings
from django.core.exceptions import PermissionDenied
from django.db.models import Q
from django.db.transaction import non_atomic_requests
from django.shortcuts import get_object_or_404
from django.utils.translation import ugettext, ugettext_lazy ... | |
from __future__ import unicode_literals
import boto
import boto.ec2
import boto3
from boto.exception import EC2ResponseError
from botocore.exceptions import ClientError
import pytest
import sure # noqa
from moto import mock_ec2_deprecated, mock_ec2
from moto.ec2.models import AMIS, OWNER_ID
from moto.core import AC... | |
# Copyright 2020 Google Research. 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... | |
import os
import tempfile
import shutil
from xml.etree import ElementTree as ET
from django.test import TransactionTestCase
from django.core.exceptions import ValidationError
from django.core.files.uploadedfile import UploadedFile
from django.contrib.auth.models import Group
from django.db import IntegrityError
from ... | |
# The Nexus software is licensed under the BSD 2-Clause license.
#
# You should have recieved a copy of this license with the software.
# If you did not, you can find one at the following link.
#
# http://opensource.org/licenses/bsd-license.php
VERSION = "v1.1.-1"
INFO_VIPLIST = [
#AKA: List of awesome people.
... | |
# -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
import json
from django.contrib.auth import get_user_model
from django.test import TestCase
from model_mommy import mommy
from rest_framework.test import APIClient
from core.models import DataFile, Process, ProcessNode, Sample, Substra... | |
# -*- coding: utf-8 -*-
# Licensed under a 3-clause BSD style license - see LICENSE.rst
"""Sundry function and class decorators."""
from __future__ import print_function
import functools
import inspect
import sys
import textwrap
import types
import warnings
from .codegen import make_function_with_signature
from .ex... | |
"""
Routers provide a convenient and consistent way of automatically
determining the URL conf for your API.
They are used by simply instantiating a Router class, and then registering
all the required ViewSets with that router.
For example, you might have a `urls.py` that looks something like this:
router = route... | |
#!/usr/bin/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.
"""This script packages the PNaCl translator files as:
(1) a Chrome Extension (crx), which can be used as a straight-forward CRX,
... | |
"""Support for Epson projector."""
from __future__ import annotations
import logging
from epson_projector.const import (
BACK,
BUSY,
CMODE,
CMODE_LIST,
CMODE_LIST_SET,
DEFAULT_SOURCES,
EPSON_CODES,
FAST,
INV_SOURCES,
MUTE,
PAUSE,
PLAY,
POWER,
SOURCE,
SOURCE_... | |
"""
molecules.py
Define the molecules that make up a simple DNA chain
"""
from copy import deepcopy
import numpy as np
import pandas as pd
from fractaldna.dna_models import dnapositions as dpos
from fractaldna.utils import rotations as rot
# Physical parameters, all in Angstrom
GUANINE_SIZE = dpos.MoleculeFromAtom... | |
# Copyright 2016 Peter Dahlberg
#
# 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 ... | |
#!/usr/bin/python
#
# Copyright (c) 2016, The OpenThread Authors.
# 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... | |
"""hiddenMarkovModel.py contains objects for handling HMMs for SignalAlign"""
from __future__ import print_function
import sys
import os
from itertools import izip
import numpy as np
# Globals
NORM_DIST_PARAMS = 2
NB_MODEL_PARAMS = 5
class SignalHmm(object):
def __init__(self, model_type):
self.match... | |
r"""File-like objects that read from or write to a string buffer.
This implements (nearly) all stdio methods.
f = StringIO() # ready for writing
f = StringIO(buf) # ready for reading
f.close() # explicitly release resources held
flag = f.isatty() # always false
pos = f.tell() # get current pos... | |
import os
import sys
import unittest
import warnings
from types import ModuleType
from django.conf import ENVIRONMENT_VARIABLE, LazySettings, Settings, settings
from django.core.exceptions import ImproperlyConfigured
from django.http import HttpRequest
from django.test import (
SimpleTestCase, TestCase, Transactio... | |
# -*- coding: utf-8 -*-
"""
A collection of utilities for canonicalizing and inspecting graphs.
Among other things, they solve of the problem of deterministic bnode
comparisons.
Warning: the time to canonicalize bnodes may increase exponentially on larger
graphs. Use with care!
Example of comparing two graphs::
... | |
"""Support for Rflink devices."""
import asyncio
from collections import defaultdict
import logging
import async_timeout
import voluptuous as vol
from homeassistant.const import (
ATTR_ENTITY_ID, CONF_COMMAND, CONF_HOST, CONF_PORT,
STATE_ON, EVENT_HOMEASSISTANT_STOP)
from homeassistant.core import CoreState, ... | |
# Copyright 2015 Cisco Systems, 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 writin... | |
import os
import signal
import sys
import numpy as np
import pytest
import ray
from ray.test_utils import (
wait_for_condition,
wait_for_pid_to_exit,
)
SIGKILL = signal.SIGKILL if sys.platform != "win32" else signal.SIGTERM
def test_cached_object(ray_start_cluster):
config = {
"num_heartbeats_t... | |
import json
from flask import g
from sci.utils import random_sha1
from jobserver.utils import get_ts
from jobserver.recipe import Recipe
from jobserver.db import BUILD_HISTORY
KEY_JOB_BUILDS = 'job:builds:%s'
KEY_BUILD = 'build:%s'
KEY_BUILD_SESSIONS = 'sessions:%s'
KEY_SESSION = 'session:%s'
# The session is crea... | |
"""
Utilities for working with nexus tokens.
Helps with generating tokens, validating tokens.
"""
import binascii
from collections import Mapping
from datetime import datetime
import hashlib
import json
import logging
import os
import re
import sys
import time
import urllib
import requests
import rsa
log = logging.g... | |
"""Qt implementation of _Renderer and GUI."""
# Authors: Guillaume Favelier <guillaume.favelier@gmail.com>
# Eric Larson <larson.eric.d@gmail.com>
#
# License: Simplified BSD
from contextlib import contextmanager
import pyvista
from pyvistaqt.plotting import FileDialog
from PyQt5.QtCore import Qt, pyqtSign... | |
import copy
import json
import os.path as op
from inspect import getmro
import six
from six.moves.urllib.parse import urlencode
from .exceptions import ObjectDoesNotExist
from .mixins import ReplicatedMixin, ScalableMixin
from .query import Query
from .utils import obj_merge
class ObjectManager(object):
def __ca... | |
#! /usr/env/python
"""
flow_director_dinf.py: provides the component FlowDirectorDINF.
Directs flow on raster grids only using the Dinfinity algorithm of
Tarboton 1997.
"""
from landlab.components.flow_director.flow_director_to_many import(
_FlowDirectorToMany)
from landlab.components.flow_director import flow_direc... | |
# 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 ... | |
from teafacto.util import ticktock, argprun, inp, tokenize
import os, pickle, random
from teafacto.procutil import *
from IPython import embed
from scipy import sparse
from teafacto.blocks.lang.wordvec import Glove, WordEmb
from teafacto.blocks.lang.sentenc import TwoLevelEncoder
from teafacto.blocks.seq.rnn import RN... | |
import datetime
from urllib.parse import urlencode
from rest_framework.reverse import reverse
from minicash.core.models import Record
from minicash.utils.testing import RESTTestCase
from .factories import AssetFactory, RecordFactory, TagFactory
class FilterTestCaseMixin:
def assert_res_count(self, count, q):
... | |
# Copyright (c) 2013 OpenStack Foundation.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless... | |
"""
The User is really a cheap abstraction for inputs and outputs. Rather than have an individual document
for each input and each output, we group them by users. That way, a device that connects has all its properties
associated with one document, and it becomes trivial to modify/check its properties and valid input ... | |
"""
This script will instruct a physical machine or VM
to run a binary for a specified amount of time
(c) 2015 Massachusetts Institute of Technology
"""
# Native
import logging
logger = logging.getLogger(__name__)
import optparse
import sys
import os
import socket
import time
import multiprocessing
# LO-... | |
# 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.
import argparse
import logging
import os
import csv
import tempfile
from collections import defaultdict
from pathlib import Path
import torch... | |
"""
Tests the content_features module.
"""
import unittest
import numpy as np
import scipy.sparse as ss
import mock
from sklearn.feature_extraction.text import CountVectorizer
from .context import content_features
from .context import config
from .context import util
from .context import test_utils as tu
class Conten... | |
# -*- coding: utf-8 -*-
"""
sphinx.transforms
~~~~~~~~~~~~~~~~~
Docutils transforms used by Sphinx when reading documents.
:copyright: Copyright 2007-2015 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from os import path
from docutils import nodes
from docutils.uti... | |
from functools import partial
from whiskeynode import whiskeycache
from whiskeynode import WhiskeyNode
from whiskeynode.edges import Edge
from whiskeynode.terminaltypes import TerminalType
from whiskeynode.exceptions import (BadEdgeRemovalException,
InvalidEdgeDataException,
... | |
#!/usr/bin/env python3
import sys
import os
import git_wrapper
import path_utils
import string_utils
def change_stash_index(stash_name, index):
if stash_name is None or index is None:
return None
idx_begin = stash_name.rfind("{")
idx_end = stash_name.rfind("}")
if idx_begin == -1 or idx_end =... | |
# Copyright 2018 PerfKitBenchmarker 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 appli... | |
from django.conf import settings
from django.core.checks.messages import Error
from django.core.checks.security import base, csrf, sessions
from django.core.management.utils import get_random_secret_key
from django.test import SimpleTestCase
from django.test.utils import override_settings
class CheckSessionCookieSecu... | |
"""Class to hold all media player accessories."""
import logging
from pyhap.const import CATEGORY_SWITCH
from homeassistant.components.media_player import (
ATTR_INPUT_SOURCE,
ATTR_INPUT_SOURCE_LIST,
ATTR_MEDIA_VOLUME_LEVEL,
ATTR_MEDIA_VOLUME_MUTED,
DOMAIN,
SERVICE_SELECT_SOURCE,
SUPPORT_P... | |
#!/usr/bin/env python
#
# This source file is part of the osgBoostPython library
#
# Copyright (C) 2009-2010 Jean-Sebastien Guay
#
# This program is free software; you can redistribute it and/or modify it under
# the terms of the GNU Lesser General Public License as published by the Free Software
# Foundation; either... | |
from __future__ import division, print_function, absolute_import
from ...utils.six.moves import xrange
import numpy as np
import nose
from dipy.io.bvectxt import orientation_from_string
from dipy.tracking.utils import (affine_for_trackvis, connectivity_matrix,
density_map, length, mov... | |
import datetime
import functools
from dateutil.parser import parse as parse_date
from modularodm import (
fields,
Q,
)
from modularodm.exceptions import NoResultsFound
from modularodm.validators import MaxLengthValidator
from framework.auth import Auth
from framework.exceptions import PermissionsError
from fr... | |
"""Support for Rflink devices."""
import asyncio
from collections import defaultdict
import logging
import async_timeout
import voluptuous as vol
from homeassistant.const import (
ATTR_ENTITY_ID, CONF_COMMAND, CONF_HOST, CONF_PORT,
STATE_ON, EVENT_HOMEASSISTANT_STOP)
from homeassistant.core import CoreState, ... | |
'''Deep Dreaming in Keras.
Run the script with:
```
python deep_dream.py path_to_your_base_image.jpg prefix_for_results
```
e.g.:
```
python deep_dream.py img/mypic.jpg results/dream
```
It is preferable to run this script on GPU, for speed.
If running on CPU, prefer the TensorFlow backend (much faster).
Example res... | |
#!/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... | |
#!/usr/bin/env python
import os, sys, time, datetime, codecs, shutil, subprocess, re, math, base64
from stat import *
from tiapp import *
from xml.dom.minidom import parseString
this_dir = os.path.dirname(os.path.abspath(__file__))
scripts_root_dir = os.path.dirname(this_dir)
tools_root_dir = os.path.dirname(scripts_... | |
import logging
import time
from teuthology.misc import get_testdir, reconnect
from teuthology.orchestra import run
from teuthology.orchestra.remote import Remote
from teuthology.task import install as install_task
log = logging.getLogger(__name__)
def clear_firewall(ctx):
"""
Remove any iptables rules crea... | |
# -*- coding: utf-8 -*-
from operator import attrgetter
from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType
from pyangbind.lib.yangtypes import RestrictedClassType
from pyangbind.lib.yangtypes import TypedListType
from pyangbind.lib.yangtypes import YANGBool
from pyangbind.lib.yangtypes import YANGListTy... | |
from collections import OrderedDict
from music21 import roman, stream, chord, harmony, key, interval
letter_ordering = ['c', 'db', 'd', 'eb', 'e', 'f', 'gb', 'g', 'ab', 'a', 'bb', 'b']
# from resource.py
LETTER_PARTIAL_CO_RELABELS = [[['C##', 'D'], ['A#', 'Bb']],
[['C##', 'D'], ['E#'... | |
# -*- encoding: utf-8 -*-
#
# Copyright 2013 Hewlett-Packard Development Company, L.P.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# ... | |
# 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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.