gt stringclasses 1
value | context stringlengths 2.49k 119k |
|---|---|
"""
Implements a client class to query the
`Deezer API <https://developers.deezer.com/api>`_
"""
from __future__ import annotations
from typing import Any
import requests
from deezer.exceptions import (
DeezerErrorResponse,
DeezerHTTPError,
DeezerUnknownResource,
)
from deezer.pagination import Paginated... | |
#!/usr/bin/env python
#
# Copyright 2010 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... | |
# Copyright 2014 Hewlett-Packard Development Company, L.P.
# 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... | |
# Copyright (C) 2012 Nippon Telegraph and Telephone 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 appli... | |
import secrets
import site
import sys
import textwrap
import pytest
from collections import defaultdict
from dataclasses import dataclass, field, asdict
from pathlib import Path
from typing import Any, List, Dict, Tuple
from unittest.mock import patch
from httpie.context import Environment
from httpie.compat import ... | |
"""
Module for serialization/deserialization and handling of KNX addresses.
The module can handle:
* individual addresses of devices.
* (logical) group addresses.
* xknx internal group addresses.
The module supports all different writings of group addresses:
* 3rn level: "1/2/3"
* 2nd level: "1/2"
* Free format: "1... | |
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
"""Use blog post test to test user permissions logic"""
import frappe
import frappe.defaults
import unittest
import frappe.model.meta
from frappe.permissions import (add_user_per... | |
# Copyright 2020 The Oppia 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 applicable ... | |
# Copyright 2013-2014 MongoDB, 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 writin... | |
# -*- coding: utf-8 -*-
"""
Created on Mon Oct 17 13:29:13 2016
@author: Adam Ek
"""
from WSM import DataReader
from WSM import RandomVectorizer
from WSM import TermRelevance
from WSM import Contexter
from WSM import Similarity
from WSM import DataOptions
import sys
def main():
print('Welcome to Distributial Sem... | |
# -*- coding: utf-8 -*-
from __future__ import absolute_import
import unittest
from datetime import datetime
from pytz import UTC
from bqdm.action.table import TableAction
from bqdm.model.schema import BigQuerySchemaField
from bqdm.model.table import BigQueryTable
class TestTableAction(unittest.TestCase):
def... | |
import os
from .intstream import from_bytes
from .Curve import Curve
from .Point import Point
from .rfc6979 import deterministic_generate_k
class Generator(Curve, Point):
"""
A Generator is a specific point on an elliptic curve that defines a `trapdoor
function <https://en.wikipedia.org/wiki/Trapdoor_f... | |
#!/usr/bin/env python
# Copyright 2017 VMware, 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 ... | |
# 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... | |
#!/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
# "L... | |
# Copyright (c) 2016 EMC Corporation
# 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 requir... | |
"""Models for stories and story sections"""
import time
from datetime import datetime
import bleach
from django.conf import settings
from django.contrib.auth.models import User
from django.core import urlresolvers
from django.core.cache import cache
from django.db import models
from django.db.models import Q
from djan... | |
import base64
import datetime
import gnupg
import httplib
import json
import os
import random
import requests
import sys
import tempfile
from ConfigParser import ConfigParser
from logging_settings import get_logger
from psycopg2 import IntegrityError
from subprocess import Popen, PIPE
from M2Crypto import DSA, BIO
sy... | |
import json
import optparse
import os
import sqlite3
import sys
version = "0.5.0"
gene_count = 0
def asbool(val):
if isinstance(val, str):
val_lower = val.strip().lower()
if val_lower in ('true', '1'):
return True
elif val_lower in ('false', '0'):
return False
... | |
# 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 th... | |
#!/usr/bin/env python3.8
'Calculations.'
import numpy as np
import cv2 as cv
from process_image import shape, odd, rotate
from images import Images
from angle import Angle
class Calculate():
'Calculate results.'
def __init__(self, core, input_images):
self.settings = core.settings.settings
... | |
# from future import standard_library
# standard_library.install_aliases()
try:
from builtins import object
except ImportError:
pass
import struct
import io
import logging
import zlib
import six
from Crypto import Random
from Crypto.Hash import SHA
from Crypto.Util.number import bytes_to_long
from Crypto.Util... | |
# Copyright 2010 OpenStack Foundation
# Copyright 2013 Hewlett-Packard Development Company, L.P.
# 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
#
# ht... | |
"""
Generate Carbon Diamond Lattice
@author: Kenny Jolley
Derived from similar form by Chris Scott
"""
from __future__ import absolute_import
from __future__ import unicode_literals
import logging
import numpy as np
from ..system.lattice import Lattice
from . import lattice_gen_utils
from six.moves import range
... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
proxy.py
~~~~~~~~
HTTP Proxy Server in Python.
:copyright: (c) 2013-2018 by Abhinav Singh.
:license: BSD, see LICENSE for more details.
"""
import os
import sys
import errno
import base64
import socket
import select
import logging
import argparse
i... | |
# Copyright 2014 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 require... | |
import datetime
import warnings
from django.forms.utils import flatatt, pretty_name
from django.forms.widgets import Textarea, TextInput
from django.utils.deprecation import RemovedInDjango21Warning
from django.utils.encoding import force_text
from django.utils.functional import cached_property
from django.utils.html ... | |
#!/usr/bin/env python3
# Copyright (c) 2014 Wladimir J. van der Laan
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
'''
A script to check that the executables produced by gitian only contain
certain symbols and are only linked aga... | |
import re
UNITS = [
'GRAM',
'KILOGRAM',
'OUNCE',
'POUND',
'TEASPOON',
'TABLESPOON',
'GALLON',
'LITER'
]
UNIT_MAP = {
'lb': 'POUND',
'Lb': 'POUND',
'LB': 'POUND',
'oz': 'OUNCE',
'Oz': 'OUNCE',
'OZ': 'OUNCE',
'g': 'GRAM',
'kg': 'KILOGRAM',
't': 'TEASPO... | |
"""Define random number Type (`RandomStateType`) and Op (`RandomFunction`)."""
from __future__ import absolute_import, print_function, division
import sys
from copy import copy
import numpy
from six import string_types
from six.moves import reduce, xrange
# local imports
import theano
from theano import tensor
from ... | |
# *****************************************************************************
#
# 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
#
# ... | |
import json
from collections import OrderedDict
from datetime import date, datetime, timedelta
from django.conf import settings
from django.core.cache import cache
from django.db import models
from django.db.models import Q, Sum
from django.template import loader
from django.utils.translation import ugettext, ugettex... | |
# -*- coding: utf-8 -*-
import json
import logging
import os
import socket
import sys
import tempfile
import traceback
import urllib2
from django.conf import settings
from django.core.files.storage import default_storage as storage
from django.core.management import call_command
from celeryutils import task
from djan... | |
import core.modules.module_registry
import core.modules.vistrails_module
from logging import debug, warn
from core.vistrail.connection import Connection
from core.vistrail.port import Port
from PyQt4 import QtGui, QtCore
import api
import vcs
import os
cdat_id = "edu.utah.sci.vistrails.cdat"
# Module names
# Note: op... | |
# Copyright 2014 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 imp
import os.path
import sys
def _GetDirAbove(dirname):
"""Returns the directory "above" this file containing |dirname| (which must
also be "abo... | |
# -*- coding: utf-8 -*-
########################################################################
#
# License: BSD
# Created: December 15, 2003
# Author: Francesc Alted - faltet@pytables.com
#
# $Id$
#
########################################################################
"""Here is defined the EArray class."""
imp... | |
'''
Video
=====
The :class:`Video` widget is used to display video files and streams.
Depending on your Video core provider, platform, and plugins, you will
be able to play different formats. For example, the pygame video
provider only supports MPEG1 on Linux and OSX. GStreamer is more
versatile, and can read many vid... | |
import collections
import warnings
try:
import ssl
except ImportError: # pragma: no cover
ssl = None
from . import compat
from . import protocols
from . import transports
from .log import logger
def _create_transport_context(server_side, server_hostname):
if server_side:
raise ValueError('Server... | |
# -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding M2M table for field badges on 'UserProfile'
m2m_table_name = db.shorten_name(u'storybase_user_userp... | |
"""
corpkit: process CONLL formatted data
"""
def parse_conll(f,
first_time=False,
just_meta=False,
usecols=None):
"""
Make a pandas.DataFrame with metadata from a CONLL-U file
Args:
f (str): Filepath
first_time (bool, optional): If True,... | |
# Pybot discord-unstable build
# Misha Larionov and Nicholas Carr
# github.com/MishaLarionov/pybot/tree/discord-unstable
# Licensed under MIT License
# See license.txt for full license
# TODO:
# Move responses into a separate .py file
print("Loading... (This may take a while)")
#Import all the stuff
import cfg, time... | |
# -*- 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... | |
#!/usr/bin/python
# Copyright (c) 2011 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
''' Runs various chrome tests through heapcheck_test.py.
Most of this code is copied from ../valgrind/chrome_tests.py.
TODO(glider): ... | |
#!/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
"License");... | |
import datetime
import decimal
from django.contrib.auth import get_user_model
from django.test import TestCase
from django.utils import timezone
from djstripe.models import Event, Transfer, Customer, CurrentSubscription, Charge
from tests.test_transfer import TRANSFER_CREATED_TEST_DATA, TRANSFER_CREATED_TEST_DATA2
... | |
"""Collate the README.md files of all repos generated from a template, into a single Markdown file
that contains a section for each repo.
Each individual README is prepended with a header that includes the GitHub login, as inferred from the name of the
generated repo. If the README already begins with a header, the lo... | |
#! /usr/bin/env python
"""
Parse throughput data for RBAR from trace files.
Revision Info
=============
* $LastChangedBy: mandke $
* $LastChangedDate: 2011-10-21 15:51:37 -0500 (Fri, 21 Oct 2011) $
* $LastChangedRevision: 5246 $
:author: Ketan Mandke <kmandke@mail.utexas.edu>
:copyright:
Copyright 2009 The Uni... | |
"""
Contains GUI forms for the slice filter.
"""
from __future__ import absolute_import
from __future__ import unicode_literals
from PySide2 import QtCore, QtWidgets
from . import base
from ...rendering import slicePlane
from ...filtering.filters import sliceFilter
################################################... | |
#
# 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... | |
#!/usr/bin/env python
''' unit test suite for multi-record set features of rdbhost, and the nextset
cursor method of rdbhdb.
'''
import unittest
import time
import sys, os
import accounts
sys.path.insert(0, '..\lib')
from rdbhdb import rdbhdb
need_version = '0.11.0'
class test_nextset(unittest.TestCase):
... | |
#!/usr/bin/env python
# coding: utf-8
from __future__ import unicode_literals
import mock
import os
import unittest
from mkdocs import nav, legacy
from mkdocs.exceptions import ConfigurationError
from mkdocs.tests.base import dedent
class SiteNavigationTests(unittest.TestCase):
def test_simple_toc(self):
... | |
# Copyright 2009-Present The Graphite Development Team
# Copyright 2008 Orbitz WorldWide
#
# 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
#
# U... | |
# Python Tools for Visual Studio
# Copyright(c) Microsoft Corporation
# 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
#
# THI... | |
# 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 ... | |
# Plots are currently included as images, because example is too big to
# run on readthedocs servers
"""
Multiatlas Segmentation
========================
This example shows how to perform multi-atlas segmentation based on MP2RAGE
data by performing the following steps:
1. Downloading three open MP2RAGE datasets using... | |
# Copyright 2008-2012 Nokia Siemens Networks Oyj
#
# 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... | |
# 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... | |
import re
from django.conf import settings
import six
from rest_framework import exceptions, serializers
from olympia import amo
from olympia.accounts.serializers import BaseUserSerializer
from olympia.amo.templatetags.jinja_helpers import absolutify
from olympia.amo.urlresolvers import get_outgoing_url, reverse
fr... | |
# Parser, based on John Aycock's SPARK examples
from spark import GenericParser
from spark import GenericASTBuilder
from ast import AST
class GrammaticalError(Exception):
def __init__(self, string):
self.string = string
def __str__(self):
return self.string
class CoreParser(GenericParser):
... | |
import base64
import datetime
import logging
import urllib
from functools import wraps
from io import BytesIO
from typing import Callable, Dict, Optional, Sequence, Tuple, TypeVar, Union, cast, overload
import django_otp
from django.conf import settings
from django.contrib.auth import REDIRECT_FIELD_NAME
from django.c... | |
import sys
import cPickle as pickle
import networkx as nx
import string
from collections import OrderedDict
import pdb
def traverse_depth_first(concept_nx_graph, parent=None):
node_list = [] #list of pairs (concept_instance, concept_var_name) e.g. ('establish-01', 'e')
if parent == None:
parent = nx.topological_so... | |
import os
import tempfile
import base64
import StringIO
import random
import unittest
from migration_manager import api
from migration_manager import serializer
from migration_manager import repository
from migration_manager import transaction
FOLDER = os.path.dirname(__file__)
REPO_DIR = os.path.join(FOLDER, "_tes... | |
# -*- coding: utf-8 -*-
"""
activity.py
~~~~~~~~~~~~
This module implements the Activity HPE OneView REST API
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from builtins import filter
from future import standar... | |
# -*- coding: utf-8 -*-
"""Test walls."""
import flickrapi
import py
import pytest
import requests
import walls
try:
# Python 3.x
from configparser import ConfigParser
except ImportError:
# Python 2.x
from ConfigParser import SafeConfigParser as ConfigParser
@pytest.fixture
def config(tmpdir):
f ... | |
# -*- coding: utf-8 -*-
"""
Created on Wed Mar 12 12:48:33 2014
@author: ibackus
"""
# External modules
import pynbody
SimArray = pynbody.array.SimArray
import numpy as np
import os
import cPickle as pickle
# ICgen modules
import calc_rho_zr
import calc_temp
import pos_class
import make_snapshot
import ICgen_settings... | |
#
# ReportLab QRCode widget
#
# Ported from the Javascript library QRCode for Javascript by Sam Curren
#
# URL: http://www.d-project.com/
# http://d-project.googlecode.com/svn/trunk/misc/qrcode/js/qrcode.js
# qrcode.js is copyright (c) 2009 Kazuhiko Arase
#
# Original ReportLab module by German M. Bravo
#
# modified an... | |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Copyright 2012 Nebula, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# no... | |
"""Module for interactive demos using IPython.
This module implements a few classes for running Python scripts interactively
in IPython for demonstrations. With very simple markup (a few tags in
comments), you can control points where the script stops executing and returns
control to IPython.
Provided classes
=====... | |
from _pydevd_bundle.pydevd_constants import dict_contains
import sys
from _pydevd_bundle import pydevd_xml
from os.path import basename
import traceback
try:
from urllib import quote, quote_plus, unquote, unquote_plus
except:
from urllib.parse import quote, quote_plus, unquote, unquote_plus #@Reimport @Unresol... | |
import os
import json
import enum
from Tests.scripts.utils.content_packs_util import IGNORED_FILES
CONTENT_ROOT_PATH = os.path.abspath(os.path.join(__file__, '../../..')) # full path to content root repo
PACKS_FOLDER = "Packs" # name of base packs folder inside content repo
PACKS_FULL_PATH = os.path.join(CONTENT_ROO... | |
"Implements KeyDict and KeySet classes"
from collections import defaultdict
import numpy as np
from .small_classes import Numbers, Quantity
from .small_scripts import is_sweepvar, isnan, SweepValue
DIMLESS_QUANTITY = Quantity(1, "dimensionless")
INT_DTYPE = np.dtype(int)
def clean_value(key, value):
"""Gets the ... | |
# Copyright (c) 2006-2010 Mitch Garnaat http://garnaat.org/
# Copyright (c) 2010, Eucalyptus Systems, Inc.
#
# 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
# w... | |
#!/usr/bin/env python
# Copyright (c) 2011 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Usage: change_mach_o_flags.py [--executable-heap] [--no-pie] <executablepath>
Arranges for the executable at |executable_path| ... | |
# -*- coding: utf-8 -*-
from __future__ import with_statement
from datetime import datetime
import os.path
import shutil
from StringIO import StringIO
import tempfile
import unittest
from trac.attachment import Attachment
from trac.core import *
from trac.test import EnvironmentStub
from trac.tests.resource import T... | |
# 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 ... | |
from __future__ import unicode_literals
from django.core.exceptions import ValidationError
from django.db import models
from django.db import transaction
from django.shortcuts import redirect
from django.utils.translation import ugettext_lazy as _
from satchless.process import InvalidData
from .forms import DeliveryF... | |
#!/usr/bin/python
import binascii, re, json, copy, sys
from bitcoin.main import *
### Hex to bin converter and vice versa for objects
def json_is_base(obj, base):
alpha = get_code_string(base)
if isinstance(obj, (str, unicode)):
for i in range(len(obj)):
if alpha.find(obj[i]) == -1:
... | |
# 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... | |
# pylint: skip-file
# flake8: noqa
class RegistryException(Exception):
''' Registry Exception Class '''
pass
class RegistryConfig(OpenShiftCLIConfig):
''' RegistryConfig is a DTO for the registry. '''
def __init__(self, rname, namespace, kubeconfig, registry_options):
super(RegistryConfig, s... | |
# 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... | |
#!/usr/bin/env python
# Copyright 2017 Ericsson AB.
# For a full list of individual contributors, please see the commit history.
#
# 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:... | |
"""Tests for the PS4 media player platform."""
from unittest.mock import MagicMock, patch
from pyps4_2ndscreen.credential import get_ddp_message
from pyps4_2ndscreen.ddp import DEFAULT_UDP_PORT
from pyps4_2ndscreen.media_art import TYPE_APP as PS_TYPE_APP
from homeassistant.components import ps4
from homeassistant.co... | |
# Imports
from machine import I2C
# Register pointers
REG_CONFIG = const(1)
REG_TEMP_BOUNDARY_UPPER = const(2)
REG_TEMP_BOUNDARY_LOWER = const(3)
REG_TEMP_BOUNDARY_CRITICAL = const(4)
REG_TEMP = const(5)
REG_MANUFACTURER_ID = const(6)
REG_DEVIDE_ID = const(7)
REG_RESOLUTION = const(8)
# Sensor resolution values
TEM... | |
from __future__ import unicode_literals
from django.db import models
from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger
from django.utils.encoding import python_2_unicode_compatible
from taggit.models import TaggedItemBase
from taggit.managers import TaggableManager
from modelcluster.fields imp... | |
from biicode.client.rest.rest_api import RestApiClient
from biicode.common.utils.serializer import Serializer, ListDeserializer
from biicode.common.exception import BiiServiceException
from biicode.common.model.symbolic.block_version_table import BlockVersionTable
from biicode.common.find.finder_result import FinderRes... | |
"""Constants for 1-Wire integration."""
from pi1wire import InvalidCRCException, UnsupportResponseException
from pyownet.protocol import Error as ProtocolError
from homeassistant.components.binary_sensor import BinarySensorDeviceClass
from homeassistant.components.onewire.const import (
DOMAIN,
MANUFACTURER_ED... | |
import re
import os, sys
from __exceptions__ import formattedException
isUsingWindows = (sys.platform.lower().find('win') > -1) and (os.name.lower() == 'nt')
isUsingMacOSX = (sys.platform.lower().find('darwin') > -1) and (os.name.find('posix') > -1) and (not isUsingWindows)
isUsingLinux = (sys.platform.lower().find('l... | |
# Copyright 2014 Big Switch Networks, 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... | |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright 2013 The Plaso Project Authors.
# Please see the AUTHORS file for details on individual 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 L... | |
# file: gini_nw.py
from ImImagePlugin import number
import os
import xml.dom.minidom
from gini_components import *
class GINI_NW:
switches = []
vm = []
vrm = []
vmb = []
vr = []
cr=[]
vwr = []
def __init__(self, docDOM):
"Initialize the GINI_NW class"
self.getSwitches... | |
#!/usr/bin/env python
"""
Auditory-model features based on subband PCA (sbpca) faetures
Based on calcAudSemaFtrs matlab code.
2013-09-19 Dan Ellis dpwe@ee.columbia.edu
"""
import math
import numpy as np
import scipy.signal
import scipy.io
import scipy.cluster
import sbpca
# for main
import sys
# For SRI's wavreadi... | |
# 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 compliance with the License. You may obtain
# a ... | |
#
# 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... | |
import socket as _orig_sock
from tests import LimitedTestCase, skip_with_pyevent, main, skipped
from eventlet import event
from eventlet import greenio
from eventlet import debug
from eventlet.green import socket
from eventlet.green import time
from eventlet.green.socket import GreenSSLObject
import errno
import event... | |
# -*- 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, soft... | |
# 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | |
#!/usr/bin/env python
#
# VM Backup extension
#
# Copyright 2015 Microsoft 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
#
# U... | |
# 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... | |
'''
Copyright (c) 2009-2018, K. Kumar (me@kartikkumar.com)
Distributed under the MIT License.
See accompanying file LICENSE.md or copy at http://opensource.org/licenses/MIT
'''
# Set up modules and packages.
# Plotting
import matplotlib
matplotlib.use('TkAgg')
import matplotlib.pyplot as plt
from matplotlib import rcP... | |
from core import dates
from db.db_manager import db_sync_manager
from delegate.geni.v3.rm_adaptor import AdaptorFactory
from extensions.sfa.util import xrn
from handler.geni.v3 import exceptions as geni_ex
from rspecs.commons import validate
import core
logger = core.log.getLogger("common-utils")
import random
class... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.