gt stringclasses 1
value | context stringlengths 2.49k 119k |
|---|---|
import logging
import os
from google.appengine.ext import webapp
from google.appengine.api import users
from google.appengine.ext.webapp import template
import oauth
from stores import check_valid_callback
from utils import initialize_server_request, send_oauth_error
from decorators import oauth_required
from consts ... | |
# -*- coding: utf-8 -*-
from nose.tools import * # noqa
import mock
import httpretty
from tests.base import OsfTestCase
from tests.factories import AuthUserFactory, ProjectFactory
import urlparse
from framework.auth import authenticate, Auth
from website.addons.mendeley.tests.factories import (
MendeleyAccoun... | |
"""
* NCtoolKit (C) 2007-2017 Luis F.Loureiro, under zlib software license.
* code.google.com/p/nctoolkit
*
* Toolkit python buildscript
"""
import subprocess
import os,sys
from stat import *
import datetime
compileOptimization = '-O0' # '-O3'
def PrepareCompiteToObject(incfolders,srcfile,outfile):
fileFlag = os.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
#
# Unless required by applicable law or agreed to in writing, software
# ... | |
from __future__ import division
import calendar
import copy
import math
import time
import re
import urllib
from django.http import HttpResponse
from django_conneg.decorators import renderer
from django_conneg.http import HttpResponseSeeOther
from django_conneg.views import HTMLView, JSONPView
import rdflib
from hum... | |
#!/usr/bin/env python
"""Test for client."""
import array
import pdb
import StringIO
import time
import urllib2
from M2Crypto import X509
import logging
from grr.client import actions
from grr.client import client
from grr.client import comms
from grr.lib import aff4
from grr.lib import communicator
from grr.lib ... | |
"""Models for the aps_production app."""
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
from django.utils.timezone import timedelta
from django.utils.translation import ugettext_lazy as _
class Error(models.Model):
"""
An actual error, that occurred
:order_run:... | |
# pylint: disable=invalid-name, unused-import
"""Symbolic graph construction API.
This namespace contains most of the registered operators.
For detailed list of operators, checkout ``Core Tensor Operators``
"""
from __future__ import absolute_import as _abs
import sys as _sys
import os as _os
import ctypes as _ctypes
... | |
from __future__ import annotations
from abc import (
ABC,
abstractmethod,
)
from collections import abc
import functools
from io import StringIO
from itertools import islice
from typing import (
Any,
Callable,
Mapping,
)
import numpy as np
import pandas._libs.json as json
from pandas._libs.tslibs... | |
#!/usr/bin/python
#
# Useful information can be found at https://svn.planet-lab.org/wiki/NodeManager
#
# Faiyaz Ahmed <faiyaza at cs dot princeton dot edu>
# Copyright (C) 2008 The Trustees of Princeton University
"""Node Manager"""
import optparse
import time
#import xmlrpclib
#import socket
import os
import sys
#... | |
#: processes accounting transactions from text file, and prints the balance
#:
#: usage: python p.py [<options>] <file>
#: options:
#: -i : initial balance file
#: -d : date min/max/month/year
#: examples: 2016, 2016-04, 2016-04:2016-05, 2016-04-02:2016-04-08
#:
#: can be called from any folder, and can use wrapper s... | |
from __future__ import division, print_function, absolute_import
import string
import warnings
from scipy import stats
from scipy.stats import norm, multivariate_normal
from scipy.linalg import toeplitz, pinv
from sklearn import cluster
from sklearn.utils import check_random_state
import autograd.numpy as np
from a... | |
"""Copyright 2012 Phidgets Inc.
This work is licensed under the Creative Commons Attribution 2.5 Canada License.
To view a copy of this license, visit http://creativecommons.org/licenses/by/2.5/ca/
"""
__author__ = 'Adam Stelmack'
__version__ = '2.1.8'
__date__ = 'May 17 2010'
import threading
from ctypes import *
f... | |
# -*- coding: utf-8 -*-
# Copyright (c) 2013, First Party Software
# All rights reserved.
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
# 1. Redistributions of source code must retain the above copyright notice,
# t... | |
#!/usr/bin/env python
# geo2d1.py - Tier 1 code to export geonetwork metadata into a DataONE GMN.
# The International Arctic Research Center (IARC) Data Archive uses the xml
# form of ISO 19115 metadata, ISO 19139. Not all researchers fill out
# metadata that validates, however, so this code xslt transforms the public... | |
# ----------------------------------------------------------------------------
# pyglet
# Copyright (c) 2006-2008 Alex Holkner
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistributi... | |
# coding: utf-8
""" General utilities """
__author__ = "Andy Casey <arc@ast.cam.ac.uk>"
__all__ = ["atomic_number", "element", "reflect_about", "latexify"]
import logging
from collections import namedtuple
from functools import update_wrapper
from threading import RLock
import numpy as np
from scipy.special import... | |
"""
SleekXMPP: The Sleek XMPP Library
Copyright (C) 2011 Nathanael C. Fritz
This file is part of SleekXMPP.
See the file LICENSE for copying permission.
"""
import logging
from sleekxmpp.xmlstream import JID
from sleekxmpp.xmlstream.handler import Callback
from sleekxmpp.xmlstream.matcher import Sta... | |
# -*- coding: utf-8 -*-
"""
Django settings for {{cookiecutter.project_name}} project.
For more information on this file, see
https://docs.djangoproject.com/en/dev/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/dev/ref/settings/
"""
from __future__ import absolu... | |
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
from webnotes.utils.minify import JavascriptMinify
"""
Build the `public` folders and setup languages
"""
import os, sys, webnotes
from cssmin import cssmin
def bundle(no_... | |
# Copyright (c) 2012, Cloudscaling
# 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... | |
# 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 sublime
import operator
import os
import re
# Helper module
try:
from .helper import H
except:
from helper import H
# Settings variables
try:
from . import settings as S
except:
import settings as S
# DBGp protocol constants
try:
from . import dbgp
except:
import dbgp
# Config module... | |
"""
The `compat` module provides support for backwards compatibility with older
versions of django/python, and compatibility wrappers around optional packages.
"""
# flake8: noqa
from __future__ import unicode_literals
import django
import inspect
from django.core.exceptions import ImproperlyConfigured
from django.co... | |
import random
import uuid
from Crypto.PublicKey import RSA
from google.appengine.ext import ndb
from google.appengine.api import users
from base64 import b64encode, b64decode
from jinja2 import Template
from utilities import firebase, keys
from augment_exceptions import NonUniqueException
from constants import *
AL... | |
# Copyright (c) 2014 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
This script is intended for use as a GYP_GENERATOR. It takes as input (by way of
the generator flag config_path) the path of a json file that dictates the file... | |
#!/usr/bin/env python
#
# 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
# "... | |
import os
import stat
import sys
import django
from django.core.management import call_command, CommandError
import click
import requests
from .utils import format_help, order_manually
class Config(object):
def __init__(self):
self.url = "https://raw.githubusercontent.com/pinax/pinax/master/projects.js... | |
# -*- coding: utf8 -*-
"""
.. module:: lesscpy.lessc.parser
:synopsis: Lesscss parser.
http://www.dabeaz.com/ply/ply.html
http://www.w3.org/TR/CSS21/grammar.html#scanner
http://lesscss.org/#docs
Copyright (c)
See LICENSE for details.
.. moduleauthor:: Johann T. Mariusson <jtm@robot.is>
"""
fr... | |
# Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | |
import unittest
from flask_testing import TestCase
from datetime import datetime as dt
from app.models import *
from app import create_app, db
from flask_login import current_user
import json
from base64 import urlsafe_b64encode
from werkzeug.http import parse_authorization_header, parse_accept_header
from werkzeug.dat... | |
# 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... | |
import pytest
import aiohttpretty
from waterbutler.core import exceptions
from waterbutler.providers.bitbucket import BitbucketProvider
from waterbutler.providers.bitbucket.provider import BitbucketPath
from waterbutler.providers.bitbucket import settings as bitbucket_settings
from waterbutler.providers.bitbucket.me... | |
from django.http import Http404
from django.contrib.auth.models import User
from rest_framework import status, generics
from rest_framework.views import APIView
from rest_framework.decorators import api_view
from rest_framework.response import Response
from rest_framework.permissions import AllowAny
from mockatron_core... | |
# Copyright 2017-present Open Networking 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 agr... | |
"""
This module contains helper functions for controlling caching. It does so by
managing the "Vary" header of responses. It includes functions to patch the
header of response objects directly and decorators that change functions to do
that header-patching themselves.
For information on the Vary header, see:
http... | |
# Copyright 2016 Open Source Robotics Foundation, 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... | |
from keras.models import Model
from keras.layers import Input, Masking, Dense, LSTM
from keras.layers import Dropout, TimeDistributed, Bidirectional, merge
from keras.layers.embeddings import Embedding
from keras.utils import np_utils
from keras.optimizers import RMSprop
import numpy as np
import pandas as pd
import ... | |
import ply.lex as lex
import ply.yacc as yacc
import pprint
import sys
reserved = {
'if' : 'IF',
'for' : 'FOR',
'define' : 'DEFINE',
'return' : 'RETURN',
'function' : 'FUNCTION',
'true': 'TRUE',
'false': 'FALSE',
'var' : 'VAR',
'if' : 'IF',
'else' : 'ELSE'
}
tokens = [
'N... | |
#
# Histogram.py -- Histogram plugin for Ginga reference viewer
#
# This is open-source software licensed under a BSD license.
# Please see the file LICENSE.txt for details.
#
import numpy
from ginga.gw import Widgets, Plot
from ginga import GingaPlugin
from ginga import AutoCuts
from ginga.util import plots
class H... | |
#!/usr/bin/env python3
"""
Pegasus Metadata is a tool to query metadata collected by Pegasus workflows.
Usage: pegasus-metadata [-h] [-v] [-c] {task,file,workflow} ... submit_dir
"""
##
# Copyright 2007-2012 University Of Southern California
#
# Licensed under the Apache License, Version 2.0 (the "License");
# yo... | |
import string
from model_mommy import mommy
from datetime import datetime
from django_rq import job
from django.test.client import Client
from django.core.urlresolvers import reverse
from django.test.client import RequestFactory
from django.contrib.auth.models import User
from django.utils import timezone
from dateutil... | |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# 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 License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# ... | |
"""Support for Sonarr."""
from datetime import datetime
import logging
import time
from pytz import timezone
import requests
import voluptuous as vol
from homeassistant.components.sensor import PLATFORM_SCHEMA
from homeassistant.const import (
CONF_API_KEY,
CONF_HOST,
CONF_MONITORED_CONDITIONS,
CONF_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... | |
# Python
import pytest
import mock
# DRF
from rest_framework import status
from rest_framework.response import Response
from rest_framework.exceptions import PermissionDenied
# AWX
from awx.api.generics import (
ParentMixin,
SubListCreateAttachDetachAPIView, SubListAttachDetachAPIView,
DeleteLastUnattach... | |
import pickle
from matplotlib import pyplot
import os
import numpy as np
from pandas.io.parsers import read_csv
from sklearn.utils import shuffle
from lasagne import layers
from lasagne.updates import nesterov_momentum
from nolearn.lasagne import NeuralNet, BatchIterator
FTRAIN = './data/training.csv'
FTEST = './data/... | |
"""
Finite Discrete Random Variables - Prebuilt variable types
Contains
========
FiniteRV
DiscreteUniform
Die
Bernoulli
Coin
Binomial
Hypergeometric
"""
from __future__ import print_function, division
from sympy.core.compatibility import as_int
from sympy.core.logic import fuzzy_not, fuzzy_and
from sympy.stats.frv i... | |
"""Nearest Neighbor Classification"""
# Authors: Jake Vanderplas <vanderplas@astro.washington.edu>
# Fabian Pedregosa <fabian.pedregosa@inria.fr>
# Alexandre Gramfort <alexandre.gramfort@inria.fr>
# Sparseness support by Lars Buitinck <L.J.Buitinck@uva.nl>
#
# License: BSD, (C) INRIA, Univer... | |
"""Dirac notation for states."""
from __future__ import print_function, division
from sympy import (cacheit, conjugate, Expr, Function, integrate, oo, sqrt,
Tuple)
from sympy.core.compatibility import u
from sympy.printing.pretty.stringpict import prettyForm, stringPict
from sympsi.qexpr import QEx... | |
from mrjob.job import MRJob
from mrjob.protocol import PickleProtocol, PickleValueProtocol
import numpy as np
import lxmls.readers.pos_corpus as pcc
from lxmls.sequences.hmm import HMM
import pickle
def load_sequence(s, word_dict, tag_dict):
"""
seq = load_sequence(s, word_dict, tag_dict)
Load a sequence... | |
# 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 (c) 2016 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
#
# Unless requ... | |
# coding: utf-8
# Copyright (c) Pymatgen Development Team.
# Distributed under the terms of the MIT License.
"""
This module implements a FloatWithUnit, which is a subclass of float. It
also defines supported units for some commonly used units for energy, length,
temperature, time and charge. FloatWithUnit also suppor... | |
"""
Flask-Cloudy
"""
import os
import datetime
import base64
import hmac
import hashlib
import warnings
from werkzeug.utils import secure_filename
from werkzeug.datastructures import FileStorage
from importlib import import_module
from flask import send_file, abort, url_for, request
import shortuuid
from libcloud.stor... | |
#
# Copyright 2016 The BigDL 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 ... | |
"""
Operation for decentralized buildings
"""
import time
from math import ceil
import numpy as np
import pandas as pd
from itertools import repeat
import cea.config
import cea.inputlocator
from cea.optimization.master.emissions_model import calc_emissions_Whyr_to_tonCO2yr
import cea.technologies.boiler as boiler... | |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | |
"""Test script for the gzip module.
"""
import unittest
from test import support
from test.support import bigmemtest, _4G
import os
import io
import struct
import array
gzip = support.import_module('gzip')
data1 = b""" int length=DEFAULTALLOC, err = Z_OK;
PyObject *RetVal;
int flushmode = Z_FINISH;
unsigned lo... | |
__author__ = 'adeb'
import numpy as np
import theano
from theano.tensor.signal import downsample
from theano.tensor.nnet import conv, conv3d2d
from theano.tensor.shared_randomstreams import RandomStreams
from spynet.utils.utilities import share, get_h5file_data
from spynet.models.max_pool_3d import max_pool_3d
cl... | |
#!/usr/bin/env python
"Makes working with XML feel like you are working with JSON"
try:
from defusedexpat import pyexpat as expat
except ImportError:
from xml.parsers import expat
from xml.sax.saxutils import XMLGenerator
from xml.sax.xmlreader import AttributesImpl
try: # pragma no cover
from cStringIO i... | |
from _pydev_bundle import pydev_log
from _pydevd_bundle.pydevd_utils import hasattr_checked, DAPGrouper
try:
import StringIO
except:
import io as StringIO
import traceback
from os.path import basename
from functools import partial
from _pydevd_bundle.pydevd_constants import dict_iter_items, dict_keys, xrange, ... | |
#!/usr/bin/env python3
# nlhtree_py/testDropFromU.py
""" Test the drop_from_u_dir functionality. """
import os
import sys
import time
import unittest
from binascii import hexlify
import hashlib
from rnglib import SimpleRNG
from nlhtree import NLHTree, NLHLeaf
from xlattice import HashTypes
from xlu import UDir, DirS... | |
"""Blocking and non-blocking HTTP client interfaces.
This module defines a common interface shared by two implementations,
``simple_httpclient`` and ``curl_httpclient``. Applications may either
instantiate their chosen implementation class directly or use the
`AsyncHTTPClient` class from this module, which selects an... | |
import math
import numpy as np
import os
from osgeo import gdal
from osgeo import osr
from django.conf import settings
from django.contrib.gis.geos import Polygon, MultiPolygon, MultiLineString, LineString, Point
from faker import Factory
from noise import snoise2
from scipy.ndimage.filters import median_filter
from s... | |
'''
Build a neural machine translation model with soft attention
'''
import theano
import theano.tensor as tensor
from theano.sandbox.rng_mrg import MRG_RandomStreams as RandomStreams
import cPickle as pkl
import ipdb
import numpy
import copy
import os
import warnings
import sys
import time
import logging
from colle... | |
import logging
import os
import uuid
from datetime import datetime
from django.conf import settings
from django.contrib.auth.models import User
from django.core.mail import send_mail
from django.db import models
from django.db.models import ManyToManyField
from django.utils.encoding import iri_to_uri
from django.utils... | |
# ripped from https://www.hex-rays.com/products/ida/support/freefiles/vb.idc
# and http://vrt-blog.snort.org/2014/08/discovering-dynamically-loaded-api-in.html
import ptypes,ndk
from ptypes import *
class Str(pstr.string): pass
class Byte(pint.uint8_t): pass
class Word(pint.uint16_t): pass
class Dword(pint.uint32_t)... | |
# -*- 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
#... | |
# 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 ... | |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright 2012 Nicira, Inc
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#... | |
"""
Test reload for trained models.
"""
import os
import pytest
import unittest
import tempfile
import numpy as np
import deepchem as dc
import tensorflow as tf
import scipy
from flaky import flaky
from sklearn.ensemble import RandomForestClassifier
from deepchem.molnet.load_function.chembl25_datasets import CHEMBL25_T... | |
"""
This is the main module for running the BERNAISE code.
More specific info will follow in a later commit.
"""
import dolfin as df
from common.cmd import parse_command_line, help_menu
from common.io import create_initial_folders, load_checkpoint, save_solution, \
load_parameters, load_mesh
__author__ = "Gaute Li... | |
#!/usr/bin/env python
"""A script to generate FileCheck statements for mlir unit tests.
This script is a utility to add FileCheck patterns to an mlir file.
NOTE: The input .mlir is expected to be the output from the parser, not a
stripped down variant.
Example usage:
$ generate-test-checks.py foo.mlir
$ mlir-opt foo... | |
from datetime import (
date,
datetime,
)
import itertools
import numpy as np
import pytest
from pandas.core.dtypes.cast import construct_1d_object_array_from_listlike
import pandas as pd
from pandas import (
Index,
MultiIndex,
Series,
Timestamp,
date_range,
)
import pandas._testing as tm
... | |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 OpenStack 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 requ... | |
# TrumpScript Tokenizer
# 1/16/2016
import os
import random
import re
import sys
from src.trumpscript.allowed_words import ALLOWED
from src.trumpscript.constants import *
from src.trumpscript.disallowed_words import DISALLOWED
class Tokenizer:
@staticmethod
def toke(token_type, token_value, line) -> dict:
... | |
# Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | |
from nose.tools import *
from tests.base import ApiTestCase
from tests.factories import AuthUserFactory, PreprintFactory, PreprintProviderFactory
from api.base.settings.defaults import API_BASE
class TestPreprintRelationshipPreprintProvider(ApiTestCase):
def setUp(self):
super(TestPreprintRelationshipPr... | |
#!/usr/bin/env python
# CREATED:2013-03-08 15:25:18 by Brian McFee <brm2132@columbia.edu>
# unit tests for librosa.filters
#
# This test suite verifies that librosa core routines match (numerically) the output
# of various DPWE matlab implementations on a broad range of input parameters.
#
# All test data is generated... | |
"""
Discretizers classes, to be used in lime_tabular
"""
import numpy as np
import sklearn
import sklearn.tree
import scipy
from sklearn.utils import check_random_state
from abc import ABCMeta, abstractmethod
class BaseDiscretizer():
"""
Abstract class - Build a class that inherits from this class to implemen... | |
"""Logging
"""
import sys
import os
import logging
from pip import backwardcompat
import colorama, pkg_resources
def _color_wrap(*colors):
def wrapped(inp):
return "".join(list(colors) + [inp, colorama.Style.RESET_ALL])
return wrapped
def should_color(consumer, environ, std=(sys.stdout, sys.stderr... | |
import pytest
from tests.utils import load_fixtures
@load_fixtures("tests/fixtures/test_fixture.yaml")
@pytest.mark.parametrize(
"login, password",
[
("tom", "testpassword"),
("kate", "testpassword"),
("paul", "testpassword"),
(None, None),
],
)
@pytest.mark.django_db
def ... | |
# Copyright (C) 2003-2007 John Rochester <john@jrochester.org>
#
# This file is part of paramiko.
#
# Paramiko 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 version 2.1 of the License, or (at ... | |
# Copyright (C) 2010 Google Inc. All rights reserved.
# Copyright (C) 2010 Gabor Rapcsanyi (rgabor@inf.u-szeged.hu), University of Szeged
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of so... | |
# -*- coding: utf-8 -*-
"""
Pdb debugger class.
Modified from the standard pdb.Pdb class to avoid including readline, so that
the command line completion of other programs which include this isn't
damaged.
In the future, this class will be expanded with improvements over the standard
pdb.
The code in this file is ma... | |
#!/usr/bin/env python
# -*- cpy-indent-level: 4; indent-tabs-mode: nil -*-
# ex: set expandtab softtabstop=4 shiftwidth=4:
#
# Copyright (C) 2012,2013,2014,2015,2017 Contributor
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You ... | |
#!/usr/bin/env python
"""
@package mi.dataset.parser
@file marine-integrations/mi/dataset/parser/ctdpf_j_cspp.py
@author Joe Padula
@brief Parser for the ctdpf_j_cspp dataset driver
Release notes:
Modified by Chris Goodrich, December 2014 to remove state stuff
Initial Release
"""
__author__ = 'Joe Padula'
__license_... | |
#!/usr/bin/python
#
# Copyright 2016 Michael Sparks
#
# 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... | |
""" Tools for doing common subexpression elimination.
"""
from __future__ import print_function, division
from sympy.core import Basic, Mul, Add, Pow, sympify, Symbol, Tuple
from sympy.core.singleton import S
from sympy.core.function import _coeff_isneg
from sympy.core.exprtools import factor_terms
from sympy.core.com... | |
#! /usr/bin/env python
from __future__ import division, absolute_import, print_function
# System imports
from distutils.util import get_platform
import os
import sys
import unittest
# Import NumPy
import numpy as np
major, minor = [ int(d) for d in np.__version__.split(".")[:2] ]
if major == 0:
BadListError = T... | |
from image_registration.fft_tools import correlate2d,fast_ffts,dftups,upsample_image,zoom,shift
import image_registration # for doctests
import iterative_zoom
import warnings
import numpy as np
__all__ = ['chi2_shift','chi2_shift_iterzoom','chi2n_map']
def chi2_shift(im1, im2, err=None, upsample_factor='auto', bounda... | |
# Copyright 2015 by Fred Moolekamp
# License: BSD 3-clause
from __future__ import print_function, division
from collections import OrderedDict
from toyz.utils.errors import ToyzJobError
import math
import os
import numpy as np
from toyz.utils import core
from toyz.web import session_vars
# Set the default values for t... | |
# coding: utf-8
"""
Kubernetes
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
The version of the OpenAPI document: release-1.23
Generated by: https://openapi-generator.tech
"""
import pprint
import re # noqa: F401
import si... | |
# Copyright IBM Corp. 2013 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 unicode_literals
# -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'Product._meta_title'
db.add_column('shop_product', '... | |
## www.pubnub.com - PubNub Real-time push service in the cloud.
# coding=utf8
## PubNub Real-time Push APIs and Notifications Framework
## Copyright (c) 2010 Stephen Blum
## http://www.pubnub.com/
## -----------------------------------
## PubNub 3.1 Real-time Push Cloud API
## -----------------------------------
im... | |
# Copyright 2016 Cloudbase Solutions Srl
# 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 r... | |
from xscontainer import api_helper
from xscontainer import util
from xscontainer.util import log
import constants
import fcntl
import errno
import os
import paramiko
import paramiko.rsakey
import select
import socket
import StringIO
import sys
DOCKER_SOCKET_PATH = '/var/run/docker.sock'
SSH_PORT = 22
ERROR_CAUSE_NET... | |
# 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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.