gt stringclasses 1
value | context stringlengths 2.49k 119k |
|---|---|
# -*- coding: utf-8 -*-
'''
Render the pillar data
'''
# Import python libs
import os
import collections
import logging
# Import salt libs
import salt.loader
import salt.fileclient
import salt.minion
import salt.crypt
from salt._compat import string_types
from salt.template import compile_template
from salt.utils.dic... | |
import os.path
import sys
clientRoot = os.path.normpath(os.path.join(os.path.dirname(__file__), '..'))
if not clientRoot in sys.path:
sys.path.append(clientRoot)
from KalturaCoreClient import *
from KalturaClientBase import *
########## enums ##########
class KalturaAuditTrailAction:
CREATED = "CREATED"
... | |
import logging
import gearman.io
import gearman.util
from gearman.connection import GearmanConnection
from gearman.constants import _DEBUG_MODE_
from gearman.errors import ConnectionError, GearmanError, ServerUnavailable
from gearman.job import GearmanJob, GearmanJobRequest
from gearman import compat
gearman_logger =... | |
#!/usr/bin/env python
import logging
import inspect
import numpy as np
#from matplotlib import _cntr as cntr
#from contours.core import shapely_formatter as shapely_fmt
#from contours.quad import QuadContourGenerator
from astropy.coordinates import Angle
from astropy import constants as c
from astropy import wcs
fro... | |
""" miscellaneous sorting / groupby utilities """
import numpy as np
from pandas._libs import algos, hashtable, lib
from pandas._libs.hashtable import unique_label_indices
from pandas.core.dtypes.cast import infer_dtype_from_array
from pandas.core.dtypes.common import (
ensure_int64,
ensure_platform_int,
... | |
# eon
# A python module for working with dates and date ranges
import sys
sys.dont_write_bytecode = True
__author__ = "Michael Vijay Saha"
import datetime
"""A line segment (or ray, or line) on the arrow of time."""
class DateRange:
def __init__(self,date1,date2=None):
"""Build a DateRange object.
... | |
# Copyright 2017 The Armada Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in w... | |
import logging
import re
from collections import OrderedDict
from phovea_server.security import current_user, is_logged_in
from .utils import clean_query
__author__ = 'Samuel Gratzl'
_log = logging.getLogger(__name__)
REGEX_TYPE = type(re.compile(''))
class ArgumentInfo(object):
def __init__(self, type=None, descr... | |
'''
Created on Dec 27, 2012
@author: kieranfinn
'''
import time
beginning=time.time()
import numpy as np
import settings
import os
from random import shuffle
import pickle
import mean
import ibcc
import frequentist
import pylab as p
from mpl_toolkits.axes_grid1 import host_subplot
import mpl_toolkits.axisartist as AA
... | |
"""An abstract class for entities."""
from abc import ABC
import asyncio
from datetime import datetime, timedelta
import functools as ft
import logging
from timeit import default_timer as timer
from typing import Any, Dict, Iterable, List, Optional, Union
from homeassistant.config import DATA_CUSTOMIZE
from homeassist... | |
#!/bin/env python3
"""
Run disk io benchmarks
"""
import timeit
import subprocess
import argparse
import sys
import re
import itertools
import os
# TODO improve latency execution
# use small blocksize, eg 4096, to test latency of block access
# TODO create a better total summary after modes are executed
# TODO ... | |
#!/usr/bin/python3
import argparse
import cv2
import math
import numpy as np
import os
import pyexiv2 # dnf install python3-exiv2 (py3exiv2)
from props import root, getNode
import props_json
from lib import Camera
from lib import Image
parser = argparse.ArgumentParser(description='Align and combine... | |
__all__ = ['DataStore']
from bisect import bisect_left
DATASTORE_FLAG_SET = 1
DATASTORE_FLAG_DELETE = 2
class DataStore(object):
def __init__(self, pk):
self.pk = tuple(pk) # primary key
# memtable
self.MEM_TABLE_MAX_ITEMS = 4
self.memtable = MemTable(datastore=self)
... | |
# Copyright 2017, 2018, 2021 Stefan Richthofer
#
# 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 a... | |
# -*- coding: UTF-8 -*-
#!/usr/bin/env python
import csv
import os
import json
import errno
from pprint import pprint
from collections import *
PRINT_OUTPUT = False
################################################################################
def main():
infile = 'data/td_T5-composition.txt'
d = convert... | |
#
# 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... | |
# -*- coding: utf-8 -*-
'''
Control of SSH known_hosts entries
==================================
Manage the information stored in the known_hosts files.
.. code-block:: yaml
github.com:
ssh_known_hosts:
- present
- user: root
- fingerprint: 16:27:ac:a5:76:28:2d:36:63:1b:56:4d:eb:df... | |
# -*- coding: utf-8 -*-
"""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... | |
"""
mongoquery provides a straightforward API to match Python objects against
MongoDB Query Language queries.
"""
import re
from collections.abc import Sequence, Mapping
from six import string_types
# pylint: disable=invalid-name
try:
string_type = basestring
except NameError:
string_type = str
# Pythons >=... | |
#!/usr/bin/env python
"""Tests for grr_response_server.checks.filters."""
from __future__ import absolute_import
from __future__ import division
from __future__ import unicode_literals
import collections
from absl import app
from future.utils import iteritems
from future.utils import itervalues
from grr_response_cor... | |
""" Test cogapp.
http://nedbatchelder.com/code/cog
Copyright 2004-2015, Ned Batchelder.
"""
from __future__ import absolute_import
import os, os.path, random, re, shutil, stat, sys, tempfile
# Use unittest2 if it's available, otherwise unittest. This gives us
# back-ported features for 2.6.
try:
import... | |
#!/usr/bin/env python
# Copyright 2015-2016 Yelp 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 ... | |
# -*- coding: utf-8 -*-
"""
Created on Fri Oct 6 12:03:20 2017
@author: rachael
Create a dummy gsd file with 4 molecules of 17 beads each in 6 snapshots
Used to check cluster analysis
"""
from __future__ import absolute_import, division, print_function
import gsd.hoomd
import numpy as np
def quatMultiply(q1,q2):
... | |
# $Id$
"""mime - MIME decoding Library"""
import rfc822, re
import cStringIO as StringIO
class Error(Exception):
pass
class Entity(rfc822.Message):
def __init__(self, msg, mime=0, eol=r"\r\n", headers=None):
if headers is not None:
fp = StringIO.StringIO(headers + "\n" + msg)
else:
fp = St... | |
''' Test of EM
----------
Test updates and convergence of EM process.
Usage:
$ python -m test.test_cap_em
'''
from unittest import TestCase, main
from numpy import array, identity, absolute
from numpy.linalg import det, pinv
from numpy.testing import assert_allclose
from math import log
from algo.... | |
import sys
import traceback
import os
import re
###############################################################################
# Explanation of metrics in /proc/meminfo can be found here
#
# http://www.redhat.com/advice/tips/meminfo.html
# and
# http://unixfoo.blogspot.com/2008/02/know-about-procmeminfo.html
# and
#... | |
from datetime import datetime
import cgi
import json
import logging
from stackdriver_client import StackdriverClient
def params_to_query(params):
query_list = ['{0}={1}'.format(key, value) for key, value in params.items()]
return '?{0}'.format('&'.join(query_list)) if query_list else ''
class BaseHandler(object):... | |
import json
from django.contrib.auth.decorators import user_passes_test
from django.core.urlresolvers import reverse
from django.http import HttpResponse, HttpResponseRedirect
from django.shortcuts import render_to_response
from django.template import RequestContext
from crits.backdoors.forms import AddBackdoorForm
f... | |
#!/usr/bin/env jython
# Test cases for queries.py, to be run with testqueries.sh (nosetests)
# Use the test framework for new queries or else you do not know what
# EPL is doing and you are wasting time.
# Marc de Lignie, Politie IV-organisatie
# September 24, 2014
import java.lang
import sys, time, re
from mock im... | |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright 2010 OpenStack Foundation
# Copyright 2012 University Of Minho
#
# 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
#
# ... | |
"""
@package mi.instrument.sunburst.sami2_ph.ooicore.test.test_driver
@file marine-integrations/mi/instrument/sunburst/sami2_ph/ooicore/driver.py
@author Kevin Stiemke
@brief Test cases for ooicore driver
USAGE:
Make tests verbose and provide stdout
* From the IDK
$ bin/test_driver
$ bin/test_driver ... | |
# Copyright 2014 The Oppia 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 applicable ... | |
"""ClusterMsgs module: Message types for Cluster rendering"""
# This module is intended to supply routines and dataformats common to
# both ClusterClient and ClusterServer.
from panda3d.core import *
from direct.distributed.PyDatagram import PyDatagram
from direct.distributed.PyDatagramIterator import PyDatagramItera... | |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2011 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Copyright 2011 Fourth Paradigm Development, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "Licen... | |
from builtins import str
import json
import re
from moto.core import ACCOUNT_ID, BaseBackend, BaseModel
from moto.core.utils import BackendDict
from .exceptions import BadRequestException
class FakeResourceGroup(BaseModel):
def __init__(
self, name, resource_query, description=None, tags=None, configura... | |
#! /usr/bin/env python
import sys
import argparse
import cv2
import numpy
class LaserTracker(object):
def __init__(self, cam_width=640, cam_height=480, hue_min=20, hue_max=160,
sat_min=100, sat_max=255, val_min=200, val_max=256,
display_thresholds=False):
"""
* `... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache Lice... | |
import mock
from mock import patch
import unittest
from cfgm_common.vnc_db import DBBase
from svc_monitor import config_db
from svc_monitor import loadbalancer_agent
from vnc_api.vnc_api import *
import argparse
import ConfigParser
class F5LBTest(unittest.TestCase):
def setUp(self):
self.vnc_lib = mock.Moc... | |
# -*- coding: utf-8 -*-
"""This file contains the MSIE zone settings plugin."""
from plaso.events import windows_events
from plaso.parsers import winreg
from plaso.parsers.winreg_plugins import interface
__author__ = 'Elizabeth Schweinsberg (beth@bethlogic.net)'
class MsieZoneSettingsPlugin(interface.WindowsRegist... | |
import numpy as np
import pandas as pd
from xray import DataArray
import xray.plot as xplt
from xray.plot.plot import (_infer_interval_breaks,
_determine_cmap_params,
_build_discrete_cmap,
_color_palette)
from . import TestCase, requ... | |
"""Content-oriented XBlocks."""
from string import Template
from lxml import etree
from web_fragments.fragment import Fragment
from xblock.core import Scope, String, XBlock
class HelloWorldBlock(XBlock):
"""A simple block: just show some fixed content."""
def fallback_view(self, view_name, context=None):... | |
##########################################################################
#
# Copyright (c) 2017, Image Engine Design 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:
#
# * Redistribu... | |
# coding: utf-8
from __future__ import unicode_literals
import datetime
try:
# Try importing from unittest2 first. This is primarily for Py2.6 support.
import unittest2 as unittest
except ImportError:
import unittest
from xml.dom.minidom import parseString
from mock import Mock, patch
from xero import ... | |
# 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 ... | |
# for python 3
# You'll need to customize this according to your needs. Proper orientation of
# the kinect is vital; if participants are able to maintain their head or wrists
# continuously inside the word rects, they will repeatedly trigger the collision
# detection
from pykinect2 import PyKinectV2
from pykinect2.PyKi... | |
# 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... | |
# coding: utf-8
from __future__ import unicode_literals
import itertools
import re
import random
from .common import InfoExtractor
from ..compat import (
compat_HTTPError,
compat_parse_qs,
compat_str,
compat_urllib_parse_urlencode,
compat_urllib_parse_urlparse,
compat_urlparse,
)
from ..utils ... | |
"""
This module contains helper functions for controlling caching. It does so by
managing the "Vary" header of responses. It includes functions to patch the
header of response objects directly and decorators that change functions to do
that header-patching themselves.
For information on the Vary header, see:
http... | |
# Copyright 2014 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 a... | |
import collections
import enum
import time
from dataclasses import dataclass
from typing import DefaultDict, Dict, List, Optional, Tuple, Union
import wsproto.handshake
from mitmproxy import flow, http
from mitmproxy.connection import Connection, Server
from mitmproxy.net import server_spec
from mitmproxy.net.http imp... | |
#! /usr/bin/python
'''
Interface to BBC /programmes JSON etc
- Identifies PID of current programme on a chosen channel
- Provides output for PIDs in a chosen format (XML, RDF etc)
- Identifies currently playing tracks on radio channels TODO
'''
from datetime import datetime
from datetime import timedelta
from datetim... | |
# This is open-source software licensed under a BSD license.
# Please see the file LICENSE.txt for details.
"""
The ``Info`` plugin provides a pane of commonly useful metadata about the
associated channel image. Common information includes some metadata
header values, coordinates, dimensions of the image, minimum and
... | |
# -*- coding: utf-8 -*-
import pytest
import gevent
from raiden.tests.utils.transfer import (
assert_synched_channels,
channel,
direct_transfer,
)
from raiden.exceptions import (
NoPathError,
InsufficientFunds,
)
from raiden.api.python import RaidenAPI
# Use a large enough settle timeout to have v... | |
from datetime import datetime
from uuid import UUID
from django.utils.timezone import make_aware, now, FixedOffset
from django.test import TestCase
from django_vend.auth.models import VendRetailer
from .models import VendOutlet, VendRegister
from .forms import VendOutletForm, VendRegisterForm
class VendOutletFormTe... | |
#!/usr/bin/env python
# vim:fileencoding=utf-8
'''
A python interface to massively parallel computing frameworks (HTCondor and Sun Grid Engine)
* The method map(...) is similar to the standard map function but spawns the
function execution using the processing framework.
* the method imap_unordered is similar to... | |
# Copyright 2014 the Melange authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wr... | |
# List shared folders + shared members as CSV format.
#
# Required permission:
# * Dropbox Business, Team member file access
#
# Required library:
# * Dropbox SDK Python https://github.com/dropbox/dropbox-sdk-python
# * Tested on [Dropbox SDK Python v6.1](https://github.com/dropbox/dropbox-sdk-python/releases/tag/v6... | |
from .utilities import http, urlfactory, customjson
__author__ = 'sathley'
from .entity import AppacitiveEntity, connection_system_properties
from .error import *
from .object import AppacitiveObject
from .endpoint import AppacitiveEndpoint
from .response import AppacitiveCollection
import logging
connection_logger ... | |
# coding=utf-8
r"""
This code was generated by
\ / _ _ _| _ _
| (_)\/(_)(_|\/| |(/_ v1.0.0
/ /
"""
from twilio.base import deserialize
from twilio.base import serialize
from twilio.base import values
from twilio.base.instance_context import InstanceContext
from twilio.base.instance_resource import... | |
# 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... | |
"""
sphinx.ext.napoleon.iterators
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
A collection of helpful iterators.
:copyright: Copyright 2007-2021 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import collections
from typing import Any, Iterable, Optional
class peek_iter:
""... | |
import textwrap
from os.path import dirname
from os.path import join
import pytest
from werkzeug.urls import url_parse
from lektor.publisher import GithubPagesPublisher
from lektor.publisher import RsyncPublisher
def test_get_server(env):
server = env.load_config().get_server("production")
assert server.nam... | |
import pytest
import numpy as np
from numpy.testing import assert_allclose
from numpy.testing import assert_array_equal
from sklearn.compose import make_column_transformer
from sklearn.datasets import make_classification
from sklearn.exceptions import NotFittedError
from sklearn.linear_model import LogisticRegression
... | |
#! /usr/bin/python3
import sys
import os
import threading
import decimal
import time
import json
import re
import requests
import collections
import logging
import binascii
from datetime import datetime
from dateutil.tz import tzlocal
import argparse
import configparser
import appdirs
import tarfile
import urllib.requ... | |
"""Custom loader."""
import logging
import os
import sys
import fnmatch
from collections import OrderedDict
from typing import Union, List, Dict, Iterator, overload, TypeVar
import yaml
try:
import keyring
except ImportError:
keyring = None
try:
import credstash
except ImportError:
credstash = None
... | |
"""Support for KNX/IP climate devices."""
from typing import List, Optional
import voluptuous as vol
from xknx.devices import Climate as XknxClimate, ClimateMode as XknxClimateMode
from xknx.knx import HVACOperationMode
from homeassistant.components.climate import PLATFORM_SCHEMA, ClimateDevice
from homeassistant.com... | |
# Licensed to the Software Freedom Conservancy (SFC) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The SFC licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... | |
# Copyright 2014 Huawei Technologies Co. 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... | |
# 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 (c) 2010 Citrix Systems, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you m... | |
#!/usr/bin/env python
# imports # {{{
import eventlet
from eventlet.green import zmq
from eventlet.hubs import use_hub
from eventlet.green.socket import error as socket_error
from eventlet.event import Event
import logging, argparse
# }}}
use_hub("zeromq")
# globals # {{{
logger = logging.getLogger("orbited_node")
ct... | |
import csv
import json
import urllib
from django.contrib import messages
from django.core.paginator import Paginator, EmptyPage, InvalidPage
from django.core.urlresolvers import reverse
from django.http import HttpResponse, HttpResponseRedirect
from django.shortcuts import get_object_or_404, render_to_response
from dja... | |
"""Config flow to configure Nest.
This configuration flow supports two APIs:
- The new Device Access program and the Smart Device Management API
- The legacy nest API
NestFlowHandler is an implementation of AbstractOAuth2FlowHandler with
some overrides to support the old APIs auth flow. That is, for the new
API ... | |
import re
import sys
import threading
import time
import os
import syncplay
from syncplay import constants
from syncplay import utils
from syncplay.messages import getMessage
from syncplay.utils import formatTime, isURL
class ConsoleUI(threading.Thread):
def __init__(self):
self.promptMode = threading.E... | |
#
# Copyright 2015 LinkedIn Corp. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... | |
# 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 ... | |
""" This module contains all classes used to model intrinsics behavior. """
from pythran.conversion import to_ast
from pythran.range import UNKNOWN_RANGE
import ast
import sys
if sys.version_info[0] > 2:
ast3_arguments = ast.arguments
def make_ast_arguments(*args):
return ast3_arguments(args[0], ar... | |
# sql/ddl.py
# Copyright (C) 2009-2015 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""
Provides the hierarchy of DDL-defining schema items as well as routines
to invoke them... | |
# -*- encoding: utf-8
from sqlalchemy.testing import eq_
from sqlalchemy import *
from sqlalchemy import types, schema, event
from sqlalchemy.databases import mssql
from sqlalchemy.testing import fixtures, AssertsCompiledSQL, \
ComparesTables
from sqlalchemy import testing
from sqlalchemy.engine.reflection impo... | |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# 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.apach... | |
#
# A class which manages both (1) the general purpose stack ("data
# stack") used by the story code to store temporary data, and (2) the
# interpreter-private stack of routines ("call stack") and their local
# variables.
#
# For the license of this file, please consult the LICENSE file in the
# root directory of this ... | |
import cloudpassage
import datetime
import os
import pytest
from cloudpassage.utility import Utility as utility
config_file_name = "portal.yaml.local"
tests_dir = os.path.abspath(os.path.join(os.path.dirname(__file__), "../"))
config_file = os.path.join(tests_dir, "configs/", config_file_name)
session_info = cloudpas... | |
import logging
import time
from uuid import uuid4
from kubernetes.client.rest import ApiException
from ray.autoscaler._private.command_runner import KubernetesCommandRunner
from ray.autoscaler._private.kubernetes import core_api, log_prefix, \
extensions_beta_api
from ray.autoscaler._private.kubernetes.config impo... | |
# coding: utf-8
import pytest
from jsl import (
NumberField, IntField, DocumentField, StringField, BooleanField,
Document, ALL_OF, INLINE, ANY_OF, ONE_OF, RECURSIVE_REFERENCE_CONSTANT
)
from util import normalize
def test_inheritance_mode_inline():
class Child(Document):
child_attr = IntField()
... | |
# This file helps to compute a version number in source trees obtained from
# git-archive tarball (such as those provided by githubs download-from-tag
# feature). Distribution tarballs (built by setup.py sdist) and build
# directories (produced by setup.py build) will contain a much shorter file
# that just contains t... | |
import fileinput, os, re, sys
from assets import Asset
from asset_sets import AssetSet
from stores import Store
from tags import TagSet
class SafeCLI:
def __init__(self, store=None):
if store:
self.store = store
self.silent = False
self.verbose = False
self.output_buffer = []
self.variables = {}
def s... | |
# 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 ... | |
#
# 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... | |
# 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 l... | |
from BinPy.ic import *
from nose.tools import with_setup, nottest
##########################
# IC's with 14 pins
##########################
def test_IC_7470():
c = Clock(1, 500)
c.start()
testIC = IC_7470()
p = {1: 1, 2: 1, 4: 0, 5: 0, 7: 0, 9: 1, 10: 1, 12: c, 13: 0, 14: 1}
testIC.setIC(p)
q... | |
from __future__ import absolute_import, division, print_function
import pdil
from pdil.vendor import Qt
from .._lib import space
from pymel.core import Callback, MeshVertex, scriptJob, select, selected, warning, promptDialog
previousName = ''
def getSpaceName(prevName=''):
global previousName
name = ... | |
# coding=utf-8
#
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writi... | |
import numpy as np
import pandas as pd
import xgboost as xgb
import datetime
import operator
from sklearn.cross_validation import train_test_split
from collections import Counter
from nltk.corpus import stopwords
import matplotlib.pyplot as plt
from pylab import plot, show, subplot, specgram, imshow, savefig
import ma... | |
import mock
import pytest
from addons.wiki.models import WikiVersion
from django.core.exceptions import ValidationError
from django.utils import timezone
from framework.auth.core import Auth
from framework.exceptions import PermissionsError
from nose.tools import assert_raises
from osf.models import Node, Registration... | |
#!/usr/bin/env python
#
# Copyright (c) 2016 Cisco and/or its affiliates.
# 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... | |
__author__ = 'robswift'
from collections import defaultdict
from EB.builder.utilities import screener
import numpy as np
from scipy import stats
def get_sort_order(molecules):
"""
Determine the sort order, i.e. ascending for binding energy estimates, or descending for similarity scores. First,
count the ... | |
#===============================================================================
# Copyright 2007 Matt Chaput
#
# 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/li... | |
#=========================================================================
# pisa_div_test.py
#=========================================================================
import pytest
import random
import pisa_encoding
from pymtl import Bits
from PisaSim import PisaSim
from pisa_inst_test_utils import *
#---------... | |
# Python imports
# Don't add any from __future__ imports here. This code should execute
# against standard Python.
import unittest
from unittest import skipUnless
import datetime
import random
import time
import signal
import threading
# Project imports
import posix_ipc
# Hack -- add tests directory to sys.path so Pyt... | |
import gdb
import re
import sys
# some feedback that the nim runtime support is loading, isn't a bad
# thing at all.
gdb.write("Loading Nim Runtime support.\n", gdb.STDERR)
# When error occure they occur regularly. This 'caches' known errors
# and prevents them from being reprinted over and over again.
errorSet = set... | |
import unittest
from server import app
from model import *
from image_engine import *
from scaletracker import *
from sequencer import *
from random import random
connect_to_db(app)
class ImageEngineTests(unittest.TestCase):
""" Tests functions in image_engine.py """
def test_rgb_to_hsv(self):
""" ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.