gt stringclasses 1
value | context stringlengths 2.49k 119k |
|---|---|
import logging
from pylons import request, response, session
from pylons import tmpl_context as c
from pylons.controllers.util import abort, redirect_to, url_for
from pylons.decorators import validate
from formencode import validators
from cogenircapp.lib.base import BaseController
import cogenircapp.model as model
l... | |
import pytest
import numpy as np
from numpy.testing import assert_array_almost_equal, assert_array_equal, assert_allclose
from sklearn.datasets import load_linnerud
from sklearn.cross_decomposition._pls import (
_center_scale_xy,
_get_first_singular_vectors_power_method,
_get_first_singular_vectors_svd,
... | |
#!/usr/bin/python
#
# Copyright (C) 2013 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless require... | |
"""
Interaction with the Supervisor daemon
======================================
.. code-block:: yaml
wsgi_server:
supervisord.running:
- require:
- pkg: supervisor
- watch:
- file: /etc/nginx/sites-enabled/wsgi_server.conf
"""
import logging
log = logging.getLogger(__... | |
from PIL import Image
from StringIO import StringIO
import imagedb.links
import imagehash
import json
import subprocess
import re
import numpy
import tempfile
import hashlib
import zlib
import config
images = config.images
class NoTags(Exception):
pass
class Exists(Exception):
pass
class NoDocument(Exceptio... | |
# -*- coding: utf-8 -*-
"""
Production Configurations
- Use djangosecure
- Use Amazon's S3 for storing static files and uploaded media
- Use mailgun to send emails
- Use Redis on Heroku
{% if cookiecutter.use_sentry_for_error_reporting == 'y' %}
- Use sentry for error logging
{% endif %}
{% if cookiecutter.use_opbeat ... | |
#!/usr/bin/env python2
#
# Distributed under the MIT/X11 software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
from test_framework.mininode import *
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import *
from test_framew... | |
# $Id: io.py 4750 2006-09-16 21:32:29Z wiemann $
# Author: David Goodger <goodger@python.org>
# Copyright: This module has been placed in the public domain.
"""
I/O classes provide a uniform API for low-level input and output. Subclasses
will exist for a variety of input/output mechanisms.
"""
__docformat__ = 'reStr... | |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
# This module implements the base NDData class.
import numpy as np
from copy import deepcopy
from .nddata_base import NDDataBase
from .nduncertainty import NDUncertainty, UnknownUncertainty
from astropy import log
from astropy.units import Unit, Quantit... | |
# ------------------------------------
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
# ------------------------------------
from collections import namedtuple
from ._enums import LedgerUserRole, TransactionState
try:
from typing import TYPE_CHECKING
except ImportError:
TYPE_CHECKI... | |
# Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import sys
from metrics import Metric
from telemetry.value import histogram
from telemetry.value import histogram_util
from telemetry.value import scalar
... | |
# 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 fnmatch
import imp
import logging
import modulefinder
import optparse
import os
import sys
import zipfile
from telemetry import benchmark
from teleme... | |
from jnpr.junos import jxml
from jnpr.junos import jxml as JXML
from lxml.etree import _Element
from ncclient.operations.rpc import RPCError
class RpcError(Exception):
"""
Parent class for all junos-pyez RPC Exceptions
"""
def __init__(
self, cmd=None, rsp=None, errs=None, dev=None, time... | |
"""The tests for the geojson platform."""
from asynctest.mock import patch, MagicMock, call
from homeassistant.components import geo_location
from homeassistant.components.geo_location import ATTR_SOURCE
from homeassistant.components.geo_location.geo_json_events import \
SCAN_INTERVAL, ATTR_EXTERNAL_ID, SIGNAL_DEL... | |
import numpy as np
__all__ = ['ANTsTransform',
'set_ants_transform_parameters',
'get_ants_transform_parameters',
'get_ants_transform_fixed_parameters',
'set_ants_transform_fixed_parameters',
'apply_ants_transform',
'apply_ants_transform_to_point',
... | |
import datetime
from django.conf import settings
from django.core import mail
from django.core.urlresolvers import reverse
from django.test import TestCase
from registration import forms
from registration.models import RegistrationProfile
from registration import get_user_model
TEST_USER_MODEL = get_user_model()
... | |
#!/usr/bin/env python
"""NumPy: array processing for numbers, strings, records, and objects.
NumPy is a general-purpose array-processing package designed to
efficiently manipulate large multi-dimensional arrays of arbitrary
records without sacrificing too much speed for small multi-dimensional
arrays. NumPy is built ... | |
# -*- coding: utf-8 -*-
'''
manage the "remote management" service via kickstart and property lists.
:maintainer: Mosen <mosen@github.com>
:maturity: beta
:depends: mac_prefs
:platform: darwin
'''
# This would not have been possible without the hard work from dayglojesus/managedmac
import binascii
... | |
from django.template import loader
from django.core.urlresolvers import reverse
from django.utils.translation import ugettext_lazy as _
from django.utils.decorators import method_decorator
from django.views.decorators.csrf import csrf_protect
from django.contrib.contenttypes.models import ContentType
from django.db im... | |
import numpy as np
import pandas as pd
from optmize import *
import cv2
from sklearn import metrics
from sklearn.metrics import pairwise_distances
def evaluate(membership,dataSet):
exp = np.array(getExpResult(membership))
index = metrics.silhouette_score(np.array(dataSet), exp, metric='euclidean')
print in... | |
from django.shortcuts import render
from rango.models import Category
from rango.models import Page
from rango.models import User
from rango.forms import CategoryForm
from rango.forms import PageForm
from rango.forms import UserForm, UserProfileForm
from django.contrib.auth import authenticate, login
from django.http i... | |
# -*- test-case-name: twisted.mail.test.test_mailmail -*-
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Implementation module for the I{mailmail} command.
"""
from __future__ import print_function
import os
import sys
import rfc822
import getpass
from ConfigParser import ConfigParser
t... | |
# -*- coding: utf-8 -*-
import base64
import hashlib
import json
import logging
import os
import shutil
import subprocess
import sys
import tempfile
import traceback
import urlparse
import uuid
import zipfile
from django import forms
from django.conf import settings
import requests
from appvalidator import validate_a... | |
"""Let's Encrypt client crypto utility functions.
.. todo:: Make the transition to use PSS rather than PKCS1_v1_5 when the server
is capable of handling the signatures.
"""
import logging
import os
import time
import Crypto.Hash.SHA256
import Crypto.PublicKey.RSA
import Crypto.Signature.PKCS1_v1_5
import M2Cryp... | |
# Copyright (C) 2016 Nippon Telegraph and Telephone 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://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | |
# 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... | |
import itertools as it
import difflib
import glob
import os
from pkg_resources import resource_filename
from lxml import etree as ET
import parmed as pmd
import pytest
from foyer import Forcefield, forcefields
from foyer.forcefield import generate_topology
from foyer.forcefield import _check_independent_residues, _s... | |
# -*- coding: utf-8 -*-
import os
import datetime
import httplib as http
import time
import functools
import furl
import itsdangerous
import jwe
import jwt
import mock
import pytest
from django.utils import timezone
from django.contrib.auth.models import Permission
from framework.auth import cas, signing
from framewo... | |
# Copyright 2012 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Copyright 2012 Nebula, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the... | |
""" an XML-RPC server to allow remote control of PyMol
Author: Greg Landrum (glandrum@users.sourceforge.net)
Created: January 2002
$LastChangedDate$
License: This file is part of the RDKit. The contents are covered by the terms of
the BSD license which is included in the file license.txt, f... | |
#from scipy import *
from pylab import *
import numpy
import collections as cll
from tank import *
#from math import pi
# Read data
Datasource=0 #or 0:Paraview gauges 1:Gauge functions 2:Vof integration 3:Zero crossing analysis
Variable=1 # 0:y; 1:u; 2:v
if Datasource!=3:
Numbe... | |
# Copyright (c) 2015 Quobyte 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... | |
# 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 ... | |
#!/usr/bin/env python
"""
Copyright 2012 GroupDocs.
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 ... | |
# 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 use ... | |
#!/usr/bin/env python3
# Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""A tool to generate symbols for a binary suitable for breakpad.
Currently, the tool only supports Linux, Android, and Mac. Support ... | |
# coding=utf-8
# Copyright 2018 The Tensor2Tensor 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... | |
# Copyright 2020 The TensorFlow Probability 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 o... | |
# -*- coding: utf-8 -
#
# This file is part of gunicorn released under the MIT license.
# See the NOTICE for more information.
import t
import os
import sys
from gunicorn import config
from gunicorn.app.base import Application
from gunicorn.workers.sync import SyncWorker
dirname = os.path.dirname(__file__)
def cfg_... | |
from collections import Iterator, namedtuple
from operator import add
import pickle
from random import random
import pytest
from dask.imperative import value, do, to_task_dasks, compute, Value
from dask.utils import raises
def test_value():
v = value(1)
assert v.compute() == 1
assert 1 in v.dask.values(... | |
#!/usr/bin/env python3
# botler: the CCoWMU IRC bot.
import socket
import logging
import sys
import glob
import datetime
import requests
import traceback
import os
import re
import shutil
import json
import ssl
# Load PostgreSQL library
try:
import psycopg2
except ImportError:
pass
def load_config(file_nam... | |
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
# Copyright (c) 2010 Citrix Systems, Inc.
# Copyright 2011 Ken Pepple
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use t... | |
import ast
import json
import threading
import os
from copy import deepcopy
from util import user_dir, print_error, print_msg, print_stderr, PrintError
from bitcoin import MAX_FEE_RATE, FEE_TARGETS
SYSTEM_CONFIG_PATH = "/etc/electrum-arg.conf"
config = None
def get_config():
global config
return config
... | |
'''
This is the main server code of the swiss knife dns
'''
import sys
import logging
import SocketServer
import dnslib
import traceback
from swandns.swan_errors.exceptions import SWAN_StopProcessingRequest,SWAN_DNS_Exception,SWAN_SkipProcessing,SWAN_NoSuchZoneError,SWAN_DropAnswer,SWAN_UnkownInetFamily
from swandns.ut... | |
#!/usr/bin/env python
"""This file contains common grr jobs."""
import logging
import os
import pdb
import traceback
import psutil
from grr.client import client_utils
from grr.lib import flags
from grr.lib import rdfvalue
# pylint: disable=unused-import
from grr.lib import rdfvalues
# pylint: enable=unused-import
... | |
# Copyright 2019 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import annotations
import enum
import itertools
import logging
import os
import pickle
from abc import ABC, abstractmethod
from collections import defaultdict
from datacla... | |
#
# 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
# ... | |
"""Tests for the ReviewRequestLastUpdateResource."""
from __future__ import unicode_literals
from dateutil.parser import parse as parse_date
from django.contrib.auth.models import User
from django.utils import six
from djblets.webapi.testing.decorators import webapi_test_template
from reviewboard.diffviewer.models i... | |
# Copyright 2018 The AI Safety Gridworlds 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 b... | |
# 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
# distributed under the... | |
from __future__ import division, print_function
import numpy as np
np.random.seed(1337)
from copy import deepcopy
from numpy import log, sqrt
from numpy.random import choice
from time import time
from keras.models import load_model
import keras
import numba as nb
from numba import jit
from heuristic_agent import *
siz... | |
#!/usr/bin/env python
# encoding: utf-8
"""Test Hdfs client interactions with HDFS."""
from collections import defaultdict
from hdfs.client import *
from hdfs.util import HdfsError, temppath
from util import _IntegrationTest
from nose.tools import eq_, nottest, ok_, raises, assert_regex
from requests.exceptions impor... | |
#
# This source file is part of the EdgeDB open source project.
#
# Copyright 2008-present MagicStack Inc. and the EdgeDB 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... | |
from rpython.rtyper.test.test_llinterp import interpret
from rpython.translator.c.test.test_genc import compile
from rpython.tool.pytest.expecttest import ExpectTest
from rpython.tool.udir import udir
from rpython.rlib import rposix, rposix_stat, rstring
import os, sys
import errno
import py
def rposix_requires(funcna... | |
"""The tests the History component."""
# pylint: disable=protected-access,invalid-name
from copy import copy
from datetime import timedelta
import json
from unittest.mock import patch, sentinel
import pytest
from homeassistant.components import history, recorder
from homeassistant.components.recorder.models import pr... | |
# -*- 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
... | |
#!/usr/bin/env python
import vtk
import numpy as np
from vmtk import vmtkscripts
import argparse
import copy
import sys
# extract region boundaries
class GetBoundaries():
def __init__(self, args):
self.Surface = None
self.InputFile = args.surface
self.OutputFile = args.file_out
... | |
"""
This module handles the conversion of docstring flavors to Markdown.
The conversion from docstring flavors to Markdown is mostly done with regular expressions.
This is not particularly beautiful, but good enough for our purposes.
The alternative would be to depend on <https://github.com/rr-/docstring_parser> or a ... | |
"""LAS File Reader
The main class defined here is LASReader, a class that reads a LAS file
and makes the data available as a Python object.
"""
# Copyright (c) 2011, Warren Weckesser
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted, provid... | |
#!/usr/bin/python
from __future__ import (absolute_import, division, print_function)
# Copyright 2019 Fortinet, Inc.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the Lic... | |
from __future__ import unicode_literals, division, absolute_import
from builtins import * # pylint: disable=unused-import, redefined-builtin
import logging
import os
import re
import shutil
import time
from flexget import plugin
from flexget.entry import Entry
from flexget.event import event
from flexget.utils impor... | |
#!/usr/bin/python
# Copyright 2011 WebDriver committers
#
# 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... | |
# Revision graph generator for Mercurial
#
# Copyright 2008 Dirkjan Ochtman <dirkjan@ochtman.nl>
# Copyright 2007 Joel Rosdahl <joel@rosdahl.net>
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2 or any later version.
"""supports walking the history as D... | |
#!/usr/bin/env python
# encoding: utf-8
"""
Copyright (c) 2010 The Echo Nest. All rights reserved.
Created by Scotty Vercoe on 2010-08-25.
The Catalog module loosely covers http://developer.echonest.com/docs/v4/catalog.html
Refer to the official api documentation if you are unsure about something.
"""
try:
import... | |
import numpy as np
import tensorflow as tf
class tf_RNN_LSTM_Classifier:
"""RNN classifier with LSTM cells with tensorflow
"""
#get a batch of training data from the whole training dataset randomly
@staticmethod
def get_random_batch(data, target, batch_size):
num_of_training_data ... | |
"""Nearly exact trust-region optimization subproblem."""
from __future__ import division, print_function, absolute_import
import numpy as np
from scipy.linalg import (norm, get_lapack_funcs, solve_triangular,
cho_solve)
from ._trustregion import (_minimize_trust_region, BaseQuadraticSubproble... | |
from __future__ import division, print_function
import numpy as np
import matplotlib.pyplot as plt
from astropy.io import fits as pyfits
import glob
from astropy.stats.funcs import median_absolute_deviation as MAD
from scipy.ndimage import label
from photo_test import raw_moment, intertial_axis, plot_bars
from kepf... | |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 Michael Still and Canonical 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:... | |
#!/usr/bin/env python
import os
try:
__IPYTHON__
import sys
del sys.argv[1:]
except:
pass
import srwl_bl
import srwlib
import srwlpy
import srwl_uti_smp
def set_optics(v=None):
el = []
pp = []
names = ['S0', 'S0_HDM', 'HDM', 'HDM_S1', 'S1', 'S1_S2', 'S2', 'S2_CRL1', 'CRL1', 'CRL2', 'CRL2... | |
# -*- coding: utf-8 -*-
import cherrypy
import mako
import mimetypes
import os
import six
import girder.events
from girder import constants, logprint, __version__, logStdoutStderr, _setupCache
from girder.models.setting import Setting
from girder import plugin
from girder.settings import SettingKey
from girder.utility... | |
# 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... | |
"""
.. function:: file(location, [formatting options])
Opens and returns a file or url as a table. The file's format is defined through
named options. *location* is defined through a URL, or a regular filename, can be given also as
the named parameter *url* or *file*. If no named parameters are given the returned tabl... | |
from django.core import mail
from django.core.urlresolvers import resolve
from django.template.loader import render_to_string
from django.test import TestCase
from django.utils.html import escape
from blog.views import (about, about_site, category, contact, index, show_post)
from .factories import *
class HomePageTe... | |
#
# 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... | |
# __init__.py -- The tests for dulwich
# Copyright (C) 2007 James Westby <jw+debian@jameswestby.net>
#
# Dulwich is dual-licensed under the Apache License, Version 2.0 and the GNU
# General Public License as public by the Free Software Foundation; version 2.0
# or (at your option) any later version. You can redistribut... | |
# Copyright 2014 IBM Corp.
# 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... | |
#!/usr/bin/python
# @lint-avoid-python-3-compatibility-imports
#
# ext4dist Summarize ext4 operation latency.
# For Linux, uses BCC, eBPF.
#
# USAGE: ext4dist [-h] [-T] [-m] [-p PID] [interval] [count]
#
# Copyright 2016 Netflix, Inc.
# Licensed under the Apache License, Version 2.0 (the "License")
#
# 12-Fe... | |
import pytest
import numpy as np
from keras import backend as K
from keras.layers import core
from keras.utils.test_utils import layer_test, keras_test
@keras_test
def test_masking():
layer_test(core.Masking,
kwargs={},
input_shape=(3, 2, 3))
@keras_test
def test_merge():
from... | |
# Protocol Buffers - Google's data interchange format
# Copyright 2008 Google Inc. All rights reserved.
# http://code.google.com/p/protobuf/
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions o... | |
"""Offer reusable conditions."""
from datetime import timedelta
import functools as ft
import logging
import sys
from homeassistant.helpers.typing import ConfigType
from homeassistant.core import HomeAssistant
from homeassistant.components import (
zone as zone_cmp, sun as sun_cmp)
from homeassistant.const import... | |
"OrderPortal: Form pages."
from __future__ import print_function, absolute_import
import json
import logging
import tornado.web
from . import constants
from . import saver
from . import settings
from . import utils
from .fields import Fields
from .requesthandler import RequestHandler, ApiV1Mixin
class FormSaver(s... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Script to load word embeddings from different representations
and save them in the nlpnet format (numpy arrays and a text
vocabulary).
"""
import argparse
import re
import logging
import numpy as np
from six.moves import cPickle
from collections import defaultdict
im... | |
from __future__ import absolute_import
import logging
log = logging.getLogger(__name__)
from flask import request, jsonify
from bokeh import protocol
from .bbauth import (
handle_auth_error
)
from ..app import bokeh_app
from ..crossdomain import crossdomain
from ..serverbb import get_temporary_docid, BokehServe... | |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
This module provides utilities for PSF-fitting photometry.
"""
from astropy.table import QTable
from astropy.modeling.models import Const2D, Identity, Shift
from astropy.nddata.utils import add_array, extract_array
import numpy as np
__all__ = ['prep... | |
# 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... | |
# Copyright 2011 OpenStack Foundation.
# (C) Copyright 2015 Hewlett-Packard Development Company, L.P.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# ... | |
'''
Test suite for serializer classes.
'''
import sys
from random import Random
from datetime import datetime
import pytest
import random_words
from ...types import NotRegisteredError, NameNotRegisteredError
from ..base import (
TypeRegistrySerializationBase,
TypeNotSerializableError,
)
class Serialization... | |
import os.path
import sys
import hashlib
from cStringIO import StringIO
import re
from lixian_encoding import default_encoding
def magnet_to_infohash(magnet):
import re
import base64
m = re.match(r'magnet:\?xt=urn:btih:(\w+)', magnet)
assert m, magnet
code = m.group(1)
if re.match(r'^[a-zA-Z0-9]{40}$', code):
... | |
# Copyright 2014-2015 ARM Limited
#
# 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... | |
from sklearn.preprocessing import StandardScaler, LabelEncoder, Imputer
from keras.utils import np_utils
import pandas as pd
import numpy as np
import logging
class explicit_imputer():
def __init__(self):
pass
def transform(self, data):
if not isinstance(data, pd.DataFrame):
rais... | |
"""Support for Russound multizone controllers using RIO Protocol."""
import logging
import voluptuous as vol
from homeassistant.components.media_player import MediaPlayerDevice, PLATFORM_SCHEMA
from homeassistant.components.media_player.const import (
MEDIA_TYPE_MUSIC,
SUPPORT_SELECT_SOURCE,
SUPPORT_TURN_... | |
#! /usr/bin/env python
# $Header$
'''Compound typecodes.
'''
from pysphere.ZSI import _children, _child_elements, \
_inttypes, _stringtypes, _seqtypes, _find_arraytype, _find_href, \
_find_type, _get_idstr, EvaluateException
from pysphere.ZSI.TC import _get_xsitype, TypeCode, Any, AnyElement, AnyType, \
... | |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2007-2009 Christopher Lenz
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution.
"""Python client API for CouchDB.
>>> server = Server()
>>> db = server.create('python-tests')
>>> ... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
nodeenv
~~~~~~~
Node.js virtual environment
:copyright: (c) 2014 by Eugene Kalinin
:license: BSD, see LICENSE for more details.
"""
import contextlib
import io
import sys
import os
import re
import stat
import logging
import operator
import optpar... | |
#!/usr/bin/env python
# Copyright 2011 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 ... | |
# 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 os
import sys
from io import StringIO
from unittest import expectedFailure, skip
from django.apps import apps
from django.conf import settings
from django.core import serializers
from django.db import router
from django.db.transaction import atomic
from django.utils.module_loading import import_string
# The pr... | |
#
# LOFAR Transients Key Project
"""
General purpose astronomical coordinate handling routines.
"""
import sys
import math
import pywcs
import logging
import datetime
import pytz
from casacore.measures import measures
from casacore.quanta import quantity
logger = logging.getLogger(__name__)
# Note that we take a +v... | |
# -*- coding: utf-8 -*-
from django.forms import TextInput, Media, TextInput, CharField, Form, MultiWidget
from django.template import Template, Context
from django.test import TestCase
from django.test.utils import override_settings
@override_settings(
STATIC_URL=None,
MEDIA_URL='http://media.example.com/med... | |
"""
This module contains the spatial lookup types, and the `get_geo_where_clause`
routine for Oracle Spatial.
Please note that WKT support is broken on the XE version, and thus
this backend will not work on such platforms. Specifically, XE lacks
support for an internal JVM, and Java libraries are required to use... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.