gt stringclasses 1
value | context stringlengths 2.49k 119k |
|---|---|
# Copyright 2012-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 la... | |
from os.path import dirname
import logging
import time
try:
from PIL import Image
except ImportError:
import Image
from django.conf import settings
from django.core.management import call_command
from django.db.models import loading
from django.core.files.base import ContentFile
from django.http import HttpR... | |
# Copyright 2012, Nachi Ueno, NTT MCL, 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 applic... | |
# -*- coding: utf-8 -*-
# This file is part of beets.
# Copyright 2016, Jakob Schnitzer.
#
# 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 ... | |
# -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import DataMigration
from django.db import models
class Migration(DataMigration):
def forwards(self, orm):
for n in orm.NetworkGroup.objects.all():
if n.youtube:
n.y... | |
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from typing import Any, Callable, List, Optional, Sequence, TypeVar, Iterable, Set, Tuple, Text
from six import binary_type
import base64
import errno
import hashlib
import heapq
import itertools
import os
import sys
from ti... | |
"""
This module hanles configuration related stuff
"""
import os.path as op
from . import conf_endpoints as scmc
from . import data_input_endpoints as scmdi
from . import property_endpoints as scmp
from . import request as req
def conf_file2name(conf_file):
conf_name = op.basename(conf_file)
if conf_name.en... | |
import inspect
import gc
import sys
import os.path
import difflib
from earthdragon.func_util import get_parent
import pandas as pd
def is_property(code):
"""
Using some CPython gc magics, check if a code object is a property
gc idea taken from trace.py from stdlib
"""
# use of gc.get_referrers()... | |
# coding: utf-8
from __future__ import division, unicode_literals, print_function
"""
Input sets for VASP GW calculations
Single vasp GW work: Creates input and jobscripts from the input sets for a specific job
"""
__author__ = "Michiel van Setten"
__copyright__ = " "
__version__ = "0.9"
__maintainer__ = "Michiel v... | |
#
# File:
# mptick_10.py
#
# Synopsis:
# Demonstrates how to mask Lambert Conformal Projection map.
# Shows how to add your own longitude/latitude labels to a
# masked Lambert Conformal plot.
#
# Categories:
# map plot
#
# Based on NCL example:
# mptick_10.ncl
#
# Author:
# Karin Meier-Fleisc... | |
import copy
import datetime
import unittest2
import webtest
import json
import md5
import api_main
import cron_main
from google.appengine.api import taskqueue
from google.appengine.ext import ndb
from google.appengine.ext import testbed
from consts.account_permissions import AccountPermissions
from consts.auth_type ... | |
# Tweepy
# Copyright 2009-2010 Joshua Roesslein
# See LICENSE for details.
# Appengine users: https://developers.google.com/appengine/docs/python/sockets/#making_httplib_use_sockets
from __future__ import absolute_import, print_function
import logging
import re
import requests
import sys
from requests.exceptions imp... | |
"""CGI-savvy HTTP Server.
This module builds on SimpleHTTPServer by implementing GET and POST
requests to cgi-bin scripts.
If the os.fork() function is not present (e.g. on Windows),
os.popen2() is used as a fallback, with slightly altered semantics; if
that function is not present either (e.g. on Macintosh), only Py... | |
# $Id$
#
# Copyright (C) 2002-2006 Greg Landrum and Rational Discovery LLC
#
# @@ All Rights Reserved @@
# This file is part of the RDKit.
# The contents are covered by the terms of the BSD license
# which is included in the file license.txt, found at the root
# of the RDKit source tree.
#
""" tools for interacti... | |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
# -*- coding: utf-8 -*-
import pytest
asdf = pytest.importorskip('asdf')
import warnings
from packaging.version import Version
import numpy as np
from asdf import util
from asdf.tests import helpers
from asdf import AsdfFile
import asdf
import astrop... | |
import math
from typing import Optional
import pytest
from plenum.common.moving_average import MovingAverage, ExponentialMovingAverage, EventFrequencyEstimator, \
EMAEventFrequencyEstimator
START_TIME = 10
STEP = 3
class MockMovingAverage(MovingAverage):
def __init__(self):
self.updates = []
... | |
#!/usr/bin/python
#
import os
import sys
import getopt
import math
import tempfile
import stat
import re
import shlex
import time
import subprocess
from subprocess import Popen
import glob
#import topsort
import topological
from util import get_new_directory
from util import get_new_file
import random
from pypipeline.... | |
# 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... | |
# 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 plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType
import copy as _copy
class Hoverlabel(_BaseTraceHierarchyType):
# class properties
# --------------------
_parent_path_str = "sankey"
_path_str = "sankey.hoverlabel"
_valid_props = {
"align",
"align... | |
from __future__ import print_function
import os
import subprocess
import re
from cffi import FFI
# Globals
CPP_OUTPUT = os.path.join(os.path.dirname(__file__), "_lcb.h")
FAKE_INKPATH = os.path.join(os.path.dirname(__file__), 'fakeinc')
LCB_ROOT = os.environ.get('PYCBC_CFFI_PREFIX', '')
ffi = FFI()
C = None
CPP_INPU... | |
"""
Data structures for sparse float data. Life is made simpler by dealing only
with float64 data
"""
# pylint: disable=E1101,E1103,W0231
import numpy as np
import warnings
from pandas.core.dtypes.missing import isna, notna
from pandas.compat.numpy import function as nv
from pandas.core.index import Index, ensure_i... | |
# Copyright (c) 2010 Cloud.com, Inc
# Copyright 2012 Cloudbase Solutions Srl
# 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/... | |
# -*- coding: utf-8 -*-
from scarlett.core.config import Config, ScarlettConfigLocations
import datetime
import os
import platform
import logging
import logging.config
import scarlett.errors
# NOTE: take from scarlett_improved
try:
import dbus
import dbus.service
from dbus.mainloop.glib import DBusGMainL... | |
import struct
import ctypes
from block.BitmapBlock import BitmapBlock
from block.BitmapExtBlock import BitmapExtBlock
from FSError import *
class ADFSBitmap:
def __init__(self, root_blk):
self.root_blk = root_blk
self.blkdev = self.root_blk.blkdev
# state
self.ext_blks = []
self.bitmap_blks = []... | |
import json
import lxml
from bs4 import BeautifulSoup
import re
import urllib2
def _get_soup(url):
# returns a beautiful soup object for further operations
opener = urllib2.build_opener()
opener.addheaders = [('User-agent', 'Mozilla/5.0')]
response = opener.open(url)
return BeautifulSoup(response.r... | |
import socket
import sys
import threading
import CommonUtil
import functools
import time
import re
from messages.Message import Message as Message
from database.databaseinterface import databaseinterface
#welcom message sent to every user apon login
def welcome_message():
msg = Message('0000000000000000', '00000000... | |
# 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... | |
import sublime_plugin
from ..libs.view_helpers import *
from ..libs import *
from .event_hub import EventHub
class TypeScriptEventListener(sublime_plugin.EventListener):
"""To avoid duplicated behavior among event listeners"""
# During the "close all" process, handling on_activated events is
# undesirabl... | |
# -*- coding: utf-8 -*-
"""
Created on Thu Mar 10 21:36:44 2016
@author: Tobias Jachowski
"""
import matplotlib.pyplot as plt
import numpy as np
from pyoti.modification.modification import Modification, GraphicalMod
from pyoti import helpers as hp
from pyoti.evaluate import signal as sn
from pyoti.evaluate import tet... | |
#
# Copyright 2016 Quantopian, 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 wr... | |
#
# 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 glob
import sys
import os
import subprocess
import re
########################################################################
#######################################################################
# Check for dependencies
#
# Is there a way to do this more elegantly?
# 1. Run "pip install numpy"
# 2. ... | |
# Copyright 2022 The MT3 Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | |
#import matplotlib
#matplotlib.use('WXAgg')
import sys
import numpy as np
import pandas as pd
import wx
import wx.grid as gridlib
import wx.lib.mixins.gridlabelrenderer as gridlabelrenderer
class HugeTable(gridlib.GridTableBase):
"""
Table class for virtual grid
"""
def __init__(self, log, num_rows,... | |
#!/usr/bin/env python
# Copyright (c) 2012 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.
"""Script to parse perf data from Chrome Endure test executions, to be graphed.
This script connects via HTTP to a buildbot master... | |
# Copyright 2021 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import annotations
import os.path
from textwrap import dedent
import pytest
from pants.backend.go import target_type_rules
from pants.backend.go.target_type_rules import... | |
from __future__ import print_function
import sys
import csv
def warning(*objs):
print("WARNING:", *objs, file=sys.stderr)
def error(*objs):
print("ERROR:", *objs, file=sys.stderr)
def fatal(*objs):
print("FATAL:", *objs, file=sys.stderr)
sys.exit(1)
if len(sys.argv) != 3:
sys.exit("Usage: " + sys.argv[0]... | |
# 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... | |
import unittest
from tests.availability import lxml_available, requests_available
import contextlib
import filecmp
import pathlib
import socketserver
import sys
import tempfile
from concurrent import futures
if requests_available:
from garage.http import clients
from garage.http import utils
from tests.h... | |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 OpenStack 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 requ... | |
#
# Copyright (c) 2013 Juniper Networks, Inc. All rights reserved.
#
#
# This file contains authentication/authorization functionality for VNC-CFG
# subsystem. It also currently contains keystone adaptation which can in
# future by moved to vnc_auth_keystone.py
#
import gevent
from gevent import monkey
monkey.patch_al... | |
# import sqlite3
# import iso8601
import logging
import os
import requests
rootLogger = logging.getLogger(__name__)
pica_url = os.environ.get('pica_url')
def get_appointment_msg(msg_info,time_frame):
rootLogger.info('Getting Appointments')
'''
if not msg_info["Device ID"]: #test database
param =... | |
# 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 The StackStorm Authors.
# Copyright 2019 Extreme Networks, 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 ... | |
#!/usr/bin/python3
##
# Doxygen filter for Google Protocol Buffers .proto files.
# This script converts .proto files into C++ style ones
# and prints the output to standard output.
#
# version 0.6-beta-vg
#
# How to enable this filter in Doxygen:
# 1. Generate Doxygen configuration file with command 'doxygen -g <file... | |
#!/usr/local/bin/python
# -*-coding:Utf-8 -*
import os
import math
def GA_settings():
"""Provides the view for the user setting of the GA experiments and returns the settings set"""
options = {}
os.system("clear")
print('===== OPTIONS =====\n')
preset = int(raw_input(
"PRESET\n"
... | |
# cython: infer_types=True
#
# Tree visitor and transform framework
#
from __future__ import absolute_import, print_function
import sys
import inspect
from . import TypeSlots
from . import Builtin
from . import Nodes
from . import ExprNodes
from . import Errors
from . import DebugFlags
from . import Future
impor... | |
import oebakery
import logging
import oelite.util
import oelite.git
import sys
import os
import subprocess
description = "Add layer to manifest helper tool"
arguments = (
("layer", "Name of the layer to add (fx. meta/qt or src/linux)", 0),
)
def add_parser_options(parser):
parser.add_option(
'-d', ... | |
# Lint as: python3
# Copyright 2020 The TensorFlow Probability 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 ... | |
# Copyright 2012 OpenStack Foundation
# 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... | |
# 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 agreed to in writing, ... | |
# -*- coding: utf-8 -*-
from operator import attrgetter
from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType
from pyangbind.lib.yangtypes import RestrictedClassType
from pyangbind.lib.yangtypes import TypedListType
from pyangbind.lib.yangtypes import YANGBool
from pyangbind.lib.yangtypes import YANGListTy... | |
from django.contrib.admin.filterspecs import FilterSpec
from django.contrib.admin.options import IncorrectLookupParameters
from django.contrib.admin.util import quote
from django.core.paginator import Paginator, InvalidPage
from django.db import models
from django.db.models.query import QuerySet
from django.utils.encod... | |
# Authors: Emmanuelle Gouillart <emmanuelle.gouillart@normalesup.org>
# Gael Varoquaux <gael.varoquaux@normalesup.org>
# License: BSD 3 clause
import numpy as np
import scipy as sp
from scipy import ndimage
from nose.tools import assert_equal, assert_true
from numpy.testing import assert_raises
from sklearn... | |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
from django.conf import settings
import oauth2client.django_orm
class Migration(migrations.Migration):
dependencies = [
('auth', '0006_require_contenttypes_0002'),
migrations.swappable_depend... | |
#!/usr/bin/env python
# Copyright (c) 2012 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.
"""Smoke tests for gclient.py.
Shell out 'gclient' and run basic conformance tests.
This test assumes GClientSmokeBase.URL_BASE i... | |
'''
Parallel computation of pseudospecta of a square matrix by its definition.
Author: Dmitry E. Kislov
E-mail: kislov@easydan.com
Date: 25 Nov. 2015
'''
from __future__ import print_function
import multiprocessing
import warnings
import numpy as np
import itertools
__all__ = ['gersgorin_bounds', 'pseudo', 'eigen_... | |
from ._compat import PY2, pickle, http_cookies, unicode_text, b64encode, b64decode
import os
import time
from datetime import datetime, timedelta
from beaker.crypto import hmac as HMAC, hmac_sha1 as SHA1, sha1
from beaker import crypto, util
from beaker.cache import clsmap
from beaker.exceptions import BeakerException... | |
import os
import json
import hashlib
import logging
import collections
import requests
import urlparse
import yaml
import validate
log = logging.getLogger("cwltool")
class NormDict(dict):
def __init__(self, normalize=unicode):
super(NormDict, self).__init__()
self.normalize = normalize
def __... | |
import hlt
import numpy as np
import pandas as pd
from time import time
import itertools
import os
import sys
args = ' '.join(sys.argv)
if 'define' in args:
overrides = eval(args.split('define')[1].strip())
TIME_LIMIT = 1.9
nav_angles = np.array([-np.array(list(range(0, 35, 1)) + list(range(35, 120, 3))), 1+np.ar... | |
#
# This file is part of pyasn1-modules software.
#
# Copyright (c) 2005-2017, Ilya Etingof <etingof@gmail.com>
# License: http://pyasn1.sf.net/license.html
#
# PKCS#7 message syntax
#
# ASN.1 source from:
# https://opensource.apple.com/source/Security/Security-55179.1/libsecurity_asn1/asn1/pkcs7.asn.auto.html
#
# Samp... | |
"""
Base driver for the UHFQA instrument including all common functionality.
Application dependent code can be found in the UHFQuantumController and in the
UHFQA_qudev modules.
"""
import time
import logging
import numpy as np
import pycqed.instrument_drivers.physical_instruments.ZurichInstruments.ZI_bas... | |
# -*- coding: utf-8 -*-
"""
oauthlib.oauth1.rfc5849.endpoints.access_token
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This module is an implementation of the access token provider logic of
OAuth 1.0 RFC 5849. It validates the correctness of access token requests,
creates and persists tokens as well as create the p... | |
import numpy, scipy, scipy.optimize, scipy.interpolate
import h5py
import os, os.path, time, copy
from PnSC_ui import *
#def ndiv(x, nptsoneside=20):
# nptsoneside=max(nptsoneside, 2.)
# gapptsoneside=min(gapptsoneside, nptsoneside-2.)
# for gap in range(gapptsoneside+1):
# starti=numpy.uint32([max(i-(... | |
# This file is part of 'NTLM Authorization Proxy Server' http://sourceforge.net/projects/ntlmaps/
# Copyright 2001 Dmitry A. Rozmanov <dima@xenon.spb.ru>
#
# 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 Soft... | |
infostr = '''azm_db_merge version 1.0 Copyright (c) 2016 Freewill FX Co., Ltd. All rights reserved.'''
usagestr = '''
Merge (import) AZENQOS Android .azm
test log files that contain SQLite3 database files (azqdata.db) into a target
central database (Now MS-SQL and SQLite3 only, later/roadmap: PostgreSQL and MySQL).\n
... | |
"""Support for WeMo humidifier."""
import asyncio
from datetime import timedelta
import logging
import async_timeout
from pywemo import discovery
import requests
import voluptuous as vol
from homeassistant.components.fan import (
SPEED_HIGH,
SPEED_LOW,
SPEED_MEDIUM,
SPEED_OFF,
SUPPORT_SET_SPEED,
... | |
from __future__ import unicode_literals
from collections import defaultdict, OrderedDict
from itertools import chain
from functools import reduce
import operator
from django.core.exceptions import ImproperlyConfigured
from django.forms.forms import BaseForm
from django.forms.utils import ErrorList
from django.forms.... | |
# coding: utf-8
import os
import socket
import gzip
from gppylib.commands.base import Command, REMOTE, WorkerPool, CommandResult
from gppylib.db import dbconn
from test.behave_utils.utils import getRows, validate_parse_email_file
from gppylib.gparray import GpArray
from gppylib.operations.unix import CheckFile
from te... | |
# coding=utf-8
# Copyright 2022 The Google Research 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 applicab... | |
# coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import (
determine_ext,
ExtractorError,
float_or_none,
xpath_text,
)
class AdultSwimIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?adultswim\.com/videos/(?P<is_playlist>playlist... | |
'''
Created on 2015/06/01
:author: hubo
'''
from __future__ import print_function, absolute_import, division
import warnings
class IsMatchExceptionWarning(Warning):
pass
class EventMatcher(object):
'''
A matcher to match an event
'''
def __init__(self, indices, judgeFunc = None):
# cut... | |
import unittest
from test import support
from test.support import warnings_helper
import gc
import weakref
import operator
import copy
import pickle
from random import randrange, shuffle
import warnings
import collections
import collections.abc
import itertools
class PassThru(Exception):
pass
def check_pass_thru(... | |
###############################################################################
#
# ChartPie - A class for writing the Excel XLSX Pie charts.
#
# Copyright 2013-2017, John McNamara, jmcnamara@cpan.org
#
from warnings import warn
from . import chart
class ChartPie(chart.Chart):
"""
A class for writing the Exc... | |
# Copyright 2009 Paul J. Davis <paul.joseph.davis@gmail.com>
#
# This file is part of the pywebmachine package released
# under the MIT license.
import inspect
import os
import random
from gunicorn._compat import execfile_
from gunicorn.config import Config
from gunicorn.http.parser import RequestParser
from gunicorn... | |
#!/usr/bin/env python3
# Copyright 2020 The Pigweed 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... | |
import pymongo
from django.core.management.base import BaseCommand
from django.conf import settings
from optparse import make_option
from crits.core.mongo_tools import mongo_connector
class Command(BaseCommand):
"""
Script Class.
"""
option_list = BaseCommand.option_list + (
make_option('--r... | |
# Copyright 2015 Google Inc. All Rights Reserved.
"""Starts the vtcombo process."""
import json
import logging
import os
import socket
import subprocess
import time
import urllib
from vttest import environment
class ShardInfo(object):
"""Contains the description for setting up a test shard.
Every shard should... | |
#
# Copyright (c) 2008-2015 Citrix 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 l... | |
"""Support for Vera devices."""
import asyncio
from collections import defaultdict
import logging
from typing import Any, Dict, Generic, List, Optional, Type, TypeVar
import pyvera as veraApi
from requests.exceptions import RequestException
import voluptuous as vol
from homeassistant import config_entries
from homeas... | |
import time
import socket
import struct
import urlparse
import select
import utils
from xlog import getLogger
xlog = getLogger("x_tunnel")
import global_var as g
import proxy_session
def netloc_to_host_port(netloc, default_port=80):
if ":" in netloc:
host, _, port = netloc.rpartition(':')
port =... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2019 The FATE 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/lic... | |
import sys, os
try:
import xml.etree.cElementTree as ET
except ImportError:
import cElementTree as ET
sys.path.append(os.path.dirname(os.path.abspath(__file__))+"/../..")
import Utils.ElementTreeUtils as ETUtils
import Utils.Range as Range
from collections import defaultdict
import ExampleBuilders.PhraseTrigger... | |
import itertools
import dask
from . import registry
from ..utils import get_ip_interface
DEFAULT_SCHEME = dask.config.get("distributed.comm.default-scheme")
def parse_address(addr, strict=False):
"""
Split address into its scheme and scheme-dependent location string.
>>> parse_address('tcp://127.0.0.1... | |
import threading
import time
from unittest import mock
from multiple_database.routers import TestRouter
from django.core.exceptions import FieldError
from django.db import (
DatabaseError, NotSupportedError, connection, connections, router,
transaction,
)
from django.test import (
TransactionTestCase, ove... | |
"""
Support to interface with the Emby API.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/media_player.emby/
"""
import logging
from datetime import timedelta
import voluptuous as vol
import homeassistant.helpers.config_validation as cv
from homeassi... | |
# -*- coding: utf-8 -*-
# Copyright 2013 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 requir... | |
# 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | |
# DIALS_ENABLE_COMMAND_LINE_COMPLETION
from __future__ import annotations
import concurrent.futures
import copy
import logging
import sys
import iotbx.phil
from dxtbx.model.experiment_list import ExperimentList
from dials.algorithms.indexing import DialsIndexError, indexer
from dials.array_family import flex
from ... | |
#
#
# Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2014 Google 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:
#
# 1. Redistributions of source code must retain the above copyri... | |
import sys, unittest, struct, math
from binascii import hexlify
from ctypes import *
def bin(s):
return hexlify(buffer(s)).upper()
# Each *simple* type that supports different byte orders has an
# __ctype_be__ attribute that specifies the same type in BIG ENDIAN
# byte order, and a __ctype_le__ attribute that is... | |
# -*- coding: utf-8 -*-
"""The parsers and plugins manager objects."""
import pysigscan
from plaso.frontend import presets
from plaso.lib import specification
class ParsersManager(object):
"""Class that implements the parsers manager."""
_parser_classes = {}
@classmethod
def DeregisterParser(cls, parser_c... | |
# -*- coding: iso-8859-1 -*-
# (c) 2009-2014 Martin Wendt and contributors; see WsgiDAV https://github.com/mar10/wsgidav
# Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php
"""
DAV provider that publishes a Mercurial repository.
Note: This is **not** production code!
The repository is... | |
# http://www.aumhaa.com
# by amounra 0313
from __future__ import with_statement
import Live
import time
import math
""" _Framework files """
from _Framework.ButtonElement import ButtonElement # Class representing a button a the controller
from _Framework.ButtonMatrixElement import ButtonMatrixElement # Class represe... | |
# -*- coding: utf-8 -*-
from contextlib import closing
from pyramid import testing
import pytest
import datetime
import os
from psycopg2 import IntegrityError
from webtest.app import AppError
from cryptacular.bcrypt import BCRYPTPasswordManager
from journal import connect_db
from journal import DB_SCHEMA
from journal ... | |
__author__ = 'abuddenberg'
from gcis_clients import GcisClient, SurveyClient, survey_token, gcis_dev_auth, gcis_stage_auth
from gcis_clients.domain import Report, Chapter
# from sync_utils import realize_parents, realize_contributors
from collections import OrderedDict
import pickle
import sys
# gcis = GcisClient('... | |
#!/usr/bin/python
"""
Import Data Frame
Copyright (c) 2014, 2015 Andrew Hawkins
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 us... | |
"""
Copyright (c) 2013-2015, Joshua Pitts
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice,
this list of conditions and t... | |
from __future__ import absolute_import, unicode_literals
import re
from collections import OrderedDict
from django import template
from django.template import loader
from django.utils import six
from django.utils.encoding import force_text, iri_to_uri
from django.utils.html import escape, format_html, smart_urlquote
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.