gt stringclasses 1
value | context stringlengths 2.49k 119k |
|---|---|
import os, sys, io
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))
import apx
import unittest
class TestCompilePackProg(unittest.TestCase):
def test_packU8(self):
dataElement = apx.DataElement.UInt8(minVal=0, maxVal=3)
compiler = apx.Compiler()
prog = compiler.c... | |
import numpy as np
import pytest
from scipy import linalg
from sklearn.utils import check_random_state
from sklearn.utils._testing import assert_array_equal, assert_no_warnings
from sklearn.utils._testing import assert_array_almost_equal
from sklearn.utils._testing import assert_allclose
from sklearn.utils._testing ... | |
# -*- coding: utf-8 -*-
import subprocess
from django.http import HttpResponse
from django.utils.timezone import now as timezone_now
from zerver.lib.test_helpers import (
most_recent_message,
most_recent_usermessage,
POSTRequestMock)
from zerver.lib.test_classes import (
ZulipTestCase,
)
from zerve... | |
# Copyright (c) 2012 Rackspace Hosting
# 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... | |
# --------------------------------------------------------------------------- #
import logging
from abc import ABCMeta
import collections
import datetime
from cryptography import x509
from cryptography.x509.oid import NameOID, ExtensionOID
from cryptography.hazmat.primitives import serialization, hashes
from crypto... | |
#!/usr/bin/python
# coding=utf-8
import api
from . import batched, parse_datetime, parse_date
from cache import SchedulesDirectCache
from common import Status, LineupMap, LineupMapList, ScheduleList, Headend, Lineup, ChangeLineupResponse, ServiceRegion
import logging
import hashlib
class SchedulesDirect(object):
... | |
#!/usr/bin/env python
# Copyright (C) 2015 Intel Corporation
#
# Released under the MIT license (see COPYING.MIT)
# ./runtest.py -b build_data.json -a tag -f test.manifest
import sys
import os
import time
import unittest
import inspect
from functools import wraps
BASEDIR = os.path.abspath(os.path.join(os.path.dirna... | |
"""
Methods for generating "perfect data" hessians.
"""
__docformat__ = "restructuredtext en"
import copy
import logging
logger = logging.getLogger('RxnNets.PerfectData')
import sets
import scipy
import scipy.integrate
import Dynamics
from SloppyCell import HAVE_PYPAR, my_rank, my_host, num_procs
if HAVE_PYPAR:
... | |
"""
TODO:
Implement a test that proves file configs override rather than overwrite
the defaults. Unfortunately this functionality will have to be implemented
first.
"""
import os
from unittest import mock
import pytest
import requests
from pianodb.pianodb import (number_of_workers, gen_dummy_cmd, get_con... | |
import os
import json
import sys
import shlex
import subprocess
import logging
import itertools, collections
import re
om_script = "model2dae.mos" # name of generated Open Modelica script
class CygwinError(Exception):
"""Exception raised for dealing with Cygwin.
Attributes:
msg -- explanation of th... | |
from __future__ import unicode_literals
from django.conf.urls import patterns, url, include
from django.contrib.auth.models import User
from django.http import HttpResponse
from django.test import TestCase
from django.utils import six
from rest_framework import HTTP_HEADER_ENCODING
from rest_framework import exceptions... | |
import difflib
from os import error
import sqlite3
import json
from contextlib import closing
from Template import SQL
# from TX74 import TextContent # difflib import here
class Base(object):
'''universal holder for raw data
SQLite: data means a table, type = sql
JSON:
CSV
XML
'''
def __... | |
# encoding: utf-8
from __future__ import unicode_literals
import re
from django.template import Context, loader
from django.utils import datetime_safe, six
from haystack.exceptions import SearchFieldError
from haystack.utils import get_model_ct_tuple
class NOT_PROVIDED:
pass
DATETIME_REGEX = re.compile('^(?P... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2010 British Broadcasting Corporation and Kamaelia Contributors(1)
#
# (1) Kamaelia Contributors are listed in the AUTHORS file and at
# http://www.kamaelia.org/AUTHORS - please extend this file,
# not this notice.
#
# Licensed under the Apache License... | |
# Copyright 2016 United States Government as represented by the Administrator
# of the National Aeronautics and Space Administration. All Rights Reserved.
#
# Portion of this code is Copyright Geoscience Australia, Licensed under the
# Apache License, Version 2.0 (the "License"); you may not use this file
# except in c... | |
# Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | |
from collections import namedtuple
from itertools import groupby
from pathlib import Path
from typing import List, Optional
from urllib.parse import unquote, urlparse
from loguru import logger
from flexget import plugin
from flexget.components.ftp.sftp_client import SftpClient, SftpError
from flexget.config_schema im... | |
"""Test the Z-Wave over MQTT config flow."""
from unittest.mock import patch
import pytest
from homeassistant import config_entries
from homeassistant.components.hassio.handler import HassioAPIError
from homeassistant.components.ozw.config_flow import TITLE
from homeassistant.components.ozw.const import DOMAIN
from ... | |
#
# Copyright (c) SAS Institute 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 w... | |
# Copyright 2013-2014 Amazon.com, Inc. or its affiliates. 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. A copy of the License
# is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "LICENSE.txt"... | |
import time
from collections import namedtuple
from datetime import timedelta
import requests
from django.contrib.sessions.models import Session
from django.db import connection
from django.db.models import Count
from django.db.models import Sum
from django.db.utils import OperationalError
from django.utils import tim... | |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright 2013 Dell 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/lice... | |
# Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""GYP backend that generates Eclipse CDT settings files.
This backend DOES NOT generate Eclipse CDT projects. Instead, it generates XML
files that can be importe... | |
# copyright 2003-2013 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
# contact http://www.logilab.fr/ -- mailto:contact@logilab.fr
#
# This file is part of astroid.
#
# astroid is free software: you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published by the
#... | |
#!/usr/bin/env python
# Licensed to Cloudera, Inc. under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. Cloudera, Inc. licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you ma... | |
from OpenGLCffi.GL import params
@params(api='gl', prms=['n', 'ids'])
def glCreateTransformFeedbacks(n, ids):
pass
@params(api='gl', prms=['xfb', 'index', 'buffer'])
def glTransformFeedbackBufferBase(xfb, index, buffer):
pass
@params(api='gl', prms=['xfb', 'index', 'buffer', 'offset', 'size'])
def glTransformFeed... | |
from panda3d.core import *
from panda3d.direct import *
from DistributedNPCToonBase import *
from direct.gui.DirectGui import *
from panda3d.core import *
from panda3d.direct import *
import NPCToons
from direct.task.Task import Task
from toontown.toonbase import TTLocalizer
from toontown.pets import PetshopGUI
from to... | |
# Copyright 2011 Denali Systems, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... | |
"""Models and database functions for paverave project."""
# import heapq
# import time
from flask_sqlalchemy import SQLAlchemy
from sqlalchemy.orm import relationship
# from sqlalchemy import Table, Column, Integer, ForeignKey
# Do i need both of these?
# from SQLAlchemy import DateTime
import datetime
# import corr... | |
#! /usr/bin/env python
import os
import logging
import ConfigParser
from pbcore.io.FastaIO import FastaReader, FastaWriter
from pbphase.AmpliconAnalyzer import AmpliconAnalyzer
from pbhla.log import initialize_logger
from pbhla.arguments import args, parse_args
from pbhla.fofn import ( create_baxh5_fofn,
... | |
from __future__ import print_function
from dynamicserialize.dstypes.com.raytheon.uf.common.dataquery.requests import RequestConstraint
from shapely.geometry import box, Point
from awips.dataaccess import DataAccessLayer as DAL
from awips.ThriftClient import ThriftRequestException
from awips.test.dafTests import baseDa... | |
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
# (c) 2012 Mike Lewis
import logging; log = logging.getLogger(__name__)
try:
import simplejson as json
except ImportError:
import json
import base64
import hashlib
import hmac
import inspect
import string
import time
import urllib
# 3rd party libraries that might... | |
from micawber import *
from micawber.test_utils import test_pr, test_cache, test_pr_cache, TestProvider, BaseTestCase
class ProviderTestCase(BaseTestCase):
def test_register_unregister(self):
pr = ProviderRegistry()
provider1 = TestProvider('link')
provider2 = TestProvider('link')
... | |
import math
import numpy
import re
import StringIO
import sys
# Script to translate from TLM flat file to U-FLAME lattice.
#
# type name length [m] type [-18: Stripper, -21: Corrector, -28: BPM, -30: Matrix]
# mark LS1_CA01:BPM_D1129 0.000000 -28.000000
#
# t... | |
# Author: Jonas Latt, jonas.latt@flowkit.com
class Cpp2d:
def __init__(self, lattice):
self.lattice = lattice
def collide_boundaries(self):
return {
'var': ['fin', 'nx', 'ny', 'c', 't', 'q', 'wall', 'force', 'omega'],
'code': """
blitz::Array<double,1> feq(q);
... | |
"""Tests for the Z-Wave init."""
import asyncio
from collections import OrderedDict
from datetime import datetime
import unittest
from unittest.mock import MagicMock, patch
import pytest
from pytz import utc
import voluptuous as vol
from homeassistant.bootstrap import async_setup_component
from homeassistant.componen... | |
# 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 2020 Netflix, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in w... | |
"""Tests for the Z-Wave init."""
import asyncio
from collections import OrderedDict
from datetime import datetime
import unittest
import pytest
from pytz import utc
import voluptuous as vol
from homeassistant.bootstrap import async_setup_component
from homeassistant.components import zwave
from homeassistant.componen... | |
#!/usr/bin/python
""" Script for computing observables from a transport+hydro hybrid output """
import argparse
import os.path
import math
import array
from collections import defaultdict
from hic import flow
from hybrid_analysis.event_selection import centrality_filters as cf
from hybrid_analysis.file_reader import h... | |
from toolz import curry
import numpy as np
import pandas as pd
from nfldata.common import process_time_col
from nfldata.lookup import score_before_time
offense_team_stat_columns = [
'rushing_att',
'rushing_yds',
'rushing_tds',
'rushing_twoptm',
'fumbles_lost',
'passing_att',
'passing_cmp',... | |
#!/usr/bin/env python
# coding=utf-8
##########################################################################
from __future__ import print_function
import configobj
import optparse
import os
import shutil
import sys
import tempfile
import traceback
sys.path.append(os.path.abspath(
os.path.join(os.path.dirname(_... | |
"""
flickr.py
Copyright 2004 James Clarke <james@jamesclarke.info>
THIS SOFTWARE IS SUPPLIED WITHOUT WARRANTY OF ANY KIND, AND MAY BE
COPIED, MODIFIED OR DISTRIBUTED IN ANY WAY, AS LONG AS THIS NOTICE
AND ACKNOWLEDGEMENT OF AUTHORSHIP REMAIN.
This TODO list may not include recent API changes.
TODO (see TODO c... | |
"""Support for representing current time of the day as binary sensors."""
from datetime import datetime, timedelta
import logging
import pytz
import voluptuous as vol
from homeassistant.components.binary_sensor import PLATFORM_SCHEMA, BinarySensorDevice
from homeassistant.const import (
CONF_AFTER,
CONF_BEFOR... | |
# 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... | |
import pytest
from . import testUtil as ipwb_test
from ipwb import replay
from time import sleep
import requests
import urllib
# Successful retrieval
# Accurate retrieval
# Comprehensive retrieval of sub-resources
@pytest.mark.parametrize("warc,lookup,has_md_header", [
('HTTP404.warc', 'memento/2020020210000... | |
# python3
# coding=utf-8
# Copyright 2020 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 ... | |
# $Id: universal.py 6112 2009-09-03 07:27:59Z milde $
# Authors: David Goodger <goodger@python.org>; Ueli Schlaepfer
# Copyright: This module has been placed in the public domain.
"""
Transforms needed by most or all documents:
- `Decorations`: Generate a document's header & footer.
- `Messages`: Placement of system ... | |
#
# Copyright (c) 2007 Red Hat
#
# Written by Mauricio Teixeira <mteixeira@webset.net>
#
# This file is part of Smart Package Manager.
#
# Smart Package Manager is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as published
# by the Free Software Foundation; ... | |
# -*- coding: utf-8 -*-
#
# electrical documentation build configuration file, created by
# sphinx-quickstart on Thu Mar 22 15:47:53 2012.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# ... | |
import json
from django.test import TestCase
from django.contrib.auth import get_user_model
from django.test.utils import override_settings
from django.contrib.sites.models import Site
from allauth.socialaccount.models import SocialApp
from allauth.socialaccount.providers.facebook.provider import GRAPH_API_URL
import... | |
#!/usr/bin/env python
#
#
# 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
#... | |
# Copyright (c) 2010-2013 OpenStack Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agree... | |
# Copyright 2002-2009, Distributed Systems Architecture Group, Universidad
# Complutense de Madrid (dsa-research.org)
#
# 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 ... | |
import time
import datetime
from dateutil.parser import parse as datetime_parse
from tzlocal import get_localzone
import pytz
import os
import simplejson as json
import psycopg2
from psycopg2.extensions import AsIs
import argparse
import shapely
from shapely.geometry import mapping, shape, Point
from .pgpointcloud ... | |
from django import forms
from django.db.models import get_model
from lighthouse.models.lapack_eigen import *
from lighthouse.models.lapack_choiceDict import *
#####------- Allow disabling options in a RadioSelect widget ----------#####
from django.utils.safestring import mark_safe
from django.utils.encoding import for... | |
import copy
prefixes = ['mis', 'im', 'un', 'dis']
opposites = {
"absent": "present",
"abundant": "scarce",
"accept": "decline, refuse",
"accurate": "inaccurate",
"admit": "deny",
"advantage": "disadvantage",
"against": "for",
"agree": "disagree",
"alive": "dead",
"all": "none, ... | |
import unittest
import numpy
import six
import chainer
from chainer.backends import cuda
from chainer import functions
from chainer import gradient_check
from chainer import testing
from chainer.testing import attr
@testing.parameterize(*(testing.product({
'shape': [None, (2, 3), (2, 3, 2), (2, 3, 2, 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... | |
# References:
# http://developer.download.nvidia.com/books/HTML/gpugems/gpugems_ch38.html
# https://github.com/PavelDoGreat/WebGL-Fluid-Simulation
# https://www.bilibili.com/video/BV1ZK411H7Hc?p=4
# https://github.com/ShaneFX/GAMES201/tree/master/HW01
import argparse
import numpy as np
import taichi as ti
# How to ... | |
"""Perform regional de-novo assembly calling with cortex_var.
Using a pre-mapped set of reads and BED file of regions, performs de-novo
assembly and variant calling against the reference sequence in each region.
This avoids whole genome costs while gaining the advantage of de-novo
prediction.
http://cortexassembler.s... | |
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under t... | |
from __future__ import division
import numpy as np
from six.moves import range
def normalize(theta, start=0):
"""
Normalize an angle to be in the range :math:`[0, 2\pi]`
Parameters
-----------
theta : float
input angle to normalize
start: float
input start angle (optional, ... | |
# Copyright 2018 NOKIA
#
# 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... | |
from __future__ import absolute_import
from collections import namedtuple
import functools
import zipper
from . import fn
from .fn import curry
def union(inclusions, tree):
targets = functools.reduce(
# for each tree func run it, convert to set
lambda p, f: p | set(f(tree)),
inclusions,... | |
# ==================================================================================================
# Copyright 2015 Twitter, Inc.
# --------------------------------------------------------------------------------------------------
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use thi... | |
"""
This tutorial introduces logistic regression using Theano and stochastic
gradient descent.
Logistic regression is a probabilistic, linear classifier. It is parametrized
by a weight matrix :math:`W` and a bias vector :math:`b`. Classification is
done by projecting data points onto a set of hyperplanes, the distance... | |
from __future__ import absolute_import
import unittest
from chong import chong
from six.moves import range
board = chong.Board()
class IsLegalPlacementTestCase(unittest.TestCase):
def test_simple_placement(self):
p1 = board.positions[(0, 3)]
p2 = board.positions[(7, 4)]
# p1 to move
... | |
# coding: utf-8
# In[1]:
import datetime
import glob
import hashlib
import multiprocessing as mp
import os
import queue
import random
import threading
from functools import partial
import keras.backend.tensorflow_backend as KTF
#import matplotlib.pyplot as plt
import numpy as np
import tensorflow as tf
from keras i... | |
# Copyright 2015 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | |
import os
import xlrd
from xlutils.copy import copy
from datetime import datetime as dt
from PIL import Image
from shutil import rmtree
from pcwg_tool import pcwg_inner_ranges
import numpy as np
template_name = 'Share_1_template.xls'
sheet_map = {'Submission': 0,
'Meta Data': 1,
'Baseline': ... | |
from nose.tools import eq_
from allmychanges.changelog_updater import update_changelog_from_raw_data3
from django.test import Client
from allmychanges.models import (
Changelog,
User,
Issue)
from allmychanges.env import Environment
from allmychanges.utils import first, reverse
from allmychanges.issues impor... | |
# 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... | |
# Copyright 2015 Brocade Communications Systems, Inc
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | |
# Copyright (c) 2021, Apple Inc. All rights reserved.
#
# Use of this source code is governed by a BSD-3-clause license that can be
# found in the LICENSE.txt file or at https://opensource.org/licenses/BSD-3-Clause
from ...models.neural_network import NeuralNetworkBuilder as _NeuralNetworkBuilder
from ...proto import ... | |
"""Author: Arthur Mensch
Benchmarks of sklearn SAGA vs lightning SAGA vs Liblinear. Shows the gain
in using multinomial logistic regression in term of learning time.
"""
import json
import time
from os.path import expanduser
import matplotlib.pyplot as plt
import numpy as np
from sklearn.datasets import fetch_rcv1, ... | |
# Copyright 2014 Objectif Libre
# Copyright 2015 Dot Hill Systems Corp.
# Copyright 2016 Seagate Technology or one of its affiliates
#
# 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 Lic... | |
'''
To run a Bokeh application on a Bokeh server from a single Python script,
pass the script name to ``bokeh serve`` on the command line:
.. code-block:: sh
bokeh serve app_script.py
By default, the Bokeh application will be served by the Bokeh server on a
default port ({DEFAULT_PORT}) at localhost, under the ... | |
# 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
#
# Unless required by applicable law or agree... | |
import numpy as np
from scipy.constants import pi
from numpy.fft import fftshift
from scipy.fftpack import fft, ifft
from six.moves import builtins
from cython_files.cython_integrand import *
from time import time
import sys
from numpy.testing import assert_allclose
import pickle as pl
#from scipy.fftpack import fft... | |
"""The tests for the openalpr cloud platform."""
import asyncio
from homeassistant.components import camera, image_processing as ip
from homeassistant.components.openalpr_cloud.image_processing import OPENALPR_API_URL
from homeassistant.core import callback
from homeassistant.setup import setup_component
from tests.a... | |
# 3rd party imports
from bidi.algorithm import get_display as apply_bidi
# Django imports
from django.conf import settings
# Project imports
from .base import TestGeneratePdfBase
from .factories import create_voters
from .utils_for_tests import extract_pdf_page, extract_textlines, clean_textlines, unwrap_lines
from .... | |
#!/usr/bin/env python3
from ircbot import IRCBot
from threading import Thread
from concurrent import futures
from time import sleep
import uuid
import re
"""
IRC Bot able to sync with other peers and to know them. Then it can be extended
to support stuff like coordinated searches and so on
"""
class Botsync:
start... | |
import pytest
from mopidy import models
from mopidy_spotify import images
@pytest.fixture
def img_provider(provider):
images._cache = {}
return provider
def test_get_artist_images(web_client_mock, img_provider):
uris = [
"spotify:artist:4FCGgZrVQtcbDFEap3OAb2",
"http://open.spotify.com/... | |
from __future__ import print_function
import sys, hashlib, time, threading, socket, signal, os, re
import random, sqlite3, requests, pickle, feedparser
try:
import queue
except ImportError:
import Queue as queue
try:
import urllib.parse as urlparse
except ImportError:
import urlparse
from . import param, norma... | |
# 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 agreed to in writing, software
# distributed under t... | |
# coding: utf-8
"""
ORCID Member
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501
OpenAPI spec version: Latest
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import si... | |
# Copyright (c) 2016 Huawei Technologies Co., Ltd.
# 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
#
# ... | |
# coding=utf-8
# Copyright 2018 The Google AI Language Team 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 ... | |
# -*- coding: utf-8 -*-
"""
Python advanced pretty printer. This pretty printer is intended to
replace the old `pprint` python module which does not allow developers
to provide their own pretty print callbacks.
This module is based on ruby's `prettyprint.rb` library by `Tanaka Akira`.
Example Usage
-------------
T... | |
from TASSELpy.java.lang.Object import Object
import TASSELpy.net.maizegenetics.matrixalgebra.decomposition.EigenvalueDecomposition
import TASSELpy.net.maizegenetics.matrixalgebra.decomposition.SingularValueDecomposition
from TASSELpy.utils.helper import make_sig
from TASSELpy.utils.Overloading import javaOverload,javaC... | |
"""
Copyright (c) 2015-2019 Red Hat, Inc
All rights reserved.
This software may be modified and distributed under the terms
of the BSD license. See the LICENSE file for details.
"""
from atomic_reactor.core import DockerTasker, retry, RetryGeneratorException, ContainerTasker
from atomic_reactor.util import clone_git... | |
import multiprocessing
from multiprocessing import Process
import logging
import time
import datetime
import subprocess
import psutil
import os
import sys
from cloudscheduler.lib.db_config import Config
class ProcessMonitor:
config = None
processes = {}
process_ids = {}
static_process_ids = {}
dyn... | |
#!/usr/bin/env python
#
# spyne - Copyright (C) Spyne contributors.
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later ve... | |
import random
import numpy as np
import tensorflow as tf
import data_util
emb_init = tf.truncated_normal_initializer(mean=0.0, stddev=0.01)
fc_layer = tf.contrib.layers.fully_connected
class BiGRUModel(object):
def __init__(self,
source_vocab_size,
target_vocab_size,
... | |
# -*- coding: utf-8 -*-
# Copyright 2015 OpenMarket Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable la... | |
"""
MPII Keypoints process functions.
"""
from __future__ import print_function, division
import os
import numpy as np
from dbcollection.datasets import BaseTask, BaseField
from dbcollection.utils.decorators import display_message_processing, display_message_load_annotations
from dbcollection.utils.string_ascii impo... | |
# Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | |
from functools import partial
from menpo.feature import no_op
from menpofit.math import (IIRLRegression, IRLRegression, PCRRegression,
OptimalLinearRegression, OPPRegression)
from menpofit.modelinstance import OrthoPDM
from menpofit.error import euclidean_bb_normalised_error
from menpofit.r... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.