gt stringclasses 1
value | context stringlengths 2.49k 119k |
|---|---|
# 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 ... | |
import unittest
import itertools
import warnings
from collections import OrderedDict, namedtuple
import numpy as np
import numpy.testing as np_test
from pgmpy.factors import Factor
from pgmpy.factors import JointProbabilityDistribution as JPD
from pgmpy.factors import factor_product
from pgmpy.factors import factor_d... | |
# -*- coding: utf-8 -*-
# Copyright (C) 2006 Joe Wreschnig
#
# 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 2 of the License, or
# (at your option) any later version.
"""Read a... | |
import binascii
import errno
import hashlib
import logging
import multiprocessing
import os
import signal
import subprocess
import sys
import tempfile
import threading
import time
import uuid
from inspect import signature
import numpy as np
import psutil
import ray
import ray.gcs_utils
import ray.ray_constants as ray_... | |
# Copyright 2014 Cisco Systems, Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requir... | |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
########################################
##
# @author: Amyth
# @email: mail@amythsingh.com
# @website: www.techstricks.com
# @created_date: 31-03-2017
# @last_modify: Fri Mar 31 11:21:22 2017
##
########################################
from collect... | |
# -*- coding: utf-8 -*-
"""
Helper functions used in views.
"""
import csv
import logging
from datetime import datetime
from functools import wraps
from json import dumps
from threading import Lock
from time import time as timer
from flask import Response
from lxml import etree
from presence_analyzer.main import app... | |
'''
This package manages the interface to monit for the set of services
managed by this instance of sirikata-sample-deployment (ideally just
this one per node). It's preferable to collect all services under a
single monit daemon, with a single config. This module manages getting
services into that config, removing the... | |
# Copyright 2017 The Abseil 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 ... | |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import mptt.fields
from django.conf import settings
import cms.utils.timezone
class Migration(migrations.Migration):
dependencies = [
('auth', '0001_initial'),
('sites', '0001_initial'),
... | |
"""
plotly
======
A module that contains the plotly class, a liaison between the user
and ploty's servers.
1. get DEFAULT_PLOT_OPTIONS for options
2. update plot_options with .plotly/ dir
3. update plot_options with _plot_options
4. update plot_options with kwargs!
"""
from __future__ import absolute_import
impo... | |
from __future__ import division
import warnings
import keras.backend as K
from keras.models import Model
from keras.layers import Lambda, Input, Layer, Dense
from rl.core import Agent
from rl.policy import EpsGreedyQPolicy, GreedyQPolicy
from rl.util import *
def mean_q(y_true, y_pred):
return K.mean(K.max(y_pr... | |
import json
import datetime
import urllib
import util
import common
import pagination
import archive
@route(common.PREFIX + '/live_channels_menu')
def GetLiveChannelsMenu():
oc = ObjectContainer(title2=unicode(L('Live')))
oc.add(DirectoryObject(key=Callback(GetLiveChannels, title=L('All Channels')), title=un... | |
"""Support gathering system information of hosts which are running glances."""
from datetime import timedelta
import logging
import voluptuous as vol
from homeassistant.components.sensor import PLATFORM_SCHEMA
from homeassistant.const import (
CONF_HOST, CONF_NAME, CONF_PORT, CONF_USERNAME, CONF_PASSWORD, CONF_SS... | |
import StringIO
def addNodes():
addNode("ArrayType", "Expr", "len", "Expr", "elt", "Expr")
addNode(
"AssignStmt",
"Stmt",
"lhs",
"[]Expr",
"rhs",
"[]Expr",
"define",
"bool")
addNode("BadDecl", "Decl")
addNode("BadExpr", "Expr")
addNod... | |
#!/usr/bin/python
#
# Copyright 2018 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 ag... | |
#!/usr/bin/env python
# Just handle unary rules, working out when one is being used
import re
import category
# from, to, keep original dependencies, activated by extra flag
UNARIES = [
('S[adj]\NP','NP\NP',False,False,[
'(ADJP 0)',
'(NP {1} 0) arg:(NP PP ...):',
'(NP 1 0) arg:default:']),
('S[to]\NP','NP\NP'... | |
#!/usr/bin/env python
#
# This Python script uses FontForge to convert a set of BDF files into a
# TrueType font (TTF) and an SFD file.
#
# Copyright (c) 2013-2016 by Tilman Blumenbach <tilman [AT] ax86 [DOT] net>
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modifica... | |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
from __future__ import (absolute_import, division, print_function,
unicode_literals)
import copy
from ...extern.six.moves import xmlrpc_client as xmlrpc
from .errors import SAMPHubError
from .utils import ServerProxyPool
from .l... | |
"""This module includes common functions for visualization."""
from collections import OrderedDict
import matplotlib.pyplot as plt
import numpy as np
from elfi.model.elfi_model import Constant, ElfiModel, NodeReference
def nx_draw(G, internal=False, param_names=False, filename=None, format=None):
"""Draw the `... | |
from django.db import models
from django.http import HttpResponse
from django.template import Template, Context
from urllib import request
from urllib.error import HTTPError
from urllib.parse import urlencode
from django.utils import timezone
import json
from django.contrib.auth.models import User, Group
from datetime ... | |
import numpy as np
from numpy.testing import (assert_equal, assert_array_equal,
assert_array_almost_equal, assert_approx_equal, assert_allclose)
import pytest
from pytest import raises as assert_raises
from scipy.special import xlogy
from scipy.stats.contingency import (margins, expected_freq,
... | |
# -*- coding: utf-8 -*-
#
# This file is part of PyBuilder
#
# Copyright 2011-2020 PyBuilder Team
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/l... | |
from __future__ import print_function
import os
import unittest
from shutil import rmtree
import stat as stat_lib
from pysftpserver.server import (SSH2_FILEXFER_ATTR_ACMODTIME,
SSH2_FILEXFER_ATTR_PERMISSIONS,
SSH2_FILEXFER_ATTR_SIZE,
... | |
# Copyright 2018 TVB-HPC contributors
#
# 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... | |
import pytest, py
def exvalue():
return py.std.sys.exc_info()[1]
def f():
return 2
def test_assert():
try:
assert f() == 3
except AssertionError:
e = exvalue()
s = str(e)
assert s.startswith('assert 2 == 3\n')
def test_assert_within_finally():
excinfo = py.test.r... | |
"""Metrics to assess performance on classification task given scores
Functions named as ``*_score`` return a scalar value to maximize: the higher
the better
Function named as ``*_error`` or ``*_loss`` return a scalar value to minimize:
the lower the better
"""
# Authors: Alexandre Gramfort <alexandre.gramfort@inria.... | |
import sys
import unittest
from pyramid import testing
from pyramid.config import Configurator
PY3 = sys.version_info[0] == 3
class Test_add_handler(unittest.TestCase):
def _makeOne(self, autocommit=True):
from pyramid.config import Configurator
from pyramid_handlers import add_handler
con... | |
from itertools import combinations as combinations
from operator import attrgetter
import Player as P
###
class PokerPool(P.Player):
'''Derived class for pool of common cards'''
max_cards = 5
def __init__(self, name):
P.Player.__init__(self, name)
self.hand.max_cards = self.max_cards
###
class PokerHand... | |
#!/usr/bin/env python
#
# Copyright 2007 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 o... | |
import os
import time
import numpy as np
import argparse
import torch
import torch.nn as nn
import torch.nn.functional as F
import ray
from ray.util.sgd import TorchTrainer
from ray.util.sgd.utils import AverageMeterCollection
from ray.util.sgd.torch import TrainingOperator
import dgl
from dgl.data import RedditData... | |
# 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 Li... | |
from ucloudclient import uexceptions
from ucloudclient.utils import base
class UnetManager(base.Manager):
'''
net manager class
'''
def eip_create(self, region, operator_name, bandwidth, charge_type=None,
quantity=None):
'''
create an eip
:param region:
... | |
####################################################################
# FILENAME: urldispatch.py
# PROJECT: Shiji API
# DESCRIPTION: Implements an alternative URL router for Twisted Web.
#
# * Handles routing to the appropriate API->version->call.
# * Allows for multiple versions of the same API to e... | |
from __future__ import division
import os
import time
import math
from glob import glob
import tensorflow as tf
import numpy as np
from six.moves import xrange
from ops import *
from utils import *
def conv_out_size_same(size, stride):
return int(math.ceil(float(size) / float(stride)))
class DCGAN(object):
def _... | |
# 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 ... | |
"""Test the Logitech Harmony Hub config flow."""
from unittest.mock import AsyncMock, MagicMock, patch
import aiohttp
from homeassistant import config_entries, data_entry_flow
from homeassistant.components import ssdp
from homeassistant.components.harmony.config_flow import CannotConnect
from homeassistant.components... | |
from .ns1_api_url import NS1_ENDPOINTS
class Ns1Url:
def __init__(self, api_endpoint, check):
self.check = check
self.api_endpoint = api_endpoint
# generate url for QPS and usages statistics
# returns dictionary in form of <metric name>:<metric url>}
def get_stats_url_usage(self, key,... | |
#!/usr/bin/env python
#
# Copyright 2007 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 o... | |
# 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... | |
# -*- test-case-name: calendarserver.provision.test.test_root -*-
##
# Copyright (c) 2005-2017 Apple 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.a... | |
import unittest2 as unittest
import httplib
import uuid
import json
from xml.etree import ElementTree
class HttpTestCase(unittest.TestCase):
"""Performs generic HTTP request testing.
Defines a ``request`` method for use in test cases that makes
HTTP requests, and two new asserts:
* assertResponseSuc... | |
#!/usr/bin/env python
# Licensed to Cloudera, Inc. under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. Cloudera, Inc. licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you ma... | |
import hashlib
import logging
import random
import re
import time
from datetime import datetime, timedelta
from django.conf import settings
from django.contrib.auth.models import User, Group
from django.contrib.sites.models import Site
from django.db import models
from django.utils.translation import ugettext as _, ug... | |
# -*- coding: utf-8 -*-
from operator import attrgetter
from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType
from pyangbind.lib.yangtypes import RestrictedClassType
from pyangbind.lib.yangtypes import TypedListType
from pyangbind.lib.yangtypes import YANGBool
from pyangbind.lib.yangtypes import YANGListTy... | |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
"""
Creates the bar charts
All steps required to generate bar charts that use stock (time-agnostic) data.
-----
"""
# Built-in Modules
import itertools
import pickle
import sys
import traceback
# Third-party Modules
# Note the order and structure of matplotlib imports... | |
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | |
#! /usr/bin/env python2
"""
mbed SDK
Copyright (c) 2011-2013 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 applicabl... | |
"""Tests for the 'setuptools' package"""
import sys
import os
import unittest
import doctest
import distutils.core
import distutils.cmd
from distutils.errors import DistutilsOptionError, DistutilsPlatformError
from distutils.errors import DistutilsSetupError
from distutils.core import Extension
from distutils.version i... | |
import re
import requests
import six
import urllib3
from ipa_command_args_options import IPA_COMMAND_ARGS_OPTIONS
from st2common.runners.base_action import Action
urllib3.disable_warnings()
requests.packages.urllib3.disable_warnings() # pylint: disable=no-member
CONNECTION_OPTIONS = [
'server',
'username',
... | |
"""Supporting definitions for the Python regression tests."""
if __name__ != 'test.support':
raise ImportError('support must be imported from the test package')
import contextlib
import errno
import functools
import gc
import socket
import sys
import os
import platform
import shutil
import warnings
import unittes... | |
'CSV generator for Karnataka Budget PDFs'
import argparse
import csv
import logging
from logging.config import fileConfig
import re
import os
from parsers.pdf_to_csv import PDF2CSV
from parsers.keywords_extractor import KeywordsExtractor
fileConfig('parsers/logging_config.ini')
logger = logging.getLogger()
class Kar... | |
##
# Copyright (c) 2013-2015 Apple 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 l... | |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2013 Rackspace
#
# 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
#
# ... | |
import re
import csv
from itertools import chain
import pytz
from io import StringIO
from os import path
from functools import wraps
import unicodedata
from urllib.parse import urlparse
from collections import namedtuple
from datetime import datetime, timedelta, timezone
import dateutil
import ago
from flask import (... | |
# Copyright 2014 OpenStack Foundation
# Copyright 2014 Hewlett-Packard Development Company, L.P.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENS... | |
"""Representation of a deCONZ gateway."""
import asyncio
import async_timeout
from pydeconz import DeconzSession, errors
from homeassistant.const import CONF_API_KEY, CONF_HOST, CONF_PORT
from homeassistant.core import callback
from homeassistant.exceptions import ConfigEntryAuthFailed, ConfigEntryNotReady
from homea... | |
# Copyright 2015-2019 Yelp Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writin... | |
# Argument Clinic
# Copyright 2012-2013 by Larry Hastings.
# Licensed to the PSF under a contributor agreement.
#
import builtins
import clinic
from clinic import DSLParser
import collections
import inspect
from test import support
import sys
import unittest
from unittest import TestCase
class FakeConverter:
def... | |
#!/usr/bin/env python
"""
Module that performs extraction. For usage, refer to documentation for the class
'Extractor'. This module can also be executed directly,
e.g. 'extractor.py <input> <output>'.
"""
import argparse
import hashlib
import multiprocessing
import os
import shutil
import tempfile
import traceback
i... | |
from contextlib import contextmanager
import glob
import os
import time
import pytest
import logging
import subprocess
import typing
from cassandra import ConsistencyLevel, WriteTimeout, ReadTimeout
from cassandra.cluster import Session
from cassandra.query import SimpleStatement
from ccmlib.node import Node, handle_e... | |
# -*- coding: utf-8 -*-
from __future__ import print_function
from util import *
from pattern import graph
from pattern.graph import commonsense
#-------------------------------------------------------------------------
class TestUtilityFunctions(unittest.TestCase):
def setUp(self):
pass
def tes... | |
# Copyright 2019 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 required by applicable law or a... | |
# Copyright 2012 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Copyright 2012 Nebula, Inc.
# Copyright (c) 2012 X.commerce, a business unit of eBay Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License")... | |
VERSION_ANY = 0
CRC_POLY = 0xEDB88320
MFS_ROOT_ID = 1
MFS_NAME_MAX = 255
MFS_MAX_FILE_SIZE = 0x20000000000
# 1.6.21
VERSION = 0x010615
CHUNKSIZE = 1<<26
GETDIR_FLAG_WITHATTR = 0x01
GETDIR_FLAG_ADDTOCACHE = 0x02
GETDIR_FLAG_DIRCACHE = 0x04
#type for readdir command
TYPE_FILE = 'f'... | |
#!/usr/bin/env python3
# Copyright (c) 2010 ArtForz -- public domain half-a-node
# Copyright (c) 2012 Jeff Garzik
# Copyright (c) 2010-2018 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Litecoin P2P... | |
from itertools import product
from operator import eq, ne
import warnings
import numpy as np
from toolz import take
from catalyst.lib.labelarray import LabelArray
from catalyst.testing import check_arrays, parameter_space, CatalystTestCase
from catalyst.testing.predicates import assert_equal
from catalyst.utils.compa... | |
from zeroos.core0.client import Client as core0_client
import time, re
from unittest import TestCase
class Client(TestCase):
def __init__(self, ip, password):
self.client = core0_client(ip, password=password)
def stdout(self, resource):
return resource.get().stdout.replace('\n', '').lower()
... | |
"""
Files Pipeline
See documentation in topics/media-pipeline.rst
"""
import hashlib
import os
import os.path
import time
import logging
from email.utils import parsedate_tz, mktime_tz
from six.moves.urllib.parse import urlparse
from collections import defaultdict
import six
try:
from cStringIO import StringIO a... | |
#!/usr/bin/python
# Copyright (c) 2012 The Native Client Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# Enable 'with' statements in Python 2.5
from __future__ import with_statement
import optparse
import os.path
import shutil
impor... | |
# -*- coding: utf-8 -*-
from __future__ import print_function, division, absolute_import
import unittest
from flypy import jit
import numpy as np
class TestArrayAttributes(unittest.TestCase):
def test_array_create(self):
@jit
def identity(a):
return a
a = np.arange(10)
... | |
from __future__ import division, unicode_literals
import collections
import contextlib
import json
import numbers
try:
import requests
except ImportError:
requests = None
from jsonschema import _utils, _validators
from jsonschema.compat import (
PY3, Sequence, urljoin, urlsplit, urldefrag, unquote, urlop... | |
# 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... | |
# -*- coding: utf-8 -*-
import json
import logging
from django.conf import settings
from django.contrib.auth.decorators import login_required
from django.views.decorators.http import last_modified as cache_last_modified
from django.views.decorators.cache import never_cache as force_cache_validation
from django.core.ca... | |
#!/usr/bin/python
# -*- coding: utf-8 -*-
from __future__ import division, print_function
from contextlib import contextmanager
import cgi
import json
import os
import re
import sqlite3 as sql
import sys
print("Content-Type: text/plain\n\n")
DBFILE = os.path.expanduser('~/bikeracks.db')
KEY_ID = 'rack_id'
KEY_VALUE... | |
# vim: set ts=2 expandtab:
'''
Module: control_characters.py
Desc: ARIB (Japanese Closed Caption) Control character support
Author: John O'Neil
Email: oneil.john@gmail.com
DATE: Sunday, March 9th 2014
'''
import read
from code_set import code_set_handler_from_final_byte
from code_set import in_code_set_table
from ar... | |
import warnings
from nose.tools import assert_true, assert_raises
import numpy as np
import numpy.testing as npt
from dipy.data import get_data
from dipy.core.gradients import (gradient_table, GradientTable,
gradient_table_from_bvals_bvecs,
reorient_bv... | |
#!/usr/bin/python
# Copyright (c) 2015, BROCADE COMMUNICATIONS SYSTEMS, 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:
# 1. Redistributions of source code must retain the above copyright n... | |
# -*- coding: utf-8 -*-
"""
Environment discovery and helper functions for Google App Engine.
Some methods from the following modules have been made available for convenience:
* google.appengine.api.app_identity
https://cloud.google.com/appengine/docs/python/appidentity/
* google.appengine.api.modules
https://clou... | |
from __future__ import absolute_import
from django.shortcuts import get_object_or_404, render, redirect
from django.http import HttpResponseRedirect, HttpResponse
from django.http import JsonResponse
from django.core.urlresolvers import reverse
from django.contrib import auth,messages
from django.contrib.auth.decorato... | |
from __future__ import division, absolute_import, print_function
import confuse
import sys
import unittest
from . import _root
PY3 = sys.version_info[0] == 3
class SingleSourceTest(unittest.TestCase):
def test_dict_access(self):
config = _root({'foo': 'bar'})
value = config['foo'].get()
... | |
# 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, ... | |
import asyncio
import aiohs2
import pandas as pd
import subprocess
import urllib
import re
import logging
from functools import wraps
coroutine = asyncio.coroutine
logger = logging.getLogger(__name__)
hive_type_map = {
'BOOLEAN': pd.np.dtype(bool),
'BINARY': pd.np.dtype(bytes),
'TINYINT': pd.np.dtype(i... | |
# -*- coding: UTF-8 -*-
__all__ = ['agregation']
import numpy as np
import scipy
from scipy.sparse import csr_matrix, coo_matrix, isspmatrix_csr, isspmatrix_csc
from pyamg.relaxation import gauss_seidel
#from pyamg.util.linalg import residual_norm
# ...
try:
from petsc4py import PETSc
importPETSc=True
except I... | |
#!/usr/bin/env python
# encoding: utf-8
"""Azkaban remote interaction module.
This contains the `Session` class which will be used for all interactions with
a remote Azkaban server.
"""
from .util import AzkabanError, Config, Adapter, MultipartForm, flatten
from getpass import getpass, getuser
from os.path import b... | |
# 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 functools import total_ordering
import sys
from PyFBA import log_and_message
COMMON_REACTION_LIMIT = 5
class Compound:
"""
A compound is the essential metabolic compound that is involved in a reaction.
The compound by itself does not have a location. See PyFBA.metabolism.CompoundWithLocation for th... | |
"""
Tests that skipped rows are properly handled during
parsing for all of the parsers defined in parsers.py
"""
from datetime import datetime
from io import StringIO
import numpy as np
import pytest
from pandas.errors import EmptyDataError
from pandas import (
DataFrame,
Index,
)
import pandas._testing as ... | |
# -*- coding: utf-8 -*-
#
# Copyright 2015, Ekevoo.com.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in
# compliance with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable l... | |
# Copyright 2014-2016 OpenMarket Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in w... | |
# 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... | |
import os
import re
import sys
from hq.hquery.syntax_error import HquerySyntaxError
from pytest import raises
sys.path.insert(0, os.path.abspath('../..'))
from ..common_test_util import expected_result
from test.hquery.hquery_test_util import query_html_doc
def test_explicit_child_axis():
html_body = """
<... | |
# Copyright 2018 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | |
#-------------------------------------------------------------------------------
#
# Define classes for (uni/multi)-variate kernel density estimation.
#
# Currently, only Gaussian kernels are implemented.
#
# Written by: Robert Kern
#
# Date: 2004-08-09
#
# Modified: 2005-02-10 by Robert Kern.
# Contr... | |
# Copyright (c) 2013 Mirantis Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | |
"""
These the test the public routines exposed in types/common.py
related to inference and not otherwise tested in types/test_common.py
"""
import collections
from collections import namedtuple
from datetime import date, datetime, time, timedelta
from decimal import Decimal
from fractions import Fraction
from io impor... | |
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use ... | |
# Copyright 2013 New Dream Network, LLC (DreamHost)
#
# 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 a... | |
import datetime
import json
import re
import sys
import time
from email.header import Header
from http.client import responses
from urllib.parse import urlparse
from django.conf import settings
from django.core import signals, signing
from django.core.exceptions import DisallowedRedirect
from django.core.serializers.j... | |
#!/usr/bin/env python
import os
import math
from numpy import interp
from random import choice, sample
from time import sleep
from math import log1p
import json
import string
ROOT = "/sys/bus/hid/drivers/hid-razer/0003:1532:020F.0001"
ROW_COUNT = 6
COL_COUNT = 16
def clamp(x):
return max(0, min(x, 255))
def wr... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.