gt stringclasses 1
value | context stringlengths 2.49k 119k |
|---|---|
#!/usr/bin/env python3
#
# 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 "L... | |
#!/usr/bin/python
# Disable some pylint messages
# pylint: disable=C0103,R0201,R0904,W0511
# C0103 : Invalid name "%s" (should match %s)
# W0212 : Access to a protected member %s of a client class
# R0201 : Method could be a function
# R0904 : Too many public methods
# W0511 : TODO/FIXME/XXX
"""
Quaternion definition... | |
#!/usr/bin/env python
#
# Copyright (c) 2015 Pavel Lazar pavel.lazar (at) gmail.com
#
# The Software is provided WITHOUT ANY WARRANTY, EXPRESS OR IMPLIED.
#####################################################################
import json
import capabilities
import re
from collections import OrderedDict
from configurat... | |
#!/usr/bin/python
#The MIT License (MIT)
#
#Copyright (c) 2015 Stephen P. Smith
#
#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... | |
#
# Copyright 2015 Google Inc.
#
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
#
#!/usr/bin/env python
usage = '''
Write extra flags to outfile for DM based on the bot name:
$ python dm_flags.py outfile Test-Ubuntu-GCC-GCE-CPU-AVX2-x86-Debug
Or run self-tests:... | |
# Copyright 2016 The TensorFlow Authors. All Rights Reserved.
# Modifications Copyright 2017 Abigail See
#
# 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... | |
# Copyright 2015 - Rackspace Hosting
#
# 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... | |
from __future__ import print_function, division, absolute_import
from collections import namedtuple
import sys
from llvmlite.ir import Value
from llvmlite.llvmpy.core import Constant, Type, Builder
from . import (_dynfunc, cgutils, config, funcdesc, generators, ir, types,
typing, utils)
from .errors i... | |
"""
@package mi.instrument.harvard.massp.rga.test.test_driver
@file marine-integrations/mi/instrument/harvard/massp/rga/driver.py
@author Peter Cable
@brief Test cases for rga driver
USAGE:
Make tests verbose and provide stdout
* From the IDK
$ bin/test_driver
$ bin/test_driver -u [-t testname]
... | |
#!/usr/bin/env python
from __future__ import print_function
import argparse
import errno
import itertools
import json
import multiprocessing
import os
import shutil
import subprocess
import sys
import traceback
from shutil import copyfile
BARE_INTERFACE_SEARCH_PATHS = [
"usr/lib/swift",
"System/iOSSupport/us... | |
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:46942")
else:
access = Se... | |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
import os.path
import keyring
import numpy as np
import re
import tarfile
import string
import requests
import warnings
from pkg_resources import resource_filename
from bs4 import BeautifulSoup
import pyvo
from urllib.parse import urljoin
from astropy.ta... | |
import sys
import os
import unittest
import itertools
import time
from array import array
from weakref import proxy
try:
import threading
except ImportError:
threading = None
from test import test_support
from test.test_support import TESTFN, run_unittest
from UserList import UserList
class AutoFileTests(unit... | |
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
#
# Copyright 2014 Measurement Lab
#
# 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 ... | |
<<<<<<< HEAD
<<<<<<< HEAD
"""Python version compatibility support for minidom.
This module contains internal implementation details and
should not be imported; use xml.dom.minidom instead.
"""
# This module should only be imported using "import *".
#
# The following names are defined:
#
# NodeList -- lightest ... | |
# ----------------------------------------------------------------------------
# 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:
#
# * Redistribu... | |
# -*- coding: utf-8 -*-
from __future__ import print_function
from acq4.devices.OptomechDevice import *
import time
import numpy as np
from acq4.Manager import getManager
from acq4.devices.Stage import Stage, MoveFuture
from acq4.util.Thread import Thread
import acq4.pyqtgraph as pg
from acq4.util import Qt
from acq4.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
# distributed under t... | |
# coding=utf-8
# Copyright 2019 The Interval Bound Propagation 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 ... | |
import re
import os
from zope.interface.interfaces import ComponentLookupError
from zope.component import getUtility
from node.ext.directory import Directory
from node.ext.template import (
XMLTemplate,
DTMLTemplate,
)
from node.ext.zcml import (
ZCMLFile,
SimpleDirective,
)
from agx.core import (
h... | |
#
# Copyright 2013 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | |
from memsql.common.connection_pool import MySQLError
from memsql.common import json, errorcodes, sql_utility
import time
from datetime import datetime
from contextlib import contextmanager
PRIMARY_TABLE = """\
CREATE TABLE IF NOT EXISTS %(prefix)s_tasks (
id INT AUTO_INCREMENT PRIMARY KEY,
created TIMESTAMP DE... | |
from __future__ import division
from pygal.colors import (
parse_color, unparse_color,
rgb_to_hsl, hsl_to_rgb, darken, lighten, saturate, desaturate, rotate)
def test_parse_color():
assert parse_color('#123') == (17, 34, 51, 1., '#rgb')
assert parse_color('#cdf') == (204, 221, 255, 1., '#rgb')
as... | |
"""Cutoff-based soft filtering of genomic variants.
"""
from distutils.version import LooseVersion
import math
import os
import shutil
import numpy
import toolz as tz
import yaml
from bcbio import broad, utils
from bcbio.distributed.transaction import file_transaction
from bcbio.pipeline import config_utils
from bcbi... | |
from collections import Counter
from functools import reduce
from itertools import product
from operator import mul
import numpy as np
from .. import config
from ..base import tokenize
from ..core import flatten
from ..highlevelgraph import HighLevelGraph
from ..utils import M, parse_bytes
from .core import Array, no... | |
# 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 2011 OpenStack LLC.
# 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/... | |
#
# Copyright 2015 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 or agreed to in writing... | |
# 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 __future__ import unicode_literals
import datetime
from django.contrib.admin import ModelAdmin, TabularInline
from django.contrib.admin.helpers import InlineAdminForm
from django.contrib.admin.tests import AdminSeleniumWebDriverTestCase
from django.contrib.auth.models import Permission, User
from django.contrib.... | |
from __future__ import absolute_import, unicode_literals
import collections
import json
import mock
from django.core.urlresolvers import reverse
from django.test import TestCase
from django.test.utils import override_settings
from wagtail.api.v2 import signal_handlers
from wagtail.tests.demosite import models
from w... | |
# Copyright (c) 2013, Intel Corporation
# 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 of condit... | |
'''
Stack Layout
============
.. only:: html
.. image:: images/stacklayout.gif
:align: right
.. only:: latex
.. image:: images/stacklayout.png
:align: right
.. versionadded:: 1.0.5
:class:`StackLayout` arranges children vertically or horizontally, as many
as the layout can fit.
.. warnin... | |
"""
Tests for L{klein.plating}.
"""
from __future__ import (
absolute_import, division, print_function, unicode_literals
)
import json
from klein import Plating
from twisted.web.template import tags, slot
from twisted.web.error import FlattenerError, MissingRenderMethod
from klein.test.test_resource import requ... | |
# -*- coding: utf-8 -*-
r"""
sphinx.ext.inheritance_diagram
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Defines a docutils directive for inserting inheritance diagrams.
Provide the directive with one or more classes or modules (separated
by whitespace). For modules, all of the classes in that module will
... | |
from sqlalchemy.test.testing import assert_raises, assert_raises_message
from sqlalchemy import *
from sqlalchemy import exc, schema
from sqlalchemy.test import *
from sqlalchemy.test import config, engines
from sqlalchemy.engine import ddl
from sqlalchemy.test.testing import eq_
from sqlalchemy.test.assertsql import A... | |
#!/usr/bin/env python
'''
EC2 external inventory script
=================================
Generates inventory that Ansible can understand by making API request to
AWS EC2 using the Boto library.
NOTE: This script assumes Ansible is being executed where the environment
variables needed for Boto have already been set:... | |
import unittest
import textwrap
import antlr3
import antlr3.tree
import testbase
import sys
class T(testbase.ANTLRTest):
def setUp(self):
self.oldPath = sys.path[:]
sys.path.insert(0, self.baseDir)
def tearDown(self):
sys.path = self.oldPath
def parserClass(self, base):
... | |
# -*- coding: utf-8 -*-
""" Sahana Eden Fire Station Model
@copyright: 2009-2012 (c) Sahana Software Foundation
@license: MIT
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 ... | |
# Copyright 2020 Makani Technologies 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... | |
from functools import partial
from itertools import imap
import string
# Higher order
from standardize_address import expand_standardize_abbr
from standardize_address import lookup_standardize_abbr
from standardize_address import title_case_string
def lower_getter(getter, data):
"""
Lower cases the result of... | |
import unittest
from tempfile import mkdtemp
from os.path import join
from shutil import rmtree
from json import dumps, loads
import copy
from .settings import SPEC_DATA_DIR
from slyd.gitstorage.repoman import Repoman
def j(json):
return dumps(json, sort_keys=True, indent=4)
class RepomanTest(unittest.TestCas... | |
"""A formatter which formats phone numbers as they are entered.
An AsYouTypeFormatter can be created by invoking
AsYouTypeFormatter(region_code). After that digits can be added by invoking
input_digit() on the formatter instance, and the partially formatted phone
number will be returned each time a digit is added. cle... | |
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... | |
# Copyright 2015 Cisco Systems, 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 requi... | |
# Copyright 2013-2014 The Meson development 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/licenses/LICENSE-2.0
# Unless required by applicable law or agree... | |
"""NDG Security Basic OpenID Authentication Interface.
A demonstration implementation of an authentication interface for
OpenIDProviderMiddleware WSGI. Username/password and OpenId user identifier
details are read from a config file and passed as keywords. This class is not
intended for production use.
NERC DataG... | |
# Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | |
import re
import json
from tornado.web import HTTPError
from biothings.www.helper import BaseHandler
from biothings.utils.common import split_ids
class BiothingHandler(BaseHandler):
def _ga_event_object(self, action, data={}):
''' Returns the google analytics object for requests on this endpoint (annotat... | |
'''dossier.label.relation_label
.. This software is released under an MIT/X11 open source license.
Copyright 2012-2015 Diffeo, Inc.
'''
from __future__ import absolute_import
import cbor
from collections import Container, Hashable
import logging
import time
import enum
from itertools import imap, ifilter
from tot... | |
#!/usr/bin/env python
import os
import shutil
import glob
import time
import sys
import subprocess
import string
from optparse import OptionParser, make_option
SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
PKG_NAME = os.path.basename(SCRIPT_DIR)
PARAMETERS = None
#XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=... | |
# Copyright 2013 OpenStack Foundation
# All Rights Reserved
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requi... | |
# Copyright 2011 NTT
# 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 agreed... | |
# encoding: utf-8
"""
Image part objects, including Image
"""
import hashlib
import os
import posixpath
try:
from PIL import Image as PIL_Image
except ImportError:
import Image as PIL_Image
from StringIO import StringIO
from pptx.opc.package import Part
from pptx.opc.packuri import PackURI
from pptx.opc.sp... | |
# ----------------------------------------------------------------------------
# cocos2d
# Copyright (c) 2008-2012 Daniel Moisset, Ricardo Quesada, Rayentray Tappa,
# Lucio Torre
# Copyright (c) 2009-2014 Richard Jones, Claudio Canepa
# All rights reserved.
#
# Redistribution and use in source and binary forms, with o... | |
#!/usr/bin/env python
from __future__ import (absolute_import, division,
print_function, unicode_literals)
import sys
import os
import argparse
import subprocess
import logging
import shutil
from Bio import SeqIO
from amptk import amptklib
class MyFormatter(argparse.ArgumentDefaultsHelpFormatt... | |
from collections import OrderedDict
import numpy as np
from gym.spaces import Box, Dict
from multiworld.envs.env_util import get_stat_in_paths, \
create_stats_ordered_dict, get_asset_full_path
from multiworld.core.multitask_env import MultitaskEnv
from multiworld.envs.mujoco.sawyer_xyz.base import SawyerXYZEnv
c... | |
import unittest
import datetime
import json
from restosaur import API, responses
from restosaur.resource import Resource
from restosaur.dispatch import resource_dispatcher_factory
from django.test import SimpleTestCase
class ResourceTestCase(unittest.TestCase):
def setUp(self):
from django.test import R... | |
import HTMLParser
import json
from xml.etree import ElementTree
from django.conf import settings
from django.contrib import messages
from django.core.urlresolvers import reverse
from django.http import HttpResponseRedirect, HttpResponse, HttpResponseBadRequest, Http404
from django.shortcuts import get_object_or_404
fr... | |
from __future__ import unicode_literals
from operator import attrgetter
from django.apps import apps
from django.contrib.contenttypes.models import ContentType
from django.contrib.sessions.backends.db import SessionStore
from django.db.models import Count
from django.db.models.query_utils import deferred_class_factor... | |
from AppKit import *
from vanillaBase import VanillaBaseControl, VanillaError
_tickPositionMap = {
"left": NSTickMarkLeft,
"right": NSTickMarkRight,
"top": NSTickMarkAbove,
"bottom": NSTickMarkBelow,
}
class Slider(VanillaBaseControl):
"""
A standard slider control. Sliders can be vertical o... | |
# -*- coding: utf-8 -*-
# Copyright (c) 2015 Ericsson 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 ... | |
from requests import Response
from MicrosoftApiModule import *
import demistomock as demisto
import pytest
import datetime
TOKEN = 'dummy_token'
TENANT = 'dummy_tenant'
REFRESH_TOKEN = 'dummy_refresh'
AUTH_ID = 'dummy_auth_id'
ENC_KEY = 'dummy_enc_key'
TOKEN_URL = 'mock://dummy_url'
APP_NAME = 'ms-graph-mail-listener... | |
#!/usr/bin/env python
# ----------------------------------------------------------------------------------------------------------------------
# EXTERNAL PYTHON PACKAGES
# - nibabel : <http://nipy.sourceforge.net/nibabel/>
# - numpy : <http://www.numpy.org>
# - scipy
#
# ----------------------------------------------... | |
# Django settings for qsic3 project.
import os
import dj_database_url
from easy_thumbnails.conf import Settings as thumbnail_settings
def get_env_var(env_var, default=None, isbool=False):
"""
Return value of envirnoment variable or throw exception
"""
from django.core.exceptions import ImproperlyConf... | |
import wx
import wx.richtext as rtc
import prefs
import re
from window.basepane import BasePane
from utility import platform
from theme import Theme
class InputPane(BasePane):
def __init__(self, parent, connection):
BasePane.__init__(self, parent, connection,
style = wx.TE_PROCESS_ENTER | wx.T... | |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import warnings
from django.contrib import admin
from django.contrib.admin.sites import AdminSite
from django.contrib.auth.models import User
from django.contrib.contenttypes.admin import GenericTabularInline
from django.contrib.contenttypes.forms import ... | |
from serial import Serial
from collections import deque
from time import sleep
from enum import Enum
from threading import Thread
from datetime import datetime, timedelta
SERIAL_POLL_INTERVAL = 0.1 # Seconds between hardware serial polls pushing to serial queue
BROKER_POLL_INTERVAL = 0.05
SERIAL_TIMING_DELAY = ... | |
# encoding: utf-8
from django.conf import settings
import json
from django.core.urlresolvers import reverse
from django.http import HttpResponse, HttpResponseRedirect, Http404
from django.shortcuts import render_to_response
from django.template import RequestContext
from django.contrib import messages
from django.utils... | |
from fontPens.digestPointPen import DigestPointPen
from fontTools.misc import arrayTools as ftArrayTools
import defcon
from .tools import (
unwrapPoint,
calculateAngle
)
from . import registry
from .wrappers import *
# Stem Consistency
def testStemWidths(glyph):
"""
Stem widths should be consistent.
... | |
# Version: 2.3
# Author: Miguel Martinez Lopez
# Uncomment the next line to see my email
# print("Author's email: %s"%"61706c69636163696f6e616d656469646140676d61696c2e636f6d".decode("hex"))
try:
from Tkinter import Frame, Label
from Tkconstants import *
from tkFont import Font, nametofont
from ttk impo... | |
####
# compile.py
#!/usr/bin/env python
import re
import os
import sys
import new
import imp
import time
import struct
import marshal
import compiler
from compiler.ast import Const, AssName, AssTuple
__author__ = 'Shimomura Ikkei'
__date__ = '2005-06-23'
__all__ = ['ConstantCompiler']
# Check the string is valid c... | |
from datetime import datetime
import errno
import fcntl
import os
import socket
import sys
import traceback
import threading
import xml.etree.ElementTree as ET
from zmq.eventloop import ioloop
from tornado import iostream
from pyfire import configuration as config
from pyfire.errors import XMPPProtocolError
from pyfi... | |
# 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 ... | |
# 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 ... | |
from __future__ import unicode_literals
import sys
import os
import re
import mimetypes
from copy import copy
from io import BytesIO
try:
from urllib.parse import unquote, urlparse, urlsplit
except ImportError: # Python 2
from urllib import unquote
from urlparse import urlparse, urlsplit
from django.c... | |
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
ocr_pdf.py
~~~~~~~~~~~~~~
A brief description goes here.
"""
import subprocess
import os
import shutil
import glob
import argparse
def call(cmd, check=True, stdout=None, stderr=None):
"""
Args:
check: check return code or not
"""
if che... | |
"""Unit test for eda.py
"""
# Author : Jin Kim jjinking(at)gmail(dot)com
# Creation date : 2014.02.13
# Last Modified : 2016.04.20
#
# License : MIT
import os
import numpy as np
import pandas as pd
import scipy.stats
import unittest
from datsci import eda
CURDIR = os.path.dirname(os.path.abspath... | |
# coding=utf-8
# Copyright 2015 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import os
from hashl... | |
"""
GDB extension that adds Cython support.
"""
from __future__ import print_function
try:
input = raw_input
except NameError:
pass
import sys
import textwrap
import traceback
import functools
import itertools
import collections
import gdb
try: # python 2
UNICODE = unicode
BYTES = str
except NameE... | |
# Copyright (c) 2018 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 app... | |
# Copyright 2016, 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 of conditions and the f... | |
# Copyright 2013 Mirantis, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... | |
from django.shortcuts import render
from django.template.response import TemplateResponse
from django.core.mail import EmailMessage
from django.contrib import messages
from django.conf import settings
from django.shortcuts import render_to_response, redirect
from django.template import RequestContext, loader, Context
... | |
"""
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this ... | |
import os
import unittest
import ray
from ray.rllib import _register_all
from ray.tune.result import TIMESTEPS_TOTAL
from ray.tune import Trainable, TuneError
from ray.tune import register_trainable, run_experiments
from ray.tune.logger import Logger
from ray.tune.experiment import Experiment
from ray.tune.trial impo... | |
"""Support the ISY-994 controllers."""
from __future__ import annotations
import asyncio
from urllib.parse import urlparse
from aiohttp import CookieJar
import async_timeout
from pyisy import ISY, ISYConnectionError, ISYInvalidAuthError, ISYResponseParseError
import voluptuous as vol
from homeassistant import config... | |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
# Copyright 2011 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not... | |
from __future__ import division
import os
import shutil
from subprocess import call
import itertools
import fnmatch
from calendar import monthrange
def generate_bulktraj(basename, hysplit_working, output_dir, meteo_dir, years,
months, hours, altitudes, coordinates, run,
met... | |
from contextlib import contextmanager
from pathlib import Path
from typing import Any, Dict, Iterator, List, Union, Optional, Callable, ContextManager
import os
import tempfile
from test_driver.logger import rootlog
from test_driver.machine import Machine, NixStartScript, retry
from test_driver.vlan import VLan
from t... | |
# Copyright (c) 2018 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 ... | |
import base64
import copy
import socket
import types
from collections import defaultdict
from itertools import count
from queue import Empty
from queue import Queue as _Queue
from unittest.mock import ANY, Mock, call, patch
import pytest
from kombu import Connection, Consumer, Exchange, Producer, Queue
from kombu.exc... | |
"""
The DoInterestManager keeps track of which parent/zones that we currently
have interest in. When you want to "look" into a zone you add an interest
to that zone. When you want to get rid of, or ignore, the objects in that
zone, remove interest in that zone.
p.s. A great deal of this code is just code moved from ... | |
import copy
import os
from contextlib import contextmanager
from zope.interface import (
implementer,
alsoProvides,
)
from pyramid.interfaces import (
IRequest,
IResponseFactory,
ISession,
)
from pyramid.compat import (
PY3,
PYPY,
class_types,
)
from pyramid.config import... | |
'''
File to handle motif/expression regression
'''
__author__='Anthony Soltis'
__email__='[email protected]'
import sys,os,pickle,re
from optparse import OptionParser
import numpy as np
from scipy import stats
import fileinput
import matplotlib
matplotlib.use('pdf')
from matplotlib import pyplot as plt
def load_tgm(tg... | |
#!/usr/bin/python3
# Creates DNS zone files for all of the domains of all of the mail users
# and mail aliases and restarts nsd.
########################################################################
import os, os.path, urllib.parse, datetime, re, hashlib, base64
import ipaddress
import rtyaml
import dns.resolver
... | |
# Copyright (c) 2014, Salesforce.com, 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 of conditions... | |
"""
Authenticator to use GitHub OAuth with JupyterHub
"""
import json
import os
import re
import string
import warnings
from tornado.auth import OAuth2Mixin
from tornado import web
from tornado.httputil import url_concat
from tornado.httpclient import HTTPRequest, AsyncHTTPClient, HTTPError
from jupyterhub.auth im... | |
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the... | |
import copy
from flask import current_app as app, abort
from eve.utils import config, debug_error_message, ParsedRequest
from werkzeug.exceptions import BadRequestKeyError
def versioned_id_field(resource_settings):
""" Shorthand to add two commonly added versioning parameters.
.. versionadded: 0.4
"""
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.