gt stringclasses 1
value | context stringlengths 2.49k 119k |
|---|---|
# -*- coding: utf-8 -*-
# pylint: disable=W0231, W0142
"""Tests for statistical power calculations
Note:
tests for chisquare power are in test_gof.py
Created on Sat Mar 09 08:44:49 2013
Author: Josef Perktold
"""
import copy
import warnings
import nose
from distutils.version import LooseVersion
import numpy as... | |
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
"""
Boot session from cache or build
Session bootstraps info needed by common client side activities including
permission, homepage, default variables, system defaults etc
"""... | |
import re
import collections
from enum import Enum
from ydk._core._dm_meta_info import _MetaInfoClassMember, _MetaInfoClass, _MetaInfoEnum
from ydk.types import Empty, YList, YLeafList, DELETE, Decimal64, FixedBitsDict
from ydk._core._dm_meta_info import ATTRIBUTE, REFERENCE_CLASS, REFERENCE_LIST, REFERENCE_LEAFLI... | |
# Copyright 2019 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 argparse
import re
def process_qasm(fname):
qgates = ['H','X','CNOT','Y','Z','S','T','Tdag','Sdag','Rz','PrepX','PrepZ','MeasX','MeasZ','Toffoli','Fredkin']
qgates_1 = ['H','X','Y','Z','S','T','Tdag']
qgates_1a = ['Sdag']
qgates_2 = ['CNOT']
qgates_3 = ['Toffoli','Fredkin']
qga... | |
"""Test system log component."""
import logging
from unittest.mock import MagicMock, patch
from homeassistant.core import callback
from homeassistant.bootstrap import async_setup_component
from homeassistant.components import system_log
_LOGGER = logging.getLogger('test_logger')
BASIC_CONFIG = {
'system_log': {
... | |
# Copyright 2015 Paul Balanca. 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... | |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 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.apach... | |
# -----------------------------------------------------------------------------
# Copyright (c) 2014--, The Qiita Development Team.
#
# Distributed under the terms of the BSD 3-clause License.
#
# The full license is in the file LICENSE, distributed with this software.
# ------------------------------------------------... | |
#!/usr/bin/env impala-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 (... | |
# Copyright 2011 VMware, 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 a... | |
# -*- coding: utf-8 -*-
import warnings
import numpy as np
from pytz import utc
from pandas._libs import tslib
from pandas._libs.tslib import Timestamp, NaT, iNaT
from pandas._libs.tslibs import (
conversion, fields, timezones,
resolution as libresolution)
from pandas.util._decorators import cache_readonly
... | |
# This file is part of Indico.
# Copyright (C) 2002 - 2019 CERN
#
# Indico is free software; you can redistribute it and/or
# modify it under the terms of the MIT License; see the
# LICENSE file for more details.
from __future__ import unicode_literals
import re
from flask import render_template
from flask_plugineng... | |
from django.contrib.auth.mixins import LoginRequiredMixin
from django.db import transaction as db_transaction
from django.http import Http404
from django.http.response import HttpResponseRedirect
from django.shortcuts import get_object_or_404
from django.urls import reverse_lazy, reverse
from django.views import View
f... | |
# -*- coding: utf-8 -*-
from __future__ import print_function
import pytest
from datetime import timedelta
import numpy as np
from pandas import (DataFrame, Series, date_range, Timedelta, Timestamp,
compat, concat, option_context)
from pandas.compat import u
from pandas import _np_version_under1... | |
#!/usr/bin/env python2.7
# -*- coding: utf-8 -*-
#
# The MIT License (MIT)
#
# Copyright (c) 2014-2015 Develer S.r.L.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, i... | |
# Copyright 2018 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | |
# Copyright (c) 2014 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
# Helpful routines for regression testing
#
# Add python-bitcoinrpc to module search path:
import os
import sys
from decimal impor... | |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# (c) Copyright 2012-2013 Hewlett-Packard Development Company, L.P.
# All Rights Reserved.
#
# 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. ... | |
# -*- coding: utf-8 -*-
from __future__ import (absolute_import, division, print_function,
unicode_literals)
import itertools
from grako.model import NodeWalker
try:
import pygraphviz as pgv
except:
raise
__all__ = ['draw']
def draw(filename, grammar):
traverser = GraphvizWalk... | |
"""
This module implements the built-in class and method decorators and their
handling classes.
"""
# Standard library imports
import functools
import inspect
# Local imports
from uplink import arguments, helpers, hooks, interfaces, utils
from uplink.compat import abc
__all__ = [
"headers",
"params",
"for... | |
#!/usr/bin/env python
#
# Copyright 2010 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 require... | |
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
#
# The contents of this file are subject to the Mozilla Public License
# Version 1.1 (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.mozilla.org/MPL/
#
# Softwa... | |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.conf import settings
from django.core import mail
from django.core.urlresolvers import reverse
from django.test import TestCase
from django.utils.crypto import salted_hmac
from .test_models import MessageModelFactory, BlacklistedEmailFactory
... | |
#!/usr/bin/env python3
#
# Copyright 2016 Red Hat, Inc.
#
# Authors:
# Fam Zheng <famz@redhat.com>
#
# This work is licensed under the MIT License. Please see the LICENSE file or
# http://opensource.org/licenses/MIT.
from django.conf.urls import url
from django.http import HttpResponse, Http404
from django.urls i... | |
"""Test to verify that Home Assistant core works."""
# pylint: disable=protected-access
import asyncio
import logging
import os
import unittest
from unittest.mock import patch, MagicMock
from datetime import datetime, timedelta
from tempfile import TemporaryDirectory
import voluptuous as vol
import pytz
import pytest
... | |
"""
Input/Output tools for working with binary data.
The Stata input tools were originally written by Joe Presbrey as part of PyDTA.
You can find more information here http://presbrey.mit.edu/PyDTA
See Also
--------
numpy.lib.io
"""
import warnings
from statsmodels.compat.python import (lzip, lmap, lrange,
... | |
import unittest
import numpy as np
import io
import inspect
from unittest.mock import Mock, patch, call
from io import StringIO
import os
from vasppy.summary import (Summary, md5sum, potcar_spec, find_vasp_calculations,
load_vasp_summary)
from vasppy.vaspmeta import VASPMeta
from pymatgen.... | |
#
# Copyright 2012 ibiblio
#
# 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.txt
#
# Unless required by applicable law or agreed to in writing... | |
# -*- coding: utf-8 -*-
"""
jinja.utils
~~~~~~~~~~~
Utility functions.
**license information**: some of the regular expressions and
the ``urlize`` function were taken from the django framework.
:copyright: 2007 by Armin Ronacher, Lawrence Journal-World.
:license: BSD, see LICENSE for more... | |
# Copyright (c) 2014 Hoang Do, Phuc Vo, P. Michiardi, D. Venzano
#
# 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 argparse
import deep_architect.utils as ut
from deep_architect.contrib.misc.datasets.loaders import (load_cifar10,
load_mnist)
from deep_architect.contrib.misc.datasets.dataset import InMemoryDataset
from deep_architect.searchers import common as se
fro... | |
"""
Calculation thread for modeling
"""
import time
import numpy as np
import math
from sas.sascalc.data_util.calcthread import CalcThread
from sas.sascalc.fit.MultiplicationModel import MultiplicationModel
class Calc2D(CalcThread):
"""
Compute 2D model
This calculation assumes a 2-fold symmetry of th... | |
from jsonrpc import ServiceProxy
import sys
import string
# ===== BEGIN USER SETTINGS =====
# if you do not set these you will be prompted for a password for every command
rpcuser = ""
rpcpass = ""
# ====== END USER SETTINGS ======
if rpcpass == "":
access = ServiceProxy("http://127.0.0.1:5888")
else:
access = Ser... | |
"""Create bcbio_sample.yaml files from standard templates and lists of input files.
Provides an automated way to generate a full set of analysis files from an inpu
YAML template. Default templates are provided for common approaches which can be tweaked
as needed.
"""
import collections
import contextlib
import copy
im... | |
import ConfigParser
import copy
import datetime
import getpass
import logging
import os
import re
import sys
from StringIO import StringIO
import traceback
import types
import textwrap
from optparse import OptionParser, OptionGroup
import basedefs
import validators
from . import utils
import processors
import output_... | |
# Copyright 2018 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 -*-
'''
Wrapper around Server Density API
=================================
.. versionadded:: 2014.7.0
'''
# Import Python libs
from __future__ import absolute_import
import json
import logging
import os
import tempfile
# Import 3rd-party libs
import salt.ext.six as six
from salt.ext.six.moves im... | |
import os
import sys
import re
import types
import itertools
import numpy
import CGAT.Stats as Stats
import CGAT.IndexedGenome as IndexedGenome
from CGATReport.Tracker import *
from PeakcallingReport import *
##########################################################################
#################################... | |
# Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | |
#!/usr/bin/env python
# coding: utf-8
from datetime import datetime
from distutils import spawn
import argparse
import json
import os
import platform
import shutil
import socket
import sys
import urllib
import urllib2
__version__ = '6.0.2'
############################################################################... | |
# Copyright (c) 2008, Aldo Cortesi. All rights reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify,... | |
from sqlalchemy import exc as sqla_exc
from sqlalchemy import text
from alembic.testing import exclusions
from alembic.testing.requirements import SuiteRequirements
from alembic.util import compat
from alembic.util import sqla_compat
class DefaultRequirements(SuiteRequirements):
@property
def unicode_string(... | |
# 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... | |
#!/usr/bin/python
#
# Copyright 2015 CityGrid Media, 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 applic... | |
#!/usr/bin/env python
# encoding: utf-8
################################################################################
#
# RMG - Reaction Mechanism Generator
#
# Copyright (c) 2002-2017 Prof. William H. Green (whgreen@mit.edu),
# Prof. Richard H. West (r.west@neu.edu) and the RMG Team (rmg_dev@mit.edu)
#
# ... | |
from basic import Basic, S
from operations import AssocOp
from cache import cacheit
from logic import fuzzy_not
from numbers import Integer, Rational
from symbol import Symbol
# internal marker to indicate:
# "there are still non-commutative objects -- don't forget to processe them"
class NC_Marker:
is_Order ... | |
""" Testing utility functions
"""
import numpy as np
import random
from dipy.core.geometry import (sphere2cart, cart2sphere,
nearest_pos_semi_def,
sphere_distance,
cart_distance,
vector_co... | |
"""
@package mi.instrument.seabird.sbe16plus_v2.ctdbp_no.driver
@file mi/instrument/seabird/sbe16plus_v2/ctdbp_no/driver.py
@author Tapana Gupta
@brief Driver class for sbe16plus V2 CTD instrument.
"""
__author__ = 'Tapana Gupta'
__license__ = 'Apache 2.0'
import re
import time
from mi.core.log import get_logger
lo... | |
#!/usr/bin/python
# Standard Library
import argparse
import datetime
import json
import logging
import os
import subprocess
from functools import wraps
# Third Party
import requests
import mixingboard
from chassis.database import db_session
from chassis.models import User, Account, JobHistory, Notification, Token
fro... | |
#!/usr/bin/env python
import os
import sys
from svm import *
from svm import __all__ as svm_all
__all__ = ['evaluations', 'svm_load_model', 'svm_predict', 'svm_read_problem',
'svm_save_model', 'svm_train'] + svm_all
sys.path = [os.path.dirname(os.path.abspath(__file__))] + sys.path
def svm_read_problem(... | |
import numpy as np
import math
from pylab import *
from palettable.wesanderson import Zissou_5 as wsZ
import matplotlib.ticker as mtick
from scipy.interpolate import interp1d
from scipy.interpolate import griddata
#from sg_filter import savitzky_golay
from scipy.signal import savgol_filter
import scipy.fftpack
def ... | |
"""Site services for use with a Web Site Process Bus."""
import os
import re
import signal as _signal
import sys
import time
import threading
from cherrypy._cpcompat import basestring, get_daemon, get_thread_ident, ntob, set, Timer, SetDaemonProperty
# _module__file__base is used by Autoreload to make
# absolute any... | |
import sys, os, math
import Image
from collections import namedtuple
from clint.textui import progress
import xml.etree.ElementTree as ET
BBox = namedtuple("Bbox", 'x y w h')
AtlasData = namedtuple("Atlas", "src_images, mips, bboxes")
def NextMultipleOf(n, target):
mod = n % target
if mod == 0:
retu... | |
# Copyright 2020 Catalyst Cloud
#
# 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 agre... | |
#!/usr/bin/python
#============================ adjust path =====================================
import sys
import os
if __name__ == "__main__":
here = sys.path[0]
sys.path.insert(0, os.path.join(here, '..', '..','libs'))
sys.path.insert(0, os.path.join(here, '..', '..','external_libs'))
#==============... | |
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import unittest
from typing import Dict, List
import torch
import tests.utils as test_utils
from fairseq import utils
from fairseq.data impo... | |
import logging
import spotipy
import spotipy.oauth2 as oauth2
import json
import datetime
from errbot import BotPlugin, botcmd
class BotifyPlugin(BotPlugin):
def activate(self):
from config import BOTIFY_CREDS
super(BotifyPlugin, self).activate()
# dict of name: id for playlists, name is t... | |
from datetime import datetime
from os import path
from django.core.urlresolvers import NoReverseMatch
from django.test.utils import override_settings
from nose.tools import eq_, ok_
import amo.tests
from mkt.comm.models import (CommAttachment, CommunicationNote,
CommunicationThread, Comm... | |
# file test_fedora/test_views.py
#
# Copyright 2011 Emory University Libraries
#
# 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
#
#... | |
"""
This module contains the base Script class that all
scripts are inheriting from.
It also defines a few common scripts.
"""
from sys import getsizeof
from time import time
from collections import defaultdict
from twisted.internet.defer import maybeDeferred
from twisted.internet.task import LoopingCall
from django.... | |
#!/usr/bin/python
#
# Copyright (C) 2012 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# pylint: disable=missing-docstring,invalid-name
import random
import tempfile
import shutil
import os.path
# pylint: disable=redefined-builtin,wildcard-import,unused-wildcard-import
from ansible.module_utils.basic import * # noqa: F403
DOCUMENTATION = '''
---
module: open... | |
import fnmatch
import os
import re
import sys
NAME = "name"
DISPLAY_NAME = "display_name"
SIZE = "size"
PATH = "path"
BASE_FILE = "base_file"
LINE = "line"
ASM = "asm"
STACK_SIZE = "stack_size"
STACK_QUALIFIERS = "stack_qualifiers"
ADDRESS = "address"
TYPE = "type"
TYPE_FUNCTION = "function"
TYPE_VARIABLE = "variable"... | |
import re
import logging
from subprocess import Popen, PIPE, CalledProcessError, check_output as _check_output
from dummy import config
from dummy.utils import io
__all__ = ( "parse", "baseline" )
logger = logging.getLogger( __name__ )
# alias check_output to not pipe to stdout
check_output = lambda cmd: _check_outp... | |
from future import standard_library
standard_library.install_aliases()
from builtins import str
from builtins import object
from cgi import escape
from io import BytesIO as IO
import functools
import gzip
import dateutil.parser as dateparser
import json
import os
from flask import after_this_request, request, Response
... | |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2011, Cisco Systems, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-... | |
"""
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... | |
#!/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 VCoinTestFramework
from test_framework.util import *
from test_framewor... | |
# Copyright (c) 2012 OpenStack Foundation
# All Rights Reserved.
# Copyright 2013 Red Hat, 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/lice... | |
'''
Proto-Beads & their filesystem layout
'''
import os
import zipfile
from . import layouts
from . import meta
from . import tech
from .bead import Bead
# technology modules
persistence = tech.persistence
securehash = tech.securehash
fs = tech.fs
# generated with `uuidgen -t`
META_VERSION = 'aaa947a6-1f7a-11e6-ba... | |
"""Utility functions that don't fit in the main modules"""
from __future__ import print_function, division
import numpy as np
import pandas as pd
def connect_nfldb():
"""Connect to the nfldb database.
Rather than using the builtin method we make our own,
since we're going to use SQLAlchemy as the engine... | |
import os
from os.path import sep, normpath, join, exists
import ntpath
import copy
from collections import namedtuple
import shutil
from subprocess import Popen, PIPE
import re
from tools.arm_pack_manager import Cache
from tools.targets import TARGET_MAP
from tools.export.exporters import Exporter
from tools.export.c... | |
# Copyright 2019 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | |
import csv
import math
import random
# This is an implementation of the Naive Bayes Algorithm.
# The dataset we are using is comprised of 768 observations of medical
# details for Pima Native American patients.
"""
Pima Native American dataset: https://archive.ics.uci.edu/ml/datasets/pima+indians+diabetes
Row schema:... | |
# -*- coding: utf-8 -*-
# try something like
from text_utils import cram
@caching
def index():
response.files.append(URL(r=request,c='static',f='css/prettyCheckboxes.css'))
response.files.append(URL(r=request,c='static',f='js/prettyCheckboxes.js'))
def timetable():
q = db.activity.type!='poster'
... | |
import logging
import ldap
import re
class LDAPPublisher:
"""
Publish a Zimbra addressbook to a LDAP server
"""
addressbook = None
""" Zimbra Addressbook to publish """
config = None
""" Publisher configuration """
attribute_map = {
"cn": "fileAsStr",
"sn": "_attrs... | |
"""Test libzmq security (libzmq >= 3.3.0)"""
# -*- coding: utf8 -*-
# Copyright (C) PyZMQ Developers
# Distributed under the terms of the Modified BSD License.
import os
import contextlib
import time
from threading import Thread
import zmq
from zmq.tests import (
BaseZMQTestCase, SkipTest, PYPY
)
from zmq.utils ... | |
from __future__ import division, print_function, absolute_import
from ...utils.six.moves import xrange
import numpy as np
import nose
from dipy.io.bvectxt import orientation_from_string
from dipy.tracking.utils import (affine_for_trackvis, connectivity_matrix,
density_map, length, mov... | |
# 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 (c) 2010-2012 David Rio Vierra
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WA... | |
from __future__ import absolute_import, division, print_function
import math
import re
from operator import getitem
from .compatibility import unicode
from .context import _globals
from .core import add, inc # noqa: F401
from .core import (istask, get_dependencies, subs, toposort, flatten,
revers... | |
# Copyright 2015 StackHut 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 writing, so... | |
# Natural Language Toolkit: IPI PAN Corpus Reader
#
# Copyright (C) 2001-2012 NLTK Project
# Author: Konrad Goluchowski <kodie@mimuw.edu.pl>
# URL: <http://www.nltk.org/>
# For license information, see LICENSE.TXT
import functools
from .util import StreamBackedCorpusView, concat
from .api import CorpusReader
def _pa... | |
import sendgrid
import os
sg = sendgrid.SendGridAPIClient(os.environ.get('SENDGRID_API_KEY'))
##################################################
# Retrieve all mail settings #
# GET /mail_settings #
params = {'limit': 1, 'offset': 1}
response = sg.client.mail_settings.get(query_params=params)
print(response.status_... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
test_grapper
----------------------------------
Tests for `grapper` module.
"""
import unittest
from grapper import grapper
import os
import json
import multiprocessing
OUTPUT_FILE = "test_output.json"
class TestGrapper(unittest.TestCase):
def setUp(self):
... | |
#!/usr/bin/env python
# Copyright (c) 2012 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""This script manages the installed toolchains in the chroot.
"""
import copy
import glob
import json
import os
from chromite... | |
# Copyright 2012-2013 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Modifications made by Cloudera are:
# Copyright (c) 2016 Cloudera, 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. A cop... | |
"""
Base classes for writing management commands (named commands which can
be executed through ``django-admin.py`` or ``manage.py``).
"""
import os
import sys
from io import BytesIO
from optparse import make_option, OptionParser
import traceback
import django
from django.core.exceptions import ImproperlyConfigured
f... | |
"""
Form Widget classes specific to the Django admin site.
"""
from __future__ import unicode_literals
import copy
from django import forms
from django.contrib.admin.templatetags.admin_static import static
from django.core.urlresolvers import reverse
from django.forms.widgets import RadioFieldRenderer
from django.for... | |
#!/usr/bin/env python2
"""
mbed SDK
Copyright (c) 2011-2014 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 applicabl... | |
#!/usr/bin/env python
#
# Copyright 2006, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list... | |
from aiida.orm.calculation.job import JobCalculation
from aiida.orm.data.parameter import ParameterData
from aiida.orm.data.structure import StructureData
from aiida.common.exceptions import InputValidationError
from aiida.common.datastructures import CalcInfo, CodeInfo
from aiida.common.utils import classproperty
fro... | |
import pytest
import uuid
import os
from django.utils.translation import ugettext_lazy as _
from django.utils.encoding import smart_text
from awx.main.scheduler.dag_workflow import WorkflowDAG
class Job():
def __init__(self, status='successful'):
self.status = status
class WorkflowNode(object):
de... | |
# Copyright (c) 2015 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 ... | |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 OpenStack LLC
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# Copyright 2011 - 2012 Justin Santa Barbara
# All Rights Reserved.
#
# Licensed under the Apache License, ... | |
# <license>
# Copyright (C) 2011 Andrea Interguglielmi, All rights reserved.
# This file is part of the coral repository downloaded from http://code.google.com/p/coral-repo.
#
# Modified for the Hive system by Sjoerd de Vries
# All modifications copyright (C) 2012 Sjoerd de Vries, All rights reserved
#
# Redistributio... | |
# 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.
"""Finds desktop browsers that can be controlled by telemetry."""
import logging
import os
import sys
import dependency_manager # pylint: disable=import-er... | |
import os, psycopg2, re, time
import logging
import shutil
from urlparse import urlparse
logger = logging.getLogger(__name__)
class Postgresql:
def __init__(self, config):
self.name = config["name"]
self.params = config.get('parameters', {})
self.listen_addrs = self.params.get('listen_a... | |
import collections
from dateutil.parser import parse
from datetime import datetime, timedelta
import json
from urlparse import urlparse
from waffle.models import Switch
from django.conf import settings
from django.core import mail
from django.core.cache import cache
from django.contrib.auth.tokens import default_toke... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.