prompt
large_stringlengths
72
9.34k
completion
large_stringlengths
0
7.61k
<|file_name|>is_near_arterial.py<|end_file_name|><|fim▁begin|> # Opus/UrbanSim urban simulation software. # Copyright (C) 2005-2009 University of Washington # See opus_core/LICENSE from opus_core.variables.variable import Variable from variable_functions import my_attribute_label from urbansim.length_constants ...
"""Boolean indicating if this gridcell is near an arterial, as specified by the arterial threshold (a constant). Distance is assumed to be measured from the "border" of the gridcell.""" distance_to_arterial = "distance_to_arterial" def dependencies(self): return [my_attribute_label(self....
<|file_name|>is_near_arterial.py<|end_file_name|><|fim▁begin|> # Opus/UrbanSim urban simulation software. # Copyright (C) 2005-2009 University of Washington # See opus_core/LICENSE from opus_core.variables.variable import Variable from variable_functions import my_attribute_label from urbansim.length_constants ...
return [my_attribute_label(self.distance_to_arterial)]
<|file_name|>is_near_arterial.py<|end_file_name|><|fim▁begin|> # Opus/UrbanSim urban simulation software. # Copyright (C) 2005-2009 University of Washington # See opus_core/LICENSE from opus_core.variables.variable import Variable from variable_functions import my_attribute_label from urbansim.length_constants ...
return get_is_near_arterial(self.get_dataset().get_attribute(self.distance_to_arterial), dataset_pool.get_dataset('urbansim_constant'))
<|file_name|>is_near_arterial.py<|end_file_name|><|fim▁begin|> # Opus/UrbanSim urban simulation software. # Copyright (C) 2005-2009 University of Washington # See opus_core/LICENSE from opus_core.variables.variable import Variable from variable_functions import my_attribute_label from urbansim.length_constants ...
self.do_check("x == False or x == True", values)
<|file_name|>is_near_arterial.py<|end_file_name|><|fim▁begin|> # Opus/UrbanSim urban simulation software. # Copyright (C) 2005-2009 University of Washington # See opus_core/LICENSE from opus_core.variables.variable import Variable from variable_functions import my_attribute_label from urbansim.length_constants ...
length = UrbanSimLength(distance, urbansim_constant["gridcell_width"].units) return length.less_than(urbansim_constant["near_arterial_threshold_unit"])
<|file_name|>is_near_arterial.py<|end_file_name|><|fim▁begin|> # Opus/UrbanSim urban simulation software. # Copyright (C) 2005-2009 University of Washington # See opus_core/LICENSE from opus_core.variables.variable import Variable from variable_functions import my_attribute_label from urbansim.length_constants ...
def test_my_inputs( self ): # Assumes distance is measured from the gridcell border to the arterial. tester = VariableTester( __file__, package_order=['urbansim'], test_data={ 'gridcell':{ 'grid_id': array([1,2,3,4,5,6]),...
<|file_name|>is_near_arterial.py<|end_file_name|><|fim▁begin|> # Opus/UrbanSim urban simulation software. # Copyright (C) 2005-2009 University of Washington # See opus_core/LICENSE from opus_core.variables.variable import Variable from variable_functions import my_attribute_label from urbansim.length_constants ...
tester = VariableTester( __file__, package_order=['urbansim'], test_data={ 'gridcell':{ 'grid_id': array([1,2,3,4,5,6]), 'distance_to_arterial': array([0.0, 50.0, 99.0, 100.0, 101.0, 200.0]), }...
<|file_name|>is_near_arterial.py<|end_file_name|><|fim▁begin|> # Opus/UrbanSim urban simulation software. # Copyright (C) 2005-2009 University of Washington # See opus_core/LICENSE from opus_core.variables.variable import Variable from variable_functions import my_attribute_label from urbansim.length_constants ...
opus_unittest.main()
<|file_name|>is_near_arterial.py<|end_file_name|><|fim▁begin|> # Opus/UrbanSim urban simulation software. # Copyright (C) 2005-2009 University of Washington # See opus_core/LICENSE from opus_core.variables.variable import Variable from variable_functions import my_attribute_label from urbansim.length_constants ...
dependencies
<|file_name|>is_near_arterial.py<|end_file_name|><|fim▁begin|> # Opus/UrbanSim urban simulation software. # Copyright (C) 2005-2009 University of Washington # See opus_core/LICENSE from opus_core.variables.variable import Variable from variable_functions import my_attribute_label from urbansim.length_constants ...
compute
<|file_name|>is_near_arterial.py<|end_file_name|><|fim▁begin|> # Opus/UrbanSim urban simulation software. # Copyright (C) 2005-2009 University of Washington # See opus_core/LICENSE from opus_core.variables.variable import Variable from variable_functions import my_attribute_label from urbansim.length_constants ...
post_check
<|file_name|>is_near_arterial.py<|end_file_name|><|fim▁begin|> # Opus/UrbanSim urban simulation software. # Copyright (C) 2005-2009 University of Washington # See opus_core/LICENSE from opus_core.variables.variable import Variable from variable_functions import my_attribute_label from urbansim.length_constants ...
get_is_near_arterial
<|file_name|>is_near_arterial.py<|end_file_name|><|fim▁begin|> # Opus/UrbanSim urban simulation software. # Copyright (C) 2005-2009 University of Washington # See opus_core/LICENSE from opus_core.variables.variable import Variable from variable_functions import my_attribute_label from urbansim.length_constants ...
test_my_inputs
<|file_name|>helpers.py<|end_file_name|><|fim▁begin|>from __future__ import print_function import os import sys import subprocess import pkg_resources try: import pkg_resources _has_pkg_resources = True except: _has_pkg_resources = False try: import svn.local _has_svn_local = True except: _has...
if label: n = {'{}'.format(label):s} else: n = {'source code':s}
<|file_name|>helpers.py<|end_file_name|><|fim▁begin|>from __future__ import print_function import os import sys import subprocess import pkg_resources try: import pkg_resources _has_pkg_resources = True except: _has_pkg_resources = False try: import svn.local _has_svn_local = True except: _has...
return "test helper text"
<|file_name|>helpers.py<|end_file_name|><|fim▁begin|>from __future__ import print_function import os import sys import subprocess import pkg_resources try: import pkg_resources _has_pkg_resources = True except: _has_pkg_resources = False try: import svn.local _has_svn_local = True except: _has...
""" Given a dictionary d, return a string with each entry in the form 'key: value' and entries separated by newlines. """ vals = [] for k in d.keys(): vals.append('{}: {}'.format(k, d[k])) v = '\n'.join(vals) return v
<|file_name|>helpers.py<|end_file_name|><|fim▁begin|>from __future__ import print_function import os import sys import subprocess import pkg_resources try: import pkg_resources _has_pkg_resources = True except: _has_pkg_resources = False try: import svn.local _has_svn_local = True except: _has...
""" Helper function for getting the module ("module") in the current namespace and their versions. The optional argument 'label' allows you to set the string used as the dictionary key in the returned dictionary. By default the key is '[module] version'. """ if not _has_pkg_resour...
<|file_name|>helpers.py<|end_file_name|><|fim▁begin|>from __future__ import print_function import os import sys import subprocess import pkg_resources try: import pkg_resources _has_pkg_resources = True except: _has_pkg_resources = False try: import svn.local _has_svn_local = True except: _has...
""" Helper function for getting the contents of a file, provided the filename. Returns a dictionary keyed (by default) with the filename where the value is a string containing the contents of the file. The optional argument 'label' allows you to set the string used as the dictiona...
<|file_name|>helpers.py<|end_file_name|><|fim▁begin|>from __future__ import print_function import os import sys import subprocess import pkg_resources try: import pkg_resources _has_pkg_resources = True except: _has_pkg_resources = False try: import svn.local _has_svn_local = True except: _has...
""" Helper function for obtaining the SVN repository information for the current directory (default) or the directory supplied in the svndir argument. Returns a dictionary keyed (by default) as 'SVN INFO' where the value is a string containing essentially what is returned by 'svn info'....
<|file_name|>helpers.py<|end_file_name|><|fim▁begin|>from __future__ import print_function import os import sys import subprocess import pkg_resources try: import pkg_resources _has_pkg_resources = True except: _has_pkg_resources = False try: import svn.local _has_svn_local = True except: _has...
""" Helper function for obtaining the git repository hash. for the current directory (default) or the directory supplied in the gitpath argument. Returns a dictionary keyed (by default) as 'GIT HASH' where the value is a string containing essentially wh...
<|file_name|>helpers.py<|end_file_name|><|fim▁begin|>from __future__ import print_function import os import sys import subprocess import pkg_resources try: import pkg_resources _has_pkg_resources = True except: _has_pkg_resources = False try: import svn.local _has_svn_local = True except: _has...
""" Helper function for obtaining the source code. for the current directory (default) or the directory supplied in the sourcepath argument. Returns a dictionary keyed (by default) as 'source code' where the value is a string containing the source code. The optional argument 'label' allo...
<|file_name|>helpers.py<|end_file_name|><|fim▁begin|>from __future__ import print_function import os import sys import subprocess import pkg_resources try: import pkg_resources _has_pkg_resources = True except: _has_pkg_resources = False try: import svn.local _has_svn_local = True except: _has...
return {}
<|file_name|>helpers.py<|end_file_name|><|fim▁begin|>from __future__ import print_function import os import sys import subprocess import pkg_resources try: import pkg_resources _has_pkg_resources = True except: _has_pkg_resources = False try: import svn.local _has_svn_local = True except: _has...
k = '{}'.format(label)
<|file_name|>helpers.py<|end_file_name|><|fim▁begin|>from __future__ import print_function import os import sys import subprocess import pkg_resources try: import pkg_resources _has_pkg_resources = True except: _has_pkg_resources = False try: import svn.local _has_svn_local = True except: _has...
k = '{} version'.format(module)
<|file_name|>helpers.py<|end_file_name|><|fim▁begin|>from __future__ import print_function import os import sys import subprocess import pkg_resources try: import pkg_resources _has_pkg_resources = True except: _has_pkg_resources = False try: import svn.local _has_svn_local = True except: _has...
print('ERROR: {} NOT FOUND.'.format(filename)) return {}
<|file_name|>helpers.py<|end_file_name|><|fim▁begin|>from __future__ import print_function import os import sys import subprocess import pkg_resources try: import pkg_resources _has_pkg_resources = True except: _has_pkg_resources = False try: import svn.local _has_svn_local = True except: _has...
fin = open(filename, 'r') contents = '' for l in fin: contents += l if label: d = {'{}'.format(label): contents} else: d = {filename: contents} return d
<|file_name|>helpers.py<|end_file_name|><|fim▁begin|>from __future__ import print_function import os import sys import subprocess import pkg_resources try: import pkg_resources _has_pkg_resources = True except: _has_pkg_resources = False try: import svn.local _has_svn_local = True except: _has...
d = {'{}'.format(label): contents}
<|file_name|>helpers.py<|end_file_name|><|fim▁begin|>from __future__ import print_function import os import sys import subprocess import pkg_resources try: import pkg_resources _has_pkg_resources = True except: _has_pkg_resources = False try: import svn.local _has_svn_local = True except: _has...
d = {filename: contents}
<|file_name|>helpers.py<|end_file_name|><|fim▁begin|>from __future__ import print_function import os import sys import subprocess import pkg_resources try: import pkg_resources _has_pkg_resources = True except: _has_pkg_resources = False try: import svn.local _has_svn_local = True except: _has...
print('SVN information unavailable.') print('You do not have the "svn" package installed.') print('Install "svn" from pip using "pip install svn"') return {}
<|file_name|>helpers.py<|end_file_name|><|fim▁begin|>from __future__ import print_function import os import sys import subprocess import pkg_resources try: import pkg_resources _has_pkg_resources = True except: _has_pkg_resources = False try: import svn.local _has_svn_local = True except: _has...
repo = svn.local.LocalClient(svndir)
<|file_name|>helpers.py<|end_file_name|><|fim▁begin|>from __future__ import print_function import os import sys import subprocess import pkg_resources try: import pkg_resources _has_pkg_resources = True except: _has_pkg_resources = False try: import svn.local _has_svn_local = True except: _has...
repo = svn.local.LocalClient(os.getcwd())
<|file_name|>helpers.py<|end_file_name|><|fim▁begin|>from __future__ import print_function import os import sys import subprocess import pkg_resources try: import pkg_resources _has_pkg_resources = True except: _has_pkg_resources = False try: import svn.local _has_svn_local = True except: _has...
k = '{}'.format(label)
<|file_name|>helpers.py<|end_file_name|><|fim▁begin|>from __future__ import print_function import os import sys import subprocess import pkg_resources try: import pkg_resources _has_pkg_resources = True except: _has_pkg_resources = False try: import svn.local _has_svn_local = True except: _has...
k = 'SVN INFO'
<|file_name|>helpers.py<|end_file_name|><|fim▁begin|>from __future__ import print_function import os import sys import subprocess import pkg_resources try: import pkg_resources _has_pkg_resources = True except: _has_pkg_resources = False try: import svn.local _has_svn_local = True except: _has...
thisdir = os.getcwd() os.chdir(gitpath)
<|file_name|>helpers.py<|end_file_name|><|fim▁begin|>from __future__ import print_function import os import sys import subprocess import pkg_resources try: import pkg_resources _has_pkg_resources = True except: _has_pkg_resources = False try: import svn.local _has_svn_local = True except: _has...
l = '{}'.format(label)
<|file_name|>helpers.py<|end_file_name|><|fim▁begin|>from __future__ import print_function import os import sys import subprocess import pkg_resources try: import pkg_resources _has_pkg_resources = True except: _has_pkg_resources = False try: import svn.local _has_svn_local = True except: _has...
l = 'GIT HASH'
<|file_name|>helpers.py<|end_file_name|><|fim▁begin|>from __future__ import print_function import os import sys import subprocess import pkg_resources try: import pkg_resources _has_pkg_resources = True except: _has_pkg_resources = False try: import svn.local _has_svn_local = True except: _has...
os.chdir(sourcepath)
<|file_name|>helpers.py<|end_file_name|><|fim▁begin|>from __future__ import print_function import os import sys import subprocess import pkg_resources try: import pkg_resources _has_pkg_resources = True except: _has_pkg_resources = False try: import svn.local _has_svn_local = True except: _has...
print('ERROR: {} NOT FOUND.'.format(scode)) return {}
<|file_name|>helpers.py<|end_file_name|><|fim▁begin|>from __future__ import print_function import os import sys import subprocess import pkg_resources try: import pkg_resources _has_pkg_resources = True except: _has_pkg_resources = False try: import svn.local _has_svn_local = True except: _has...
with open(scode,'r') as f: s = f.read() if label: n = {'{}'.format(label):s} else: n = {'source code':s}
<|file_name|>helpers.py<|end_file_name|><|fim▁begin|>from __future__ import print_function import os import sys import subprocess import pkg_resources try: import pkg_resources _has_pkg_resources = True except: _has_pkg_resources = False try: import svn.local _has_svn_local = True except: _has...
n = {'{}'.format(label):s}
<|file_name|>helpers.py<|end_file_name|><|fim▁begin|>from __future__ import print_function import os import sys import subprocess import pkg_resources try: import pkg_resources _has_pkg_resources = True except: _has_pkg_resources = False try: import svn.local _has_svn_local = True except: _has...
n = {'source code':s}
<|file_name|>helpers.py<|end_file_name|><|fim▁begin|>from __future__ import print_function import os import sys import subprocess import pkg_resources try: import pkg_resources _has_pkg_resources = True except: _has_pkg_resources = False try: import svn.local _has_svn_local = True except: _has...
test_helper
<|file_name|>helpers.py<|end_file_name|><|fim▁begin|>from __future__ import print_function import os import sys import subprocess import pkg_resources try: import pkg_resources _has_pkg_resources = True except: _has_pkg_resources = False try: import svn.local _has_svn_local = True except: _has...
dict_to_str
<|file_name|>helpers.py<|end_file_name|><|fim▁begin|>from __future__ import print_function import os import sys import subprocess import pkg_resources try: import pkg_resources _has_pkg_resources = True except: _has_pkg_resources = False try: import svn.local _has_svn_local = True except: _has...
module_version
<|file_name|>helpers.py<|end_file_name|><|fim▁begin|>from __future__ import print_function import os import sys import subprocess import pkg_resources try: import pkg_resources _has_pkg_resources = True except: _has_pkg_resources = False try: import svn.local _has_svn_local = True except: _has...
file_contents
<|file_name|>helpers.py<|end_file_name|><|fim▁begin|>from __future__ import print_function import os import sys import subprocess import pkg_resources try: import pkg_resources _has_pkg_resources = True except: _has_pkg_resources = False try: import svn.local _has_svn_local = True except: _has...
svn_information
<|file_name|>helpers.py<|end_file_name|><|fim▁begin|>from __future__ import print_function import os import sys import subprocess import pkg_resources try: import pkg_resources _has_pkg_resources = True except: _has_pkg_resources = False try: import svn.local _has_svn_local = True except: _has...
get_git_hash
<|file_name|>helpers.py<|end_file_name|><|fim▁begin|>from __future__ import print_function import os import sys import subprocess import pkg_resources try: import pkg_resources _has_pkg_resources = True except: _has_pkg_resources = False try: import svn.local _has_svn_local = True except: _has...
get_source_code
<|file_name|>switch.py<|end_file_name|><|fim▁begin|>"""Support for Switchbot bot.""" from __future__ import annotations <|fim▁hole|> from switchbot import Switchbot # pylint: disable=import-error import voluptuous as vol from homeassistant.components.switch import ( DEVICE_CLASS_SWITCH, PLATFORM_SCHEMA, S...
import logging from typing import Any
<|file_name|>switch.py<|end_file_name|><|fim▁begin|>"""Support for Switchbot bot.""" from __future__ import annotations import logging from typing import Any from switchbot import Switchbot # pylint: disable=import-error import voluptuous as vol from homeassistant.components.switch import ( DEVICE_CLASS_SWITCH,...
"""Import yaml config and initiates config flow for Switchbot devices.""" # Check if entry config exists and skips import if it does. if hass.config_entries.async_entries(DOMAIN): return hass.async_create_task( hass.config_entries.flow.async_init( DOMAIN, contex...
<|file_name|>switch.py<|end_file_name|><|fim▁begin|>"""Support for Switchbot bot.""" from __future__ import annotations import logging from typing import Any from switchbot import Switchbot # pylint: disable=import-error import voluptuous as vol from homeassistant.components.switch import ( DEVICE_CLASS_SWITCH,...
"""Set up Switchbot based on a config entry.""" coordinator: SwitchbotDataUpdateCoordinator = hass.data[DOMAIN][entry.entry_id][ DATA_COORDINATOR ] async_add_entities( [ SwitchBotBotEntity( coordinator, entry.unique_id, entry.d...
<|file_name|>switch.py<|end_file_name|><|fim▁begin|>"""Support for Switchbot bot.""" from __future__ import annotations import logging from typing import Any from switchbot import Switchbot # pylint: disable=import-error import voluptuous as vol from homeassistant.components.switch import ( DEVICE_CLASS_SWITCH,...
"""Representation of a Switchbot.""" coordinator: SwitchbotDataUpdateCoordinator _attr_device_class = DEVICE_CLASS_SWITCH def __init__( self, coordinator: SwitchbotDataUpdateCoordinator, idx: str | None, mac: str, name: str, device: Switchbot, ) -> N...
<|file_name|>switch.py<|end_file_name|><|fim▁begin|>"""Support for Switchbot bot.""" from __future__ import annotations import logging from typing import Any from switchbot import Switchbot # pylint: disable=import-error import voluptuous as vol from homeassistant.components.switch import ( DEVICE_CLASS_SWITCH,...
"""Initialize the Switchbot.""" super().__init__(coordinator, idx, mac, name) self._attr_unique_id = idx self._device = device
<|file_name|>switch.py<|end_file_name|><|fim▁begin|>"""Support for Switchbot bot.""" from __future__ import annotations import logging from typing import Any from switchbot import Switchbot # pylint: disable=import-error import voluptuous as vol from homeassistant.components.switch import ( DEVICE_CLASS_SWITCH,...
"""Run when entity about to be added.""" await super().async_added_to_hass() last_state = await self.async_get_last_state() if not last_state: return self._attr_is_on = last_state.state == STATE_ON self._last_run_success = last_state.attributes["last_run_succe...
<|file_name|>switch.py<|end_file_name|><|fim▁begin|>"""Support for Switchbot bot.""" from __future__ import annotations import logging from typing import Any from switchbot import Switchbot # pylint: disable=import-error import voluptuous as vol from homeassistant.components.switch import ( DEVICE_CLASS_SWITCH,...
"""Turn device on.""" _LOGGER.info("Turn Switchbot bot on %s", self._mac) async with self.coordinator.api_lock: self._last_run_success = bool( await self.hass.async_add_executor_job(self._device.turn_on) )
<|file_name|>switch.py<|end_file_name|><|fim▁begin|>"""Support for Switchbot bot.""" from __future__ import annotations import logging from typing import Any from switchbot import Switchbot # pylint: disable=import-error import voluptuous as vol from homeassistant.components.switch import ( DEVICE_CLASS_SWITCH,...
"""Turn device off.""" _LOGGER.info("Turn Switchbot bot off %s", self._mac) async with self.coordinator.api_lock: self._last_run_success = bool( await self.hass.async_add_executor_job(self._device.turn_off) )
<|file_name|>switch.py<|end_file_name|><|fim▁begin|>"""Support for Switchbot bot.""" from __future__ import annotations import logging from typing import Any from switchbot import Switchbot # pylint: disable=import-error import voluptuous as vol from homeassistant.components.switch import ( DEVICE_CLASS_SWITCH,...
"""Return true if unable to access real state of entity.""" if not self.data["data"]["switchMode"]: return True return False
<|file_name|>switch.py<|end_file_name|><|fim▁begin|>"""Support for Switchbot bot.""" from __future__ import annotations import logging from typing import Any from switchbot import Switchbot # pylint: disable=import-error import voluptuous as vol from homeassistant.components.switch import ( DEVICE_CLASS_SWITCH,...
"""Return true if device is on.""" return self.data["data"]["isOn"]
<|file_name|>switch.py<|end_file_name|><|fim▁begin|>"""Support for Switchbot bot.""" from __future__ import annotations import logging from typing import Any from switchbot import Switchbot # pylint: disable=import-error import voluptuous as vol from homeassistant.components.switch import ( DEVICE_CLASS_SWITCH,...
"""Return the state attributes.""" return { **super().extra_state_attributes, "switch_mode": self.data["data"]["switchMode"], }
<|file_name|>switch.py<|end_file_name|><|fim▁begin|>"""Support for Switchbot bot.""" from __future__ import annotations import logging from typing import Any from switchbot import Switchbot # pylint: disable=import-error import voluptuous as vol from homeassistant.components.switch import ( DEVICE_CLASS_SWITCH,...
return
<|file_name|>switch.py<|end_file_name|><|fim▁begin|>"""Support for Switchbot bot.""" from __future__ import annotations import logging from typing import Any from switchbot import Switchbot # pylint: disable=import-error import voluptuous as vol from homeassistant.components.switch import ( DEVICE_CLASS_SWITCH,...
return
<|file_name|>switch.py<|end_file_name|><|fim▁begin|>"""Support for Switchbot bot.""" from __future__ import annotations import logging from typing import Any from switchbot import Switchbot # pylint: disable=import-error import voluptuous as vol from homeassistant.components.switch import ( DEVICE_CLASS_SWITCH,...
return True
<|file_name|>switch.py<|end_file_name|><|fim▁begin|>"""Support for Switchbot bot.""" from __future__ import annotations import logging from typing import Any from switchbot import Switchbot # pylint: disable=import-error import voluptuous as vol from homeassistant.components.switch import ( DEVICE_CLASS_SWITCH,...
async_setup_platform
<|file_name|>switch.py<|end_file_name|><|fim▁begin|>"""Support for Switchbot bot.""" from __future__ import annotations import logging from typing import Any from switchbot import Switchbot # pylint: disable=import-error import voluptuous as vol from homeassistant.components.switch import ( DEVICE_CLASS_SWITCH,...
async_setup_entry
<|file_name|>switch.py<|end_file_name|><|fim▁begin|>"""Support for Switchbot bot.""" from __future__ import annotations import logging from typing import Any from switchbot import Switchbot # pylint: disable=import-error import voluptuous as vol from homeassistant.components.switch import ( DEVICE_CLASS_SWITCH,...
__init__
<|file_name|>switch.py<|end_file_name|><|fim▁begin|>"""Support for Switchbot bot.""" from __future__ import annotations import logging from typing import Any from switchbot import Switchbot # pylint: disable=import-error import voluptuous as vol from homeassistant.components.switch import ( DEVICE_CLASS_SWITCH,...
async_added_to_hass
<|file_name|>switch.py<|end_file_name|><|fim▁begin|>"""Support for Switchbot bot.""" from __future__ import annotations import logging from typing import Any from switchbot import Switchbot # pylint: disable=import-error import voluptuous as vol from homeassistant.components.switch import ( DEVICE_CLASS_SWITCH,...
async_turn_on
<|file_name|>switch.py<|end_file_name|><|fim▁begin|>"""Support for Switchbot bot.""" from __future__ import annotations import logging from typing import Any from switchbot import Switchbot # pylint: disable=import-error import voluptuous as vol from homeassistant.components.switch import ( DEVICE_CLASS_SWITCH,...
async_turn_off
<|file_name|>switch.py<|end_file_name|><|fim▁begin|>"""Support for Switchbot bot.""" from __future__ import annotations import logging from typing import Any from switchbot import Switchbot # pylint: disable=import-error import voluptuous as vol from homeassistant.components.switch import ( DEVICE_CLASS_SWITCH,...
assumed_state
<|file_name|>switch.py<|end_file_name|><|fim▁begin|>"""Support for Switchbot bot.""" from __future__ import annotations import logging from typing import Any from switchbot import Switchbot # pylint: disable=import-error import voluptuous as vol from homeassistant.components.switch import ( DEVICE_CLASS_SWITCH,...
is_on
<|file_name|>switch.py<|end_file_name|><|fim▁begin|>"""Support for Switchbot bot.""" from __future__ import annotations import logging from typing import Any from switchbot import Switchbot # pylint: disable=import-error import voluptuous as vol from homeassistant.components.switch import ( DEVICE_CLASS_SWITCH,...
extra_state_attributes
<|file_name|>ip.py<|end_file_name|><|fim▁begin|>from charmhelpers.core.hookenv import ( config, unit_get, ) from charmhelpers.contrib.network.ip import ( get_address_in_network, is_address_in_network, is_ipv6, get_ipv6_addr, ) from charmhelpers.contrib.hahelpers.cluster import is_clustered PU...
<|file_name|>ip.py<|end_file_name|><|fim▁begin|>from charmhelpers.core.hookenv import ( config, unit_get, ) from charmhelpers.contrib.network.ip import ( get_address_in_network, is_address_in_network, is_ipv6, get_ipv6_addr, ) from charmhelpers.contrib.hahelpers.cluster import is_clustered PU...
''' Returns the correct HTTP URL to this host given the state of HTTPS configuration, hacluster and charm configuration. :configs OSTemplateRenderer: A config tempating object to inspect for a complete https context. :endpoint_type str: The endpoint type to resolve. :returns str: Base ...
<|file_name|>ip.py<|end_file_name|><|fim▁begin|>from charmhelpers.core.hookenv import ( config, unit_get, ) from charmhelpers.contrib.network.ip import ( get_address_in_network, is_address_in_network, is_ipv6, get_ipv6_addr, ) from charmhelpers.contrib.hahelpers.cluster import is_clustered PU...
resolved_address = None if is_clustered(): if config(_address_map[endpoint_type]['config']) is None: # Assume vip is simple and pass back directly resolved_address = config('vip') else: for vip in config('vip').split(): if is_address_in_network...
<|file_name|>ip.py<|end_file_name|><|fim▁begin|>from charmhelpers.core.hookenv import ( config, unit_get, ) from charmhelpers.contrib.network.ip import ( get_address_in_network, is_address_in_network, is_ipv6, get_ipv6_addr, ) from charmhelpers.contrib.hahelpers.cluster import is_clustered PU...
scheme = 'https'
<|file_name|>ip.py<|end_file_name|><|fim▁begin|>from charmhelpers.core.hookenv import ( config, unit_get, ) from charmhelpers.contrib.network.ip import ( get_address_in_network, is_address_in_network, is_ipv6, get_ipv6_addr, ) from charmhelpers.contrib.hahelpers.cluster import is_clustered PU...
address = "[{}]".format(address)
<|file_name|>ip.py<|end_file_name|><|fim▁begin|>from charmhelpers.core.hookenv import ( config, unit_get, ) from charmhelpers.contrib.network.ip import ( get_address_in_network, is_address_in_network, is_ipv6, get_ipv6_addr, ) from charmhelpers.contrib.hahelpers.cluster import is_clustered PU...
if config(_address_map[endpoint_type]['config']) is None: # Assume vip is simple and pass back directly resolved_address = config('vip') else: for vip in config('vip').split(): if is_address_in_network( config(_address_map[endpo...
<|file_name|>ip.py<|end_file_name|><|fim▁begin|>from charmhelpers.core.hookenv import ( config, unit_get, ) from charmhelpers.contrib.network.ip import ( get_address_in_network, is_address_in_network, is_ipv6, get_ipv6_addr, ) from charmhelpers.contrib.hahelpers.cluster import is_clustered PU...
resolved_address = config('vip')
<|file_name|>ip.py<|end_file_name|><|fim▁begin|>from charmhelpers.core.hookenv import ( config, unit_get, ) from charmhelpers.contrib.network.ip import ( get_address_in_network, is_address_in_network, is_ipv6, get_ipv6_addr, ) from charmhelpers.contrib.hahelpers.cluster import is_clustered PU...
for vip in config('vip').split(): if is_address_in_network( config(_address_map[endpoint_type]['config']), vip): resolved_address = vip
<|file_name|>ip.py<|end_file_name|><|fim▁begin|>from charmhelpers.core.hookenv import ( config, unit_get, ) from charmhelpers.contrib.network.ip import ( get_address_in_network, is_address_in_network, is_ipv6, get_ipv6_addr, ) from charmhelpers.contrib.hahelpers.cluster import is_clustered PU...
resolved_address = vip
<|file_name|>ip.py<|end_file_name|><|fim▁begin|>from charmhelpers.core.hookenv import ( config, unit_get, ) from charmhelpers.contrib.network.ip import ( get_address_in_network, is_address_in_network, is_ipv6, get_ipv6_addr, ) from charmhelpers.contrib.hahelpers.cluster import is_clustered PU...
if config('prefer-ipv6'): fallback_addr = get_ipv6_addr() else: fallback_addr = unit_get(_address_map[endpoint_type]['fallback']) resolved_address = get_address_in_network( config(_address_map[endpoint_type]['config']), fallback_addr)
<|file_name|>ip.py<|end_file_name|><|fim▁begin|>from charmhelpers.core.hookenv import ( config, unit_get, ) from charmhelpers.contrib.network.ip import ( get_address_in_network, is_address_in_network, is_ipv6, get_ipv6_addr, ) from charmhelpers.contrib.hahelpers.cluster import is_clustered PU...
fallback_addr = get_ipv6_addr()
<|file_name|>ip.py<|end_file_name|><|fim▁begin|>from charmhelpers.core.hookenv import ( config, unit_get, ) from charmhelpers.contrib.network.ip import ( get_address_in_network, is_address_in_network, is_ipv6, get_ipv6_addr, ) from charmhelpers.contrib.hahelpers.cluster import is_clustered PU...
fallback_addr = unit_get(_address_map[endpoint_type]['fallback'])
<|file_name|>ip.py<|end_file_name|><|fim▁begin|>from charmhelpers.core.hookenv import ( config, unit_get, ) from charmhelpers.contrib.network.ip import ( get_address_in_network, is_address_in_network, is_ipv6, get_ipv6_addr, ) from charmhelpers.contrib.hahelpers.cluster import is_clustered PU...
raise ValueError('Unable to resolve a suitable IP address' ' based on charm state and configuration')
<|file_name|>ip.py<|end_file_name|><|fim▁begin|>from charmhelpers.core.hookenv import ( config, unit_get, ) from charmhelpers.contrib.network.ip import ( get_address_in_network, is_address_in_network, is_ipv6, get_ipv6_addr, ) from charmhelpers.contrib.hahelpers.cluster import is_clustered PU...
return resolved_address
<|file_name|>ip.py<|end_file_name|><|fim▁begin|>from charmhelpers.core.hookenv import ( config, unit_get, ) from charmhelpers.contrib.network.ip import ( get_address_in_network, is_address_in_network, is_ipv6, get_ipv6_addr, ) from charmhelpers.contrib.hahelpers.cluster import is_clustered PU...
canonical_url
<|file_name|>ip.py<|end_file_name|><|fim▁begin|>from charmhelpers.core.hookenv import ( config, unit_get, ) from charmhelpers.contrib.network.ip import ( get_address_in_network, is_address_in_network, is_ipv6, get_ipv6_addr, ) from charmhelpers.contrib.hahelpers.cluster import is_clustered PU...
resolve_address
<|file_name|>Coupling2DCavities2D.py<|end_file_name|><|fim▁begin|>import numpy as np from Coupling import Coupling class Coupling2DCavities2D(Coupling): """ Coupling for cavity2D to cavity transmission. """ @property def impedance_from(self): """ Choses the right impedance of s...
return self.tau / (4.0 * np.pi)
<|file_name|>Coupling2DCavities2D.py<|end_file_name|><|fim▁begin|>import numpy as np from Coupling import Coupling class Coupling2DCavities2D(Coupling): <|fim_middle|> <|fim▁end|>
""" Coupling for cavity2D to cavity transmission. """ @property def impedance_from(self): """ Choses the right impedance of subsystem_from. Applies boundary conditions correction as well. """ return self.subsystem_from.impedance @property def impedan...
<|file_name|>Coupling2DCavities2D.py<|end_file_name|><|fim▁begin|>import numpy as np from Coupling import Coupling class Coupling2DCavities2D(Coupling): """ Coupling for cavity2D to cavity transmission. """ @property def impedance_from(self): <|fim_middle|> @property def impe...
""" Choses the right impedance of subsystem_from. Applies boundary conditions correction as well. """ return self.subsystem_from.impedance
<|file_name|>Coupling2DCavities2D.py<|end_file_name|><|fim▁begin|>import numpy as np from Coupling import Coupling class Coupling2DCavities2D(Coupling): """ Coupling for cavity2D to cavity transmission. """ @property def impedance_from(self): """ Choses the right impedance of s...
""" Choses the right impedance of subsystem_from. Applies boundary conditions correction as well. """ return self.subsystem_to.impedance
<|file_name|>Coupling2DCavities2D.py<|end_file_name|><|fim▁begin|>import numpy as np from Coupling import Coupling class Coupling2DCavities2D(Coupling): """ Coupling for cavity2D to cavity transmission. """ @property def impedance_from(self): """ Choses the right impedance of s...
""" Transmission coefficient. """ return np.zeros(self.frequency.amount)
<|file_name|>Coupling2DCavities2D.py<|end_file_name|><|fim▁begin|>import numpy as np from Coupling import Coupling class Coupling2DCavities2D(Coupling): """ Coupling for cavity2D to cavity transmission. """ @property def impedance_from(self): """ Choses the right impedance of s...
""" Coupling loss factor for transmission from a 2D cavity to a cavity. .. math:: \\eta_{12} = \\frac{ \\tau_{12}}{4 \\pi} See BAC, equation 3.14 """ return self.tau / (4.0 * np.pi)
<|file_name|>Coupling2DCavities2D.py<|end_file_name|><|fim▁begin|>import numpy as np from Coupling import Coupling class Coupling2DCavities2D(Coupling): """ Coupling for cavity2D to cavity transmission. """ @property def <|fim_middle|>(self): """ Choses the right impedance of s...
impedance_from
<|file_name|>Coupling2DCavities2D.py<|end_file_name|><|fim▁begin|>import numpy as np from Coupling import Coupling class Coupling2DCavities2D(Coupling): """ Coupling for cavity2D to cavity transmission. """ @property def impedance_from(self): """ Choses the right impedance of s...
impedance_to
<|file_name|>Coupling2DCavities2D.py<|end_file_name|><|fim▁begin|>import numpy as np from Coupling import Coupling class Coupling2DCavities2D(Coupling): """ Coupling for cavity2D to cavity transmission. """ @property def impedance_from(self): """ Choses the right impedance of s...
tau
<|file_name|>Coupling2DCavities2D.py<|end_file_name|><|fim▁begin|>import numpy as np from Coupling import Coupling class Coupling2DCavities2D(Coupling): """ Coupling for cavity2D to cavity transmission. """ @property def impedance_from(self): """ Choses the right impedance of s...
clf
<|file_name|>urls.py<|end_file_name|><|fim▁begin|>from django.conf.urls import url from . import views from django.views.decorators.cache import cache_page <|fim▁hole|>urlpatterns = [ url(r'^$', views.IndexView.as_view(), name='index'), url(r'^logout/$', views.logout_view, name='logout'), ]<|fim▁end|>
app_name = 'webinter'
<|file_name|>feed_parse_extractLittlebambooHomeBlog.py<|end_file_name|><|fim▁begin|>def extractLittlebambooHomeBlog(item):<|fim▁hole|> ''' Parser for 'littlebamboo.home.blog' ''' vol, chp, frag, postfix = extractVolChapterFragmentPostfix(item['title']) if not (chp or vol) or "preview" in item['title'].lower(): r...
<|file_name|>feed_parse_extractLittlebambooHomeBlog.py<|end_file_name|><|fim▁begin|>def extractLittlebambooHomeBlog(item): <|fim_middle|> <|fim▁end|>
''' Parser for 'littlebamboo.home.blog' ''' vol, chp, frag, postfix = extractVolChapterFragmentPostfix(item['title']) if not (chp or vol) or "preview" in item['title'].lower(): return None tagmap = [ ('FW', 'Fortunate Wife', 'translated'), ('PRC', 'PRC', ...