gt stringclasses 1
value | context stringlengths 2.49k 119k |
|---|---|
"""The sensor entity for the Youless integration."""
from __future__ import annotations
from youless_api.youless_sensor import YoulessSensor
from homeassistant.components.sensor import (
STATE_CLASS_MEASUREMENT,
STATE_CLASS_TOTAL,
STATE_CLASS_TOTAL_INCREASING,
SensorEntity,
)
from homeassistant.compon... | |
"""
Summary:
Contains the AUnit, CommentUnit, HeaderUnit and UnknownSection
classes.
The AUnit is an abstract base class for all types of Isis unit read
in through the ISIS data file. All section types that are built should
inherit from the AUnit baseclass.
Author:
Duncan Runnacles
Create... | |
import tensorflow as tf
from tfsnippet.utils import (get_default_scope_name, camel_to_underscore,
add_name_and_scope_arg_doc)
from ..flows import BaseFlow
__all__ = ['InvertibleActivation', 'InvertibleActivationFlow']
class InvertibleActivation(object):
"""
Base class for intert... | |
#!/usr/bin/python
#
# set_defs.py
#
# Class inclues all set defintions
# Allow defining set of accepted values and quick membership checking
#
# Rachel Kobayashi
# with
# Aaron Anderson
# Eric Gan
#
#
import re;
from collections import deque;
from qutil import *
import nltk;
# set definitions here
# allows for qu... | |
import sys
class CardSuit:
Hearts, Spades, Clubs, Diamonds = range(1, 5)
def __init__(self):
pass
@staticmethod
def string_to_suit(s):
return {
'S': CardSuit.Spades,
'D': CardSuit.Diamonds,
'C': CardSuit.Clubs,
'H': CardSuit.Hearts
... | |
# -*- 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... | |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (c) 2011 X.commerce, a business unit of eBay Inc.
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# Copyright 2011 Piston Cloud Computing, Inc.
# All Rights Reserved.
#
# Lic... | |
"""tests the code found in the documentation
Any code changed in here needs to be updated in their place in the
documentation and vice versa, since we are copy pasting code between its
occurence to the tests.
In general, try to separate tests to one test per chunk of interdependent code
"""
import copy
from indra.sta... | |
# BenchExec is a framework for reliable benchmarking.
# This file is part of BenchExec.
#
# Copyright (C) 2007-2015 Dirk Beyer
# 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 Lic... | |
"""
pyggle.image
This library (PYGGEL) is licensed under the LGPL by Matthew Roe and PYGGEL contributors.
The image module contains classes to load and render both 2d and 3d (billboarded) images.
"""
import time
from .include import *
from . import view, data, misc
from PIL import Image as pilImage
class Image(obj... | |
"""Support for the Vallox ventilation unit fan."""
from __future__ import annotations
from collections.abc import Mapping
import logging
from typing import Any
from vallox_websocket_api import Vallox
from vallox_websocket_api.exceptions import ValloxApiException
from homeassistant.components.fan import (
SUPPORT... | |
########################################################################
# MCU Gear(R) system Sample Code
# Auther:y.kou.
# web site: http://www.milletool.com/
# Date : 8/OCT/2016
#
########################################################################
#Revision Information
#
#########################################... | |
# 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... | |
from pymongo import MongoClient
class NoodleMongoClient(MongoClient):
"""A MongoClient convenience class that exposes default collection
methods directly on the class.
"""
def __init__(self, host, database, collection=None, port=27017, use_nice_key=True, create_collection=False):
super(Noodl... | |
# -*- coding: utf-8 -*-
"""
Buildings Assessments module
@author Pradnya Kulkarni <kulkarni.pradnya@gmail.com>
@author Akila Ramakr <aramakr@ncsu.edu>
@author Fran Boon <fran@aidiq.com>
Data model from:
http://www.atcouncil.org/products/downloadable-products/placards
Postearthquake Safet... | |
import cgi
import codecs
import copy
from io import BytesIO
from itertools import chain
from urllib.parse import parse_qsl, quote, urlencode, urljoin, urlsplit
from django.conf import settings
from django.core import signing
from django.core.exceptions import (
DisallowedHost, ImproperlyConfigured, RequestDataTooB... | |
# Copyright 2015 IBM Corp.
# 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/LIC... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from django.template import Context, Template
from django.core.urlresolvers import resolve
from django.conf import settings
from django.core.handlers.wsgi import WSGIRequest
from django.shortcuts import HttpResponse
from .models impo... | |
#!/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");... | |
# coding=utf-8
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import os
import sub... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2012, Dongsheng Cai
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright
# notice, t... | |
# -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
depends_on = (("entities", "0001_initial"),)
def forwards(self, orm):
# Adding model 'Template'
db.create_table(u'sheets_templat... | |
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
import hashlib
from frappe.model.db_schema import DbManager
from frappe.installer import get_root_connection
from frappe.database import... | |
import mock
import pytest
from addons.wiki.models import WikiVersion
from django.core.exceptions import ValidationError
from django.utils import timezone
from framework.auth.core import Auth
from framework.exceptions import PermissionsError
from nose.tools import assert_raises
from osf.models import Node, Registration... | |
from CommonServerPython import *
from typing import List, Dict, Tuple, Union
import urllib3
# Disable insecure warnings
urllib3.disable_warnings()
INTEGRATION_CONTEXT_NAME = 'MSGraphCalendar'
DEFAULT_PAGE_SIZE = 100
NO_OUTPUTS: dict = {}
APP_NAME = 'ms-graph-calendar'
EVENT_HEADERS = ['Subject', 'Organizer', 'Attende... | |
# Date: August 2017
# Author: Kutay B. Sezginel
"""
Read Lammps output files for thermal conductivity calculations
"""
import os
import math
import yaml
import csv
import numpy as np
from thermof.reldist import reldist
from thermof.parameters import k_parameters, thermo_headers
def read_thermal_flux(file_path, dt=k_p... | |
from modularodm import Q
from rest_framework import generics, permissions as drf_permissions
from rest_framework.exceptions import ValidationError, NotFound, PermissionDenied
from framework.auth.oauth_scopes import CoreScopes
from api.base import generic_bulk_views as bulk_views
from api.base import permissions as ba... | |
"""
Module contains classes related to Burp Suite extension
"""
from os import walk, path
from json import loads, dumps
from imp import load_source
from burp import (IBurpExtender, IBurpExtenderCallbacks, ITab,
IContextMenuFactory)
from javax.swing import (JPanel, JTextField, GroupLayout, JTabbedPane... | |
# Copyright (c) 2015, Florian Jung and Timm Weber
# 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 c... | |
from django.utils.translation import ugettext_lazy as _
from django.utils.timezone import now
from django import forms
from django.core.urlresolvers import reverse
from django.core import management
from crispy_forms.helper import FormHelper
from crispy_forms.layout import Submit
from datetime import datetime
from .m... | |
# coding: utf-8
# Copyright (c) Pymatgen Development Team.
# Distributed under the terms of the MIT License.
from __future__ import division, print_function, unicode_literals, absolute_import
"""
This module implements classes for processing Lammps output files:
1. log file: contains the thermodynamic data with ... | |
# -*- test-case-name: twisted.web.test.test_xml -*-
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Micro Document Object Model: a partial DOM implementation with SUX.
This is an implementation of what we consider to be the useful subset of the
DOM. The chief advantage of this library is ... | |
#!/usr/bin/env python
# ex:ts=4:sw=4:sts=4:et
# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
#
# Copyright (C) 2012 Robert Yang
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software ... | |
""" Cisco_IOS_XR_ppp_ea_oper
This module contains a collection of YANG definitions
for Cisco IOS\-XR ppp\-ea package operational data.
This module contains definitions
for the following management objects\:
pppea\: PPPEA operational data
Copyright (c) 2013\-2016 by Cisco Systems, Inc.
All rights reserved.
"""
... | |
# Lint as: python2, python3
# 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
#
... | |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db.migrations.operations.base import Operation
from pg_fts.fields import TSVectorField
__all__ = ('CreateFTSIndexOperation', 'CreateFTSTriggerOperation',
'DeleteFTSIndexOperation', 'DeleteFTSTriggerOperation',
'UpdateVec... | |
from __future__ import unicode_literals
from django import VERSION
from django.contrib.contenttypes.fields import GenericForeignKey
from django.contrib.contenttypes.models import ContentType
from django.db import IntegrityError, models, transaction
from django.db.models.query import QuerySet
from django.template.defau... | |
from boto.s3.connection import S3Connection
from boto.s3.key import Key
import os, re, jsonHelper
import os.path
import time
from time import mktime
import datetime
#ABS_PATH = '~/Desktop/Dev/Learning/tests/scrapWeb/hello-world/selenium'
CRED = '.s3'
ACCESS = 'accesskey'
SECRET = 'secret'
BUCKET_NAME = 'data.hotoppy... | |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals, print_function
import time
import os
import copy
import requests
import backoff
from requests.adapters import HTTPAdapter
import six
from .contract import KongAdminContract, APIAdminContract, ConsumerAdminContract, PluginAdminContract, \
APIPluginC... | |
#!/usr/bin/env python
from __future__ import print_function
from builtins import input
import argparse
import dateutil.parser
from datetime import datetime
import logging
import os
import subprocess
import sys
import airflow
from airflow import jobs, settings, utils
from airflow.configuration import conf
from airflow.... | |
#
# Copyright (c) 2019 - 2021 StorPool.
# 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 appli... | |
from PyQt4 import QtCore
from PyQt4.QtCore import QVariant, QObject, pyqtSignal
class TreeItem(object):
def __init__(self, model, parent=None):
super(TreeItem, self).__init__()
self.__children = []
self.__parent = parent
self.__model = model
@property
def model(self):
... | |
from datetime import datetime
from django.db import models
from django.contrib.auth.models import User, Group
from django.conf import settings
from django.utils.translation import ugettext_lazy as _
from django.db.models.signals import post_save, post_delete
from ckeditor import fields as ckedit_fields
from fields im... | |
# 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... | |
"""Webhook tests for mobile_app."""
# pylint: disable=redefined-outer-name,unused-import
import logging
import pytest
from homeassistant.components.mobile_app.const import CONF_SECRET
from homeassistant.components.zone import DOMAIN as ZONE_DOMAIN
from homeassistant.const import CONF_WEBHOOK_ID
from homeassistant.core... | |
"""Parses text files downloaded by timeliness.crawler and
stores the pickled results for the analysis stage."""
import re
import os
import sys
import time
import cPickle as pickle
from datetime import date, datetime
from utils import flattened, recursive_listdir, pretty_bytes, pretty_seconds, Accumulator
from timeline... | |
from __future__ import print_function
import re
import sqlparse
from collections import namedtuple
from sqlparse.sql import IdentifierList, Identifier, Function
from sqlparse.tokens import Keyword, DML, Punctuation, Token, Error
cleanup_regex = {
# This matches only alphanumerics and underscores.
'alph... | |
##
# TRACK 1
# TWO TRAINS
# From Data-Driven DJ (datadrivendj.com) by Brian Foo (brianfoo.com)
# This file builds the sequence file for use with ChucK from the data supplied
##
# Library dependancies
import csv
import json
import math
import os
import random
import re
import time
# Config
BPM = 120 # Beats per minute... | |
# Copyright 2016 Twitter. 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 agree... | |
# coding: utf-8
from __future__ import unicode_literals
from django.template import TemplateSyntaxError
from django.test import SimpleTestCase
from ..utils import SomeClass, SomeOtherException, UTF8Class, setup
class FilterSyntaxTests(SimpleTestCase):
@setup({'filter-syntax01': '{{ var|upper }}'})
def test... | |
# Copyright 2013 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/licenses/LICENSE-2.0
#
# Unless r... | |
"""Collection of custom Keras layers."""
# Imports
from keras import backend as K
from keras.layers.core import Dense, Reshape, RepeatVector, Lambda, Dropout
from keras.layers import Input, merge
from keras.layers.recurrent import LSTM
from keras.layers.normalization import BatchNormalization
from keras.regularizers i... | |
import os
from datetime import datetime, timedelta
from mimetypes import guess_type
try:
import socks
except ImportError:
socks = None
from . import TelegramBareClient
from . import helpers, utils
from .errors import (
RPCError, UnauthorizedError, InvalidParameterError, PhoneCodeEmptyError,
PhoneCodeE... | |
from __future__ import unicode_literals
import re
import datetime
from django.utils import six
from django.db import models
from django.conf import settings
from django.db.migrations import operations
from django.db.migrations.migration import Migration
from django.db.migrations.questioner import MigrationQuestioner
... | |
# Copyright 2012 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 by a... | |
# 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... | |
# Copyright Hybrid Logic Ltd. See LICENSE file for details.
"""
Tests for ``flocker.control._persistence``.
"""
from uuid import uuid4
from eliot.testing import validate_logging, assertHasMessage, assertHasAction
from twisted.internet import reactor
from twisted.trial.unittest import TestCase, SynchronousTestCase
... | |
import io
import logging
import shutil
import subprocess
from collections import namedtuple
from pathlib import Path
from subprocess import Popen
from tempfile import TemporaryDirectory
from textwrap import dedent
import pytest
import Pegasus
from Pegasus import yaml
from Pegasus.braindump import Braindump
from Pegas... | |
import datetime
from deform.exception import ValidationFailure
from pyramid.httpexceptions import HTTPSeeOther
from pyramid.renderers import render_to_response
from brouz import accounting
from brouz import enums
from brouz.forms import make_add_form
from brouz.forms import make_edit_form
from brouz.i18n import _
fr... | |
# -*- coding: utf-8 -*-
"""
The MIT License
===============
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, merge... | |
import re
from decimal import Decimal
import pytz
from zope.interface import implementer
from .. import handhistory as hh
from ..hand import Combo, Card
from ..constants import Limit, Game, GameType, MoneyType, Currency, Action
__all__ = ["PKRHandHistory"]
@implementer(hh.IStreet)
class _Street(hh._BaseStreet):
... | |
"""Test ZHA Gateway."""
import asyncio
import time
from unittest.mock import patch
import pytest
import zigpy.profiles.zha as zha
import zigpy.zcl.clusters.general as general
import zigpy.zcl.clusters.lighting as lighting
from homeassistant.components.light import DOMAIN as LIGHT_DOMAIN
from homeassistant.components.... | |
# 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 writi... | |
"""
SQLite database backend
Store traces from tallyable objects in individual SQL tables.
Implementation Notes
--------------------
For each object, a table is created with the following format:
key (INT), trace (INT), v1 (FLOAT), v2 (FLOAT), v3 (FLOAT) ...
For multidimensional objects, ndim>1, eg (2,2) the table ... | |
import sys
if sys.version_info < (3,):
range = xrange
import numpy as np
import pandas as pd
import scipy.stats as ss
import scipy.special as sp
from .. import families as fam
from .. import tsm as tsm
from .. import data_check as dc
from .scores import *
from .gas_core_recursions import gas_recursion
class GA... | |
# Copyright (c) 2014 Andrew Kerr. All rights reserved.
# Copyright (c) 2015 Tom Barron. All rights reserved.
# 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
... | |
# Copyright (c) 2011 X.commerce, a business unit of eBay Inc.
# Copyright 2011 Eldar Nugaev
# 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://... | |
#!/usr/bin/env python3
import argparse
import datetime
import glob
import inspect
import json
import os
import pandas
import subprocess
import sys
import codespeed_upload
def get_script_dir():
return os.path.dirname(inspect.getabsfile(get_script_dir))
SCRIPTDIR = get_script_dir()
DEFAULT_REPO = os.path.join(SCR... | |
# Copyright (C) 2012-2013 Andy Balaam and The Pepper Developers
# Released under the MIT License. See the file COPYING.txt for details.
from nose.tools import *
from libpepper.builtins import add_builtins
from libpepper.environment import PepEnvironment
from libpepper.cpp.cppvalues import *
from libpepper.cpp.cppre... | |
"""
.. A wrapper for the Analyzer. It runs it as an XML-RPC server to isolate from
lengthy grammar-building times.
.. moduleauthor:: Luca Gilardi <lucag@icsi.berkeley.edu>
------
See LICENSE.txt for licensing information.
------
"""
import sys
from utils import Struct, update, display # @UnusedImport
from xm... | |
import _init_paths
import inspect
import os
import shutil
import time
import numpy as np
import tensorflow as tf
from PIL import Image
from image_pylib import IMGLIB
import data_engine
import random
VGG_MEAN = [103.939, 116.779, 123.68]
image_height = 288
image_width = 384
feature_height = int(np.ceil(image_height / 1... | |
#
# 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... | |
import hashlib
import json
import logging
import os.path
import re
from io import BytesIO
import asyncio
import mitmproxy.flow
import tornado.escape
import tornado.web
import tornado.websocket
from mitmproxy import contentviews
from mitmproxy import exceptions
from mitmproxy import flowfilter
from mitmproxy import htt... | |
# -*- coding: utf-8 -*-
import datetime
from time import sleep
from lettuce import *
from django.utils.datastructures import SortedDict
from rapidsms.contrib.locations.models import *
from survey.features.page_objects.aggregates import AggregateStatusPage, DownloadExcelPage, InvestigatorReportPage
from survey.features... | |
# 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... | |
from __future__ import unicode_literals
import random
import re
import six
EC2_RESOURCE_TO_PREFIX = {
'customer-gateway': 'cgw',
'dhcp-options': 'dopt',
'image': 'ami',
'instance': 'i',
'internet-gateway': 'igw',
'network-acl': 'acl',
'network-interface': 'eni',
'network-interface-attac... | |
# Copyright (c) 2014 Dell 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 a... | |
import copy
import time
import inspect
from JumpScale import j
from JPackageStateObject import JPackageStateObject
#from JumpScale.core.sync.Sync import SyncLocal
from ActionManager import ActionManager
from CodeManagementRecipe import CodeManagementRecipe
from JumpScale.core.system.fs import FileLock
def JPLock(fu... | |
"""The HTTP api to control the cloud integration."""
import asyncio
from functools import wraps
import logging
import aiohttp
import async_timeout
import attr
from hass_nabucasa import Cloud, auth, thingtalk
from hass_nabucasa.const import STATE_DISCONNECTED
import voluptuous as vol
from homeassistant.components impo... | |
from builtins import str
from builtins import object
from astropy.io import fits
import numpy as np
import astropy.units as u
import pkg_resources
import six
# From https://heasarc.gsfc.nasa.gov/docs/software/fitsio/c/c_user/node20.html
# Codes for the data type of binary table columns and/or for the
# data type of va... | |
import sys
import os
import ctypes
if os.name == 'nt':
from cefpython1 import cefpython_py27 as cefpython
#else:
# import webkit
# import jswebkit
import gobject
import gtk
import pygtk
pygtk.require('2.0')
import gtk
import gobject
import re
import platform
import Widgets
def GetApplicationPath(file=None):... | |
#!/usr/bin/env python
from __future__ import print_function
import argparse
import errno
import itertools
import json
import multiprocessing
import os
import shutil
import subprocess
import sys
import traceback
from shutil import copyfile
BARE_INTERFACE_SEARCH_PATHS = [
"usr/lib/swift",
"System/iOSSupport/us... | |
#!/usr/bin/env python
# Copyright (c) 2011-2018, wradlib developers.
# Distributed under the MIT License. See LICENSE.txt for more info.
"""
Vertical Profile of Reflectivity (VPR)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Precipitation is 3-dimensional in space. The vertical distribution of
precipitation (and thus refle... | |
from itertools import izip, chain, repeat
import requests
import re
from abc import abstractmethod
class BaseParser(object):
def group(self, n, iterable, padvalue=None):
return izip(*[chain(iterable, repeat(padvalue, n - 1))] * n)
@abstractmethod
def get_scores_json(self):
raise NotImplem... | |
# -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'Result.mo_pers'
db.add_column(u'cmp_result', 'mo_pers',
... | |
# rfc3339.py -- Implementation of the majority of RFC 3339 for python.
# Copyright (c) 2008, 2009, 2010 LShift Ltd. <query@lshift.net>
#
# 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 withou... | |
#
# Copyright IBM Corp. 2016 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 ... | |
import sys
import threading
import httplib
import time
import json
import asyncore
import socket
import os
import logging
import random
import multiprocessing
import SocketServer
from OutgoingMessage import *
from Util import *
from multiprocessing import Queue
# Setup logging redirection
logger = logging.getLogger('b... | |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2013 Violin Memory, 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/LIC... | |
# 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 ... | |
"""
KBase narrative service and method API.
The main classes defined here are :class:`Service` and :class:`ServiceMethod`.
See :func:`example` for an example of usage.
"""
__author__ = ["Dan Gunter <dkgunter@lbl.gov>", "William Riehl <wjriehl@lbl.gov>"]
__version__ = "0.0.1"
## Imports
# Stdlib
from collections impo... | |
#! /usr/bin/env python
# encoding: utf-8
import argparse
import errno
import logging
import os
import platform
import re
import sys
import subprocess
import tempfile
try:
import winreg
except ImportError:
import _winreg as winreg
try:
import urllib.request as request
except ImportError:
import urllib ... | |
from copy import copy
from django.utils.module_loading import import_string
# Cache of actual callables.
_standard_context_processors = None
# We need the CSRF processor no matter what the user has in their settings,
# because otherwise it is a security vulnerability, and we can't afford to leave
# this to human error... | |
# -*- 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 field 'System.warranty_start'
db.add_column(u'systems', 'warranty_start',
sel... | |
# ===================================================================
#
# Copyright (c) 2015, Legrandin <helderijs@gmail.com>
# 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. Redistributio... | |
from gooey.gui.widgets import widget_pack
__author__ = 'Chris'
import wx
from gooey.gui import styling
class BaseGuiComponent(object):
def __init__(self, data, widget_pack):
self.data = data
# parent
self.panel = None
# Widgets
self.title = None
self.help_msg = None
# Internal Widg... | |
import os
from typing import Any, Dict, Sequence
from unittest import mock
from urllib.parse import urlsplit
import ujson
from django.conf import settings
from django.http import HttpResponse
from django.test import override_settings
from corporate.models import Customer
from zerver.lib.integrations import INTEGRATIO... | |
# Copyright 2017 The Meson development team
# 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 ... | |
"""Config flow for HomeKit integration."""
import random
import re
import string
import voluptuous as vol
from homeassistant import config_entries
from homeassistant.components.camera import DOMAIN as CAMERA_DOMAIN
from homeassistant.components.media_player import DOMAIN as MEDIA_PLAYER_DOMAIN
from homeassistant.comp... | |
# Copyright 2020 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 applic... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.