gt stringclasses 1
value | context stringlengths 2.49k 119k |
|---|---|
import inspect
import utils
from activations import Identity
from baselayers import AbsLayer
from convolution import ConvLayer, DeConvLayer
from scanlayers import ScanConvLSTM, ScanLSTM
from simple import FullyConnectedLayer, ZeroLayer
class RecurrentLayer(AbsLayer):
"""
A reccurent layer consists of two... | |
import warnings
import numpy as np
import scipy.sparse as sp
from sklearn.utils.testing import assert_array_almost_equal
from sklearn.utils.testing import assert_almost_equal
from sklearn.utils.testing import assert_equal
from sklearn.utils.testing import assert_true
from sklearn.utils.testing import assert_less
from... | |
import numpy as np
import scipy as sp
from scipy import stats
import chippr
from chippr import defaults as d
from chippr import utils as u
def mean(population):
"""
Calculates the mean of a population
Parameters
----------
population: np.array, float
population over which to calculate the... | |
#Copyright (c) 2014, Ben Goodrich
#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 notice, this list of conditions and the following... | |
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Tests for L{twisted.cred}, now with 30% more starch.
"""
import hmac
from zope.interface import implements, Interface
from twisted.trial import unittest
from twisted.cred import portal, checkers, credentials, error
from twisted.python impor... | |
# Copyright 2011 Justin Santa Barbara
# Copyright 2012 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/l... | |
# Copyright (C) 2018 Zhixian MA <zx@mazhixian.me>
import os
import time
import numpy as np
import matplotlib.pyplot as plt
from matplotlib import gridspec
from scipy.misc import imsave
class printException(Exception):
"""
Ref: http://blog.csdn.net/kwsy2008/article/details/48468345
"""
pass
class Leve... | |
import numpy as np
import pandas as pd
from .pycompat import basestring, iteritems, suppress, dask_array_type, bytes_type
from . import formatting
from .utils import SortedKeysDict, not_implemented
class ImplementsArrayReduce(object):
@classmethod
def _reduce_method(cls, func, include_skipna, numeric_only):
... | |
#!/usr/bin/env python
"""
This sample application presents itself as a BBMD sitting on an IP network
that is also a router to a VLAN. The VLAN has a device on it with an analog
value object that returns a random value for the present value.
Note that the device instance number of the virtual device will be 100 times... | |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2010-2011 OpenStack 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... | |
# Copyright 2013 Donald Stufft and individual 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 applicable law... | |
# Gay Porn Collector
import cookielib, cgi, re, os, platform, json, urllib
PLUGIN_LOG_TITLE='Gay Porn Collector' # Log Title
VERSION_NO = '2017.07.26.0'
# Delay used when requesting HTML, may be good to have to prevent being
# banned from the site
REQUEST_DELAY = 0
# URLS
BASE_URL='http://www.gayporncollector.com'
... | |
# 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... | |
# Copyright 2010 Jacob Kaplan-Moss
# Copyright 2011 Nebula, Inc.
# Copyright 2013 Alessio Ababilov
# Copyright 2013 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
# ... | |
"""
NPC Corporations, agents, and other fun.
"""
from django.db import models
class CrpActivity(models.Model):
"""
Activity types of corporations.
CCP Table: crpActivities
CCP Primary key: "activityID" tinyint(3)
"""
id = models.IntegerField(unique=True, primary_key=True)
name = models.Cha... | |
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and contributors
# For license information, please see license.txt
from __future__ import unicode_literals, print_function
import frappe
import imaplib
import re
import json
import socket
from frappe import _
from frappe.model.document import Document
from frappe.uti... | |
# Copyright 2012 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... | |
#!/usr/bin/env python
# Copyright 2017 F5 Networks 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... | |
"""Miscellaneous utilities."""
import numpy as np
class Normalizer():
"""An abstract class for normalizing inputs.
"""
def normalize(self, X):
"""Return corresponding points in normalized domain.
Parameters
----------
X : ndarray
contains all input points o... | |
#! /usr/bin/python
# Joe Deller 2014
# A second day at the Minecraft Races
# Level : Intermediate
# Uses : Libraries, variables, loops, lists, methods, loops and logic
# Second version of the horse race program
# This time the horses will not race until we have
# clicked on a special stone block next to the start li... | |
import base64
from rancher import ApiError
import pytest
from .common import * # NOQA
CLUSTER_NAME = os.environ.get("CLUSTER_NAME", "")
namespace = {"p_client": None, "ns": None, "cluster": None, "project": None}
def test_secret_create_all_ns():
"""
Verify creation of secrets is functional
"""
p... | |
"""
Author: Jay Engineer
Home Page: https://github.com/jay754/Facebook-Graph-Info
Script: fbwrapper.py
Python/PHP Facebook-Graph API
PHP/Python Wrapper for Facebook-open-graph (no OAuth)
license: The BSD 3-Clause License
"""
import urllib2
import urllib
import simplejson as json
import json
import requests
import ... | |
""" Module "Request Manager" : Module for interacting via Habitica API
All fetching, scoring, editing, deleting activities are defined here.
"""
# Standard Library Imports
import requests
import time
import imp
import importlib
import datetime
# Custom Module Imports
import config as C
from screen import Screen
... | |
# Copyright 2017 datawire. 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 agr... | |
import os
import sys
sys.path.append(os.path.join(
os.path.dirname(os.path.realpath(__file__)), ".."))
from db.db_manager import db_sync_manager
from mapper.utils.filter import PathFinderTNtoSDNFilterUtils as FilterUtils
from mapper.utils.format import PathFinderTNtoSDNFormatUtils as FormatUtils
from mapper.utils.c... | |
# Copyright (c) 2015 Scality
# 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 a... | |
from unittest import mock
from unittest.mock import patch
from ddt import data, ddt
from rest_framework import status, test
from waldur_core.structure import signals as structure_signals
from waldur_core.structure.models import ServiceSettings
from waldur_mastermind.marketplace import models as marketplace_models
fro... | |
#!/usr/bin/env python3
import csv
import json
import pathlib
import records
from util import (query_file, name_and_status, is_number, finish_point,
TYPE_2_INT, FINISH_2_NAME)
CSV_DATA = pathlib.Path('data/csv')
META_DATA = pathlib.Path('data/meta.json')
TABLES = [
'Ninja', 'Course', 'Obstacle',... | |
import csv
import datetime
from decimal import Decimal
import json
import operator
try:
from urlparse import urlparse
except ImportError:
from urllib.parse import urlparse
import sys
from peewee import *
from playhouse.db_url import connect
from playhouse.migrate import migrate
from playhouse.migrate import Sc... | |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import numpy
import numpy.matlib
linalg = numpy.linalg
# import scikits.learn.machine.em.densities as densities
# For treatment of missing data, see:
#
# Shumway, R.H. &... | |
# Copyright (c) 2018 Red Hat, Inc.
# All Rights Reserved.
import dateutil
import logging
from django.db.models import Count
from django.db import transaction
from django.shortcuts import get_object_or_404
from django.utils.timezone import now
from django.utils.translation import ugettext_lazy as _
from rest_framewor... | |
from qtpy.QtWidgets import (
QHBoxLayout,
QVBoxLayout,
QGroupBox,
QPushButton,
QCheckBox,
QLabel,
QGridLayout,
QMessageBox,
)
from qtpy.QtCore import Qt, Slot, Signal, QThreadPool, QRunnable
from .useful_widgets import (
set_tooltip,
SecondaryWindow,
LineEditExtended,
Int... | |
slugs = {
'robots.txt' : {'date':'','new_slug':'robots.txt'},
'rss.xml' : {'date':'','new_slug':'rss.xml'},
'tag/appengine' : {'date':'/search/label/','new_slug':'appengine'},
'tag/observations' : {'date':'/search/label/','new_slug':'observations'},
'tag/projects' : {'date':'/search/label/','new_sl... | |
# Copyright 2012 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... | |
#
# Copyright (C) 2016 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 applicable law or agreed t... | |
# Copyright lowRISC contributors.
# Licensed under the Apache License, Version 2.0, see LICENSE for details.
# SPDX-License-Identifier: Apache-2.0
from pathlib import Path
from typing import Any, Dict, Optional, Union
import hjson # type: ignore
from reggen.lib import check_int, check_keys, check_list, check_name, c... | |
"""
Tests for the following offsets:
- BYearBegin
- BYearEnd
"""
from __future__ import annotations
from datetime import datetime
import pytest
from pandas._libs.tslibs.offsets import YearOffset
from pandas.tests.tseries.offsets.common import (
Base,
assert_is_on_offset,
assert_offset_equal,
)
from pan... | |
# -*- coding: utf-8 -*-
############################ Copyrights and license ############################
# #
# Copyright 2012 Vincent Jacques <vincent@vincent-jacques.net> #
# Copyright 2012 Zearin <zearin@gonk.net> ... | |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# ----------------------------------------------------------------------------
# Xcode 4 template generator for cocos2d project
# (c) 2011 Ricardo Quesada
#
# LICENSE: Dual License: MIT & GNU GPL v2 Whatever suits you best.
#
# Given a directory, it generates the "Definitions" ... | |
import pytest
import unittest
from calvin.runtime.north.plugins.port import queue
from calvin.runtime.north.calvin_token import Token, ExceptionToken
from calvin.runtime.north.plugins.port.queue.common import QueueFull, QueueEmpty
pytest_unittest = pytest.mark.unittest
class DummyPort(object):
pass
def create_... | |
"""
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
distri... | |
# coding: utf-8
"""
MINDBODY Public API
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501
OpenAPI spec version: v6
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
impor... | |
# Copyright 2012-2017 The Meson development 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/licenses/LICENSE-2.0
# Unless required by applicable law or agree... | |
#!/usr/bin/env python
"""Tests for the hunt database api."""
from __future__ import absolute_import
from __future__ import division
from __future__ import unicode_literals
import collections
import random
from future.utils import text_type
from grr_response_core.lib import rdfvalue
from grr_response_core.lib.rdfvalu... | |
"""
Provides utility functions for providing standardized behavior among python scripts.
In addition, many of the functions are designed to significantly ease the burden
to produce a new script for validation, transformation, or conversion.
"""
import sys
import os
import logging
import pydoc
import time
import re
imp... | |
# (C) Copyright 2020 IBM Corp.
# (C) Copyright 2020 Inova Development 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-... | |
#!/usr/bin/env python3
import json
import os
import subprocess
import enum
import sys
from xml.sax import saxutils
class PAMResult:
"""
A test result from pam.
"""
class Status(enum.Enum):
PASS = 1
FAIL = 2
ERROR = 3
def __init__(self, class_name, name, status, descripti... | |
#!/usr/bin/env python
#
# Copyright (c) 2013-2016, ETH Zurich.
# All rights reserved.
#
# This file is distributed under the terms in the attached LICENSE file.
# If you do not find this file, copies can be found by writing to:
# ETH Zurich D-INFK, Universitaetstr. 6, CH-8092 Zurich. Attn: Systems Group.
import schedu... | |
# Author: David Decotigny 2008 Oct 3
# @brief Routines to determine which new objects are reachable
# between 2 points in the code
import gc, cPickle as pickle, weakref, sys, traceback
#
# Method 1: use weak ref to track new live objects
# Advantages: we have live pointers to the new live objects. And fast
# Drawb... | |
#!/usr/bin/python
# Copyright (c) 2014 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.
"""A package is a JSON file describing a list of package archives."""
import json
import os
import posixpath
import sys
sys.path... | |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# Copyright 2010-2011 OpenStack Foundation.
# Copyright 2012 Justin Santa Barbara
# All Rights Reserved.
#
# Licensed under the Apache Lic... | |
import numpy as np
import pytest
from pandas.errors import UnsupportedFunctionCall
from pandas import (
DataFrame,
DatetimeIndex,
Series,
)
import pandas._testing as tm
from pandas.core.window import Expanding
def test_doc_string():
df = DataFrame({"B": [0, 1, 2, np.nan, 4]})
df
df.expandin... | |
# Copyright (c) 2011 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.
"""GDB support for Chrome types.
Add this to your gdb by amending your ~/.gdbinit as follows:
python
import sys
sys.path.insert(0, "/path/to/tools... | |
"""
HTML Widget classes
"""
import copy
import datetime
import re
import warnings
from collections import defaultdict
from itertools import chain
from django.conf import settings
from django.forms.utils import to_current_timezone
from django.templatetags.static import static
from django.utils import datetime_safe, fo... | |
# quick_info/controllers.py
# Brought to you by We Vote. Be good.
# -*- coding: UTF-8 -*-
from .models import QuickInfo, QuickInfoManager, QuickInfoMasterManager
from ballot.models import OFFICE, CANDIDATE, POLITICIAN, MEASURE
from candidate.models import CandidateManager
from config.base import get_environment_variab... | |
# Copyright 2014, 2016 IBM Corp.
#
# 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 django.contrib.auth import logout, authenticate, login
from django.contrib.auth.models import User
from django.contrib.auth.decorators import login_required
from django.core.urlresolvers import reverse
from django.http import HttpResponseRedirect, HttpResponse
from django.shortcuts import render_to_response, redir... | |
# coding=utf-8
from __future__ import absolute_import, division, print_function, unicode_literals
from boot_config import *
import re
import webbrowser
from functools import partial
from distutils.version import LooseVersion
from os.path import join, basename, splitext, isfile
from pprint import pprint
if QT4: # ___ ... | |
############################################################################
# Copyright(c) Open Law Library. All rights reserved. #
# See ThirdPartyNotices.txt in the project root for additional notices. #
# #
# Licensed u... | |
# pylint: disable=too-many-instance-attributes,too-many-locals
# pylint: disable=too-many-branches,too-many-statements,too-many-arguments
"""Executor group is a convenient tool for managing a group of executors."""
import logging
import numpy as np
from .. import context as ctx
from .. import ndarray as nd
from ..io ... | |
"""The tests for the demo climate component."""
import pytest
import voluptuous as vol
from homeassistant.components.climate.const import (
ATTR_AUX_HEAT,
ATTR_CURRENT_HUMIDITY,
ATTR_CURRENT_TEMPERATURE,
ATTR_FAN_MODE,
ATTR_HUMIDITY,
ATTR_HVAC_ACTION,
ATTR_HVAC_MODE,
ATTR_HVAC_MODES,
... | |
"""Representation of a deCONZ gateway."""
import asyncio
import async_timeout
from pydeconz import DeconzSession, errors
from homeassistant.config_entries import SOURCE_REAUTH
from homeassistant.const import CONF_API_KEY, CONF_HOST, CONF_PORT
from homeassistant.core import callback
from homeassistant.exceptions impor... | |
#!/usr/bin/env python
# coding=utf-8
"""
Edit a pdb file to provide missing data
"""
from __future__ import print_function
import os
import sys
import argparse
import numpy as np
from md_utils.md_common import list_to_file, InvalidDataError, warning, process_cfg, create_out_fname, read_csv_dict, \
print_qm_kind, c... | |
"""
Tagging utilities - from user tag input parsing to tag cloud
calculation.
"""
import math
from django.db.models.query import QuerySet
from django.utils import six
from django.utils.encoding import force_text
from django.utils.translation import ugettext as _
# Font size distribution algorithms
LOGARITHMIC, LINEAR... | |
# Copyright 2016-2021 The Meson development 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/licenses/LICENSE-2.0
# Unless required by applicable law or agree... | |
from __future__ import print_function, division
import inspect
from sympy.core.cache import cacheit
from sympy.core.singleton import S
from sympy.core.sympify import _sympify
from sympy.logic.boolalg import Boolean
from sympy.utilities.source import get_class
from contextlib import contextmanager
class AssumptionsCon... | |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
"""Decode the trained Attention outputs (TIMIT corpus)."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from os.path import join, abspath
import sys
import tensorflow as tf
import yaml
import argparse
sys... | |
#-------------------------------------------------------------------------------
# bindlibrary.py
#
# library for get bind information.
#
#
# Copyright (C) 2015, Ryosuke Fukatani
# License: Apache 2.0
#-------------------------------------------------------------------------------
import sys
import os
sys.path.insert... | |
#!/usr/bin/env python
'''======================================================
Created by: D. Spencer Maughan
Last updated: May 2015
File name: IRIS_origin_IP.py
Organization: RISC Lab, Utah State University
Notes:
This file is meant for realtime tuning of waypoint PID gains.
==============... | |
from datetime import datetime, timedelta
from manager_rest.test.base_test import BaseServerTestCase
from cloudify_rest_client.exceptions import CloudifyClientError
class ExecutionSchedulesTestCase(BaseServerTestCase):
DEPLOYMENT_ID = 'deployment'
fmt = '%Y-%m-%dT%H:%M:%S.%fZ'
an_hour_from_now = \
... | |
################################################################################
# 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... | |
import mock
from mock import Mock
from pamqp import specification
import amqpstorm
from amqpstorm import AMQPChannelError
from amqpstorm import AMQPConnectionError
from amqpstorm import AMQPInvalidArgument
from amqpstorm import AMQPMessageError
from amqpstorm import Channel
from amqpstorm import exception
from amqpsto... | |
#
# PgMain.py -- web application threading help routines.
#
# Eric Jeschke (eric@naoj.org)
#
# Copyright (c) Eric R. Jeschke. All rights reserved.
# This is open-source software licensed under a BSD license.
# Please see the file LICENSE.txt for details.
#
from __future__ import print_function
import sys, traceback
im... | |
from datetime import date, timedelta
from ..core import WesternCalendar, MON, TUE, SAT, SUN
from ..registry_tools import iso_register
@iso_register('AU')
class Australia(WesternCalendar):
"Australia"
include_good_friday = True
include_easter_monday = True
include_queens_birthday = False
include_l... | |
from director import callbacks
from director.fieldcontainer import FieldContainer
from director.timercallback import TimerCallback
import re
import numpy as np
from collections import OrderedDict
def cleanPropertyName(s):
"""
Generate a valid python property name by replacing all non-alphanumeric characters ... | |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import base64
import operator
import re
import threading
import openerp
from openerp.osv import fields, osv
from openerp import api, tools
from openerp.http import request
from openerp.tools.safe_eval import safe_eval a... | |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable... | |
import datetime
import os
import tba_config
from google.appengine.api import memcache
from google.appengine.ext import ndb
from google.appengine.ext.webapp import template
from base_controller import CacheableHandler
from consts.district_type import DistrictType
from helpers.match_helper import MatchHelper
from helpe... | |
# Copyright (c) 2021 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 app... | |
import kernelwidget
import bufferswidget
import displaywidget
import newdialog
import stylesheet
import settings
import icons
import utils
import pygpuip
import os
from PySide import QtGui, QtCore
class MainWindow(QtGui.QMainWindow):
def __init__(self, path, settings = None):
super(MainWindow, self).__init... | |
# Copyright 2015 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.
# pylint: disable=unused-argument
import errno
import logging
import os
import re
import shutil
import tempfile
import threading
import time
from devil.and... | |
import pdb
import numpy as np
import math
import time
import chainer
import chainer.functions as F
import chainer.links as L
from chainer import cuda
from util import gaussian_kl_divergence_standard
from util import gaussian_logp
from util import gaussian_logp0
from util import bernoulli_logp
class VAE(chainer.Chai... | |
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... | |
#!/usr/bin/python
# 1. Iterate through all the image pairs and triangulate the match points.
# 2. Set the 3d location of features to triangulated position (possibly
# averaged if the feature is included in multiple matches
# 3. Compute new camera poses with solvePnP() using triangulated point locations
# 4. Repeat
... | |
from __future__ import annotations
import asyncio
import logging
import uuid
from collections import defaultdict, deque
from collections.abc import Container
from math import log2
from time import time
from tlz import topk
from tornado.ioloop import PeriodicCallback
import dask
from dask.utils import parse_timedelta... | |
import asyncio
import concurrent.futures
import copy
import glob
import logging
import os
import sys
import time
import types
from collections import OrderedDict
from functools import partial
from pprint import pformat
from types import SimpleNamespace
import aiocron
import asyncssh
from biothings.utils.configuration ... | |
import h2o_nodes
from h2o_test import dump_json, verboseprint
import h2o_util
import h2o_print as h2p
from h2o_test import OutputObj
#************************************************************************
def runStoreView(node=None, **kwargs):
print "FIX! disabling runStoreView for now"
return {}
if no... | |
"""
Summary
=======
Blogs don't always consist solely of blog entries. Sometimes you want
to add other content to your blog that's not a blog entry. For
example, an "about this blog" page or a page covering a list of your
development projects.
This plugin allows you to have pages served by douglas that aren't
blog ... | |
"""Python wrappers around TensorFlow ops.
This file is MACHINE GENERATED! Do not edit.
Original C++ source file: memory_stats_ops.cc
"""
import collections as _collections
import six as _six
from tensorflow.python import pywrap_tensorflow as _pywrap_tensorflow
from tensorflow.python.eager import context as _context
... | |
import json
import flask
import requests
import markdown
import httplib
from time import gmtime, strftime
from flask import Flask, request, redirect, url_for, g, render_template, flash, session
from flask import abort,make_response, Markup, send_from_directory,send_file
from werkzeug.utils import secure_filename
fro... | |
"""
Low-level operating system functions from :mod:`os`.
Cooperative I/O
===============
This module provides cooperative versions of :func:`os.read` and
:func:`os.write`. These functions are *not* monkey-patched; you
must explicitly call them or monkey patch them yourself.
POSIX functions
---------------
On POSIX,... | |
import json
import requests
from datetime import date, datetime
def _request(symbol):
response = requests.get('http://www.google.com/finance/info', params={
'q': symbol,
})
return response.text
def _try_float(val):
try:
return float(val)
except:
return None
def _try_date(... | |
# Copyright 2011 OpenStack Foundation.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless req... | |
# -*- coding: utf-8 -*-
# Copyright 2022 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... | |
import os
import time
from functools import wraps
from flask import (Flask, redirect, url_for, session,
request, render_template)
from flask_oauthlib.client import OAuth, OAuthException
from flask_sslify import SSLify
SPOTIFY_APP_ID = os.environ.get('SPOTIFY_APP_ID')
SPOTIFY_APP_SECRET = os.environ... | |
import tensorflow as tf
import numpy as np
from data import *
def weight_variable(shape, name=None):
initial = tf.truncated_normal(shape, stddev=0.1)
if name:
return tf.Variable(initial, name)
else:
return tf.Variable(initial)
def bias_variable(shape, name=None):
initial = tf.constant(0.1, shape=shap... | |
import argparse
import ConfigParser
import sys
import os
import pkg_resources
import time
from datetime import datetime, timedelta
from termcolor import colored
from fake_section_head import FakeSectionHead
from live_logs import download_live_logs
from s3_logs import download_s3_logs
from search import find_cached_logs... | |
import mock
import datetime
from modularodm import Q
from nose.tools import * # flake8: noqa (PEP8 asserts)
from framework import auth
from framework.auth import exceptions
from framework.exceptions import PermissionsError
from website import models, project
from tests import base
from tests.base import fake
from te... | |
# -*- coding: utf-8 -*-
# Copyright 2014-2018 Rumma & Ko Ltd
# License: BSD, see LICENSE for more details.
"""
Defines the :rst:dir:`sigal_image` directive.
.. rst:directive:: sigal_image
.. _picsel: https://github.com/lsaffre/picsel
.. _Shotwell: https://en.wikipedia.org/wiki/Shotwell_%28software%29
.. _digiKam: ht... | |
"""TestAuthZ implementations of learning.Objective"""
import datetime
import pytest
from tests.utilities.general import is_never_authz, is_no_authz, uses_cataloging
from dlkit.abstract_osid.authorization import objects as ABCObjects
from dlkit.abstract_osid.authorization import queries as ABCQueries
from dlkit.abstrac... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.