gt stringclasses 1
value | context stringlengths 2.49k 119k |
|---|---|
"""Tests for the Awair sensor platform."""
from homeassistant.components.awair.const import (
API_CO2,
API_HUMID,
API_LUX,
API_PM10,
API_PM25,
API_SCORE,
API_SPL_A,
API_TEMP,
API_VOC,
ATTR_UNIQUE_ID,
DOMAIN,
SENSOR_TYPES,
)
from homeassistant.const import (
ATTR_ICON... | |
from __future__ import unicode_literals
import datetime
import warnings
from django.contrib.admin.templatetags.admin_urls import add_preserved_filters
from django.contrib.admin.utils import (
display_for_field, display_for_value, label_for_field, lookup_field,
)
from django.contrib.admin.views.main import (
A... | |
#!/usr/bin/env python
#
# Copyright 2007 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 o... | |
# (c) 2005 Ian Bicking and contributors; written for Paste (http://pythonpaste.org)
# Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php
import sys
import os
import inspect
import copydir
import command
from paste.util.template import paste_script_template_renderer
class Template(objec... | |
#!/usr/bin/env python
"""html2text: Turn HTML into equivalent Markdown-structured text."""
__version__ = "2.292"
__author__ = "Aaron Swartz (me@aaronsw.com)"
__copyright__ = "(C) 2004-2008 Aaron Swartz. GNU GPL 3."
__contributors__ = ["Martin 'Joey' Schulze", "Ricardo Reyes"]
# TODO:
# Support decoded entities with ... | |
"""
Start playing wtih some of the parts of
https://github.com/hughperkins/neonCl-underconstruction/blob/master/winograd_kernels_cl.py
"""
from __future__ import print_function, division
import time
import string
import random
import jinja2
import argparse
import numpy as np
import pyopencl as cl
import subprocess
impo... | |
# 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 2021 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import absolute_import
import os
import zipfile
from abc import abstractmethod
from contextlib import contextmanager
from pex.common import atomic_directory, is_python_sc... | |
# coding=utf-8
"""
This module, core_server_generator.py, contains the code for the outline of the Core Server.
"""
from code_manager.abstract_definitions.classes import ParentClass
from code_manager.abstract_definitions.classes import ChildClass
from code_manager.abstract_definitions.variables import PassedInStringF... | |
import argparse, json, os, time
from parcellearning import pairgat
from parcellearning.utilities import gnnio
from parcellearning.utilities.early_stop import EarlyStopping
from parcellearning.utilities.batch import partition_graphs
from parcellearning.utilities.load import load_schema
from shutil import copyfile
from... | |
# Copyright 2020 DeepMind Technologies Limited.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | |
#!/usr/bin/env python
"""
check_graphite.py
~~~~~~~
:copyright: (c) 2012 DISQUS.
:license: Apache License 2.0, see LICENSE for more details.
"""
import json
import optparse
import urllib
import urllib2
import sys
from numbers import Real
NAGIOS_STATUSES = {
'OK': 0,
'WARNING': 1,
'CRITICAL': 2,
'UNK... | |
# coding: utf-8
"""
DocuSign REST API
The DocuSign REST API provides you with a powerful, convenient, and simple Web services API for interacting with DocuSign. # noqa: E501
OpenAPI spec version: v2.1
Contact: devcenter@docusign.com
Generated by: https://github.com/swagger-api/swagger-codegen.gi... | |
import petsc4py
import sys
petsc4py.init(sys.argv)
from petsc4py import PETSc
import mshr
from dolfin import *
import sympy as sy
import numpy as np
import ExactSol
import MatrixOperations as MO
import CheckPetsc4py as CP
from dolfin import __version__
import MaxwellPrecond as MP
import StokesPrecond
import time
de... | |
#
# 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... | |
# 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 ... | |
"""
Thomson Reuters Data Citation Index service for registry objects.
"""
"""
The TR DCI service relies on a table "registry_object_citations".
The service operates as follows:
1. Get the registry objects to look up from the database.
2. Look up the registry objects in TR DCI, updating each one's
citation data in ... | |
import re
import sys
import copy
import socket
from datetime import datetime
from decimal import Decimal
from collections import Mapping, Container
if sys.version_info[0] == 3:
_str_type = str
_int_types = (int,)
else:
_str_type = basestring
_int_types = (int, long)
class SchemaError(ValueError):
... | |
# coding: utf-8
# # Extract text of Admit Notes
# #### Start with patient MRN and the Admission Date.
# #### This requires 4 sequential sql pulls:
# 1) Find the PatientEncounterID for the hospital admission.
# 2) Find the set of NoteIDs associated with the ZPatientID (PatientEncounterID missing from Notes.
# 3) Find ... | |
''' graph_controllers
routes related to the graphs
'''
import datetime
import json
from flask import (render_template, request, flash, redirect, url_for, session
, abort)
from mongoengine import *
from application import app
# view controls
from decorators import *
# mongoengine models
from models import *
# som... | |
# 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 pandac.PandaModules import Vec3, Vec4, Point3, TextNode, VBase4
from direct.gui.DirectGui import DGG, DirectFrame, DirectButton, DirectLabel, DirectScrolledList, DirectCheckButton
from direct.gui import DirectGuiGlobals
from direct.showbase import DirectObject
from direct.showbase import PythonUtil
from toontown.t... | |
import os
import sys
import getopt
import Common
import AutoGemmParameters
import KernelParameters
################################################################################
# SINC - Kernel Source Includes
################################################################################
class KernelSourceIncludes... | |
"""Support for MQTT fans."""
import logging
import voluptuous as vol
from homeassistant.components import fan, mqtt
from homeassistant.components.fan import (
ATTR_SPEED,
SPEED_HIGH,
SPEED_LOW,
SPEED_MEDIUM,
SPEED_OFF,
SUPPORT_OSCILLATE,
SUPPORT_SET_SPEED,
FanEntity,
)
from homeassista... | |
#
# 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 2015 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agre... | |
"""
kombu.transport.pyamqplib
=========================
amqplib transport.
:copyright: (c) 2009 - 2011 by Ask Solem.
:license: BSD, see LICENSE for more details.
"""
import socket
try:
from ssl import SSLError
except ImportError:
class SSLError(Exception): # noqa
pass
from amqplib import client_0_... | |
import functools
from django import http
from django.shortcuts import (get_list_or_404, get_object_or_404, redirect,
render)
from django.views.decorators.vary import vary_on_headers
import commonware.log
import session_csrf
from mobility.decorators import mobilized
from tower import uget... | |
#!python
"""
AndroidTabs
===========
AndroidTabs try to reproduce the behaviours of Android Tabs.
It allow you to create your own custom tabbed panel
with an animated tab indicator in a easy way.
Just create your tabs that must inherit from AndroidTabsBase
and add them to an AndroidTabs instance.
class MyTab(BoxLayou... | |
# vim:fileencoding=utf-8:noet
from __future__ import (unicode_literals, division, absolute_import, print_function)
import re
import os
import socket
from powerline.lib.url import urllib_read
from powerline.lib.threaded import ThreadedSegment, KwThreadedSegment
from powerline.lib.monotonic import monotonic
from powerl... | |
# Copyright (c) 2010 OpenStack Foundation
# 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 complianc... | |
# Copyright 2018 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... | |
"""Test case implementation"""
import sys
import difflib
import pprint
import re
import unittest
import warnings
from unittest2 import result
from unittest2.util import (
safe_repr, safe_str, strclass,
unorderable_list_difference
)
from unittest2.compatibility import wraps
__unittest = True
DIFF_OMITTED =... | |
# -*- 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... | |
from pgmpy.exceptions import CardinalityError
from pgmpy.factors import Factor
from pgmpy.models import MarkovModel
from pgmpy.tests import help_functions as hf
import numpy as np
import unittest
class TestMarkovModelCreation(unittest.TestCase):
def setUp(self):
self.graph = MarkovModel()
def test_cl... | |
# informix.py
# Copyright (C) 2005,2006, 2007, 2008 Michael Bayer mike_mp@zzzcomputing.com
#
# coding: gbk
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
import datetime
from sqlalchemy import sql, schema, exceptions, pool, util
from s... | |
# Copyright 2021 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 or agreed to in writing, ... | |
import warnings
import numpy as np
from numpy import asarray_chkfinite, single
from misc import LinAlgError, _datacopied
from lapack import get_lapack_funcs
__all__ = ['qz']
_double_precision = ['i','l','d']
def _select_function(sort, typ):
if typ in ['F','D']:
if callable(sort):
#assume th... | |
# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0
# For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt
"""File wrangling."""
import fnmatch
import ntpath
import os
import os.path
import posixpath
import re
import sys
from coverage import env
from coverage.backward ... | |
# -*- coding: utf-8 -*-
"""
pygments.cmdline
~~~~~~~~~~~~~~~~
Command line interface.
:copyright: Copyright 2006-2020 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import os
import sys
import getopt
from textwrap import dedent
from pygments import __version__, hi... | |
"""Compressed Block Sparse Row matrix format"""
from __future__ import division, print_function, absolute_import
__docformat__ = "restructuredtext en"
__all__ = ['bsr_matrix', 'isspmatrix_bsr']
from warnings import warn
import numpy as np
from .data import _data_matrix, _minmax_mixin
from .compressed import _cs_m... | |
import unittest
from django.core.exceptions import FieldError
from django.db import IntegrityError, connection, transaction
from django.db.models import CharField, Count, F, IntegerField, Max
from django.db.models.functions import Abs, Concat, Lower
from django.test import TestCase
from django.test.utils import regist... | |
""" Abstractions for handling resources via Amazon Web Services (AWS) API
The intention of these utilities is to allow other infrastructure to
interact with AWS without having to understand AWS APIs. Additionally,
this module provides helper functions for the most common queries required
to manipulate and test a DC/OS... | |
# 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
# distrib... | |
# This file is dual licensed under the terms of the Apache License, Version
# 2.0, and the BSD License. See the LICENSE file in the root of this repository
# for complete details.
from __future__ import absolute_import, division, print_function
import abc
import datetime
from enum import Enum
import six
from crypto... | |
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by app... | |
# sqlalchemy/exc.py
# Copyright (C) 2005-2011 the SQLAlchemy authors and contributors <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""Exceptions used with SQLAlchemy.
The base exception class is :class:`.SQLAlchemy... | |
# (C) Datadog, Inc. 2010-2016
# All rights reserved
# Licensed under Simplified BSD License (see LICENSE)
'''
Monitor the Windows Event Log
'''
# stdlib
import calendar
from datetime import datetime, timedelta
# project
from checks.wmi_check import WinWMICheck, to_time, from_time
from utils.containers import hash_mut... | |
"""This module is the heart of PyEcore. It defines all the basic concepts that
are common to EMF-Java and PyEcore (EObject/EClass...).
It defines the basic classes and behavior for PyEcore implementation:
* EObject
* EPackage
* EClass
* EAttribute
* EReference
* EDataType
These concepts are enough if dynamic metamode... | |
# -*- coding: utf-8 -*-
"""
Tests of the neo.core.irregularlysampledsignal.IrregularySampledSignal class
"""
import unittest
import os
import pickle
import warnings
from copy import deepcopy
import numpy as np
import quantities as pq
from numpy.testing import assert_array_equal
from neo.core.dataobject import Array... | |
# 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 use ... | |
import mock
import unittest
from bin.commands import snapshot
class TestSnapshotSnapshot(unittest.TestCase):
def setUp(self):
# store private methods so they can be restored after tests that mock them
self._stash_buffer = snapshot._stash_buffer
def tearDown(self):
snapshot._stash_bu... | |
#
# 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 2011 Isaku Yamahata <yamahata@valinux co jp>
# 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... | |
"""
@brief test log(time=2s)
@author Xavier Dupre
"""
import sys
import os
import unittest
from pyquickhelper.sphinxext.revealjs.directives import heading
from pyquickhelper.sphinxext.revealjs.directives import RevealjsDirective
from pyquickhelper.sphinxext.revealjs.directives import RvNoteDirective
from pyq... | |
#!/usr/bin/env python
"""
Copyright (c) 2015-2018 Alex Forencich
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,... | |
# Copyright 2015 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | |
########
# Copyright (c) 2014 GigaSpaces Technologies 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
#
# Unless... | |
from __future__ import unicode_literals
import json
import logging
import requests
import six
from six.moves.urllib.parse import quote
from globus_sdk import config, exc
from globus_sdk.version import __version__
from globus_sdk.response import GlobusHTTPResponse
class ClientLogAdapter(logging.LoggerAdapter):
"... | |
import re
import math
import glob
import pickle
import sys
import numpy as np
from peptide import Peptide
from xlink import XLink
from match import Match
from mzxmlreader import MZXMLReader
from fastareader import FastaReader
from random import shuffle
def logit(coef, x):
v = x
x = [1]
x.extend(v)
val = 0
for i... | |
from datetime import datetime
from django.core.cache import cache
from django.core.urlresolvers import reverse
from django.conf import settings
from django.db.models import permalink, Count
from django.template.defaultfilters import truncatechars
from lxml import etree
import json
import logging
import os
import reques... | |
"""
Dialogs that query users and verify the answer before accepting.
Query is the generic base class for a popup dialog.
The user must either enter a valid answer or close the dialog.
Entries are validated when <Return> is entered or [Ok] is clicked.
Entries are ignored when [Cancel] or [X] are clicked.
The 'return va... | |
#!/usr/bin/env python
import google
import numpy as np
import os.path
import tensorflow as tf
from tensorflow.python.ops import array_ops
from tensorflow.python.ops import embedding_ops
from tensorflow.python.ops import gru_ops
from tensorflow.python.ops import math_ops
from tensorflow.python.ops import nn_ops
from te... | |
# Copyright (c) 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 agreed to in writ... | |
"""Color util methods."""
from __future__ import annotations
import colorsys
import math
from typing import NamedTuple
import attr
# mypy: disallow-any-generics
class RGBColor(NamedTuple):
"""RGB hex values."""
r: int
g: int
b: int
# Official CSS3 colors from w3.org:
# https://www.w3.org/TR/2010... | |
from collections import namedtuple
import numpy
from numpy.linalg import norm
from sklearn import svm
import sklearn
from constants import CORE_COMBO, ARYL, XGROUPS, RGROUPS
from structure import from_data
from data.models import Predictor
ARYL = [x for x in ARYL if len(x) == 1]
XGROUPS = XGROUPS[:-1]
RGROUPS = RGR... | |
#
# 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 (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... | |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import tensorflow as tf
import pandas as pd
import numpy as np
import re
import os
from tensorflow.python.keras.preprocessing import text
from tensorflow.python.keras import models
from tensorflow.python.keras... | |
"""
Tasks viewed from the mturk website nested in an iframe
"""
import json
import random
import datetime
from ua_parser import user_agent_parser
from django.conf import settings
from django.core.context_processors import csrf
from django.views.decorators.http import require_POST
from django.views.decorators.csrf imp... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
:mod:`cache` --- Data caching facility
======================================
"""
__docformat__ = "restructuredtext en"
import sys
import sqlite3
import importlib
from time import time
try:
import cPickle as pickle
except ImportError:
import pickle
# FI... | |
"""Test the module nearmiss."""
# Authors: Guillaume Lemaitre <g.lemaitre58@gmail.com>
# Christos Aridas
# License: MIT
import pytest
import numpy as np
from sklearn.utils._testing import assert_array_equal
from sklearn.neighbors import NearestNeighbors
from imblearn.under_sampling import NearMiss
X = np.a... | |
# 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 ag... | |
"""Test the Tradfri config flow."""
from unittest.mock import patch
import pytest
from homeassistant import data_entry_flow
from homeassistant.components.tradfri import config_flow
from tests.common import MockConfigEntry, mock_coro
@pytest.fixture
def mock_auth():
"""Mock authenticate."""
with patch(
... | |
# Software License Agreement (BSD License)
#
# Copyright (c) 2013, Willow Garage, 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... | |
from Child import Child
from Node import Node # noqa: I201
STMT_NODES = [
# continue-stmt -> 'continue' label? ';'?
Node('ContinueStmt', kind='Stmt',
children=[
Child('ContinueKeyword', kind='ContinueToken'),
Child('Label', kind='IdentifierToken',
is_optio... | |
"""
missing types & inference
"""
from functools import partial
import numpy as np
from pandas._config import get_option
from pandas._libs import lib
import pandas._libs.missing as libmissing
from pandas._libs.tslibs import NaT, iNaT
from pandas._typing import DtypeObj
from pandas.core.dtypes.common import (
DT... | |
# Copyright 2012 OpenStack Foundation
# Copyright 2013 IBM Corp.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LIC... | |
from typing import Sequence, List, Optional, Union, Any, Dict
from enum import Enum
from numbers import Number
import numpy as np
import datetime
from pydantic import BaseModel, Field
from .config import SweepConfig
from ._types import floating
class RunState(str, Enum):
pending = "pending"
running = "runnin... | |
# encoding: utf-8
"""
Plot-related objects. A plot is known as a chart group in the MS API. A chart
can have more than one plot overlayed on each other, such as a line plot
layered over a bar plot.
"""
from __future__ import absolute_import, print_function, unicode_literals
from ..enum.chart import XL_CHART_TYPE as ... | |
'''
encounter_db.py
Provides methods to write a list of stellar close encounters to files in a systematic way.
The provided output is meant to be later loaded in a systematic way.
Each star cluster run is saved in a directory, categorized by the cluster parameters.
To load multiple runs, `os.walk` may be used.
'''
i... | |
#!/usr/bin/env python
"""
mbed SDK
Copyright (c) 2011-2013 ARM Limited
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable... | |
# -*- coding: utf-8 -*-
# The LLVM Compiler Infrastructure
#
# This file is distributed under the University of Illinois Open Source
# License. See LICENSE.TXT for details.
""" This module is responsible to run the analyzer commands. """
import re
import os
import os.path
import tempfile
import fun... | |
# Copyright (c) 2010 Friedrich Romstedt <friedrichromstedt@gmail.com>
# See also <www.friedrichromstedt.org> (if e-mail has changed)
#
# 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... | |
#this program corresponds to special.py
from decimal import Decimal
import types
from numpy.testing import *
import scipy.signal as signal
from scipy.signal import lfilter, correlate, convolve, convolve2d
from numpy import array, arange
import numpy as np
class _TestConvolve(TestCase):
def test_basic(self):
... | |
#!/usr/bin/env python
"""Library for processing of artifacts.
This file contains non-GRR specific pieces of artifact processing and is
intended to end up as an independent library.
"""
import re
from typing import Iterable
from typing import Text
from grr_response_core.lib import interpolation
from grr_response_co... | |
"Supporting objects and functions to convert Matplotlib objects into Bokeh."
#-----------------------------------------------------------------------------
# Copyright (c) 2012 - 2014, Continuum Analytics, Inc. All rights reserved.
#
# Powered by the Bokeh Development Team.
#
# The full license is in the file LICENSE.t... | |
from __future__ import division, absolute_import, print_function
__all__ = ['column_stack', 'row_stack', 'dstack', 'array_split', 'split', 'hsplit',
'vsplit', 'dsplit', 'apply_over_axes', 'expand_dims',
'apply_along_axis', 'kron', 'tile', 'get_array_wrap']
import warnings
import numpy.core.nume... | |
#!/usr/bin/env python
"""
STK500v2 protocol implementation for programming AVR chips.
The STK500v2 protocol is used by the ArduinoMega2560 and a few other Arduino platforms to load firmware.
"""
__copyright__ = "Copyright (C) 2013 David Braam - Released under terms of the AGPLv3 License"
import os, struct, sys, time
f... | |
#!/usr/bin/env python
# pylint: disable=missing-docstring
# flake8: noqa: T001
# ___ ___ _ _ ___ ___ _ _____ ___ ___
# / __| __| \| | __| _ \ /_\_ _| __| \
# | (_ | _|| .` | _|| / / _ \| | | _|| |) |
# \___|___|_|\_|___|_|_\/_/_\_\_|_|___|___/_ _____
# | \ / _ \ | \| |/ _ \_ _| | __| \_ ... | |
#!/usr/bin/python
import argparse
import collections
import ctypes
import math
import opcodes
import sys
class ParseError(Exception):
def __init__(self, value):
self.value = value
def __str__(self):
return '%s' % (self.value)
class Parser:
__MAGIC_JUMP = 'FIXME'
def __init__(self, d... | |
import sys
import py, pytest
import _pytest.assertion as plugin
from _pytest.assertion import reinterpret, util
needsnewassert = pytest.mark.skipif("sys.version_info < (2,6)")
def interpret(expr):
return reinterpret.reinterpret(expr, py.code.Frame(sys._getframe(1)))
class TestBinReprIntegration:
pytestmark ... | |
from __future__ import unicode_literals
from future.builtins import str
from django import VERSION
from django.contrib.auth.models import AnonymousUser
from django.db import connection
from django.template import Context, Template
from django.test.utils import override_settings
from mezzanine.conf import settings
fro... | |
"""
Tests for the CSScheme dumper
"""
import pytest
from ..tinycss.css21 import Stylesheet, Declaration, RuleSet
from ..tinycss.token_data import Token
from ..tinycss.tokenizer import tokenize_grouped
from .. import dumper
from ..dumper import DumpError
from ..parser import StringRule
from . import jsonify
# ... | |
import datetime
from io import BytesIO
import re
from warnings import catch_warnings
import numpy as np
import pytest
from pandas import (
CategoricalIndex,
DataFrame,
HDFStore,
MultiIndex,
_testing as tm,
date_range,
read_hdf,
)
from pandas.tests.io.pytables.common import (
ensure_cle... | |
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import os
import random
import logging
from collections import Counter
import torch
class EM:
"""
EM algorithm used to quantize the... | |
#!/usr/bin/env python2.7
# -*- coding: utf-8 -*-
"""
Unit Test Cases for :mod:`tvecs.vector_space_mapper.vector_space_mapper`.
.. py:currentmodule:: tvecs.vector_space_mapper.vector_space_mapper
"""
import os
import pytest
import random
from tvecs.model_generator import model_generator as mod
from tvecs.bilingual_ge... | |
import datetime
import logging
import re
from django.utils import timezone
from django.contrib.auth import get_user_model
from django.core.exceptions import ValidationError
from django.utils.translation import ugettext_lazy as _
from django_auth_policy import signals
from django_auth_policy.models import LoginAttempt... | |
"""
SleekXMPP: The Sleek XMPP Library
Copyright (C) 2010 Nathanael C. Fritz
This file is part of SleekXMPP.
See the file LICENSE for copying permission.
"""
from __future__ import with_statement, unicode_literals
import copy
import logging
import socket as Socket
import ssl
import sys
import threadi... | |
"""
Support for Google - Calendar Event Devices.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/google/
NOTE TO OTHER DEVELOPERS: IF YOU ADD MORE SCOPES TO THE OAUTH THAN JUST
CALENDAR THEN USERS WILL NEED TO DELETE THEIR TOKEN_FILE. THEY WILL LOSE THEI... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.