gt stringclasses 1
value | context stringlengths 2.49k 119k |
|---|---|
# coding=utf-8
"""
This module, views.py, is where all the backend and frontend server requests are handled and returned to the user.
"""
# Needed to send back a rendered HTML page.
from django.shortcuts import render
# Needed for sending a simple HttpResponse such as a string response.
from django.http import HttpRe... | |
# Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | |
#!/usr/bin/env python
# PYTHON_ARGCOMPLETE_OK
"""Training for the Copy Task in Neural Turing Machines."""
import argparse
import json
import logging
import time
import random
import re
import sys
import attr
import argcomplete
import torch
import numpy as np
LOGGER = logging.getLogger(__name__)
from tasks.copytas... | |
from .theme import theme
import matplotlib as mpl
import matplotlib.pyplot as plt
from numpy import isreal
def _set_default_theme_rcparams(gg, style, gridweight, context):
"""helper method to set the default rcParams and other theming relevant
things
"""
# select grid line width:
gridweights = {
... | |
from __future__ import unicode_literals
from __future__ import absolute_import
import os
import re
import copy
import fnmatch
import logging
import operator
from string import Template
import six
from scalyr_agent import scalyr_logging
from scalyr_agent.configuration import BadConfiguration
from scalyr_agent.json_li... | |
import bpy
# Use some of the existing buttons.
from bl_ui import properties_render
properties_render.RENDER_PT_render.COMPAT_ENGINES.add('PSYCHOPATH_RENDER')
properties_render.RENDER_PT_dimensions.COMPAT_ENGINES.add('PSYCHOPATH_RENDER')
properties_render.RENDER_PT_output.COMPAT_ENGINES.add('PSYCHOPATH_RENDER')
del pro... | |
################################################################################
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this... | |
# Copyright (c) 2009, Peter Sagerson
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# - Redistributions of source code must retain the above copyright notice, this
# list of conditions and the ... | |
# encoding: utf-8
import datetime
from south.db import db
from south.v2 import DataMigration
from django.db import models
try:
import cPickle as pickle
except ImportError:
import pickle
from src.utils.utils import to_str, to_unicode
#from src.typeclasses.models import PackedDBobject,PackedDict,PackedList
from ... | |
# Copyright 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 agre... | |
# -*- coding: utf-8 -*-
"""
============================================
Interacting with Data Using SunPy TimeSeries
============================================
This is an early run-through of the basic functionality of the SunPy TimeSeries
class.
This is intended primarily to demonstrate the current interface for d... | |
# Copyright (C) 2002, Thomas Hamelryck (thamelry@binf.ku.dk)
# This code is part of the Biopython distribution and governed by its
# license. Please see the LICENSE file that should have been included
# as part of this package.
"""mmCIF parsers"""
from __future__ import print_function
from string import ascii_lette... | |
# Copyright (c) 2013-2017 University Corporation for Atmospheric Research/Unidata.
# Distributed under the terms of the MIT License.
# SPDX-License-Identifier: MIT
"""
Code to support reading and parsing catalog files from a THREDDS Data Server (TDS).
They help identifying the latest dataset and finding proper URLs to... | |
import collections
import logging
import time
from xml.etree import ElementTree
import six
import recurly
from six import StringIO
from six.moves import urllib, http_client
from six.moves.urllib.parse import urljoin
from recurly import Account, AddOn, Address, Adjustment, BillingInfo, Coupon, Plan, Redemption, Subsc... | |
# -*- coding: utf-8 -*-
"""
The MIT License (MIT)
Copyright (c) 2015-2016 Rapptz
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to u... | |
"""Development tasks."""
import os
import re
from itertools import chain
from pathlib import Path
from shutil import which
from typing import List, Optional, Pattern
import httpx
import toml
from duty import duty
from git_changelog.build import Changelog, Version
from jinja2 import StrictUndefined
from jinja2.sandbox... | |
from mock import MagicMock, patch, sentinel
from pika import BlockingConnection, PlainCredentials
from pika.adapters.tornado_connection import TornadoConnection
from pika.exceptions import AMQPConnectionError
from pikachewie.broker import Broker
from tests import _BaseTestCase
mod = 'pikachewie.broker'
class _Broke... | |
from __future__ import unicode_literals
from copy import copy
import difflib
import errno
from functools import wraps
import json
import os
import posixpath
import re
import socket
import sys
import threading
import unittest
from unittest import skipIf # NOQA: Imported here for backward compatibility
from unit... | |
from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType
import copy as _copy
class Tickformatstop(_BaseTraceHierarchyType):
# class properties
# --------------------
_parent_path_str = "contourcarpet.colorbar"
_path_str = "contourcarpet.colorbar.tickformatstop"
_valid_p... | |
# 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 a... | |
# 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... | |
################################################################################
# Copyright (C) 2013-2014 Jaakko Luttinen
#
# This file is licensed under the MIT License.
################################################################################
import numpy as np
from bayespy.utils import misc
import h5py
... | |
#!/usr/bin/env python
#############################################
#
# Project NFW
#
#############################################
import numpy as np
from math import *
import cosmolopy.distance as cosdist
import cosmolopy.density as cosdens
import cosmolopy.constants as cosconst
import warnings
# ---
# Set a defa... | |
import json
from django.views.generic.base import View
from django.views.generic.detail import SingleObjectMixin
from django.views.generic import (ListView, UpdateView, DeleteView,
DetailView, CreateView)
from django.core.urlresolvers import reverse_lazy, reverse
from django.shortcuts... | |
from flask import render_template, redirect, url_for, abort, flash, request, current_app, make_response
from flask.ext.login import login_required, current_user
from . import main
from .forms import EditProfileForm, EditProfileAdminForm, PostForm, CommentForm
from .. import db
from ..models import Permission, Role, Use... | |
# -*- 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... | |
# -*- coding: utf-8 -*-
#
# clx.py - Ethernet/IP Client for Rockwell PLCs
#
#
# Copyright (c) 2014 Agostino Ruscito <ruscito@gmail.com>
#
# 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 witho... | |
import thread
import traceback
thread.stack_size(1024 * 512) # reduce vm size
class Input(dict):
def __init__(self, conn, raw, prefix, command, params,
nick, user, host, paraml, msg):
chan = paraml[0].lower()
if chan == conn.nick.lower(): # is a PM
chan = nick
... | |
# -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
import collections
import json
import pytest
from django.core import signing
from django.core.urlresolvers import reverse
from django.db.models import QuerySet
from django.utils.encoding import force_text
from selenium.common.exceptions ... | |
#!/usr/bin/env python
# Copyright 2015-2016 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 ... | |
#!/usr/bin/env python
# Script to convert game event ID stored in MongoDB to Pandas dataframe for analysis
# TODO: Visualize each event as an image, potentially?
##########################################################################
## Imports
####################################################################... | |
# Copyright (c) 2011-2016 Rackspace US, 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 ... | |
################################################################################
# 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... | |
# Lint as: python2, python3
# Copyright 2018 The Bazel 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
#
# Unle... | |
#!/usr/bin/env python
from __future__ import unicode_literals
from __future__ import print_function
import os
import sys
import traceback
import logging
import threading
from time import time
from codecs import open
import click
import sqlparse
from prompt_toolkit import CommandLineInterface, Application, AbortAction... | |
__author__ = 'MBlaauw'
if __name__ == "__main__":
reload(sys)
sys.setdefaultencoding("utf-8")
import sys
import re, time, datetime, numpy as np, pandas as pd
from pandas import concat
from bs4 import BeautifulSoup
from urllib2 import urlopen
#BASE_URL = 'http://www.bol.com/nl/l/nederlandse-boeken/nederlandse-... | |
"""Provide an authentication layer for Home Assistant."""
import asyncio
from collections import OrderedDict
from datetime import timedelta
import logging
from typing import Any, Dict, List, Optional, Tuple, cast
import jwt
from homeassistant import data_entry_flow
from homeassistant.auth.const import ACCESS_TOKEN_EX... | |
# -*- coding: utf-8 -*-
############################ Copyrights and license ############################
# #
# Copyright 2013 AKFish <akfish@gmail.com> #
# Copyright 2013 Ed Jackson <ed.jackson@gmail.com> ... | |
#!/usr/bin/env python
def main():
import sys
raw_data = load_csv(sys.argv[1])
k_l = set()
for k in raw_data:
k_l.add(get_stencil_num(k))
k_l = list(k_l)
for k in k_l:
for is_dp in [1]:
for t in [0, 1]:
plot_lines(raw_data, k, is_dp, t)
def get_ste... | |
# Copyright 2019 Verily Life Sciences 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 appli... | |
# (c) 2018, NetApp, Inc
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
''' unit test template for ONTAP Ansible module '''
from __future__ import print_function
import json
import pytest
from units.compat import unittest
from units.compat.mock import patch, Mock
from ans... | |
"Base Cache class."
import time
import warnings
from django.core.exceptions import ImproperlyConfigured
from django.utils.module_loading import import_string
class InvalidCacheBackendError(ImproperlyConfigured):
pass
class CacheKeyWarning(RuntimeWarning):
pass
# Stub class to ensure not passing in a `tim... | |
import pytest
import numpy as np
import pandas as pd
import pandas.util._test_decorators as td
from pandas.util import testing as tm
from pandas import (PeriodIndex, period_range, notna, DatetimeIndex, NaT,
Index, Period, Int64Index, Series, DataFrame, date_range,
offsets)
fro... | |
#! /usr/bin/env python
import os
import argparse
import config
import config.user_input.console
from build_all_examples import run_program
from config.boards import list_of_boards, load_board_config
from config.devices import list_of_devices, list_of_vendors, \
list_of_families, load_device_config
from config.ar... | |
#!/usr/bin/python
# 1 - Import library
import pygame
from pygame.locals import *
import math
import random
# 2 - Initialize the game
pygame.init()
width = 640
height = 480
screen=pygame.display.set_mode((width, height))
keys = [False, False, False, False]
playerpos=[100,100]
acc=[0,0]
arrows=[]
badtimer=100
badtim... | |
"""
DefinedAEpTandZ0 (:mod:`skrf.media.definedAEpTandZ0`)
======================================================
Transmission line medium defined by A, Ep, Tand and Z0.
This medium is defined by attenuation A, relative permittivity Ep_r,
loss angle tand and characteristic impedance Z0.
Djirdjevic/Svennson dispersion... | |
#
# 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... | |
#
# 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 us... | |
# 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"); 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... | |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file '/Users/bibsian/Desktop/git/database-development/Views/ui_dialog_time.ui'
#
# Created by: PyQt4 UI code generator 4.11.4
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
try:
_fromUtf8 = QtCore.QS... | |
from __future__ import annotations
import mimetypes
from pathlib import Path
from typing import Any, Dict, List, Optional
import yaml
from pydantic import BaseModel, Field, FilePath, HttpUrl, validator
from lander.plugins import parsers, themes
__all__ = ["BuildSettings"]
class DownloadableFile(BaseModel):
""... | |
# Copyright (c) 2015 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/LICENSE-2.0
#
# Unless required by appli... | |
__author__ = "Dusan (Ph4r05) Klinec"
__copyright__ = "Copyright (C) 2014 Dusan (ph4r05) Klinec"
__license__ = "Apache License, Version 2.0"
__version__ = "1.0"
import ply.lex as lex
import ply.yacc as yacc
from .model import *
import pdb
from helpers import LexHelper, LU
from logicparser import FOLParser, FOLLexer, ... | |
# This file helps to compute a version number in source trees obtained from
# git-archive tarball (such as those provided by githubs download-from-tag
# feature). Distribution tarballs (built by setup.py sdist) and build
# directories (produced by setup.py build) will contain a much shorter file
# that just contains th... | |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Shader programs and infrastructure for wire frame items
"""
import logging
from OpenGL.GL import (
shaders,
glUniform1fv,
glGetUniformLocation,
GL_VERTEX_SHADER,
GL_FRAGMENT_SHADER,
)
from qplotutils import CONFIG
from qplotutils.wireframe.base_... | |
"""
This module converts requested URLs to callback view functions.
RegexURLResolver is the main class here. Its resolve() method takes a URL (as
a string) and returns a ResolverMatch object which provides access to all
attributes of the resolved URL match.
"""
from __future__ import unicode_literals
import functools... | |
import datetime
from firebase_admin import messaging
from firebase_admin.exceptions import FirebaseError, InvalidArgumentError, InternalError, UnavailableError
from firebase_admin.messaging import QuotaExceededError, SenderIdMismatchError, ThirdPartyAuthError, UnregisteredError
import json
from mock import patch, Mock,... | |
import tensorflow as tf
import numpy as np
import os
import sys
import random
import subprocess
from redis import Redis
import time
sys.path.append(os.path.realpath(".."))
import helpers.utils as hlp
from models.feed_forward import FFContinuous
class EvolutionStrategiesTrainer(FFContinuous):
def __init__(self, ... | |
"""Something I have to write here
"""
from __future__ import division
import tensorflow as tf
#from tensorflow.python.ops.rnn_cell import RNNCell
from tensorflow.python.ops.rnn_cell_impl import _RNNCell as RNNCell
from tensorflow.python.ops import variable_scope as vs
from tensorflow.python.ops import math_ops
from ... | |
# -*- coding: utf-8 -*-
"""\
This is a python port of "Goose" orignialy licensed to Gravity.com
under one or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership.
Python port was written by Xavier Grangier for Recrutae
Gravity.co... | |
# Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | |
from __future__ import print_function, division
from builtins import range
from builtins import object
import numpy as np
from cs231n import optim
from cs231n.coco_utils import sample_coco_minibatch
class CaptioningSolver(object):
"""
A CaptioningSolver encapsulates all the logic necessary for training
i... | |
# 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 agreed to in writing, s... | |
#!/usr/bin/env python2.5
#
# Copyright 2009 the Melange 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 applic... | |
import numpy
import pylab
import contrib.modelfit
def run_nonlinearity_detection(activities,predicted_activities,num_bins=20,display=False ,name='piece_wise_nonlinearity.png'):
(num_act,num_neurons) = numpy.shape(activities)
a=pylab.rcParams['font.size']
os = []
if disp... | |
__author__ = "Jan Kowalleck (jan.kowalleck@googlemail.com)"
__copyright__ = "Copyright (c) 2014 Jan Kowalleck"
__license__ = "MIT"
__all__ = ['Bundler', 'BundlerPathIsNoDirException']
### some imports ####
#import sys
import os
import re
#import chardet
#import subprocess
import bs4
from pygments.token import Tok... | |
import logging
import wx
from matplotlib.backends.backend_wxagg import NavigationToolbar2WxAgg as NavigationToolbar
from matplotlib.widgets import Lasso
from matplotlib import path
from matplotlib import dates
# from odmtools.common.logger import LoggerTool
from odmtools.common.icons.plotToolbar import back, filesave... | |
# -*- coding: utf-8 -*-
"""
ambari_jinja2.filters
~~~~~~~~~~~~~~
Bundled jinja filters.
:copyright: (c) 2010 by the Jinja Team.
:license: BSD, see LICENSE for more details.
"""
import re
import math
from random import choice
from operator import itemgetter
from itertools import imap, groupby
from ... | |
# -*- coding: utf-8 -*-
# Copyright (c) 2015-2022, Exa Analytics Development Team
# Distributed under the terms of the Apache License 2.0
"""
Basis Function Manipulation
################################
Functions for managing and manipulating basis set data.
Many of the ordering schemes used in computational codes can ... | |
# Copyright (c) 2017 by David Cournapeau
# This software is released under the MIT license. See LICENSE file for the
# actual license.
import contextlib
import mock
import os
import os.path
import shutil
import sys
import tempfile
import textwrap
import unittest
from simple_versioner import git_version, write_version_... | |
# Copyright (C) 2013-2015 DNAnexus, Inc.
#
# This file is part of dx-toolkit (DNAnexus platform client libraries).
#
# 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... | |
# -*- coding: utf-8 -*-
"""
Created on Thu Nov 14 10:18:30 2013
@author: Jon F
"""
import copy
from datetime import date, datetime, timedelta
def convert_date_to_days_since_date2(date, date2):
"""
date: Python Date object; end date in date range
date2: Python Date object; start date in date ran... | |
"""
Test functions for models.GLM
"""
from statsmodels.compat import range
import os
import numpy as np
from numpy.testing import (assert_almost_equal, assert_equal, assert_raises,
assert_allclose, assert_, assert_array_less)
from scipy import stats
import statsmodels.api as sm
from statsmo... | |
# Copyright 2012 NTT Data. All Rights Reserved.
# Copyright 2012 Yahoo! 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/li... | |
from datetime import datetime
import numpy as np
import pytest
import pandas as pd
from pandas import DataFrame, Index, Series, Timestamp, date_range
import pandas._testing as tm
class TestDataFrameConcat:
def test_concat_multiple_frames_dtypes(self):
# GH 2759
A = DataFrame(data=np.ones((10, 2... | |
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | |
# 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) 2011-2014, Agora Games, LLC All rights reserved.
https://github.com/agoragames/haigha/blob/master/LICENSE.txt
'''
from collections import deque
from chai import Chai
from haigha.channel_pool import ChannelPool
class ChannelPoolTest(Chai):
def test_init(self):
c = ChannelPool('connec... | |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2011 Rackspace
# Copyright (c) 2011 X.commerce, a business unit of eBay 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 t... | |
#
# Author: John Tran <jhtran@att.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 law or agreed to i... | |
import unittest
from pycoin.key.BIP32Node import BIP32Node
from pycoin.serialize import h2b
class Bip0032TestCase(unittest.TestCase):
def test_vector_1(self):
master = BIP32Node.from_master_secret(h2b("000102030405060708090a0b0c0d0e0f"))
self.assertEqual(
master.wallet_key(as_private=... | |
from __future__ import unicode_literals
import collections
import datetime
import hashlib
import itertools
import os.path
import re
import time
from . import (
commands,
helper,
sheet,
student,
sendmail,
)
Submission = collections.namedtuple(
'Submission',
['id', 'sheet_id', 'student_id',... | |
import os, sys
import json, csv
import matplotlib.pyplot as plt
from matplotlib import gridspec
import numpy as np
import pylab
import optparse
dictionary = {}
'''
Create the specified directory, if not exists.
'''
def path_to_dir(out):
if not os.path.exists(out) and not out == '':
os.makedirs(out)
if out == '':... | |
"""Unit test for Treadmill app trace events module.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import unittest
import mock
from treadmill.trace.app import events
class AppTraceEventsTest(unittest.TestCase... | |
'''
/******************************************************************
*
* Copyright 2018 Samsung Electronics 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
*
* htt... | |
import copy
import logging
from typing import Dict, List, Optional, Tuple
import ray
import ray.cloudpickle as pickle
from ray.tune.result import DEFAULT_METRIC
from ray.tune.sample import Categorical, Domain, Float, Integer, Quantized, \
Uniform
from ray.tune.suggest.suggestion import UNRESOLVED_SEARCH_SPACE, \
... | |
# -*- coding: utf-8 -*-
""" Contains smart indent modes """
import re
from pyqode.core.api import TextHelper, get_block_symbol_data
from pyqode.qt.QtGui import QTextCursor
from pyqode.core.modes import AutoIndentMode, SymbolMatcherMode
from pyqode.core.modes.matcher import CLOSE, PAREN, SQUARE, BRACE, OPEN
class PyAu... | |
# Copyright 2009 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, ... | |
"""This tutorial introduces restricted boltzmann machines (RBM) using Theano.
Boltzmann Machines (BMs) are a particular form of energy-based model which
contain hidden variables. Restricted Boltzmann Machines further restrict BMs
to those without visible-visible and hidden-hidden connections.
"""
from __future__ impo... | |
#coding=utf-8
import math
import paddle.v2 as paddle
__all__ = ["conv_seq2seq"]
def gated_conv_with_batchnorm(input,
size,
context_len,
context_start=None,
learning_rate=1.0,
... | |
#
# 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... | |
#!/usr/bin/env python
"""
# =============================================================================
Copyright Government of Canada 2015-2016
Written by: Eric Marinier, Public Health Agency of Canada,
National Microbiology Laboratory
Funded by the National Micriobiology Laboratory and the Genome Canada / A... | |
# -*- coding: 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 License, Version 2.0 (the
#... | |
import datetime
from pprint import pprint
from utils.functions.models import rows_to_dict_list_lower
from utils.functions.queries import debug_cursor_execute
from utils.functions.strings import split_non_empty
def busca_ob(
cursor, ob=None, periodo=None, obs=None, ordens=None, ot=None, ob2=None, ref=None):
... | |
#!/usr/bin/env python3
"""
ID3 algo for building decision trees.
author: vikash.madhow@gatech.edu
"""
from math import log2
class Attribute:
"""
The definition of a nominal attribute (such as humidity, rain, etc.). A nominal
attribute is restricted to a list of values.
"""
def __init__(self, name... | |
""" MF Module
---------
Implementation of Matrix Factorization for prediction of helpfulness votes.
Voter and review are the dimensions considered in the model and modeled as
latent vectors.
Usage:
$ python -m algo.recsys.mf [-k <k>] [-i <iterations>] [-l <learning_rate>]
[-r <regula... | |
'''
Based on stompy: https://bitbucket.org/benjaminws/python-stomp/
Created on Jan.12.2015
Modified on Mar.10.2015
This file is to implement stomp messaging protocol.The stomp protocol is easily
written. It is designed to be as simple as possible.
@author: Jidong
'''
import socket
from frame import Frame
import time
... | |
# coding=utf-8
# Copyright 2018 The Tensor2Tensor 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... | |
# Copyright 2019, Google LLC.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing... | |
# Licensed Materials - Property of IBM
# Copyright IBM Corp. 2019
import unittest
import sys
import os
import time
import requests
import uuid
import glob
import re
from streamsx.topology.topology import Topology
from streamsx.topology.context import submit, ConfigParams
from streamsx.rest import Instance
import stre... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.