gt stringclasses 1
value | context stringlengths 2.49k 119k |
|---|---|
"""
:mod:`pyvx.vx` --- C-like Python API
==========================================
The functions specified by the `OpenVX`_ standard are provided in form of two
modules, :mod:`pyvx.vx` that provide the vxXxxfunctions and :class:`pyvx.vxu`
that provide the vxuXxx functions. Pleaserefer to the `OpenVX speficication`_
... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Overall Model for the linear program.
"""
import pulp
import time
from collections import defaultdict
# C Libraries
import pandas as pd
class SPDModel(object):
"""SPDModel
Container for setting up, solving, and organising the results
of a Simulation. C... | |
from __future__ import division, print_function
import numpy as np
from scipy.signal import fftconvolve, convolve
import itertools
"""
08/31/17
Author: Rex McArthur
Creates a class of n-dim chebyshev polynomials. Tracks leading term,
coefficents, and inculdes basic operations (+,*,scaler multip, etc.)
Assumes GRevLex ... | |
# coding: utf-8
# Copyright (c) Pymatgen Development Team.
# Distributed under the terms of the MIT License.
import os
import unittest
import numpy as np
from pymatgen.util.testing import PymatgenTest
from pymatgen.io.vasp import Vasprun
from pymatgen.analysis.defects.core import DefectEntry, Vacancy
from pymatgen.a... | |
# -*- coding: utf-8 -*-
from flask import Flask, jsonify, request
from configparser import ConfigParser
from uuid import getnode as get_mac
from sys import platform as ostype
from datetime import datetime
from threading import Thread
import traceback
import platform
import cpuinfo
import psutil
import socket
import tim... | |
import numpy
import chainer
from chainer import backend
from chainer.backends import cuda
from chainer.functions.activation import sigmoid
from chainer.functions.activation import tanh
from chainer.functions.array import concat
from chainer.functions.array import split_axis
from chainer.functions.connection import lin... | |
import ugfx, badge, network, gc, time, urequests, appglue, sys
# SHA2017 Badge installer
# V2 Thomas Roos
# V1 Niek Blankers
def draw_msg(msg):
global line_number
try:
line_number
except:
line_number = 0
ugfx.clear(ugfx.WHITE)
ugfx.string(0, 0, 'Still Loading Anyway...', "P... | |
#!/usr/bin/env python
#
# 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 requ... | |
# coding=utf-8
# Copyright 2013 Janusz Skonieczny
from importlib import import_module
import logging
from flask_oauth import OAuthRemoteApp
from flask_babel import gettext as _
DEFAULT_PROPERTIES = ("user_id", "display_name", "first_name", "last_name", "email", "image_url")
class BaseProvider(OAuthRemoteApp):
d... | |
from inflection import camelize
from pytest import raises
from interfax.client import InterFAX
try:
from urllib.parse import urlunsplit, urlencode
except ImportError:
from urllib import urlencode
from urlparse import urlunsplit
try:
from unittest.mock import Mock, patch
except ImportError:
from m... | |
data = (
'', # 0x00
'', # 0x01
'', # 0x02
'', # 0x03
'', # 0x04
'', # 0x05
'', # 0x06
'', # 0x07
'', # 0x08
'', # 0x09
'', # 0x0a
'', # 0x0b
'', # 0x0c
'', # 0x0d
'', # 0x0e
'', # 0x0f
'', # 0x10
'', # 0x11
'', # 0x12
'', # 0x13
'', # 0x14
'', # 0x15
'',... | |
#!/usr/bin/env python2.5
#
# Copyright 2008 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... | |
#!/usr/bin/python
#
# Copyright (c) 2015, Arista Networks, Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# Redistributions of source code must retain the above copyright notice,
# t... | |
#!/usr/bin/env python3
# Copyright (c) 2015-2017 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 decoding scripts via decodescript RPC command."""
from test_framework.test_framework import Bitco... | |
from __future__ import unicode_literals
import warnings
from sklearn.feature_extraction.text import strip_tags
from sklearn.feature_extraction.text import strip_accents_unicode
from sklearn.feature_extraction.text import strip_accents_ascii
from sklearn.feature_extraction.text import HashingVectorizer
from sklearn.fea... | |
import json
import requests
class Buzzdata(object):
"""
Buzzdata API Client.
"""
class Error(Exception):
def __init__(self, response):
self.code = response.status_code
json = response.json
if json:
self.message = json['message']
... | |
# Copyright 2004-2017 Tom Rothamel <pytom@bishoujo.us>
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documentation files
# (the "Software"), to deal in the Software without restriction,
# including without limitation the rights to use, copy, modify, m... | |
# 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... | |
#
# 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... | |
# Code in this file is copied and adapted from
# https://github.com/openai/evolution-strategies-starter and from
# https://github.com/modestyachts/ARS
from collections import namedtuple
import logging
import numpy as np
import time
import ray
from ray.rllib.agents import Trainer, with_common_config
from ray.rllib.ag... | |
#!/usr/bin/python
# 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.
"""Tests for mb.py."""
import json
import StringIO
import os
import sys
import unittest
import mb
class FakeMBW(mb.MetaBuildWrapper):
... | |
try:
import unittest2 as unittest
except ImportError:
import unittest
from graphite.render.attime import parseTimeReference, parseATTime, parseTimeOffset, getUnitString
from datetime import datetime, timedelta
from django.utils import timezone
from .base import TestCase
import pytz
import mock
def mockDateT... | |
"""Support for Ecobee Thermostats."""
import logging
import voluptuous as vol
from homeassistant.components import ecobee
from homeassistant.components.climate import ClimateDevice
from homeassistant.components.climate.const import (
DOMAIN, STATE_COOL, STATE_HEAT, STATE_AUTO, STATE_IDLE,
ATTR_TARGET_TEMP_LOW... | |
# -*- coding: utf-8 -*-
"""
***************************************************************************
repo.py
---------------------
Date : November 2013
Copyright : (C) 2013-2016 Boundless, http://boundlessgeo.com
************************************************************... | |
#!/usr/bin/env python
# Copyright 2014, 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... | |
#!/usr/bin/env python2
#
# Desc
#
from __future__ import division # Python 3 forward compatibility
from __future__ import print_function # Python 3 forward compatibility
import logging
import sys
import threading
import time
import timer
import util
import udp_listener
class Manager(threading.Thread):
def __... | |
import math
import sys
import numpy as np
import pygame
import freqshow
import ui
# Spectrogram renkleri.
def lerp(x, x0, x1, y0, y1):
return y0 + (y1 - y0)*((x - x0)/(x1 - x0))
def rgb_lerp(x, x0, x1, c0, c1):
return (math.floor(lerp(x, x0, x1, float(c0[0]), float(c1[0]))),
math.floor(lerp(x, x0, x1, fl... | |
# coding: utf-8
# In[ ]:
from functools import wraps
from collections import OrderedDict
import re
import numpy as np
import pandas as pd
from IPython.core.display import display, HTML
import matplotlib.pyplot as plt
import matplotlib.cm as cm
from scipy.interpolate import interp1d
from sklearn.metrics import ma... | |
import json
import re
import uuid
from typing import Any, Dict, List, Optional
# This import verifies that the dependencies are available.
from pyhive import hive # noqa: F401
from pyhive.sqlalchemy_hive import HiveDate, HiveDecimal, HiveTimestamp
from datahub.ingestion.extractor import schema_util
from datahub.inge... | |
#!/usr/bin/env python
#
# 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.
"""Install *_incremental.apk targets as well as their dependent files."""
import argparse
import glob
import logging
import os
impor... | |
# This is the initial proof of concept for the core functions of the PDX Pool Schedule Scraper.
# Fairly disorganized, as I'm just playing with examples here.
# 31 Jan 2015 - Created by Emily Cain
# thanks to the authors of "Automate the Boring Stuff with Python", which was my starting point for this project.
# htt... | |
# 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 -*-
"""
Created on Mon Sep 28 00:51:20 2015
module to transform raw vtk to rotated vtk along mom bud axis
@author: sweel
"""
import os
import os.path as op
import numpy as np
from mayavi import mlab
import pandas as pd
from tvtk.api import tvtk
from mombud.vtk_viz import vtkvizfuncs as vz
import wra... | |
"""Utilities to help with developing using bcbio inside of docker.
"""
import copy
import datetime
import glob
import math
import os
import shutil
import subprocess
import sys
import boto
import numpy
import yaml
from bcbio import utils
from bcbio.distributed import objectstore
from bcbio.pipeline import genome
from ... | |
# -*- coding: utf-8 -*-
"""Platforms.
Utilities dealing with platform specifics: signals, daemonization,
users, groups, and so on.
"""
from __future__ import absolute_import, print_function, unicode_literals
import atexit
import errno
import math
import numbers
import os
import platform as _platform
import signal as ... | |
"""Module that defines indexed objects
The classes IndexedBase, Indexed and Idx would represent a matrix element
M[i, j] as in the following graph::
1) The Indexed class represents the entire indexed object.
|
___|___
' '
M[i, j]
... | |
# 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... | |
from datetime import datetime, timedelta
import json
import urllib2
from django.contrib import messages
from django.contrib.auth import authenticate, logout, login
from django.contrib.auth.models import User
from django.http import HttpResponseRedirect
from django.shortcuts import render, redirect, render_to_response
... | |
"""
Testing signals emitted on changing m2m relations.
"""
from .models import Person
from django.db import models
from django.test import TestCase
from .models import Part, Car, SportsCar, Person
class ManyToManySignalsTest(TestCase):
def m2m_changed_signal_receiver(self, signal, sender, **kwargs):
me... | |
""" terminal reporting of the full testing process.
This is a good source for looking at the various reporting hooks.
"""
from _pytest.main import EXIT_OK, EXIT_TESTSFAILED, EXIT_INTERRUPTED, \
EXIT_USAGEERROR, EXIT_NOTESTSCOLLECTED
import pytest
import py
import sys
import time
import platform
import _pytest._pl... | |
# -*- 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... | |
"""Tests for the Risco alarm control panel device."""
from unittest.mock import MagicMock, PropertyMock, patch
import pytest
from homeassistant.components.alarm_control_panel import DOMAIN as ALARM_DOMAIN
from homeassistant.components.alarm_control_panel.const import (
SUPPORT_ALARM_ARM_AWAY,
SUPPORT_ALARM_AR... | |
"""
DecMeg2014 example code.
Simple prediction of the class labels of the test set by:
- pooling all the training trials of all subjects in one dataset.
- Extracting the MEG data in the first 500ms from when the
stimulus starts.
- Projecting with RandomProjection
- Using a classifier.
Copyright Emanuele Olivetti 20... | |
# -*- 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
... | |
# Copyright 2012 NEC Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | |
# Copyright 2019,2020,2021 Sony Corporation.
# Copyright 2021 Sony Group Corporation.
#
# 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
#
# Un... | |
import collections
import datetime
import mock
import pytz
from babel import dates, Locale
from schema import Schema, And, Use, Or
from django.utils import timezone
from osf.modm_compat import Q
from modularodm.exceptions import NoResultsFound
from nose.tools import * # noqa PEP8 asserts
from framework.auth import A... | |
#!/usr/bin/env python
import subprocess
import threading
import shelve
import os
from numpy import arange, sin, pi, linspace
import matplotlib
matplotlib.use('WXAgg')
from matplotlib.backends.backend_wxagg import FigureCanvasWxAgg as FigureCanvas
from matplotlib.backends.backend_wx import NavigationToolbar2Wx
from 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
# ... | |
import warnings, copy
from astropy.time import Time, TimeDelta
from astropy.coordinates import SkyCoord, AltAz, ICRS, FK5, EarthLocation, Longitude
from astropy import units as U
import numpy as NP
import constants as CNST
# Perform some IERS adjustments
from astropy.utils import iers
tnow = Time.now()
try:
prin... | |
"""Views for ecommerce"""
from decimal import Decimal
import logging
from django.conf import settings
from django.contrib.auth import get_user_model
from django.http.response import Http404
from django.shortcuts import get_object_or_404
from django.urls import reverse
from ipware import get_client_ip
from rest_framewo... | |
"""
LICENCE
-------
Copyright 2013 by Kitware, Inc. All Rights Reserved. Please refer to
KITWARE_LICENSE.TXT for licensing information, or contact General Counsel,
Kitware, Inc., 28 Corporate Drive, Clifton Park, NY 12065.
Specific backend implementation that leveraged an SQLite3 database to store
features.
"""
imp... | |
import re
from django.forms.widgets import TextInput, HiddenInput, MultiWidget, Media
from django.utils.safestring import mark_safe
from django_mongoengine.utils import OrderedDict
# The list of JavaScript files to insert to render any Dictionary widget
MEDIAS = ('jquery-1.8.0.min.js', 'dict.js', 'helper.js')
ADD_FI... | |
# Copyright 2010 Owen Taylor
#
# This file is part of Reinteract and distributed under the terms
# of the BSD license. See the file COPYING in the Reinteract
# distribution for full details.
#
########################################################################
import cairo
import gtk
import logging
import os
impo... | |
from __future__ import division, absolute_import, print_function
import sys
import warnings
import itertools
import operator
import numpy as np
from numpy.testing.utils import _gen_alignment_data
from numpy.testing import (
TestCase, run_module_suite, assert_, assert_equal, assert_raises,
assert_almost_equal,... | |
"""
homeassistant.components.sensor.openweathermap
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
OpenWeatherMap (OWM) service.
Configuration:
To use the OpenWeatherMap sensor you will need to add something like the
following to your configuration.yaml file.
sensor:
platform: openweathermap
api_key: YOUR_APP_KEY... | |
from __future__ import print_function
import errno
import json
import os
import platform
import re
import shlex
import signal
import subprocess
import sys
import tempfile
import textwrap
import time
import traceback
from pynailgun import NailgunConnection, NailgunException
from timing import monotonic_time_nanos
from ... | |
import os
import threading
from datetime import timedelta
from flask import make_response, current_app, request, render_template, jsonify
from apiclient import discovery, errors
from functools import update_wrapper
from app import app
from copy import deepcopy
from app import cache
from pybars import Compiler
import da... | |
import tensorflow as tf
import prettytensor as pt
import numpy as np
import scipy.io as io
import argparse
import models
import sys
import os
import data_loader
from collections import defaultdict
from constants import *
from progressbar import ETA, Bar, Percentage, ProgressBar
from sklearn.metrics import precision_r... | |
#!/usr/bin/env python
# Copyright 2015 Yelp Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | |
"""SCons.Platform.posix
Platform-specific initialization for POSIX (Linux, UNIX, etc.) systems.
There normally shouldn't be any need to import this module directly. It
will usually be imported through the generic SCons.Platform.Platform()
selection method.
"""
#
# __COPYRIGHT__
#
# Permission is hereby granted, fre... | |
# coding=utf-8
# Copyright 2015 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import json
import o... | |
#!/usr/bin/env python
#
# Author: Gael Varoquaux <gael dot varoquaux at normalesup dot org>
# Copyright (c) 2009 Gael Varoquaux
# License: BSD Style, 3 clauses.
# Forked by: Mike McKerns (December 2013)
# Author: Mike McKerns (mmckerns @caltech and @uqfoundation)
# Copyright (c) 2013-2015 California Institute of Techn... | |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compli... | |
import time
import RPi.GPIO as GPIO
import matplotlib.pyplot as plt
# Use BCM GPIO references
# instead of physical pin numbers
GPIO.setmode(GPIO.BCM)
class MotorControl:
def __init__(self):
#specify params
self.forwardSpeed=30
self.turnSpeed=40
self.maxSpeed=1.7*self.forwardSpee... | |
import os
import sys
from functools import partial
import traceback
import time
def short_repr(s):
v = repr(s)
if len(v) > 20:
return v[:12] + "..." + v[-5:]
return v
class Model:
def __init__(self, env, history):
self.files = {}
self.tasks = []
self.env = env
... | |
"""Parses GTFS feeds urls:
https://transit.land/ - Transitland
http://transitfeeds.com/feeds - Openmobilitydata
Crawls all the urls, loads feed zips and extracts to the specified directory."""
import argparse
import concurrent.futures
import io
import json
import logging
import os
import time
import zipfile
... | |
#!/usr/bin/env python
from __future__ import print_function
import re, random, argparse
class Memory(object) :
def __init__(self, size, no_color) :
self.values = [0] * size
self.values[0], self.values[-1] = 128, 128
self.pointers = [0, size-1]
self.loops = []
self.no_color = no_color
def __str__(self... | |
"""
Testing Recursive feature elimination
"""
import numpy as np
from numpy.testing import assert_array_almost_equal, assert_array_equal
from nose.tools import assert_equal, assert_true
from scipy import sparse
from sklearn.feature_selection.rfe import RFE, RFECV
from sklearn.datasets import load_iris, make_friedman1... | |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compli... | |
from collections import OrderedDict
from datetime import datetime
from decimal import Decimal
from urllib.request import urlopen
from urllib.error import HTTPError
from xml.sax import handler, make_parser
import xml.etree.ElementTree
import json
import re
import time
from typing import Any, Callable, ClassVar, Dict, Li... | |
# -*- coding: utf-8 -*-
"""
Created on Mon Oct 31 14:26:20 2016
@author: apezeshk
"""
import numpy as np
import lasagne
from lasagne.layers import dnn
import theano.tensor as T
import theano
import scipy.io as sio
import os
def Path_create(file_name): #takes something like p0023_2000123_s324 and returns p0023/2000123... | |
from distutils.ccompiler import new_compiler as _new_compiler
from distutils.command.clean import clean, log
from distutils.core import Command
from distutils.dir_util import remove_tree
from distutils.errors import DistutilsExecError
from distutils.msvccompiler import MSVCCompiler
from setuptools import setup, find_pa... | |
"""
The Spatial Reference class, represensents OGR Spatial Reference objects.
Example:
>>> from django.contrib.gis.gdal import SpatialReference
>>> srs = SpatialReference('WGS84')
>>> print srs
GEOGCS["WGS 84",
DATUM["WGS_1984",
SPHEROID["WGS 84",6378137,298.257223563,
AUTHORI... | |
#
# 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... | |
"""
Event parser and human readable log generator.
For more details about this component, please refer to the documentation at
https://home-assistant.io/components/logbook/
"""
import asyncio
import logging
from datetime import timedelta
from itertools import groupby
import voluptuous as vol
from homeassistant.core ... | |
import re
import warnings
from xml.dom.minidom import parseString, Node
from django.conf import settings, UserSettingsHolder
from django.core import mail
from django.test.signals import template_rendered, setting_changed
from django.template import Template, loader, TemplateDoesNotExist
from django.template.loaders im... | |
import datetime
import time
from twisted.trial import unittest
from twisted.internet import defer, task
from twisted.python.failure import Failure
from zope.interface import implements
from mock import patch
from txtorcon import Circuit
from txtorcon import build_timeout_circuit
from txtorcon import Stream
from txtor... | |
# -*- 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
"""
# =============================================================================
Copyright Government of Canada 2015-2017
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 -*-
# This code is part of Qiskit.
#
# (C) Copyright IBM 2017, 2018.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any... | |
# Copyright 2020 Google LLC. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... | |
#
# Funcparserlib -- A parser library based on parser combinators
# by Andrey Vlasovskikh et al
#
__all__ = [
'a', 'tok', 'many', 'fwd', 'eof', 'maybe', 'skip', 'oneplus',
'name_parser_vars', 'SyntaxError', 'ParserError', 'memoize',
]
from warnings import warn
import logging
from funcparserlib.lexer import *
f... | |
# eng.py
# Copyright (c) 2013-2019 Pablo Acosta-Serafini
# See LICENSE for details
# pylint: disable=C0111,C0411,C0413,E0611,R0914,W0105,W0611,W0631
# Standard library imports
import collections
import copy
import math
import textwrap
import decimal
from decimal import Decimal
import sys
if sys.hexversion < 0x0300000... | |
# 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 ... | |
# coding: utf-8
"""
Swaggy Jenkins
Jenkins API clients generated from Swagger / Open API specification # noqa: E501
The version of the OpenAPI document: 1.1.2-pre.0
Contact: blah@cliffano.com
Generated by: https://openapi-generator.tech
"""
try:
from inspect import getfullargspec
except Im... | |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 Nebula, 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
#
# ... | |
# Copyright (c) 2010-2012 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 agree... | |
# coding: utf-8
# ### Could not find kernel error?
#
# If you ever see a "could not find a kernel for this notebook" error message, it will offer you a pull down menu for you to pick a fitting kernel.
#
# Remember, `kernels` are the notebook's way to find the correct interpretor for the code you write into notebook... | |
# -*- coding: utf-8 -*-
from django.shortcuts import get_object_or_404, redirect
from django.http import HttpResponse
from django.contrib.auth.decorators import login_required
from django.db.models import Q
from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger
from django.core import serializers
from... | |
"""The tests for the Input select component."""
# pylint: disable=protected-access
from unittest.mock import patch
import pytest
from homeassistant.components.input_select import (
ATTR_OPTION,
ATTR_OPTIONS,
CONF_INITIAL,
DOMAIN,
SERVICE_SELECT_FIRST,
SERVICE_SELECT_LAST,
SERVICE_SELECT_NE... | |
# Copyright 2018 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.
import os
import json
import shutil
import tempfile
import unittest
from telemetry.core import util
from telemetry.internal.browser import browser_finder
fr... | |
# -*- coding: utf-8 -*-
"""
Managing Gateway Groups and interactions with multiple channels.
(c) 2008-2014, Holger Krekel and others
"""
import atexit
import sys
from functools import partial
from threading import Lock
from . import gateway_bootstrap
from . import gateway_io
from .gateway_base import get_execmodel
fr... | |
import pandas as pd
import numpy as np
import tensorflow as tf
from sklearn.cross_validation import train_test_split
from sklearn.metrics import f1_score
import matplotlib.pyplot as plt
from sklearn.utils import shuffle
from sklearn.metrics import confusion_matrix
import seaborn as sns
import matplotlib.gridspec as gr... | |
# Copyright 2013: Mirantis 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 b... | |
"""
Functions for building tensorflow computational graph models. RNN models,
and tensorflow loss functions will be added to this module.
"""
import tensorflow as tf
import math
from np_ops import fan_scale
def batch_normalize(tensor_in, epsilon=1e-5, decay=0.999):
"""
Batch Normalization:
`Batch Normaliz... | |
#!/usr/bin/env python3
"""
Created on Tue Oct 22 02:37:52 2019.
@author: mtageld
"""
import numpy as np
from PIL import Image
from histomicstk.annotations_and_masks.annotation_and_mask_utils import \
get_image_from_htk_response
from histomicstk.annotations_and_masks.masks_to_annotations_handler import (
get_a... | |
# -*- coding: ascii -*-
#
# Copyright 2006-2012
# Andr\xe9 Malo or his licensors, as applicable
#
# 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-... | |
import os
import unittest
try:
from StringIO import StringIO
except ImportError:
from io import StringIO
import numpy as np
from spglib import (get_ir_reciprocal_mesh,
get_stabilized_reciprocal_mesh,
get_symmetry_dataset)
from vasp import read_vasp
data_dir = os.path.dir... | |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 Michael Still and Canonical 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:... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.