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... | |
"""\
A library of useful helper classes to the SAX classes, for the
convenience of application and driver writers.
"""
import os, urllib.parse, urllib.request
from . import handler
from . import xmlreader
# See whether the xmlcharrefreplace error handler is
# supported
try:
from codecs import xmlcharrefreplace_er... | |
#!/usr/bin/env python3
#
# Copyright (c) 2016 Roberto Riggio
#
# 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... | |
# Copyright 2016-2017 Capital One Services, 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 python3
# Copyright (c) 2016-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.
"""Test the bumpfee RPC.
Verifies that the bumpfee RPC creates replacement transactions successfully when... | |
from __future__ import unicode_literals
from datetime import date
import locale
import sys
from django.apps import apps
from django.contrib.auth import models, management
from django.contrib.auth.checks import check_user_model
from django.contrib.auth.management import create_permissions
from django.contrib.auth.mana... | |
# Copyright The Cloud Custodian Authors.
# SPDX-License-Identifier: Apache-2.0
"""
Cloud Custodian Lambda Provisioning Support
docs/lambda.rst
"""
import abc
import base64
import hashlib
import importlib
import io
import json
import logging
import os
import shutil
import time
import tempfile
import zipfile
# We use ... | |
from __future__ import unicode_literals
import re
import sys
import types
from django.conf import settings
from django.http import HttpResponse, HttpResponseNotFound
from django.template import Context, Engine, TemplateDoesNotExist
from django.template.defaultfilters import force_escape, pprint
from django.urls impor... | |
# -*- coding: utf-8 -*-
"""
oauthlib.common
~~~~~~~~~~~~~~
This module provides data structures and utilities common
to all implementations of OAuth.
"""
from __future__ import absolute_import, unicode_literals
import collections
import datetime
import logging
import random
import re
import sys
import time
try:
... | |
# -*- coding: utf-8 -*-
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
... | |
# -*- coding: utf-8 -*-
"""
mostly functional tests of gateways.
"""
import os
import socket
import subprocess
import sys
from textwrap import dedent
import execnet
import py
import pytest
from execnet import gateway_base
from execnet import gateway_io
from test_serializer import _find_version
TESTTIMEOUT = 10.0 # s... | |
from tests.unit.dataactcore.factories.staging import AwardFinancialFactory, CertifiedAwardFinancialFactory
from tests.unit.dataactcore.factories.job import SubmissionFactory
from tests.unit.dataactvalidator.utils import number_of_errors, query_columns, populate_publish_status
from dataactcore.models.lookups import PUB... | |
# Copyright 2015 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | |
"""Allow to set up simple automation rules via the config file."""
import asyncio
from functools import partial
import importlib
import logging
import voluptuous as vol
from homeassistant.setup import async_prepare_setup_platform
from homeassistant.core import CoreState, Context
from homeassistant.loader import bind_... | |
"""
Useful form fields for use with SQLAlchemy ORM.
"""
import operator
from wtforms import widgets
from wtforms.fields import SelectFieldBase
from wtforms.validators import ValidationError
from .tools import get_primary_key
from flask.ext.admin._compat import text_type, string_types
from flask.ext.admin.model.fi... | |
"""Support for APCUPSd sensors."""
from __future__ import annotations
import logging
from apcaccess.status import ALL_UNITS
import voluptuous as vol
from homeassistant.components.sensor import (
PLATFORM_SCHEMA,
SensorEntity,
SensorEntityDescription,
)
from homeassistant.const import (
CONF_RESOURCES... | |
#!/usr/bin/env python3
__author__ = 'cjm'
import argparse
import logging
import re
import yaml
import json
import uuid
import csv
import itertools
import sys
import warnings
from collections import Counter
gcif = None
synmap = {}
titlemode = False
def main():
parser = argparse.ArgumentParser(description='DOSDB... | |
from __future__ import division
from foundation.Message import Message
from foundation.Bid import Bid
from foundation.Agent import Agent
from foundation.Service import Service
from foundation.DecisionVariable import DecisionVariable
from ProviderAgentException import ProviderException
from foundation.FoundationExceptio... | |
#!/usr/bin/env python
"""
Since we do not want to store large binary data files in our Git repository,
we fetch_data_all from a network resource.
The data we download is described in a json file. The file format is a dictionary
of dictionaries. The top level key is the file name. The returned dictionary
contains a sh... | |
#
# Copyright (C) 2014 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 applicable law or agreed to in wri... | |
# Copyright 2018 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... | |
# -*- coding: utf-8 -*-
import urllib
import urllib2
import json
import random
# turbogears imports
from tg import expose, redirect, validate, flash, session, request
from tg.decorators import *
# third party imports
from repoze.what import predicates, authorize
from repoze.what.predicates import not_anonymous, in_gr... | |
from django_nose.tools import (
assert_equal,
assert_false,
assert_not_in,
assert_raises,
assert_true
)
from mock import Mock, MagicMock, patch
from pontoon.base.models import Entity
from pontoon.base.tests import (
assert_attributes_equal,
TranslationFactory,
UserFactory,
)
from pontoo... | |
"""
Support for Hue lights.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/light.hue/
"""
import json
import logging
import os
import random
import socket
from datetime import timedelta
from urllib.parse import urlparse
import voluptuous as vol
import ... | |
""" This is the utils module that collects convenience functions and code that are
useful for charts ecosystem.
"""
#-----------------------------------------------------------------------------
# Copyright (c) 2012 - 2014, Continuum Analytics, Inc. All rights reserved.
#
# Powered by the Bokeh Development Team.
#
# 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... | |
from logger import logger
from perfrunner.helpers.cbmonitor import timeit, with_stats
from perfrunner.helpers.misc import pretty_dict
from perfrunner.helpers.profiler import with_profiles
from perfrunner.tests import PerfTest, TargetIterator
class N1QLTest(PerfTest):
COLLECTORS = {
'iostat': False,
... | |
# -*- 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... | |
from __future__ import division
import random
import math
from .base import Element
from .fields import (ChoiceField, IntegerField, BooleanField,
StructField, StringField, ListField)
__all__ = ['Img', 'Rectangle', "Circle", "Arrow", "Line", "Bar"]
class Svg(Element):
tag = "svg"
colors ... | |
# Copyright 2015 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | |
# Copyright (c) 2014 VMware, 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 a... | |
'''
Created on Aug 10, 2012
:author: Sana Development Team
:version: 2.0
'''
try:
import json as simplejson
except ImportError, e:
import simplejson
import sys, traceback
import logging
from django.conf import settings
from django.forms import ValidationError
from piston.handler import BaseHandler
from mds.c... | |
# -*- coding: utf-8 -*-
#
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | |
from __future__ import absolute_import, unicode_literals
import re
from functools import partial
from inspect import getargspec
from django.conf import settings
from django.template.context import (Context, RequestContext,
ContextPopException)
from django.utils.importlib import import_module
from django.utils.ite... | |
from nose.tools import assert_regexp_matches, assert_equal, assert_false
from cassandra import (InvalidRequest, ReadFailure,
ReadTimeout, Unauthorized, Unavailable, WriteFailure,
WriteTimeout)
from cassandra.query import SimpleStatement
from time import sleep
import tools... | |
from synapse.tests.common import *
import synapse.lib.fifo as s_fifo
class FifoTest(SynTest):
def test_fifo_nack_past(self):
with self.getTestDir() as dirn:
conf = {
'dir': dirn,
'file:maxsize': 1024,
'window:max': 4,
'window:mi... | |
import simplejson as json
from flask import render_template_string
from nose.tools import eq_
from standup.apps.api2.decorators import api_key_required
from standup.apps.users.models import Team
from standup.database import get_session
from standup.tests import BaseTestCase, project, status, team, user
from urllib impo... | |
#########################################################################
# #
# #
# copyright 2002 Paul Henry Tremblay #
# ... | |
#
# Copyright (c) 2015,2016 Red Hat, Inc.
#
# Author: Loic Dachary <loic@dachary.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 r... | |
# Copyright (c) 2014 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 ... | |
# 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
# --------------------------------------------------------------------------
# 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 ... | |
# Copyright 2012-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 la... | |
import demistomock as demisto
from CommonServerPython import *
from CommonServerUserPython import *
''' IMPORTS '''
import requests
from typing import Tuple, Any
import json
# Disable insecure warnings
requests.packages.urllib3.disable_warnings()
''' GLOBAL VARS '''
SPECIAL_HEADERS: dict = {
'id': 'ID',
'u... | |
from common_fixtures import * # NOQA
from test_services \
import service_with_healthcheck_enabled
from test_machine \
import action_on_digital_ocean_machine, get_dropletid_for_ha_hosts
ha_droplets = []
if_test_host_down = pytest.mark.skipif(
not os.environ.get('DIGITALOCEAN_KEY') or
not os.environ.get... | |
#
# 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... | |
from copy import deepcopy
import datetime
import time
import stat
import os
import mimetypes
import email
import hashlib
from abc import ABCMeta, abstractmethod
from pymongo.cursor import Cursor
from tornado.web import Application, StaticFileHandler, HTTPError, URLSpec, RequestHandler
from tornado.template import Base... | |
# coding=utf-8
r"""
This code was generated by
\ / _ _ _| _ _
| (_)\/(_)(_|\/| |(/_ v1.0.0
/ /
"""
from tests import IntegrationTestCase
from tests.holodeck import Request
from twilio.base import serialize
from twilio.base.exceptions import TwilioException
from twilio.http.response import Response... | |
# Copyright 2014 Netflix, 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 plotly.basedatatypes import BaseLayoutHierarchyType as _BaseLayoutHierarchyType
import copy as _copy
class Rangeslider(_BaseLayoutHierarchyType):
# class properties
# --------------------
_parent_path_str = "layout.xaxis"
_path_str = "layout.xaxis.rangeslider"
_valid_props = {
"autor... | |
# -*- coding: utf-8 -*-
# Copyright (C) 2008-2011, Luis Pedro Coelho <luis@luispedro.org>
# vim: set ts=4 sts=4 sw=4 expandtab smartindent:
#
# License: MIT. See COPYING.MIT file in the milk distribution
from __future__ import division
import numpy as np
from .classifier import normaliselabels
import multiprocessing
... | |
#!/usr/bin/env python
#
# Electrum - lightweight Bitcoin client
# Copyright (C) 2012 thomasv@gitorious
#
# 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 witho... | |
# 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... | |
#
# Copyright (c) 2008-2015 Citrix Systems, 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 l... | |
#!/usr/bin/env python
# encoding: utf-8
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache Licens... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Generated from FHIR 1.0.2.7202 (http://hl7.org/fhir/StructureDefinition/Provenance) on 2016-06-23.
# 2016, SMART Health IT.
from . import domainresource
class Provenance(domainresource.DomainResource):
""" Who, What, When for a set of resources.
Proven... | |
import os
import re
import tqdm
import glob
import logging
import networkx
import subprocess
import shellphish_qemu
l = logging.getLogger('fuzzer.input_hierarchy')
class Input(object):
def __init__(self, filename, instance, hierarchy):
self.hierarchy = hierarchy
self.instance = instance
se... | |
import redis
import logging
import json
import time
import datetime
import itertools
import random
import urllib2
import HTMLParser
import hashlib
import re
import deckstats
# this keeps all the code that is shared amongst most of the mdoules and future modules
# it mostly contains redis storage and the recommendation... | |
# Copyright (c) 2015 Red Hat, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless require... | |
from __future__ import absolute_import
from pony.py23compat import buffer, int_types
import os
os.environ["NLS_LANG"] = "AMERICAN_AMERICA.UTF8"
import re
from datetime import datetime, date, time, timedelta
from decimal import Decimal
from uuid import UUID
import cx_Oracle
from pony.orm import core, dbapiprovider, ... | |
"""
Gaussian Mixture Models.
This implementation corresponds to frequentist (non-Bayesian) formulation
of Gaussian Mixture Models.
"""
# Author: Ron Weiss <ronweiss@gmail.com>
# Fabian Pedregosa <fabian.pedregosa@inria.fr>
# Bertrand Thirion <bertrand.thirion@inria.fr>
import numpy as np
from ..base... | |
# Copyright (c) 2013, Albert Zeyer, www.az2000.de
# All rights reserved.
# Code under 2-clause BSD licence.
import dis
import types
def _modified_jumps(codestr, jumprel=None, jumpaddrmap=None, start=None, end=None):
if jumprel is not None:
assert jumpaddrmap is None, "specify only one of jumprel and jumpaddrmap"
... | |
# Copyright (c) 2016 Stratoscale, 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 ... | |
# -*- coding: utf-8 -*-
"""
sphinx.pycode
~~~~~~~~~~~~~
Utilities parsing and analyzing Python code.
:copyright: Copyright 2007-2015 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from __future__ import print_function
import re
import sys
from os import path
from si... | |
# Class/function to process verilog file
import re, string, os
import pprint
import functools
# regular expression for signal/variable declaration:
# start of line follow by 1 to 4 word,
# an optionnal array size,
# an optional list of words
# the signal itself (not part of the regular expression)
re_bw = r... | |
"""These tests are all about the "join rewriting" feature built
to support SQLite's lack of right-nested joins. SQlite as of
version 3.7.16 no longer has this limitation.
"""
from sqlalchemy import Table, Column, Integer, MetaData, ForeignKey, \
select, exists, union
from sqlalchemy.testing import fixtures, Asser... | |
#
# Copyright (c) 2017 Juniper Networks, Inc. All rights reserved.
#
import unittest
from mock import patch, Mock
from vnc_api.vnc_api import Domain, Project, NetworkIpam, VirtualNetwork, VnSubnetsType
from kube_manager.vnc import vnc_kubernetes
from kube_manager.tests.vnc.db_mock import DBBaseKM, DBMock
from kube_... | |
import os
from os import path
import sqlite3
from .link import Link
class Links(object):
def __init__(self):
self._links = {}
def add(self, link):
self._links[link.url] = link
def find_by_tag(self, tag):
return [link for link in self._links.values() if tag in link.tags]
def... | |
#!/usr/bin/env python
# coding: utf-8
#
# Copyright (c) 2015 Cossack Labs 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 req... | |
# -*- coding: utf-8 -*-
"""Database related tools."""
import logging
from datetime import datetime
import dateutil.parser
from sqlalchemy import (
Column,
MetaData,
Table,
create_engine,
inspect,
select,
type_coerce,
)
from sqlalchemy.exc import (
DatabaseError,
NoSuchTableError,
... | |
#!/usr/bin/env python
#
# Copyright 2009 Facebook
#
# 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... | |
from datetime import datetime
import numpy as np
import pytest
import pandas as pd
from pandas import NaT, Series, Timestamp
import pandas._testing as tm
from pandas.core.internals.blocks import IntBlock
class TestSeriesInternals:
# GH 10265
def test_convert(self):
# Tests: All to nans, coerce, tru... | |
import numpy as np
import pyqtgraph as pg
from ..fitting.fitting_functions import basic_fit, advanced_fit
from .get import Get
from . import FittingTabSelected
from src.iBeatles.fitting.display import Display as FittingDisplay
class SelectedBinsHandler(object):
def __init__(self, parent=None, grand_parent=None)... | |
import os
import urllib.parse
import datetime
import threading
import http.client
import socket
import errno
import sys
import select
import time
import json
import xlog
logging = xlog.getLogger("simple_http_server")
class HttpServerHandler():
default_request_version = "HTTP/1.1"
rbufsize = -1
wbufsize ... | |
import base64
import hashlib
import hmac
import re
import time
import warnings
from typing import Optional, Union, List, Iterator
from algoliasearch.exceptions import ValidUntilNotFoundException
from algoliasearch.helpers import endpoint, is_async_available, build_raw_response_batch
from algoliasearch.http.request_op... | |
# -*- coding: utf-8 -*-
from __future__ import print_function, unicode_literals
from py.combinator import Combinator, RuleType
import py.combinator
from xml.etree.ElementTree import Element, SubElement, ElementTree, tostring
def is_normal_form(rule_type, left, right):
if (left.rule_type == FC or \
left... | |
#!/usr/bin/env python
from __future__ import absolute_import
from __future__ import print_function
from collections import deque
from contextlib import contextmanager
import logging
import os
import re
import sys
from scss import config
from scss.calculator import Calculator
from scss.compiler import _prop_split_re
f... | |
__usage__ = """
To run tests locally:
python tests/test_arpack.py [-l<int>] [-v<int>]
"""
import threading
import itertools
import numpy as np
from numpy.testing import assert_allclose, assert_equal, suppress_warnings
from pytest import raises as assert_raises
import pytest
from numpy import dot, conj, random
fr... | |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (c) 2012 NTT DOCOMO, 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.apach... | |
from multiprocessing import set_start_method, cpu_count
set_start_method('forkserver')
import os
os.environ["OMP_NUM_THREADS"] = str(cpu_count()) # or to whatever you want
from argparse import ArgumentParser
from datetime import datetime
time_now = datetime.utcnow().strftime("%Y%m%d%H%M%S")
def str2bool(v):
if ... | |
"""
--------------------------------------------------------------------------------------------
Extracted from skikit-learn to ensure basic compatibility
without creating an explicit dependency.
For the original code see
http://scikit-learn.org/
and
https://github.com/scikit-learn
----------------------------... | |
from selenium.common.exceptions import NoSuchElementException
from selenium.webdriver.support.ui import Select
from .keywordgroup import KeywordGroup
class _SelectElementKeywords(KeywordGroup):
# Public
def get_list_items(self, locator):
"""Returns the values in the select list identified by `locat... | |
# 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... | |
#
# Created as part of the StratusLab project (http://stratuslab.eu),
# co-funded by the European Commission under the Grant Agreement
# INFSO-RI-261552."
#
# Copyright (c) 2013, SixSq Sarl
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the Lice... | |
"""Implementation of restricted Boltzmann machine."""
__author__ = "Mihaela Rosca"
__contact__ = "mihaela.c.rosca@gmail.com"
import numpy as np
from common import *
from activationfunctions import *
import theano
from theano import tensor as T
from theano.tensor.shared_randomstreams import RandomStreams
theanoFloat... | |
# -*- coding: utf-8 -*-
# Copyright 2017 Objectif Libre
#
# 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 ... | |
# -*- coding: utf-8 -*-
#
# Copyright 2012-2015 Spotify AB
#
# 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... | |
#!/usr/bin/env python
"""Unit tests for sitemap_gen.py, a script for generating sitemaps
for a web server.
"""
# Please be careful that all syntax used in this file can be parsed on
# Python 1.5 -- this version check is not evaluated until after the
# entire file has been parsed.
import sys
if sys.hexversion < 0x0202... | |
#!/usr/bin/env python3
# Copyright (c) 2018-2020 The Fujicoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
import argparse
import os
import subprocess
import sys
def setup():
global args, workdir
progra... | |
# 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... | |
# -*- coding: utf-8 -*-
# unicum
# ------
# Python library for simple object cache and factory.
#
# Author: sonntagsgesicht, based on a fork of Deutsche Postbank [pbrisk]
# Version: 0.3, copyright Wednesday, 18 September 2019
# Website: https://github.com/sonntagsgesicht/unicum
# License: Apache License 2.0 (see... | |
from math import *
from legendre import legendre
twopi = 2.*pi
piover2 = .5*pi
ns_max = 8192
ee = exp(1.)
def pix2ang_ring(nside,ipix):
#c=======================================================================
#c gives theta and phi corresponding to pixel ipix (RING)
#c for a parameter nside
#c=============... | |
from pycharm_generator_utils.util_methods import *
from pycharm_generator_utils.constants import *
import keyword, re
class emptylistdict(dict):
"""defaultdict not available before 2.5; simplest reimplementation using [] as default"""
def __getitem__(self, item):
if item in self:
return d... | |
# -*- coding: utf-8 -*-
import requests
from pydeform.auth import (
get_session_http_auth_header,
get_token_http_auth_header
)
from pydeform.resources import (
CollectionListResource,
CollectionOneResource,
CurrentProjectInfoResource,
DocumentListResource,
DocumentOneResource,
NonAuthUs... | |
#!/usr/bin/env python
# coding: utf-8
import sys
import os
from textwrap import dedent
from traitlets import default
from traitlets.config.application import catch_config_error
from jupyter_core.application import NoStart
import nbgrader
from .baseapp import nbgrader_aliases, nbgrader_flags
from . import (
NbGr... | |
import datetime
import os
from tic.web.cdp import deps
TEMPLATES = {
'dojo': 'templates/command_dojo.jst',
'closure': 'templates/command_closure.jst'
}
_ALLOWED_PROPERTY_TYPES = set([
basestring,
str,
unicode,
... | |
from subprocess import call
import os
import json
import sys
BUILDER_PATH = os.path.dirname(os.path.abspath(__file__))
ROOT_PATH = os.path.join(BUILDER_PATH, '..')
FONTS_FOLDER_PATH = os.path.join(ROOT_PATH, 'fonts')
CSS_FOLDER_PATH = os.path.join(ROOT_PATH, 'css')
SCSS_FOLDER_PATH = os.path.join(ROOT_PATH, 'scss')
L... | |
# Copyright 2012 OpenStack Foundation
# Copyright 2012 Canonical 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 b... | |
"""
This module abstracts all the bytes<-->string conversions so that the python 2
and 3 code everywhere else is similar. This also has a few simple functions
that deal with the fact that bytes are different between the 2 versions even
when using from __future__ import unicode_literals. For example:
Python 2:
b'm... | |
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# d... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.