gt stringclasses 1
value | context stringlengths 2.49k 119k |
|---|---|
# Copyright 2015 Chelsio Communications 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
#
# Unle... | |
# Copyright (c) 2019 Sean Vig
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute... | |
#!/usr/bin/env python
#
# iuwandbox.py
#
# Copyright (C) 2014-2020, Takazumi Shirayanagi
# This software is released under the new BSD License,
# see LICENSE
#
import os
import sys
import re
import codecs
from argparse import ArgumentParser
from argparse import SUPPRESS
from wandbox import Wandbox
IUTEST_FUSED_SRC =... | |
from __future__ import unicode_literals
from six.moves import zip_longest, range
from prompt_toolkit.filters import HasCompletions, IsDone, Condition, to_cli_filter
from prompt_toolkit.mouse_events import MouseEventType
from prompt_toolkit.token import Token
from prompt_toolkit.utils import get_cwidth
from .container... | |
#!/usr/bin/python
# (c) 2017, NetApp, Inc
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
... | |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2011 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.apac... | |
# -*- coding: ISO-8859-15 -*-
# =============================================================================
# Copyright (c) 2004, 2006 Sean C. Gillies
# Copyright (c) 2005 Nuxeo SARL <http://nuxeo.com>
#
# Authors : Sean Gillies <sgillies@frii.com>
# Julien Anguenot <ja@nuxeo.com>
#
# Contact email: sgillie... | |
"""Provides device triggers for lutron caseta."""
from __future__ import annotations
from typing import Any
import voluptuous as vol
from homeassistant.components.automation import (
AutomationActionType,
AutomationTriggerInfo,
)
from homeassistant.components.device_automation import DEVICE_TRIGGER_BASE_SCHE... | |
#!/usr/bin/env python3
# Copyright (c) 2014-2019 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test the listtransactions API."""
from decimal import Decimal
from io import BytesIO
from test_framewo... | |
# Python3
from solution1 import crackingPassword as f
qa = [
([1, 5, 2], 2, 3,
['12',
'15',
'21',
'51']),
([4, 6, 0, 3], 4, 13,
['0000',
'0364',
'0403',
'0663',
'3003',
'3406',
'3640',
'3666',
'4004',
'4030',
'4043',
... | |
#!/usr/bin/env python3
# Copyright (c) 2016-2017 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test compact blocks (BIP 152).
Version 1 compact blocks are pre-segwit (txids)
Version 2 compact block... | |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import os
import json
import logging
import markdown
try:
# Py3k
from html.parser import HTMLParser
except ImportError:
# Py2.7
from HTMLParser import HTMLParser
from pelican import signals
from pelican.readers import MarkdownReader, HTM... | |
"""
Contains Mantrid's built-in actions.
"""
import errno
import logging
import operator
import os
import random
import eventlet
from eventlet.green import socket
from eventlet.timeout import Timeout
from httplib import responses
from mantrid.backend import Backend
from mantrid.socketmeld import SocketMelder
class ... | |
# 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... | |
"""
A class hierarchy for shock capturing diffusion methods
.. inheritance-diagram:: proteus.ShockCapturing
:parts: 1
"""
from __future__ import print_function
from __future__ import absolute_import
from builtins import range
from builtins import object
import numpy
from . import cshockCapturing
class ShockCapturin... | |
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a ... | |
# 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 ... | |
import re
import numpy as np
import pytest
from pandas import (
Interval,
IntervalIndex,
Series,
)
import pandas._testing as tm
class TestIntervalIndex:
@pytest.fixture
def series_with_interval_index(self):
return Series(np.arange(5), IntervalIndex.from_breaks(np.arange(6)))
def tes... | |
import mock
import pytest
from datarobot_batch_scoring.main import (
main, UI, main_standalone, parse_args, main_deployment_aware
)
def test_lower_case_for_user(monkeypatch):
main_args = ['--host',
'http://localhost:53646/api',
'--user', 'DataRobot@datarobot.com',
... | |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright © 2014-2016 NetApp, Inc. All Rights Reserved.
#
# DO NOT EDIT THIS CODE BY HAND! It has been generated with jsvcgen.
#
import click
from element.cli import utils as cli_utils
from element.cli import parser
from element.cli.cli import pass_context
from eleme... | |
# Copyright 2013 OpenStack Foundation
# Copyright (c) 2015 Mirantis inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/lice... | |
# -*- coding: utf-8 -*-
"""
pygments.lexers.dotnet
~~~~~~~~~~~~~~~~~~~~~~
Lexers for .net languages.
:copyright: Copyright 2006-2012 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
from pygments.lexer import RegexLexer, DelegatingLexer, bygroups, include, ... | |
# 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 ... | |
# -*- coding: utf-8 -*-
""" S3 Extensions for gluon.dal.Field, reusable fields
@requires: U{B{I{gluon}} <http://web2py.com>}
@copyright: 2009-2014 (c) Sahana Software Foundation
@license: MIT
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associ... | |
# -*- coding: utf-8; -*-
import sys
import os.path
import itertools
import argparse
import pickle
import platform
import hashlib
import re
try:
from collections import OrderedDict
except ImportError:
# Python < 2.7
from ordereddict import OrderedDict
from collections import namedtuple
from glob2 import g... | |
"""Support for Subaru sensors."""
import subarulink.const as sc
from homeassistant.components.sensor import (
DEVICE_CLASSES,
SensorDeviceClass,
SensorEntity,
)
from homeassistant.const import (
ELECTRIC_POTENTIAL_VOLT,
LENGTH_KILOMETERS,
LENGTH_MILES,
PERCENTAGE,
PRESSURE_HPA,
TEMP... | |
import os
import bz2
import csv
import collections
import bisect
import statistics
import numpy
import matplotlib.pyplot as plt
from .Blinking import *
from .util import *
def mode_error(mode):
raise(KeyError("Unknown mode: {}".format(mode)))
class Intensity(object):
"""
Implements the tools necessary f... | |
"""
=======================
Morphological Filtering
=======================
Morphological image processing is a collection of non-linear operations related
to the shape or morphology of features in an image, such as boundaries,
skeletons, etc. In any given technique, we probe an image with a small shape or
template ca... | |
# -*- coding: utf-8 -*-
'''Convenience API to obtain information on MeCab environment.'''
import logging
import os
import sys
from subprocess import Popen, PIPE
logger = logging.getLogger('natto.environment')
class MeCabEnv(object):
'''Convenience class of object to obtain information on MeCab environment.
... | |
'''
Created on 30-Jan-2015
@author: Asawari.Vaidya
'''
import inspect
from PythonNetBanxSDK import CustomerVault
from PythonNetBanxSDK import common
class CustomerVaultService(object):
'''
classdocs
'''
# Define URL paths for Customer Profile, Address and Card
_MONITOR_PATH = '/customervault/mon... | |
import codecs
import glob
import logging
import os
import textwrap
import salt.loader
import salt.utils.data
import salt.utils.files
import salt.utils.reactor as reactor
import salt.utils.yaml
from tests.support.mixins import AdaptedConfigurationTestCaseMixin
from tests.support.mock import MagicMock, Mock, mock_open, ... | |
# Copyright 2020 Deepmind Technologies Limited.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agr... | |
# Copyright 2016 Hewlett Packard Enterprise Development Company LP
#
# 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 ap... | |
# -*- coding: utf-8 -*-
'''
integration tests for mac_system
'''
# Import python libs
from __future__ import absolute_import, print_function
import random
import string
# Import Salt Testing libs
from salttesting.helpers import ensure_in_syspath, destructiveTest
from salt.ext.six.moves import range
ensure_in_syspath(... | |
import inspect
import six
__all__ = (
'Factory',
'UnrealizedInjection',
'get_dependencies',
'inject',
'injected',
)
class Factory(tuple):
"""
This class is a wrapper for a specification, declaring that instead of
a created object for the specification, a callable returning the objec... | |
# 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... | |
# This file was generated automatically by generate_protocols.py
from nintendo.nex import notification, rmc, common, streams
import logging
logger = logging.getLogger(__name__)
class AuthenticationInfo(common.Data):
def __init__(self):
super().__init__()
self.token = None
self.ngs_version = 3
self.token_t... | |
# Copyright (C) 2017 Google Inc.
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
"""Create, description, representation and equal of entities."""
# pylint: disable=too-many-arguments
# pylint: disable=too-few-public-methods
class Entity(object):
"""Class that represent model for base ... | |
# (C) Datadog, Inc. 2010-2016
# All rights reserved
# Licensed under Simplified BSD License (see LICENSE)
# stdlib
from datetime import datetime, timedelta
from hashlib import md5
from Queue import Empty, Queue
import re
import ssl
import time
import traceback
# 3p
from pyVim import connect
from pyVmomi import vim #... | |
# Copyright 2015-2016 ARM Limited
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in w... | |
#!/usr/bin/env python
###### WARNING #######
### This script is obsoleted ###
# If you get it working again, please drop me a line
# F. Alted 2004-01-27
import sys
import struct
import cPickle
import numpy as np
import tables as tb
from bsddb import db
import psyco
# This class is accessible only for the examples
... | |
import asyncio
import time
import requests
from aiohttp import web
from aiohttp_jinja2 import get_env
from aioxmpp import JID, PresenceType
from aioxmpp.roster import Item
from asynctest import Mock, CoroutineMock, MagicMock
from jinja2 import ChoiceLoader, FileSystemLoader, PackageLoader
from parsel import Selector
f... | |
#! /usr/bin/env python3
# -*- coding: utf-8 -*-
# vim: ts=2 sw=2 et ai
###############################################################################
# Copyright (c) 2012,2020 Andreas Vogel andreas@wellenvogel.net
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and... | |
# 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 os
from os.path import sep, normpath, join, exists
import ntpath
import copy
from collections import namedtuple
import shutil
from subprocess import Popen, PIPE
import re
from tools.arm_pack_manager import Cache
from tools.targets import TARGET_MAP
from tools.export.exporters import Exporter, apply_supported_wh... | |
import gc
from collections import defaultdict
import autograd.numpy.random as npr
from autograd import numpy as np
from autograd.core import getval
from .binary_dot import csr_binary_dot_left
from .nonlinearity import relu
from .wb import WeightsAndBiases
class GraphInputLayer(object):
"""
Note: at each lay... | |
"""
=============================
Generic SpectralModel wrapper
=============================
.. moduleauthor:: Adam Ginsburg <adam.g.ginsburg@gmail.com>
Module API
^^^^^^^^^^
"""
import numpy as np
from pyspeckit.mpfit import mpfit,mpfitException
from pyspeckit.spectrum.parinfo import ParinfoList,Parinfo
import copy
... | |
# graphicsUtils.py
# ----------------
# Licensing Information: Please do not distribute or publish solutions to this
# project. You are free to use and extend these projects for educational
# purposes. The Pacman AI projects were developed at UC Berkeley, primarily by
# John DeNero (denero@cs.berkeley.edu) and Dan Klei... | |
#! /usr/env/python
"""
Python implementation of HexModelGrid, a grid class used to create and manage
structured Voronoi-Delaunay grids for 2D numerical models.
Do NOT add new documentation here. Grid documentation is now built in a semi-
automated fashion. To modify the text seen on the web, edit the files
`docs/text_... | |
# -*- coding: utf-8 -*-
# Copyright 2010 British Broadcasting Corporation and Kamaelia Contributors(1)
#
# (1) Kamaelia Contributors are listed in the AUTHORS file and at
# http://www.kamaelia.org/AUTHORS - please extend this file,
# not this notice.
#
# Licensed under the Apache License, Version 2.0 (the "Lice... | |
# test asynchat
import asyncore, asynchat, socket, time
import unittest
import sys
from test import test_support
try:
import threading
except ImportError:
threading = None
HOST = test_support.HOST
SERVER_QUIT = 'QUIT\n'
if threading:
class echo_server(threading.Thread):
# parameter to determine t... | |
from __future__ import absolute_import
from collections import namedtuple, OrderedDict
from copy import deepcopy
from contextlib import contextmanager
from datetime import datetime, timedelta
from dateutil.parser import parse as parse_datetime
import logging
import functools
import os
import pytz
import re
import six
... | |
# -*- coding: utf-8 -*-
"""OSF mailing utilities.
Email templates go in website/templates/emails
Templates must end in ``.txt.mako`` for plaintext emails or``.html.mako`` for html emails.
You can then create a `Mail` object given the basename of the template and
the email subject. ::
CONFIRM_EMAIL = Mail(tpl_pre... | |
"""
This class is defined to override standard pickle functionality
The goals of it follow:
-Serialize lambdas and nested functions to compiled byte code
-Deal with main module correctly
-Deal with other non-serializable objects
It does not include an unpickler, as standard python unpickling suffices.
This module wa... | |
#!/usr/bin/env python3
###############################################################################
# Copyright 2017 The Apollo 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... | |
# Copyright (c) 2015 - present Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the BSD style license found in the
# LICENSE file in the root directory of this source tree. An additional grant
# of patent rights can be found in the PATENTS file in the same directory.
from __future__ import ... | |
"""Testing TcEx Input module field types."""
# standard library
from typing import TYPE_CHECKING, Optional
# third-party
import pytest
from pydantic import BaseModel, ValidationError
# first-party
from tcex.input.field_types import Sensitive
from tcex.input.field_types.sensitive import sensitive
from tcex.pleb.scoped... | |
# Copyright (c) 2017-2019 Uber Technologies, Inc.
# SPDX-License-Identifier: Apache-2.0
import logging
import os
from collections import Counter
import pytest
import torch
import pyro
from pyro.distributions.spanning_tree import (
NUM_SPANNING_TREES,
SpanningTree,
find_best_tree,
make_complete_graph,... | |
r"""
Filename: ddp.py
Author: Daisuke Oyama
Module for solving dynamic programs (also known as Markov decision
processes) with finite states and actions.
Discrete Dynamic Programming
----------------------------
A discrete dynamic program consists of the following components:
* finite set of states :math:`S = \{0,... | |
from __future__ import unicode_literals
import os
import django
from django.test import TestCase, TransactionTestCase
from django.utils.text import get_valid_filename
from django.utils.timezone import now
from mock import MagicMock, patch
from job.execution.container import SCALE_JOB_EXE_OUTPUT_PATH
from job.test im... | |
# -*- coding: utf-8 -*-
"""
Classic deprecation warning
===========================
Classic ``@deprecated`` decorator to deprecate old python classes, functions or methods.
.. _The Warnings Filter: https://docs.python.org/3/library/warnings.html#the-warnings-filter
"""
import functools
import inspect
import platform
... | |
from __future__ import absolute_import
import os
import re
import json
import base64
import inspect
import requests
import mimetypes
from contextlib import contextmanager
from datetime import datetime, timedelta
from django.conf import settings
from django.db import transaction
from pytz import utc
from random import... | |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.5 on 2017-02-06 10:07
from __future__ import unicode_literals
import django.db.models.deletion
from django.conf import settings
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [("order", "0014_auto_20161028_0955")]... | |
# Copyright (C) 2010 Chris Jerdonek (cjerdonek@webkit.org)
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and... | |
#!/usr/bin/env python3
# Copyright (c) 2014-2019 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test the pruning code.
WARNING:
This test uses 4GB of disk space.
This test takes 30 mins or more (up ... | |
#!/usr/bin/env python3
# Copyright (c) 2016-2017 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test account RPCs.
RPCs tested are:
- getaccountaddress
- getaddressesbyaccount
- listaddr... | |
import os
from os.path import isfile, isdir, getmtime, dirname, splitext, getsize
from tempfile import mkstemp
from shutil import copyfile
from PIL import Image
from sorl.thumbnail import defaults
from sorl.thumbnail.processors import get_valid_options, dynamic_import
class ThumbnailException(Exception):
# Stop... | |
#!/usr/bin/env python
"""Tool for mounting AFF4 datastore over FUSE."""
import datetime
import errno
import getpass
import stat
import sys
# pylint: disable=unused-import,g-bad-import-order
from grr.lib import server_plugins
# pylint: enable=unused-import,g-bad-import-order
import logging
from grr.lib import acces... | |
#! /usr/bin/python
# -*- coding: utf-8 -*-
from loguru import logger
# logger = logging.getLogger()
import unittest
import os.path as op
import pytest
path_to_script = op.dirname(op.abspath(__file__))
import sys
sys.path.insert(0, op.abspath(op.join(path_to_script, "../../io3d")))
sys.path.insert(0, op.a... | |
"""
Enable the NatLink Python extension to Dragon NaturallySpeaking.
$Id: enable.py 172 2008-09-29 16:33:59Z drocco $
(c) 2008 Daniel J. Rocco
Licensed under the Creative Commons Attribution-Noncommercial-Share Alike 3.0 United States License
http://creativecommons.org/licenses/by-nc-sa/3.0/us/
Works ... | |
from django.conf import settings
from django.db.models.sql import aggregates as sqlaggregates
from django.db.models.sql.compiler import SQLCompiler
from django.db.models.sql.constants import LOOKUP_SEP, MULTI, SINGLE
from django.db.models.sql.where import AND, OR, Constraint
from django.db.utils import DatabaseError, I... | |
# Copyright 2013 Rackspace Hosting
# 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... | |
#!/usr/bin/env python
#
# Copyright (c) 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Provisions Android devices with settings required for bots.
Usage:
./provision_devices.py [-d <device serial number>]
"""
... | |
# 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... | |
#!/usr/bin/env python
#
# Copyright (c) 2001 - 2016 The SCons Foundation
#
# runtest.py - wrapper script for running SCons tests
#
# SCons test suite consists of:
#
# - unit tests - included in *Tests.py files from src/ dir
# - end-to-end tests - these are *.py files in test/ directory that
# ... | |
from sympy.integrals.transforms import (mellin_transform,
inverse_mellin_transform, laplace_transform, inverse_laplace_transform,
fourier_transform, inverse_fourier_transform,
sine_transform, inverse_sine_transform,
cosine_transform, inverse_cosine_transform,
hankel_transform, inverse_hankel_transfo... | |
# -*- coding: utf-8 -*-
#
# KGDataset.py
#
# Copyright 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.
# You may obtain a copy of the License at
#
# http://www.apache.... | |
# -*- coding: utf-8 -*-
from decimal import Decimal
from django.contrib.auth.models import User
from django.test.testcases import TestCase
from shop.cart.modifiers_pool import cart_modifiers_pool
from shop.models.cartmodel import Cart, CartItem
from shop.models.productmodel import Product
from shop.tests.util import Mo... | |
import ctypes
import itertools
import logging
import multiprocessing
import os
import pickle
import textwrap
import unittest
from importlib import import_module
from io import StringIO
from django.core.management import call_command
from django.db import connections
from django.test import SimpleTestCase, TestCase
fro... | |
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
# Tree (Hierarchical) Nested Set Model (nsm)
#
# To use the nested set model,
# use the following pattern
# 1. name your parent field as "parent_item_group" if not have a property nsm_parent_field as your field name in ... | |
# (C) Datadog, Inc. 2010-2016
# All rights reserved
# Licensed under Simplified BSD License (see LICENSE)
# stdlib
from collections import defaultdict, namedtuple
import time
import urlparse
# 3p
import requests
# project
from checks import AgentCheck
from config import _is_affirmative
from util import headers
cla... | |
"""
Title: FixRes: Fixing train-test resolution discrepancy
Author: [Sayak Paul](https://twitter.com/RisingSayak)
Date created: 2021/10/08
Last modified: 2021/10/10
Description: Mitigating resolution discrepancy between training and test sets.
"""
"""
## Introduction
It is a common practice to use the same input image... | |
# Copyright (c) 2014 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 applicable law... | |
from .. import app
from .. import queue
from .. import hooks
from ..models import Post
from bs4 import BeautifulSoup
import urllib
import re
import requests
def register():
hooks.register('post-saved', send_webmentions)
def send_webmentions(post, args):
if args.get('action') in ('save_draft', 'publish_quiet... | |
# -*- coding: utf-8 -*-
"""
sphinx.transforms
~~~~~~~~~~~~~~~~~
Docutils transforms used by Sphinx when reading documents.
:copyright: Copyright 2007-2014 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from os import path
from docutils import nodes
from docutils.uti... | |
# Copyright (c) 2006,2007 Mitch Garnaat http://garnaat.org/
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modi... | |
import warnings
import numpy as np
import pytest
from scipy import linalg
from sklearn.base import clone
from sklearn.model_selection import train_test_split
from sklearn.utils._testing import assert_allclose
from sklearn.utils._testing import assert_array_almost_equal
from sklearn.utils._testing import ignore_warning... | |
from jsonrpc import ServiceProxy
import sys
import string
import getpass
# ===== 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:29947")
... | |
#!/usr/bin/env python
"""
Fenced Code Extension for Python Markdown
=========================================
This extension adds Fenced Code Blocks to Python-Markdown.
>>> import markdown
>>> text = '''
... A paragraph before a fenced code block:
...
... ~~~
... Fenced code block
... ~~~... | |
# -*- coding: utf-8 -*-
#
# Author: Taylor Smith <taylor.smith@alkaline-ml.com>
#
# Setup the pmdarima module. This is heavily adapted from the scikit-learn
# setup.py, since they have a similar package structure and build similar
# Cython + C modules.
import sys
import os
import platform
import shutil
from distutils... | |
#------------------------------------------------------------------------------
# Copyright (c) 2013, Nucleic Development Team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file COPYING.txt, distributed with this software.
#-------------------------------------------------... | |
"""Tests for the Nest config flow."""
import asyncio
from unittest.mock import Mock, patch
from homeassistant import data_entry_flow
from homeassistant.components.nest import DOMAIN, config_flow
from homeassistant.setup import async_setup_component
from tests.async_mock import AsyncMock
from tests.common import mock_... | |
# Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | |
"""
tests.component.media_player.test_universal
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Tests universal media_player component.
"""
from copy import copy
import unittest
import homeassistant.core as ha
from homeassistant.const import (
STATE_OFF, STATE_ON, STATE_UNKNOWN, STATE_PLAYING, STATE_PAUSED)
import ho... | |
import datetime
from decimal import Decimal
from django.utils import translation
import mock
from nose.tools import eq_, ok_
import amo
import amo.tests
from addons.models import Addon, AddonUser
from constants.payments import PROVIDER_BANGO
from market.models import AddonPremium, Price, Refund
from mkt.constants im... | |
import random
from threading import Thread
from time import sleep, time
import numpy as np
from couchbase import Couchbase
from couchbase.user_constants import OBS_NOTFOUND
from logger import logger
from perfrunner.helpers.cbmonitor import with_stats
from perfrunner.helpers.metrics import MetricHelper
from perfrunner... | |
'''
Created on 22 Apr 2014
@author: Edwin Simpson
'''
import ibcc
import numpy as np
from sklearn.cross_validation import KFold
from sklearn.metrics import roc_curve, average_precision_score, auc
import matplotlib.pyplot as plt
import os, logging
from copy import deepcopy
class Evaluator(object):
nclasses = 2
... | |
"""
Copyright (c) 2015 Michael Bright and Bamboo HR 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... | |
#!/usr/bin/env python
#
# Copyright (c) 2016, The OpenThread Authors.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# 1. Redistributions of source code must retain the above copyright
# ... | |
# Copyright (c) 2012 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.
from code import Code
from model import PropertyType
import cpp_util
from json_parse import OrderedDict
import schema_util
class _TypeDependency(object)... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.