gt stringclasses 1
value | context stringlengths 2.49k 119k |
|---|---|
# Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | |
from __future__ import unicode_literals
import json
class ImmutableObject(object):
"""
Superclass for immutable objects whose fields can only be modified via the
constructor.
:param kwargs: kwargs to set as fields on the object
:type kwargs: any
"""
def __init__(self, *args, **kwargs):
... | |
# 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... | |
# -*- coding: utf-8 -*-
# Copyright 2017 Xiaomi, 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... | |
from datetime import datetime
from .base import AutoFocusObject
from .base import NotLoaded
from ..exceptions import _InvalidSampleData
class Sample(AutoFocusObject):
# All known fields. We need to prepopulate attributes with NotLoaded when we are getting a
# partial modal due to "fields" being offered to th... | |
# 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 print_function
from jinja2.exceptions import TemplateNotFound
from mkdocs import nav, toc, utils
from mkdocs.compat import urljoin, PY2
from mkdocs.relative_path_ext import RelativePathExtension
import jinja2
import json
import markdown
import os
import logging
log = logging.get... | |
# pylint: disable=missing-docstring
from pathlib import Path
from unittest.mock import patch
from resolwe.flow.executors import constants
from resolwe.flow.executors.socket_utils import Message, Response, ResponseStatus
from resolwe.flow.managers.listener.basic_commands_plugin import BasicCommands
from resolwe.flow.ma... | |
#!/usr/bin/env python
# Copyright 2015 Dell 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 appl... | |
# coding: utf-8
#
# Copyright 2017 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 requi... | |
from .testutils import TempDirTests, BaseTestClass, FakeStrictRedis
from io import BytesIO
from webrecorder.standalone.webrecorder_player import webrecorder_player
import os
import requests
import gzip
import json
import websocket
from tempfile import NamedTemporaryFile
from warcio.timeutils import timestamp_to_is... | |
#!/usr/bin/env python3
#
# 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
# ... | |
from __future__ import unicode_literals
import json
from django.test import TestCase, override_settings
from django.utils.http import urlquote
from django.core.urlresolvers import reverse
from django.contrib.auth.models import Permission
from django.core.files.uploadedfile import SimpleUploadedFile
from django.templa... | |
# Copyright 2017 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,... | |
#!/usr/bin/env python
# Copyright (c) 2013 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applic... | |
#!/usr/bin/env python
#
# Use the raw transactions API to spend sherlockholmescoins received on particular addresses,
# and send any change back to that same address.
#
# Example usage:
# spendfrom.py # Lists available funds
# spendfrom.py --from=ADDRESS --to=ADDRESS --amount=11.00
#
# Assumes it will talk to a sher... | |
"""Config flow for Z-Wave JS integration."""
from __future__ import annotations
import asyncio
import logging
from typing import Any
import aiohttp
from async_timeout import timeout
import voluptuous as vol
from zwave_js_server.version import VersionInfo, get_server_version
from homeassistant import config_entries, ... | |
import json
import typing
import aiohttp
import hashlib
from http import HTTPStatus
from waterbutler.core import streams
from waterbutler.core import provider
from waterbutler.core import exceptions
from waterbutler.core import path as wb_path
from waterbutler.providers.box import settings
from waterbutler.providers.b... | |
#!/usr/bin/env python
"""
Usage example employing Lasagne for digit recognition using the MNIST dataset.
This example is deliberately structured as a long flat file, focusing on how
to use Lasagne, instead of focusing on writing maximally modular and reusable
code. It is used as the foundation for the introductory La... | |
# ############################################################################
#
# Copyright (c) Microsoft Corporation.
#
# This source code is subject to terms and conditions of the Apache License, Version 2.0. A
# copy of the license can be found in the License.html file at the root of this distribution. If
... | |
import numpy as np
import pytest
import dask.array as da
from dask.array.reshape import contract_tuple, expand_tuple, reshape_rechunk
from dask.array.utils import assert_eq
@pytest.mark.parametrize(
"inshape,outshape,prechunks,inchunks,outchunks",
[
((4,), (4,), ((2, 2),), ((2, 2),), ((2, 2),)),
... | |
# search.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 Klein (klein@cs.be... | |
#!/usr/bin/env python
import argparse
import numpy as np
from chainer import Variable, FunctionSet, optimizers, cuda
import chainer.functions as F
import data
import cPickle as pickle
import brica1
class SLP(FunctionSet):
def __init__(self, n_input, n_output):
super(SLP, self).__init__(
transf... | |
# Copyright 2011 OpenStack Foundation
# Copyright 2012 Justin Santa Barbara
#
# 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
#
#... | |
# Copyright DataStax, 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, softwa... | |
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
# Copyright 2011 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the ... | |
import logging
import os
import re
import uuid
from typing import Any, Dict, List, Optional, Union, cast
from great_expectations.util import get_sqlalchemy_inspector
try:
from typing import Final
except ImportError:
# Fallback for python < 3.8
from typing_extensions import Final
import click
try:
fr... | |
"""distutils.extension
Provides the Extension class, used to describe C/C++ extension
modules in setup scripts."""
__revision__ = "$Id$"
import os, string, sys
from types import *
try:
import warnings
except ImportError:
warnings = None
# This class is really only used by the "build_ext" command, so it mig... | |
# pylint: disable=W0201
from datetime import date, datetime, timedelta
import mock
import os
import unittest
from config import get_config
import destalinator
import slacker
import slackbot
sample_slack_messages = [
{
"type": "message",
"channel": "C2147483705",
"user": "U2147483697",
... | |
import re
import datetime
from pylons import config
from webhelpers.html import literal
from webhelpers.html.tags import *
from routes import url_for
import ckan.lib.helpers as h
import ckan.lib.base as base
import ckan.lib.dictization.model_dictize as model_dictize
import ckan.logic as logic
from ckan.logic.action.g... | |
from __future__ import (absolute_import, division, print_function)
from owscapable.etree import etree
from owscapable.util import nspath, testXMLValue, openURL
from owscapable.util import xml_to_dict as _xml_to_dict
from datetime import datetime
from dateutil import parser
namespaces = {
'wml1.1':'{http://www.cua... | |
# -*- coding: utf-8 -*-
"""
Custom rheaders for RLPCM template
@license: MIT
"""
from gluon import current, URL, A, SPAN
from s3 import S3ResourceHeader, s3_rheader_resource, s3_fullname
# =============================================================================
def rlpcm_br_rheader(r, tabs=None):
... | |
# Copyright 2014 IBM Corp.
# 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 ... | |
from collections import OrderedDict
import sys
import matplotlib.pyplot as plt
import numpy as np
from scipy.ndimage import interpolation
class PictureFrame(object):
"""
Lightweight wrapper for a dictionary of NumPy arrays with shape
constraints and additional convenience functions for joint
indexing... | |
# 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... | |
#!/usr/bin/python2.7
# Copyright 2010 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requi... | |
#!/usr/bin/python
# -*- coding: utf-8 -*-
from bottle import abort, Bottle, redirect, response, request, static_file, jinja2_template as template
from pysimpleblog.core.functions import BASE, Settings
from pysimpleblog.core.models import Blog, Links, Users, Sessions
blog_app = Bottle()
# Models
entries = Blog()
users ... | |
import os
import unittest
from __main__ import vtk, qt, ctk, slicer
from slicer.ScriptedLoadableModule import *
import numpy as np
import logging
import math
import time
#
# DualModalityCalibration
#
class DualModalityCalibration(ScriptedLoadableModule):
"""Uses ScriptedLoadableModule base class, available at:
ht... | |
"""
ssm_documents.py
AWS SSM Documents help methods - currently extending boto3
Note:
Credentials are required to communicate with AWS.
aws cli profile can be passed in using --profile, or
the following ENVIRONMENT VARIABLES can be set before
running this script:
AWS_ACCESS_KEY_ID
AWS_... | |
#!/usr/bin/env python
##
from __future__ import print_function
import os
import argparse
import sys
import warnings
import copy
import imp
nodes = imp.load_source('nodes', 'steps/nnet3/components.py')
nnet3_train_lib = imp.load_source('ntl', 'steps/nnet3/nnet3_train_lib.py')
chain_lib = imp.load_source('ncl', 'steps/n... | |
# coding: utf-8
"""
Onshape REST API
The Onshape REST API consumed by all clients. # noqa: E501
The version of the OpenAPI document: 1.113
Contact: api-support@onshape.zendesk.com
Generated by: https://openapi-generator.tech
"""
from __future__ import absolute_import
import re # noqa: F401
im... | |
"""Linky Atome."""
from datetime import timedelta
import logging
from pyatome.client import AtomeClient, PyAtomeError
import voluptuous as vol
from homeassistant.components.sensor import PLATFORM_SCHEMA
from homeassistant.const import (
CONF_NAME,
CONF_PASSWORD,
CONF_USERNAME,
DEVICE_CLASS_POWER,
... | |
#!/usr/bin/env python
#Module for IO functionality that is relatively general. The functions in
#this module are tested versions of ioutilst.py in sntools.
#R. Biswas, Thu Jan 30 19:42:19 CST 2014
#HISTORY:
#Copied loadfile2array from ioutilst in sntools without further checking.
#R. Biswas, Sat May 10 18:57:23 CDT 2... | |
#
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 The SCons Foundation
#
# 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 limitati... | |
# 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... | |
# -*- coding: utf-8 -*-
import datetime
import os
import django.dispatch
from django.conf import settings
from django.core.exceptions import ObjectDoesNotExist
from django.core.files.storage import default_storage as storage
from django.db import models
import caching.base
import commonware.log
import jinja2
from tow... | |
# Copyright 2013 OpenStack Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in... | |
# -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'SideEvent.video_url'
db.add_column(u'schedule_sideevent', 'video_url',
... | |
# Copyright 2021 The TensorFlow Probability Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | |
#!/usr/bin/env python
'''
Libraries for PDtrending algorithm. The major part of the libraries
consist of clustering routine.
'''
import sys
import math
from numpy import *
import rpy
from rpy import r
from misclib import *
sys.path.append('./')
def Pycluster_to_hcluster(tree):
'''
Transform tree structure of Py... | |
# -*- coding: utf-8 -*-
'''
Manage basic template commands
'''
from __future__ import absolute_import
# Import python libs
import time
import os
import codecs
import logging
# Import salt libs
import salt.utils
from salt.utils.odict import OrderedDict
from salt._compat import string_io
from salt.ext.six import strin... | |
"""Utilities for writing code that runs on Python 2 and 3"""
# Copyright (c) 2010-2014 Benjamin Peterson
#
# 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 with... | |
import collections
import io
from typing import BinaryIO, Tuple, Union
import warnings
import numpy
import skimage.io
import skimage.measure
import skimage.morphology
import skimage.segmentation
import skimage.transform
from .base import BaseSegmentationHelper
class ScikitSegmentationHelper(BaseSegmentationHelper):... | |
# Copyright 2014-2015 Canonical 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 ... | |
#!/usr/bin/env python
"""Copyright 2010 Phidgets Inc.
This work is licensed under the Creative Commons Attribution 2.5 Canada License.
To view a copy of this license, visit http://creativecommons.org/licenses/by/2.5/ca/
"""
__author__ = 'Adam Stelmack'
__version__ = '2.1.8'
__date__ = 'May 11 2010'
#Basic imports
f... | |
# Copyright (c) 2011 Justin Santa Barbara
#
# 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... | |
#!/usr/bin/env python # pylint: disable=too-many-lines
# ___ ___ _ _ ___ ___ _ _____ ___ ___
# / __| __| \| | __| _ \ /_\_ _| __| \
# | (_ | _|| .` | _|| / / _ \| | | _|| |) |
# \___|___|_|\_|___|_|_\/_/_\_\_|_|___|___/_ _____
# | \ / _ \ | \| |/ _ \_ _| | __| \_ _|_ _|
# | |) | (_) ... | |
"""Contains knowledge to build a COM object definition.
This module is used by both the @dynamic@ and @makepy@ modules to build
all knowledge of a COM object.
This module contains classes which contain the actual knowledge of the object.
This include parameter and return type information, the COM dispid and CLSID, et... | |
try:
import asyncio
except ImportError:
raise ImportError("Missing dependency: asyncio")
try:
import yaml
except ImportError:
raise ImportError("Missing dependency: asyncio")
import websockets
import json
""" Error Classes """
class ConfigError(Exception):
pass
class RPCServerError(Exception):... | |
import UnbinnedAnalysis
import BinnedAnalysis
import pyLikelihood as pyLike
import numpy
from GtBurst import LikelihoodComponent
from GtBurst import FuncFactory
import matplotlib.pyplot as plt
from matplotlib import gridspec
from threeML.plugin_prototype import PluginPrototype
from astromodels import Parameter
from th... | |
from dolfin import *
import PETScIO as IO
import numpy as np
import scipy.linalg as splin
import scipy
import petsc4py
import sys
import time
petsc4py.init(sys.argv)
import matplotlib.pylab as plt
from petsc4py import PETSc
def StoreMatrix(A,name):
test ="".join([name,".mat"])
scipy.io.savemat( test, {name... | |
#!/usr/bin/env python
import os
from ajaxuploader.views import AjaxFileUploader
from csvkit.exceptions import FieldSizeLimitError
from django.conf import settings
from django.contrib.auth import authenticate, login, logout
from django.http import HttpResponse
from django.utils.timezone import now
from livesettings im... | |
################################################################################
# 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... | |
# 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 datetime as dt
from collections import OrderedDict
from unittest import SkipTest
import numpy as np
try:
import xarray as xr
except:
raise SkipTest("Could not import xarray, skipping XArrayInterface tests.")
from holoviews.core.data import Dataset, concat
from holoviews.core.dimension import Dimension... | |
"""
PCA object that can be fit to and transform data.
Written by Jesse Livezey.
Block functionality added by Eric Dodds.
"""
import numpy as np
class PCA:
def __init__(self, dim = None, whiten = False, eps= 1e-8):
"""PCA object that can be fit to and transform data.
Args:
dim: Dime... | |
from datetime import datetime, timedelta
from dateutil.parser import parse
import hashlib
import os
import tempfile
from unidecode import unidecode
import uuid
from wsgiref.util import FileWrapper
import zipfile
from django.utils.translation import ugettext as _
from django.conf import settings
from celery.schedules ... | |
#! /usr/bin/env python
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope... | |
import os
import numpy as np
import fitsio
from legacypipe.image import LegacySurveyImage
from legacypipe.bits import DQ_BITS
'''
This is for the "pitcairn" reductions for CFIS-r data.
eg, search for data from here,
http://www.cadc-ccda.hia-iha.nrc-cnrc.gc.ca/en/community/cfis/csky.html
and use "get data", then down... | |
import pytest
from elasticmagic.search import SearchQuery
from .conftest import Car
@pytest.mark.asyncio
async def test_get(es_index, cars):
doc = await es_index.get(1, doc_cls=Car)
assert doc.name == 'Lightning McQueen'
assert doc._id == '1'
assert doc._index == es_index.get_name()
assert doc._... | |
# -*- coding: utf-8 -*-
"""If there is one recurring theme in ``boltons``, it is that Python
has excellent datastructures that constitute a good foundation for
most quick manipulations, as well as building applications. However,
Python usage has grown much faster than builtin data structure
power. Python has a growing ... | |
#!/usr/bin/python
#
# Urwid raw display module
# Copyright (C) 2004-2009 Ian Ward
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or... | |
#!/usr/bin/env python
#
# __COPYRIGHT__
#
# 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,
... | |
# Copyright (c) 2011 Intel Corporation
# Copyright (c) 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.apache.... | |
import numpy as np
from numpy import dot, shape, eye, outer, sqrt, sum, log, diagonal, zeros
from numpy import nonzero, exp, shape, reshape, diag, maximum, isnan
from numpy import copy, minimum, ones, newaxis, mod, Inf
from numpy.linalg import svd, inv, eig
from numpy.random import randint, randn, multinomial, multivar... | |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2004-2019 Edgewall Software
# Copyright (C) 2004-2005 Daniel Lundin <daniel@edgewall.com>
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
# are also available at http... | |
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the... | |
#!/usr/bin/env python3
# Copyright (c) 2017-2020 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 multiwallet.
Verify that a bitcoind node can load multiple wallet files
"""
from decimal import D... | |
# -*- coding: utf-8 -*-
from __future__ import with_statement
from cms.api import create_page, publish_page, add_plugin
from cms.conf.patch import post_patch_check
from cms.exceptions import PluginAlreadyRegistered, PluginNotRegistered
from cms.models import Page, Placeholder
from cms.models.pluginmodel import CMSPlugi... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
__author__ = 'valerio cosentino'
from util.db_util import DbUtil
class EclipseForumDao():
"""
This class handles the persistence and retrieval of Eclipse forum data
"""
def __init__(self, config, logger):
"""
:type config: dict
:p... | |
"""
Script to report election results including ballots in detail to election admin.
"""
__author__ = 'Waseem Ahmad <waseem@rice.edu>'
import logging
import models
import webapp2
from google.appengine.ext import db
from google.appengine.api import mail
from datetime import datetime
def encode(string):
try:
... | |
import pytest
from plenum.cli.helper import getClientGrams
from plenum.common.constants import NAME, VERSION, TYPE, KEYS
from plenum.test.cli.helper import assertCliTokens
from plenum.test.cli.test_command_reg_ex import getMatchedVariables
from prompt_toolkit.contrib.regular_languages.compiler import compile
from sovr... | |
from ..languages import LANGS
__all__ = ["String", "Regex", "Text", "Language", "Author", "Date", "Symbol",
"BinaryOp", "UnaryOp"]
class _Node(object):
"""Represents a single node in a query tree.
Generally speaking, a node is a constraint applied to the database. Thus,
a :py:class:`~.Language... | |
# encoding: utf-8
"""
ip/__init__.py
Created by Thomas Mangin on 2010-01-15.
Copyright (c) 2009-2015 Exa Networks. All rights reserved.
"""
import socket
from exabgp.protocol.family import AFI
from exabgp.protocol.family import SAFI
# =========================================================================== IP
#... | |
import pytest
from Tanium_v2 import Client, get_question_result, get_action_result
import json
def get_fetch_data():
with open('test_data/action_results.json', 'r') as f:
return json.loads(f.read())
BASE_URL = 'https://test.com/'
parse_question_res = {
'data': [
{
'from_canonica... | |
#!/usr/bin/env python
# Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""A helper script to print paths of NaCl binaries, includes, libs, etc.
It is similar in behavior to pkg-config or sdl-config.
"""
i... | |
"""Provides base class for extended numbers: Infinity.
"""
__docformat__ = "restructuredtext"
__all__ = ['Infinity']
from ..core import init_module, Expr
init_module.import_heads()
from .numbers import realtypes, complextypes, mpqc, numbertypes, div
def is_undefined(obj):
if isinstance(obj, Infinity):
re... | |
# -*- coding: utf-8 -*-
"""
werkzeug.useragents
~~~~~~~~~~~~~~~~~~~
This module provides a helper to inspect user agent strings. This module
is far from complete but should work for most of the currently available
browsers.
:copyright: (c) 2014 by the Werkzeug Team, see AUTHORS for more deta... | |
# 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 ... | |
# -*- encoding: utf-8 -*-
from datetime import date, timedelta
from django.conf import settings
from django.core.urlresolvers import reverse
from django.db import models
from django.utils import timezone
# from mptt.models import MPTTModel, TreeForeignKey
from reversion import revisions as reversion
from base.model_... | |
"""
This is the (unofficial) Python API for EZTV.it
Using this code, you can manage to get the information regarding any TV Show
which is listed on EZTV.it See how to use it thanks to the file "APIExample.py"
"""
from bs4 import BeautifulSoup
import requests
import re
URL = "http://eztv.it"
class EztvException(Exc... | |
import pytest
import flask
def test_basic_url_generation(app):
app.config["SERVER_NAME"] = "localhost"
app.config["PREFERRED_URL_SCHEME"] = "https"
@app.route("/")
def index():
pass
with app.app_context():
rv = flask.url_for("index")
assert rv == "https://localhost/"
d... | |
# Copyright 2015 Cisco Systems
# 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... | |
# Copyright 2013-2021 Aerospike, 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 writ... | |
points = [
{
'distanceFromExtent': -1000.0,
'environmentalSuitability': 0.939983904,
'feedId': 27,
'expertWeighting': 0.439747475,
},
{
'distanceFromExtent': -1000.0,
'environmentalSuitability': 0.484387368,
'feedId': 12,
'expertWeighting':... | |
import cPickle
import os
import sys
import time
import numpy as np
import gnumpy as gnp
from numpy import float64
import bandmat as bm
import bandmat.linalg as bla
from guppy import hpy
import logging
class SequentialDNN(object):
def __init__(self, numpy_rng, n_ins=100,
n_outs=100, l1_reg =... | |
import copy
from decimal import Decimal
from django.conf import settings as django_settings
from django.contrib.auth.models import User
from django.core.urlresolvers import reverse
from django.test import TestCase as DjangoTestCase
from setman import get_version, settings
from setman.frameworks.django_setman.models ... | |
def is_digit(ch):
return "0" <= ch <= "9"
def is_hex_digit(ch):
return is_digit(ch) or "A" <= ch <= "F" or "a" <= ch <= "f"
def is_uppercase_letter(ch):
return "A" <= ch <= "Z"
def is_lowercase_letter(ch):
return "a" <= ch <= "z"
def is_letter(ch):
return is_uppercase_letter(ch) or is_lowerc... | |
"""The tests for Cover device actions."""
import pytest
import homeassistant.components.automation as automation
from homeassistant.components.cover import DOMAIN
from homeassistant.const import CONF_PLATFORM
from homeassistant.helpers import device_registry
from homeassistant.setup import async_setup_component
from ... | |
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd.
# MIT License. See license.txt
from __future__ import unicode_literals
import sys
if __name__=="__main__":
sys.path.extend([".", "app", "lib"])
import webnotes
import unittest
from webnotes.model.meta import has_field
from webnotes.model.code import load_docty... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.