gt stringclasses 1
value | context stringlengths 2.49k 119k |
|---|---|
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Fri Sep 1 10:21:48 2017
@author: carles
"""
import random
import numpy as np
from keras.models import Sequential
from keras.layers.core import Dense
from keras.layers.convolutional import Convolution2D as Conv2D
from keras.layers import MaxPooling2D
from... | |
"""
mbed SDK
Copyright (c) 2011-2013 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 wr... | |
import os
from decimal import Decimal as D
from datetime import datetime
from django.utils.translation import ugettext_lazy as _
from oscar.apps.catalogue.categories import create_from_breadcrumbs
from oscar.core.loading import get_class, get_classes
from oscar.core.compat import UnicodeCSVReader, atomic_compat
Imp... | |
from common_fixtures import * # NOQA
TEST_SERVICE_OPT_IMAGE = 'ibuildthecloud/helloworld'
TEST_SERVICE_OPT_IMAGE_LATEST = TEST_SERVICE_OPT_IMAGE + ':latest'
TEST_SERVICE_OPT_IMAGE_UUID = 'docker:' + TEST_SERVICE_OPT_IMAGE_LATEST
LB_IMAGE_UUID = "docker:sangeetha/testlbsd:latest"
logger = logging.getLogger(__name__)
... | |
from fanstatic import Library, Resource, NeededResources
from fanstatic import compat, Inclusion, MINIFIED
from fanstatic import set_resource_file_existence_checking
from fanstatic.compiler import Compiler, Minifier
from .test_checksum import _copy_testdata
from zipfile import ZipFile
import fanstatic
import fanstatic.... | |
# Authors: Alexandre Gramfort <alexandre.gramfort@inria.fr>
# Vincent Michel <vincent.michel@inria.fr>
# Gilles Louppe <g.louppe@gmail.com>
#
# License: BSD 3 clause
"""Recursive feature elimination for feature ranking"""
import numpy as np
from ..utils import check_X_y, safe_sqr
from ..utils.metaes... | |
# -*- coding: utf-8 -*-
"""
Person Registry, Controllers
@see: U{http://eden.sahanafoundation.org/wiki/BluePrintVITA}
"""
module = request.controller
resourcename = request.function
# -----------------------------------------------------------------------------
# Options Menu (available in all Functions' Vi... | |
#!/usr/bin/python
#
# Copyright 2018-2021 Polyaxon, 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 ... | |
import glob
import json
import os
import re
from datetime import datetime
from ConfigParser import ConfigParser
from pyramid.exceptions import NotFound
from git import Repo
from git.exc import (
InvalidGitRepositoryError, NoSuchPathError, GitCommandError, BadName)
import avro.schema
from elasticutils import ge... | |
"""Provide a way to connect entities belonging to one device."""
import logging
import uuid
from typing import List, Optional
from collections import OrderedDict
import attr
from homeassistant.core import callback
from homeassistant.loader import bind_hass
_LOGGER = logging.getLogger(__name__)
_UNDEF = object()
DA... | |
# 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... | |
# -*- coding: utf-8 -*-
"""
.. module:: pytfa
:platform: Unix, Windows
:synopsis: Thermodynamics-based Flux Analysis
.. moduleauthor:: pyTFA team
Thermodynamic computations for reactions
"""
from functools import reduce
from math import log, sqrt
from . import std
from .utils import find_transported_mets
fro... | |
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | |
# Copyright 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
# not use this file except in compliance with the License. You may obtain
# a ... | |
# -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | |
import time
from dataclasses import dataclass
from typing import Iterator, List
import wsproto
import wsproto.extensions
import wsproto.frame_protocol
import wsproto.utilities
from mitmproxy import connection, http, websocket
from mitmproxy.proxy import commands, events, layer
from mitmproxy.proxy.commands import Star... | |
#!/usr/bin/env python
#
# Copyright (c) 2015 Juniper Networks, Inc. All rights reserved.
#
import logging
import subprocess
import sys
import platform
import argparse
import os
import time
# Parses nodetool status output and returns a dict
# containing the nodes and their status
def parse_nodetool_status_output(outpu... | |
# Copyright 2013: Mirantis 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 b... | |
#!/usr/bin/env python
import subprocess
import multiprocessing
from multiprocessing import Process, Queue
import os
import time
import fileinput
import atexit
import sys
import socket
import re
# Todo:
# turn the enum into an actual enum
# HTTP Scan should be added to the doc
# syn scan doesn't print it's command lin... | |
# Copyright 2014 The Swarming Authors. All rights reserved.
# Use of this source code is governed by the Apache v2.0 license that can be
# found in the LICENSE file.
"""NDB model classes used to model AuthDB relations.
Models defined here are used by central authentication service (that stores all
groups and secrets)... | |
# 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 ... | |
# Python test set -- part 5, built-in exceptions
import os
import sys
import unittest
import pickle, cPickle
from test.test_support import (TESTFN, unlink, run_unittest, captured_output,
check_warnings)
from test.test_pep352 import ignore_deprecation_warnings
# XXX This is not really e... | |
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
"""Miscellaneous file manipulation functions
"""
from future import standard_library
standard_library.install_aliases()
import pickle
import gzip
import hashlib
from hashlib import md5
import simplejson
... | |
# -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | |
#!/usr/bin/env python
# Copyright 2014 the V8 project authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Performance runner for d8.
Call e.g. with tools/run-perf.py --arch ia32 some_suite.json
The suite json format is expected to be... | |
# Copyright (c) 2010 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 ... | |
import httplib
import itertools
import array
import StringIO
import socket
import errno
import os
import tempfile
import unittest
TestCase = unittest.TestCase
from test import test_support
here = os.path.dirname(__file__)
# Self-signed cert file for 'localhost'
CERT_localhost = os.path.join(here, 'keycert.pem')
# Se... | |
#!/usr/bin/env python3
"""
This tool should create bundle specifications and tar packages from input given on stdin
NOTES:
* Create test files e.g with "for n in {1..3}; do dd if=/dev/urandom of=file${n} bs=1M count=1; done"
TODO:
* Add some form of file duplicate check; warning or symlinking
"""
import arg... | |
from unittest.mock import patch
from django.urls import reverse
from rest_framework import status
from bgp.models import Relationship
from devices.models import Platform
from net.models import Connection
from peering.constants import *
from peering.enums import CommunityType, DeviceState, RoutingPolicyType
from peeri... | |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2017, Ansible by Red Hat, inc
#
# This file is part of Ansible by Red Hat
#
# Ansible 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 Li... | |
# GloVe model from the NLP lab at Stanford:
# http://nlp.stanford.edu/projects/glove/.
import array
import collections
import io
try:
# Python 2 compat
import cPickle as pickle
except ImportError:
import pickle
import numpy as np
import scipy.sparse as sp
from .glove_cython import fit_vectors, transform_p... | |
# Copyright 2016 OpenMarket Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writin... | |
from glob import glob
import logging
from OpenSSL.crypto import FILETYPE_PEM
from mcloud.application import ApplicationController
import os
import sys
import netifaces
from traceback import print_tb
import traceback
import inject
from mcloud.deployment import DeploymentController
from mcloud.plugin import IMcloudPlugi... | |
# Copyright 2015-2016 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... | |
import struct
class Packet(object):
"""Creates ICMPv4 and v6 packets.
header
two-item sequence containing the type and code of the packet,
respectively.
version
Automatically set to version of protocol being used or None if ambiguous.
data
Contains data of the pack... | |
# --------------------------------------------------------
# Fast/er R-CNN
# Licensed under The MIT License [see LICENSE for details]
# Written by Bharath Hariharan
# --------------------------------------------------------
import xml.etree.ElementTree as ET
import os
import cPickle
import numpy as np
import ipdb
def ... | |
"""Test the validation module"""
from __future__ import division
import sys
import warnings
import tempfile
import os
from time import sleep
import numpy as np
from scipy.sparse import coo_matrix, csr_matrix
from sklearn.utils.testing import assert_true
from sklearn.utils.testing import assert_false
from sklearn.uti... | |
import math
import glob
import os
import sys
#os.system("apt-get -y update")
#os.system("apt-get -y dist-upgrade")
#os.system("apt-get -y upgrade")
#os.system("apt-get install -y python-tk")
#os.system("pip install youtube-dl")
#os.system("youtube-dl -U")
#os.system("apt-get install -y ffmpeg")
os.system("rm -rf video... | |
#!/usr/bin/env python2.7
from flask import Flask, render_template, send_from_directory, request
import socket,os,sys
from datetime import datetime,timedelta
from datetime import date as ddate
from ConfigParser import SafeConfigParser
import glob
par = SafeConfigParser()
#will be /etc/ssh-rank.ini or where ever you wan... | |
#!/usr/bin/env python3
from tempfile import mkstemp
from shutil import move
from os import remove, close
from datetime import datetime
import re
#from os import system
def replace(filePath, pattern, subst, count):
#Create temp file
fh, absPath = mkstemp()
newFile = open(absPath,'w')
oldFile = open(fileP... | |
#!/usr/bin/env python
from Tkinter import *
from tkFileDialog import askopenfilename
import os,time
_THEME_COLOR = "moccasin" # theme color for selection, highlights, etc.
# see full list in /usr/lib/X11/rgb.txt
_CHROME_COLOR= "grey95" # color for backgrounds of objects
_HIGHLIGHT_C... | |
##
# Copyright (c) 2014-2017 Apple 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 l... | |
from robot.http_connection import HttpConnection
import pytest
from asynctest.mock import MagicMock, Mock
from aiohttp.client import ClientSession
from unittest.mock import sentinel, call, DEFAULT
from aiosocks.connector import ProxyClientRequest
from aiohttp import ClientError
class MockResponse:
async def __aen... | |
import numpy as np
import pytest
from pandas._libs.tslibs.period import IncompatibleFrequency
from pandas.core.dtypes.dtypes import PeriodDtype
from pandas import (
Index,
NaT,
Period,
PeriodIndex,
Series,
date_range,
offsets,
period_range,
)
import pandas._testing as tm
from pandas.c... | |
# -*- coding: utf-8 -*-
"""Page Admin module."""
from pages import settings
from pages.models import Page, Content, PageAlias, Media
from pages.phttp import get_language_from_request, get_template_from_request
from pages.utils import get_placeholders
from pages.templatetags.pages_tags import PlaceholderNode
from pages.... | |
"""
Settings for Oscar's demo site.
Notes:
* The demo site uses the stores extension which requires a spatial database.
Only the postgis and spatialite backends are tested, but all backends
supported by GeoDjango should work.
"""
import os
# Django settings for oscar project.
PROJECT_DIR = os.path.dirname(__fi... | |
from __future__ import absolute_import
import pytest
from datetime import datetime, timedelta
from django.core.urlresolvers import reverse
from sentry.testutils import APITestCase, SnubaTestCase
from sentry.testutils.helpers.datetime import before_now, iso_format
class DiscoverQueryTest(APITestCase, SnubaTestCase)... | |
# -*- coding: utf-8 -*-
"""Module that contains functionality to monitor stopping.
Rationale
---------
In machine learning, optimization is usually not performed until the objective
is minimized; instead, if this is the case, the true objective (to which the
loss function being minimized is often just a proxy) is w... | |
# -*- coding: utf-8 -*-
"""
Compatibility code to be able to use `cookielib.CookieJar` with requests.
requests.utils imports from here, so be careful with imports.
"""
import collections
from .compat import cookielib, urlparse, Morsel
try:
import threading
# grr, pyflakes: this fixes "redefinition of unused... | |
# Copyright 2012 OpenStack Foundation
# Copyright 2013 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/LIC... | |
# 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... | |
import sys
import re
from operator import itemgetter
from random import choice
from random import randint
from HTMLParser import HTMLParser # html.parser in Python 3
from UserString import MutableString
# constants
VERSION = 1
# punch line defaults
punch_default_speed = 85
punch_default_shape = 100
punch_default_vo... | |
"""
Functions for reading and writing shapefiles.
These are simple wrappers around OGR and Shapely
libraries.
"""
from __future__ import print_function
import six
try:
from osgeo import ogr,osr
except ImportError:
import ogr,osr
import glob,os,re
from shapely import wkb,wkt
from shapely.geometry import Pol... | |
# -*- coding: utf-8 -*-
"""
Created on Feb 20, 2014
@author: Aaron Ponti
"""
import re
import random
from MicroscopyCompositeDatasetConfig import MicroscopyCompositeDatasetConfig
from ch.systemsx.cisd.openbis.dss.etl.dto.api import ChannelColor
from ch.systemsx.cisd.openbis.dss.etl.dto.api import ImageIdentifier
fro... | |
#!/usr/bin/env python2
# copyright (c) 2014 the moorecoin core developers
# distributed under the mit software license, see the accompanying
# file copying or http://www.opensource.org/licenses/mit-license.php.
#
# test rest interface
#
from test_framework.test_framework import moorecointestframework
from test_frame... | |
# -*- coding: utf-8 -*-
#
# This file is part of PyBuilder
#
# Copyright 2011-2020 PyBuilder Team
#
# 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/l... | |
#!/usr/bin/env python3
import unittest
import random
from scapy.packet import Raw
from scapy.layers.l2 import Ether, Dot1Q
from scapy.layers.inet import IP, UDP
from framework import VppTestCase, VppTestRunner
from util import Host, ppp
from vpp_sub_interface import VppDot1QSubint, VppDot1ADSubint
class TestL2bd(V... | |
import pytest
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support.ui import Select
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.common.keys import Keys
from selenium.common.exceptions import Time... | |
"""
This file holds all the functions common in the tests files
"""
import unittest
import json
from app.models.shopping import User, ShoppingList, ShoppingItem, BlacklistToken
from app import create_app, db
class BaseTestClass(unittest.TestCase):
"""
This is the parent class for all test classes of endpoints... | |
from themer import ColorParser, check_file_regex
import re
class VimColorParser(ColorParser):
check = check_file_regex('\.vim$')
vimGroups = ['Normal', 'Visual', 'VertSplit', 'Identifier', 'Statement', 'PreProc', 'Type', 'Function', 'String', 'Conditional', 'Repeat', 'Label', 'Operator', 'Keyword', 'Exception... | |
# Copyright 2014 IBM Corp.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed t... | |
import datetime
import logging
import re
from google.appengine.runtime.apiproxy_errors import DeadlineExceededError
class HolidayContext:
def __init__(self, calendar_service=None, start_date=None, end_date=None, email=None, name=None, message=None, search_calendars=None, dry_run=None):
self.calendar_serv... | |
from data_utils import featured_frame
from feature_extractor import *
from data_utils.featured_frame import *
import numpy as np
import scipy.stats as sts
import scipy.integrate as integr
from scipy.interpolate import interp1d
from sympy import mpmath
class TimeDomainFeatureExtractor(FeatureExtractor):
def __in... | |
#!/usr/bin/env python
"""Display APOGEE instrument status
History:
2011-05-06 ROwen
2011-08-31 ROwen Added support for new keyword missingFibers and new utrData fields.
2011-08-31 ROwen Modified to better handle an unknown number of missing fibers.
2011-09-09 ROwen Added a title and improved the help strings.... | |
import boto
import sure # noqa
from freezegun import freeze_time
from moto import mock_dynamodb
from boto.dynamodb import condition
from boto.dynamodb.exceptions import DynamoDBKeyNotFoundError
from boto.exception import DynamoDBResponseError
def create_table(conn):
message_table_schema = conn.create_schema(
... | |
# -*- coding: utf-8 -*-
#
# Copyright 2015-2015 Spotify AB
#
# 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 u... | |
# Copyright 2012 OpenStack Foundation
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# Copyright 2011,2012 Akira YOSHIYAMA <akirayoshiyama@gmail.com>
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "Lic... | |
from datetime import datetime
import json
import django
from django.contrib.auth.models import User
from django.core.urlresolvers import reverse
from django.db.models.signals import pre_save
from django.test.testcases import TestCase
from tastypie import fields
from tastypie.exceptions import ApiFieldError, NotFound
... | |
import demistomock as demisto
from CommonServerPython import *
from CommonServerUserPython import *
''' IMPORTS '''
import requests
from requests.auth import HTTPBasicAuth
# Disable insecure warnings
requests.packages.urllib3.disable_warnings()
''' GLOBALS/PARAMS '''
USERNAME = demisto.params()['credentials']['ide... | |
# Copyright (C) 2015 Philipp Baumgaertel
# All rights reserved.
#
# This software may be modified and distributed under the terms
# of the BSD license. See the LICENSE.txt file for details.
from math import fabs
import unittest
from skgpuppy.Covariance import GaussianCovariance, SPGPCovariance, Covariance, Dot, Peri... | |
"""This template tag library is used for displaying pagination links in
paginated Django views. It exposes a template tag `{% paginationplus %}` that
will take care of iterating over the page numbers.
Usage
-----
Add `paginationplus` to your `INSTALLED_APPS` in your settings.
At the start of the template for your pa... | |
# Copyright 2012 Anton Beloglazov
#
# 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 writ... | |
"""Landlab component that simulates overland flow.
This component simulates overland flow using the 2-D numerical model of
shallow-water flow over topography using the de Almeida et al., 2012
algorithm for storage-cell inundation modeling.
.. codeauthor:: Jordan Adams
Examples
--------
>>> import numpy as np
>>> fro... | |
#!/usr/bin/env python
import argparse
import common
import fileinput
import multiprocessing
import os
import os.path
import re
import subprocess
import sys
import traceback
EXCLUDED_PREFIXES = ("./generated/", "./thirdparty/", "./build", "./.git/",
"./bazel-", "./bazel/external", "./.cache",
... | |
"""
################################################################################
# Copyright (c) 2003, Pfizer
# Copyright (c) 2001, Cayce Ullman.
# Copyright (c) 2001, Brian Matthews.
#
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provid... | |
"""
The following :class:`Filter` and :class:`Wheel` classes can be used to simulate
coronagraph observations in imaging mode.
"""
import numpy as np
import matplotlib.pyplot as plt
from matplotlib import gridspec
import os
class Filter(object):
"""Filter for telescope imaging mode.
Parameters
----------... | |
# 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... | |
#!/usr/bin/env python
# coding: utf-8
import pytest
import os
import warnings
from pandas import DataFrame, Series
from pandas.compat import zip, iteritems
from pandas.util._decorators import cache_readonly
from pandas.core.dtypes.api import is_list_like
import pandas.util.testing as tm
from pandas.util.testing impor... | |
#!/usr/bin/env python3
# Copyright (c) 2017 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""An example functional test
The module-level docstring should include a high-level description of
what the t... | |
#!/usr/bin/env python2.4
"""static - A stupidly simple WSGI way to serve static (or mixed) content.
(See the docstrings of the various functions and classes.)
Copyright (C) 2006 Luke Arno - http://lukearno.com/
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General... | |
"""Assets represent Financial Assets, these are claims based on a contract.
These are often referred to as Securities or Products in other libraries.
"""
from __future__ import absolute_import, division, print_function
import pandas as pd
from pandas import DataFrame
from numbers import Number
from pandas.tseries.o... | |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2011 Cloudscaling Group, Inc
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LI... | |
#!/usr/bin/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 b... | |
from __future__ import absolute_import
import cgi
import email.utils
import hashlib
import getpass
import json
import logging
import mimetypes
import os
import platform
import re
import shutil
import sys
import tempfile
from pip._vendor.six.moves.urllib import parse as urllib_parse
import pip
from pip.exceptions im... | |
# Copyright 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 agreed to in... | |
"""Object-oriented interface to SWF wrapping boto.swf.layer1.Layer1"""
import time
from functools import wraps
from boto.swf.layer1 import Layer1
from boto.swf.layer1_decisions import Layer1Decisions
DEFAULT_CREDENTIALS = {
'aws_access_key_id': None,
'aws_secret_access_key': None
}
def set_default_credential... | |
#
# Evy - a concurrent networking library for Python
#
# Unless otherwise noted, the files in Evy are under the following MIT license:
#
# Copyright (c) 2012, Alvaro Saurin
# Copyright (c) 2008-2010, Eventlet Contributors (see AUTHORS)
# Copyright (c) 2007-2010, Linden Research, Inc.
# Copyright (c) 2005-2006, Bob Ippo... | |
# Copyright (c) 2020 Dell Inc. or its subsidiaries.
#
# 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... | |
#!/usr/bin/env python
#
# This library is free software, distributed under the terms of
# the GNU Lesser General Public License Version 3, or any later version.
# See the COPYING file included in this archive
#
# The docstrings in this module contain epytext markup; API documentation
# may be created by processing this... | |
# (C) Copyright 2021 Inova Development 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 appl... | |
# -*- coding: utf-8 -*-
"""
CMS
Simple Content Management System
"""
module = request.controller
resourcename = request.function
if not settings.has_module(module):
raise HTTP(404, body="Module disabled: %s" % module)
from datetime import timedelta
# ===================================================... | |
import pytest
from jinja2 import TemplateNotFound
from werkzeug.http import parse_cache_control_header
import flask
def test_blueprint_specific_error_handling(app, client):
frontend = flask.Blueprint("frontend", __name__)
backend = flask.Blueprint("backend", __name__)
sideend = flask.Blueprint("sideend",... | |
"""
Usage:
cfgen FILE [list] [OPTIONS] [--overwrite]
Commands:
list list variables and their values
Options:
--overwrite overwrite existing file
metaconfig cache
.cfgen.cache
<variable_name> = <value>
metaconfig file
cfgen.metaconfig
<variable_name> = <shell_command>
*.template
jinja templat... | |
import unittest
from test import test_support
import os
import socket
import StringIO
import urllib2
from urllib2 import Request, OpenerDirector
# XXX
# Request
# CacheFTPHandler (hard to write)
# parse_keqv_list, parse_http_list, HTTPDigestAuthHandler
class TrivialTests(unittest.TestCase):
def test_trivial(sel... | |
# Copyright 2020 DeepMind Technologies 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 ag... | |
#!/usr/bin/env python
import copy
import datetime
import email
from email.utils import parseaddr
import logging
import logging.handlers
from pprint import pprint, pformat
import re
import smtplib
import string
import sys
import time
import traceback
from configobj import ConfigObj
from email_reply_parser import Email... | |
from sqlalchemy import ForeignKey
from sqlalchemy import func
from sqlalchemy import inspect
from sqlalchemy import Integer
from sqlalchemy import literal
from sqlalchemy import literal_column
from sqlalchemy import null
from sqlalchemy import select
from sqlalchemy import String
from sqlalchemy import testing
from sql... | |
"""
pygments.lexers._tsql_builtins
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
These are manually translated lists from https://msdn.microsoft.com.
:copyright: Copyright 2006-2022 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
# See https://msdn.microsoft.com/en-us/library/ms17... | |
# Copyright (c) 2012 NetApp, 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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.