gt stringclasses 1
value | context stringlengths 2.49k 119k |
|---|---|
# This module implements PEP 386
# 2010-04-20: hg clone http://bitbucket.org/tarek/distutilsversion/
"""
"Rational" version definition and parsing for DistutilsVersionFight
discussion at PyCon 2009.
"""
import sys
import re
class IrrationalVersionError(Exception):
"""This is an irrational version."""
pass
c... | |
# Copyright 2018 The AdaNet 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
# https://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable la... | |
#!/usr/bin/env python3
# Copyright (c) 2016-2019 The Starwels developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test the SegWit changeover logic."""
from test_framework.address import (
key_to_p2sh_p2wpkh,
key_... | |
# -*- coding: utf-8 -*-
from __future__ import with_statement
from django.core.cache import cache
from django.template import Template, RequestContext
from django.test.utils import override_settings
from sekizai.context import SekizaiContext
from cms import plugin_rendering
from cms.api import create_page, add_plugin... | |
from configparser import ConfigParser
import os
import re
from qldsmanager import app_dir
from qldsmanager.util.matheval import eval_expr
from qldsmanager.util.filesystem import FSCheck
class AbstractConfig:
def __init__(self):
self.__config_dir = os.path.expanduser('~/.qldsmanager/') #has to end with /
... | |
# 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 ... | |
#!/usr/bin/env python
# coding: utf-8
"""Test clusters_diff.py."""
from __future__ import unicode_literals
from __future__ import absolute_import
from __future__ import print_function
import unittest
from biggraphite.cli import clusters_diff
import tempfile
import mock
import json
import collections
class TestRequest... | |
# Copyright 2012 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... | |
'''
Train and test Neural Event Model (NEM). This module also comes with a main function that acts as a CLI for NEM.
'''
# pylint: disable=wrong-import-position
import sys
import argparse
import pickle
import os
import numpy
numpy.random.seed(21957)
from keras.models import Model, load_model
from keras.layers import ... | |
# Copyright 2016 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, ... | |
# -*- coding: utf-8 -*-
"""
Various i18n functions.
Helper functions for both the internal translation system
and for TranslateWiki-based translations.
By default messages are assumed to reside in a package called
'scripts.i18n'. In pywikibot 2.0, that package is not packaged
with pywikibot, and pywikibot 2.0 does no... | |
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import annotations
import logging
import typing
from collections import defaultdict
from collections.abc import Iterable
from dataclasses import dataclass, field
from enum... | |
# 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... | |
# encoding: utf-8
"""Gherkin step implementations for chart data features."""
from __future__ import (
absolute_import, division, print_function, unicode_literals
)
import datetime
from behave import given, then, when
from pptx.chart.data import (
BubbleChartData, Category, CategoryChartData, XyChartData
)... | |
""" test scalar indexing, including at and iat """
import pytest
import numpy as np
from pandas import (Series, DataFrame, Timestamp,
Timedelta, date_range)
from pandas.util import testing as tm
from pandas.tests.indexing.common import Base
class TestScalar(Base):
def test_at_and_iat_get(s... | |
# Lint as: python2, python3
# Copyright 2020 Google 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/licenses/LICENSE-2.0
#
# Unless req... | |
# this document contains a lookup table for
# address prefixes owned by various manufacturers
# of network cards.
manufacturers = {
"Apple": [
"00:03:93",
"00:05:02",
"00:0a:27",
"00:0a:95",
"00:0d:93",
"00:10:fa",
"00:11:24",
"00:14:51",
"00:16:cb",
"00:17:f2",
"00:19:e3",
"00:1b:63",
"00:1... | |
# Copyright 2015, Ansible, Inc.
# Luke Sneeringer <[email protected]>
#
# 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... | |
# -*- coding: utf-8 -*-
import copy
from django.test.client import RequestFactory
from django.utils import translation
import six
from elasticsearch_dsl import Search
from mock import Mock, patch
from rest_framework import serializers
from olympia import amo
from olympia.amo.tests import TestCase
from olympia.const... | |
"""Compatibility fixes for older version of python, numpy and scipy
If you add content to this file, please give the version of the package
at which the fix is no longer needed.
# XXX : originally copied from scikit-learn
"""
# Authors: Emmanuelle Gouillart <[email protected]>
# Gael Varoq... | |
"""
Copyright 2015 Hewlett-Packard
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, softwar... | |
from sympy import (sin, cos, tan, sec, csc, cot, log, exp, atan, asin, acos,
Symbol, Integral, integrate, pi, Dummy, Derivative,
diff, I, sqrt, erf, Piecewise, Eq, symbols,
And, Heaviside, S, asinh, acosh)
from sympy.integrals.manualintegrate import manualintegra... | |
import pytest
import unittest.mock as mock
import tilemapbase.mapping as mapping
def test_projection_against_pyproj():
import random
for _ in range(1000):
lon = random.random() * 360 - 180
lat = random.random() * 85 * 2 - 85
x, y = mapping.project(lon, lat)
xx, yy = mapping.... | |
"""
The module defining the Monitor and MonitorChannel objects used for
tracking the changes in values of various quantities throughout training
"""
__authors__ = "Ian Goodfellow"
__copyright__ = "Copyright 2010-2012, Universite de Montreal"
__credits__ = ["Ian Goodfellow"]
__license__ = "3-clause BSD"
__maintainer__ =... | |
# -*- coding: utf-8 -*-
"""
celery.five
~~~~~~~~~~~
Compatibility implementations of features
only available in newer Python versions.
"""
from __future__ import absolute_import
__all__ = ['Counter', 'reload', 'UserList', 'UserDict', 'Queue', 'Empty',
'zip_longest', 'StringIO', 'BytesIO',... | |
from __future__ import absolute_import
import os
import numpy as nm
from sfepy.base.testing import TestCommon
from sfepy import data_dir
from six.moves import range
# n_vertex, n_edge, n_face, n_cell
# d1 -> d2 : num, n_incident
expected = {
'1_2_2.mesh' : ([3, 2, 0, 0], {
(0, 0) : (3, 4),
(0, 1)... | |
import datetime
from django import forms
#
# ExtJs Field models
#
#
# MISSING :
#
#'CommaSeparatedIntegerField' : {'type':'string'}
#'FileField' : {'type':'string'}
#'FilePathField' : {'type':'string'}
#'ImageField' : {'type':'string'}
#'IPAddressField' ... | |
from __future__ import annotations
import asyncio
import email.utils
import functools
import http
import inspect
import logging
import socket
import warnings
from types import TracebackType
from typing import (
Any,
Awaitable,
Callable,
Generator,
Iterable,
List,
Optional,
Sequence,
... | |
# Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | |
from datetime import datetime, date, time
from dateutil.parser import parse as parse_date
import pytest
import pytz
from predicthq.endpoints import decorators, schemas
from predicthq.endpoints.base import BaseEndpoint
def test_datetime_type():
class SchemaExample(schemas.Model):
my_datetime = schemas.D... | |
import os
import numpy as np
import tensorflow as tf
import random
from unittest.mock import MagicMock
def _print_success_message():
return print('Tests Passed')
def test_folder_path(cifar10_dataset_folder_path):
assert cifar10_dataset_folder_path is not None,\
'Cifar-10 data folder not set.'
as... | |
"""Support for Wink thermostats and Air Conditioners."""
import logging
import pywink
from homeassistant.components.climate import ClimateEntity
from homeassistant.components.climate.const import (
ATTR_TARGET_TEMP_HIGH,
ATTR_TARGET_TEMP_LOW,
CURRENT_HVAC_COOL,
CURRENT_HVAC_HEAT,
CURRENT_HVAC_IDLE... | |
#
# 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
# ... | |
#SPDX-License-Identifier: MIT
import os
import json
import logging
# generate random integer values
from random import seed
from random import randint
# seed random number generator
# DO NOT create a seed.
# Actual randomness is generated without a seed
# for this use case.
contributor_breadth_worker_p = randint(480... | |
# strategies.py
# Copyright (C) 2005, 2006, 2007, 2008 Michael Bayer [email protected]
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""sqlalchemy.orm.interfaces.LoaderStrategy implementations, and related MapperOptions."""
fro... | |
#
# Copyright 2017 Luma Pictures
#
# Licensed under the Apache License, Version 2.0 (the "Apache License")
# with the following modification you may not use this file except in
# compliance with the Apache License and the following modification to it:
# Section 6. Trademarks. is deleted and replaced with:
#
# 6. Tradem... | |
import json
import errno
import os
import time
import logging
import traceback
from cme.protocols.smb.remotefile import RemoteFile
from impacket import smb
from impacket.smb3structs import FILE_READ_DATA
from impacket.smbconnection import SessionError
CHUNK_SIZE = 4096
suffixes = ['Bytes', 'KB', 'MB', 'GB', 'TB', 'P... | |
import sys
import time
from django.db.backends.creation import BaseDatabaseCreation
TEST_DATABASE_PREFIX = 'test_'
PASSWORD = 'Im_a_lumberjack'
class DatabaseCreation(BaseDatabaseCreation):
# This dictionary maps Field objects to their associated Oracle column
# types, as strings. Column-type strings can cont... | |
# -*- coding: utf-8 -*-
from Tkinter import *
from tkColorChooser import askcolor
from turtle import *
from Settings import *
import tkMessageBox, traceback, os, turtle, re, platform, math, sys, StringIO, contextlib, tkFileDialog
def get_color():
"""
Opens the color picker dialog and assigns three variables to... | |
#!/usr/bin/python2.5
#
# Copyright 2011 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless require... | |
# Copyright (c) 2014 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... | |
import re, sys
from stackexchange.core import *
LaterClass = lambda name: LaterClassIn(name, sys.modules[__name__])
#### Revisions #
class RevisionType(Enumeration):
SingleUser = 'single_user'
VoteBased = 'vote_based'
class PostRevision(JSONModel):
transfer = ('body', 'comment', 'is_question', 'is_rollb... | |
# Copyright Anne M. Archibald 2008
# Released under the scipy license
from __future__ import division, print_function, absolute_import
import sys
import numpy as np
from heapq import heappush, heappop
import scipy.sparse
__all__ = ['minkowski_distance_p', 'minkowski_distance',
'distance_matrix',
... | |
# -*- coding: utf-8 -*-
'''
:codeauthor: :email:`Rupesh Tare <[email protected]>`
'''
# Import Python libs
from __future__ import absolute_import
import os
# Import Salt Testing Libs
from salttesting import TestCase, skipIf
from salttesting.mock import (
mock_open,
MagicMock,
patch,
NO_MOCK,
... | |
"""
Create PyML datasets from Brainvoyager data.
The location of the Brainvoyager data is assumed to be
in the current directory and can't be otherwise specified.
Requires preSVM.py, assumed to be in 'Users/type/Code/mvpa'
(which you may need to change, see around line 18).
These have been tested and run inside an ... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
A simple logger.
Based on the 'borg' recipe from [http://code.activestate.com/recipes/66531/].
"""
import os
import shutil
import time
import datetime
import traceback
# default maximum length of filename
MaxNameLength = 15
#######################################... | |
#!/usr/bin/env python
__description__ = \
"""
A set of objects and functions for blasting sequences against local and
remote servers. Also functions for filtering sequences. Uses Biopython. It
also requires ncbi's blast+ tools and cdhit to be installed and visible in
the path.
"""
__author__ = "Michael J. Harms"
... | |
import struct
class Instruction():
"""Base class for all 6502 instructions"""
def __init__(self, core):
if not hasattr(self, 'is_branch'):
self.is_branch = False
self.core = core
self.opcode = core.memory[core.pc]
try:
self.init_args()
except Attr... | |
import itertools
import matplotlib.pyplot as plt
import numpy as np
from scipy.io import wavfile
from scipy.signal import detrend, lfilter, bilinear, spectrogram, filtfilt, resample, fftconvolve
import acoustics
from acoustics.standards.iso_tr_25417_2007 import REFERENCE_PRESSURE
from acoustics.standards.iec_61672_1_2... | |
# Copyright 2020 Tensorforce Team. 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 la... | |
'''
Kivy framework
==============
Kivy is an open source library for developing multi-touch applications. It is
cross-platform (Linux/OSX/Windows/Android/iOS) and released under
the terms of the `MIT License <https://en.wikipedia.org/wiki/MIT_License>`_.
It comes with native support for many multi-touch input devices... | |
from __future__ import print_function, unicode_literals
import os
import random
import re
import select
import socket
import ssl
import string
import subprocess
import sys
import time
from itertools import count
from threading import Event, Lock, Thread
import paho.mqtt.client as mqtt
import ttfw_idf
DEFAULT_MSG_SIZ... | |
"""Test HTTP API application
"""
import datetime
import json
import os
from unittest.mock import Mock
import pytest
import smif
from flask import current_app
from smif.data_layer.store import Store
from smif.exception import SmifDataNotFoundError
from smif.http_api import create_app
@pytest.fixture
def mock_schedule... | |
# utils/SwiftBuildSupport.py - Utilities for Swift build scripts -*- python -*-
#
# This source file is part of the Swift.org open source project
#
# Copyright (c) 2014 - 2016 Apple Inc. and the Swift project authors
# Licensed under Apache License v2.0 with Runtime Library Exception
#
# See http://swift.org/LICENSE.tx... | |
# -*- coding: utf-8 -*-
"""Parser for .customDestinations-ms files."""
import logging
import os
import construct
from dfvfs.lib import definitions
from dfvfs.lib import errors as dfvfs_errors
from dfvfs.path import factory as path_spec_factory
from dfvfs.resolver import resolver
from plaso.lib import errors
from pla... | |
from django.conf import settings
# noinspection PyProtectedMember
from django.core.cache import caches
from django.utils.six import iteritems
from logging import getLogger
import requests
import requests.exceptions
import string
import random
import socket
logger = getLogger(__name__)
def random_password(minlength... | |
#!/usr/bin/python2.4
#
# Copyright 2012 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... | |
from __future__ import unicode_literals
import os
import unittest
from ship.tuflow import tuflowfilepart as tfp
from ship.tuflow.tuflowfilepart import TuflowPart
from ship.tuflow import FILEPART_TYPES as ft
from ship.tuflow import tuflowfactory as f
class TuflowFilePartTests(unittest.TestCase):
'''Tests TuflowP... | |
# Copyright 2017, OpenCensus 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... | |
"""
Main application window for starcheat GUI
"""
import sys
import logging
import json
from PyQt5 import QtWidgets
from PyQt5 import QtCore
from PyQt5.QtWidgets import QApplication
from PyQt5.QtWidgets import QMainWindow
from PyQt5.QtWidgets import QTableWidgetItem
from PyQt5.QtWidgets import QFileDialog
from PyQt5.... | |
from __future__ import nested_scopes # Backward compat for 2.1
from unittest import TestCase
from wsgiref.util import setup_testing_defaults
from wsgiref.headers import Headers
from wsgiref.handlers import BaseHandler, BaseCGIHandler
from wsgiref import util
from wsgiref.validate import validator
from wsgiref.simple... | |
import re
from dateutil.relativedelta import relativedelta
from rest_framework.decorators import api_view
from rest_framework.exceptions import APIException
from rest_framework.response import Response
from frontend.models import ImportLog
from frontend.models import Measure
from frontend.models import MeasureGlobal... | |
#/****************************************************************************
#* *
#* OpenNI 2.x Alpha *
#* Copyright (C) 2012 PrimeSense Ltd. *
#* ... | |
#
# 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... | |
# 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 ... | |
from __future__ import unicode_literals
from django import forms
from django.contrib.admin.util import (flatten_fieldsets, lookup_field,
display_for_field, label_for_field, help_text_for_field)
from django.contrib.admin.templatetags.admin_static import static
from django.contrib.contenttypes.models import ContentT... | |
#
# 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... | |
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# d... | |
# Copyright 2012 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 ... | |
# -*- coding: utf-8 -*-
import os
from pydocgen.model import ListStyleProperty, AlignmentProperty, FontEffectProperty, Image, Style, Table
from pydocgen.builders.common import Builder
class DitaBuilder(Builder):
"""Class responsible for creating a DITA V1.1 document.
It inherits from base Builder class sha... | |
#!/usr/bin/env python
#
# Electrum - lightweight Bitcoin client
# Copyright (C) 2011 Thomas Voegtlin
#
# 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... | |
import collections
import mock
from babel import dates, Locale
from schema import Schema, And, Use, Or
from django.utils import timezone
from nose.tools import * # noqa PEP8 asserts
from framework.auth import Auth
from osf.models import Comment, NotificationDigest, NotificationSubscription, Guid, OSFUser
from websi... | |
"""
sentry.web.frontend.accounts
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:copyright: (c) 2012 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
import itertools
from django.contrib import messages
from django.contrib.auth import login as login_user, authenticate
from django.core.... | |
from collections import OrderedDict
import copy
import re
from mangrove.datastore.cache_manager import get_cache_manager
from mangrove.form_model.validator_factory import validator_factory
from mangrove.datastore.database import DatabaseManager, DataObject
from mangrove.datastore.documents import FormModelDocument, En... | |
# -*- coding: utf-8 -*-
import datetime
from lxml import etree
from requests import session as requests_session
from requests.exceptions import HTTPError
from .base import Item, Storage
from .http import HTTP_STORAGE_PARAMETERS, USERAGENT, prepare_auth, \
prepare_verify
from .. import exceptions, log, utils
fro... | |
def test_000_basic_key_value_store(cfg):
# space kv dimensions k, v key k auto 0 1
# TODO: cfg.should().rm_space('kv')
cfg.must().add_space('''
space kv
key k
attributes v
''')
cfg.should().get('kv','k1').equals(None)
cfg.should().get('kv','k2').equals(None)
cfg.shou... | |
# -*- coding: utf-8 -*-
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (C) 2012 Yahoo! 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
#
# ... | |
# Copyright (c) 2012 OpenStack Foundation.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless... | |
from datetime import datetime, timedelta
import json
import os
import re
import pytz
from collections import deque
import typing
from urllib import parse, request
from django.conf import settings
from django.contrib.gis.geos import GeometryCollection, GEOSGeometry, Point
from django.contrib.gis.measure import D
from d... | |
import nbt
import struct
import time
import random
import logging
import os
import traceback
from numpy import array
from uuid import UUID
from mclevelbase import PlayerNotFound
from level import MCLevel
log = logging.getLogger(__name__)
def TagProperty(tagName, tagType, default_or_func=None):
def getter(self):
... | |
#Couple cool and very useful imports.
import sys, random
import socket
import struct
import threading
import time
import math
from PyQt4 import QtGui, QtCore
import proto.messages_robocup_ssl_wrapper_pb2 as wrapper
from proto.grSim_Packet_pb2 import grSim_Packet
from proto.grSim_Commands_pb2 import grSim_Commands, gr... | |
# Copyright 2016-2020 Amazon.com, Inc. or its affiliates. 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 copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
#
# or in the "license" f... | |
#===============================================================================
# Copyright (c) 2015, Max Zwiessele
# 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... | |
# Copyright (C) 2009 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... | |
#!/usr/bin/python2.7
"""
Copyright (c) 2014, ICFLIX Media FZ LLC All rights reserved.
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file.
Desc: Generate Nagios configuration from given file, resp. from check_multi.
"""
import logging
import logging.handlers
import json
imp... | |
#!/usr/bin/env python
# Copyright 2014 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.
import multiprocessing
import optparse
import os
import shutil
import subprocess
import sys
from slave import build_directory
SCRIPT... | |
# -*- coding: utf-8 -*-
# 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 requir... | |
from __future__ import unicode_literals
from operator import attrgetter
from django.core.exceptions import FieldError
from django.core.management import call_command
from django.db import connection
from django.test import TestCase
from django.test.utils import CaptureQueriesContext
from django.utils import six
from... | |
# Copyright The Cloud Custodian Authors.
# SPDX-License-Identifier: Apache-2.0
from c7n.resources.elasticache import _cluster_eligible_for_snapshot
from .common import BaseTest
class TestElastiCacheCluster(BaseTest):
def test_eligibility_snapshot(self):
# so black box testing, due to use of private inte... | |
# -*- coding: utf8
"""Random Projection transformers
Random Projections are a simple and computationally efficient way to
reduce the dimensionality of the data by trading a controlled amount
of accuracy (as additional variance) for faster processing times and
smaller model sizes.
The dimensions and distribution of Ra... | |
#!/usr/bin/python
"""
HeaderID Extension for Python-Markdown
======================================
Auto-generate id attributes for HTML headers.
Basic usage:
>>> import markdown
>>> text = "# Some Header #"
>>> md = markdown.markdown(text, ['headerid'])
>>> print md
<h1 id="some-header">Some He... | |
# coding=utf-8
# Copyright 2022 The ML Fairness Gym 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... | |
# Lint as: python3
# Copyright 2017 The Rudders 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... | |
#!/usr/bin/env python
r"""Gathering and processing the data required for predicting
daily temperatures from temperature, atmospheric pressure
and hygrometry time series.
Instead of gathering all daily time series into a single large
array, careful consideration is given to the possibility of
dup... | |
import os
import torch
import torchvision.datasets as datasets
from torch.utils.data.distributed import DistributedSampler
from torch.utils.data.sampler import RandomSampler
from torch.utils.data import Subset
from torch._utils import _accumulate
from utils.regime import Regime
from utils.dataset import IndexedFileData... | |
"""Compressed Block Sparse Row matrix format"""
from __future__ import division, print_function, absolute_import
__docformat__ = "restructuredtext en"
__all__ = ['bsr_matrix', 'isspmatrix_bsr']
from warnings import warn
import numpy as np
from .data import _data_matrix, _minmax_mixin
from .compressed import _cs_m... | |
from featureflow import Node, NotEnoughData
from zounds.core import ArrayWithUnits, IdentityDimension
import numpy as np
from multiprocessing.pool import ThreadPool
from os import cpu_count
class Reservoir(object):
def __init__(self, nsamples, dtype=None):
super(Reservoir, self).__init__()
if not... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Tests for `message` package."""
import copy
import aioxmpp
import aioxmpp.forms.xso as forms_xso
import pytest
from spade.message import Message, SPADE_X_METADATA
def test_prepare(message):
aiomsg = message.prepare()
assert aiomsg.to == aioxmpp.JID.fromstr("... | |
MAX_ROUNDS = 15
TOTAL_HONOR_TOKENS = 60.0
STARTING_RUNES = 4.0
STARTING_POWER = 1.0
# can't have more than 10 runes in one hand (5 mystics)
# not counting draw-card effects
RUNES_CAP = 10.0
# can't have more than 10 power in one hand (5 heavies)
POWER_CAP = 10.0
# realistically, can't really draw more than 5 card... | |
# 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 ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.