code string | signature string | docstring string | loss_without_docstring float64 | loss_with_docstring float64 | factor float64 |
|---|---|---|---|---|---|
port, pin = self.pin_to_port(pin)
self.i2c_write([0x12 + port])
raw = self.i2c_read(1)
value = struct.unpack('>B', raw)[0]
return (value & (1 << pin)) > 0 | def read(self, pin) | Read the pin state of an input pin.
Make sure you put the pin in input modus with the IODIR* register or direction_* attribute first.
:Example:
>>> expander = MCP23017I2C(gw)
>>> # Read the logic level on pin B3
>>> expander.read('B3')
False
>>> # Read the logic... | 3.423005 | 4.067451 | 0.84156 |
if port == 'A':
raw = self.i2c_read_register(0x12, 1)
elif port == 'B':
raw = self.i2c_read_register(0x13, 1)
return struct.unpack('>B', raw)[0] | def read_port(self, port) | Read the pin state of a whole port (8 pins)
:Example:
>>> expander = MCP23017I2C(gw)
>>> # Read pin A0-A7 as a int (A0 and A1 are high)
>>> expander.read_port('A')
3
>>> # Read pin B0-B7 as a int (B2 is high)
>>> expander.read_port('B')
4
:param... | 2.735914 | 2.973612 | 0.920064 |
port, pin = self.pin_to_port(pin)
portname = 'A'
if port == 1:
portname = 'B'
self._update_register('GPIO' + portname, pin, value)
self.sync() | def write(self, pin, value) | Set the pin state.
Make sure you put the pin in output mode first.
:param pin: The label for the pin to write to. (Ex. A0)
:param value: Boolean representing the new state | 5.400563 | 7.002288 | 0.771257 |
if port == 'A':
self.GPIOA = value
elif port == 'B':
self.GPIOB = value
else:
raise AttributeError('Port {} does not exist, use A or B'.format(port))
self.sync() | def write_port(self, port, value) | Use a whole port as a bus and write a byte to it.
:param port: Name of the port ('A' or 'B')
:param value: Value to write (0-255) | 3.77996 | 3.608324 | 1.047567 |
registers = {
0x00: 'IODIRA',
0x01: 'IODIRB',
0x02: 'IPOLA',
0x03: 'IPOLB',
0x04: 'GPINTENA',
0x05: 'GPINTENB',
0x0C: 'GPPUA',
0x0D: 'GPPUB',
0x12: 'GPIOA',
0x13: 'GPIOB'
}
... | def sync(self) | Upload the changed registers to the chip
This will check which register have been changed since the last sync and send them to the chip.
You need to call this method if you modify one of the register attributes (mcp23017.IODIRA for example) or
if you use one of the helper attributes (mcp23017.d... | 2.271404 | 1.977355 | 1.148708 |
result = []
for a in range(0, 7):
result.append(GPIOPin(self, '_action', {'pin': 'A{}'.format(a)}, name='A{}'.format(a)))
for b in range(0, 7):
result.append(GPIOPin(self, '_action', {'pin': 'B{}'.format(b)}, name='B{}'.format(b)))
return result | def get_pins(self) | Get a list containing references to all 16 pins of the chip.
:Example:
>>> expander = MCP23017I2C(gw)
>>> pins = expander.get_pins()
>>> pprint.pprint(pins)
[<GPIOPin A0 on MCP23017I2C>,
<GPIOPin A1 on MCP23017I2C>,
<GPIOPin A2 on MCP23017I2C>,
<GPIOP... | 3.167868 | 2.872697 | 1.102751 |
m = getattr(self.chip, self.method)
return m(**self.arguments) | def read(self) | Get the logic input level for the pin
:return: True if the input is high | 16.360119 | 23.203339 | 0.705076 |
if self.inverted:
value = not value
m = getattr(self.chip, self.method)
m(value=value, **self.arguments) | def write(self, value) | Set the logic output level for the pin.
:type value: bool
:param value: True for a logic high | 7.935539 | 11.618538 | 0.683007 |
self.init_config(app)
# Initialize extensions
self.menu_ext.init_app(app)
self.menu = app.extensions['menu']
self.breadcrumbs.init_app(app)
# Register blueprint in order to register template and static folder.
app.register_blueprint(Blueprint(
... | def init_app(self, app, **kwargs) | Initialize application object.
:param app: An instance of :class:`~flask.Flask`. | 3.3137 | 3.382202 | 0.979746 |
_vars = ['BASE_TEMPLATE', 'COVER_TEMPLATE', 'SETTINGS_TEMPLATE']
# Sets RequireJS config and SASS binary as well if not already set.
for k in dir(config):
if k.startswith('THEME_') or k in [
'REQUIREJS_CONFIG', 'SASS_BIN'] + _vars:
app.co... | def init_config(self, app) | Initialize configuration.
:param app: An instance of :class:`~flask.Flask`. | 4.955497 | 5.306684 | 0.933822 |
self.i2c_write_register(0x1c, accel)
self.i2c_write_register(0x1b, gyro)
self.accel_range = accel
self.gyro_range = gyro | def set_range(self, accel=1, gyro=1) | Set the measurement range for the accel and gyro MEMS. Higher range means less resolution.
:param accel: a RANGE_ACCEL_* constant
:param gyro: a RANGE_GYRO_* constant
:Example:
.. code-block:: python
sensor = MPU6050I2C(gateway_class_instance)
sensor.set_range... | 2.511611 | 3.087821 | 0.813393 |
current = self.i2c_read_register(0x37, 1)[0]
if enable:
current |= 0b00000010
else:
current &= 0b11111101
self.i2c_write_register(0x37, current) | def set_slave_bus_bypass(self, enable) | Put the aux i2c bus on the MPU-6050 in bypass mode, thus connecting it to the main i2c bus directly
Dont forget to use wakeup() or else the slave bus is unavailable
:param enable:
:return: | 2.185267 | 2.320567 | 0.941695 |
if not self.awake:
raise Exception("MPU6050 is in sleep mode, use wakeup()")
raw = self.i2c_read_register(0x41, 2)
raw = struct.unpack('>h', raw)[0]
return round((raw / 340) + 36.53, 2) | def temperature(self) | Read the value for the internal temperature sensor.
:returns: Temperature in degree celcius as float
:Example:
>>> sensor = MPU6050I2C(gw)
>>> sensor.wakeup()
>>> sensor.temperature()
49.38 | 4.511456 | 4.564402 | 0.9884 |
if not self.awake:
raise Exception("MPU6050 is in sleep mode, use wakeup()")
raw = self.i2c_read_register(0x3B, 6)
x, y, z = struct.unpack('>HHH', raw)
scales = {
self.RANGE_ACCEL_2G: 16384,
self.RANGE_ACCEL_4G: 8192,
self.RANGE_A... | def acceleration(self) | Return the acceleration in G's
:returns: Acceleration for every axis as a tuple
:Example:
>>> sensor = MPU6050I2C(gw)
>>> sensor.wakeup()
>>> sensor.acceleration()
(0.6279296875, 0.87890625, 1.1298828125) | 2.569378 | 2.61562 | 0.982321 |
if not self.awake:
raise Exception("MPU6050 is in sleep mode, use wakeup()")
raw = self.i2c_read_register(0x43, 6)
x, y, z = struct.unpack('>HHH', raw)
scales = {
self.RANGE_GYRO_250DEG: 16384,
self.RANGE_GYRO_500DEG: 8192,
self.R... | def angular_rate(self) | Return the angular rate for every axis in degree/second.
:returns: Angular rate for every axis as a tuple
:Example:
>>> sensor = MPU6050I2C(gw)
>>> sensor.wakeup()
>>> sensor.angular_rate()
(1.380859375, 1.6318359375, 1.8828125) | 2.715186 | 2.739043 | 0.99129 |
return [
str(value) if is_lazy_string(value) else value
for value in super(LazyNpmBundle, self)._get_contents()
] | def _get_contents(self) | Create strings from lazy strings. | 9.314099 | 5.892723 | 1.58061 |
registers = self.i2c_read_register(0xAA, 22)
(
self.cal['AC1'],
self.cal['AC2'],
self.cal['AC3'],
self.cal['AC4'],
self.cal['AC5'],
self.cal['AC6'],
self.cal['B1'],
self.cal['B2'],
self.c... | def load_calibration(self) | Load factory calibration data from device. | 2.411179 | 2.289456 | 1.053167 |
ut = self.get_raw_temp()
x1 = ((ut - self.cal['AC6']) * self.cal['AC5']) >> 15
x2 = (self.cal['MC'] << 11) // (x1 + self.cal['MD'])
b5 = x1 + x2
return ((b5 + 8) >> 4) / 10 | def temperature(self) | Get the temperature from the sensor.
:returns: The temperature in degree celcius as a float
:example:
>>> sensor = BMP180(gw)
>>> sensor.load_calibration()
>>> sensor.temperature()
21.4 | 3.206004 | 3.287432 | 0.975231 |
ut = self.get_raw_temp()
up = self.get_raw_pressure()
x1 = ((ut - self.cal['AC6']) * self.cal['AC5']) >> 15
x2 = (self.cal['MC'] << 11) // (x1 + self.cal['MD'])
b5 = x1 + x2
b6 = b5 - 4000
x1 = (self.cal['B2'] * (b6 * b6) >> 12) >> 11
x2 = (self.c... | def pressure(self) | Get barometric pressure in milibar
:returns: The pressure in milibar as a int
:example:
>>> sensor = BMP180(gw)
>>> sensor.load_calibration()
>>> sensor.pressure()
75216 | 1.649871 | 1.639668 | 1.006222 |
packet = bytearray()
packet.append(new_mode)
self.device.write(packet)
possible_responses = {
self.MODE_I2C: b'I2C1',
self.MODE_RAW: b'BBIO1',
self.MODE_SPI: b'API1',
self.MODE_UART: b'ART1',
self.MODE_ONEWIRE: b'1W01'
... | def switch_mode(self, new_mode) | Explicitly switch the Bus Pirate mode
:param new_mode: The mode to switch to. Use the buspirate.MODE_* constants | 3.506683 | 3.618405 | 0.969124 |
if power is not None:
self.power = power
if pullup is not None:
self.pullup = pullup
if aux is not None:
self.aux = aux
if chip_select is not None:
self.chip_select = chip_select
# Set peripheral status
peripheral_b... | def set_peripheral(self, power=None, pullup=None, aux=None, chip_select=None) | Set the peripheral config at runtime.
If a parameter is None then the config will not be changed.
:param power: Set to True to enable the power supply or False to disable
:param pullup: Set to True to enable the internal pull-up resistors. False to disable
:param aux: Set the AUX pin ou... | 1.876915 | 2.000641 | 0.938157 |
lower_bits_mapping = {
'400kHz': 3,
'100kHz': 2,
'50kHz': 1,
'5kHz': 0,
}
if i2c_speed not in lower_bits_mapping:
raise ValueError('Invalid i2c_speed')
speed_byte = 0b01100000 | lower_bits_mapping[i2c_speed]
sel... | def _set_i2c_speed(self, i2c_speed) | Set I2C speed to one of '400kHz', '100kHz', 50kHz', '5kHz' | 2.674748 | 2.377936 | 1.124819 |
averaging_conf = {
1: 0,
2: 1,
4: 2,
8: 3
}
if averaging not in averaging_conf.keys():
raise Exception('Averaging should be one of: 1,2,4,8')
datarates = {
0.75: 0,
1.5: 1,
3: 2,
... | def config(self, averaging=1, datarate=15, mode=MODE_NORMAL) | Set the base config for sensor
:param averaging: Sets the numer of samples that are internally averaged
:param datarate: Datarate in hertz
:param mode: one of the MODE_* constants | 2.65179 | 2.888914 | 0.917919 |
options = {
1370: 0,
1090: 1,
820: 2,
660: 3,
440: 4,
390: 5,
330: 6,
230: 7
}
if resolution not in options.keys():
raise Exception('Resolution of {} steps is not supported'.form... | def set_resolution(self, resolution=1090) | Set the resolution of the sensor
The resolution value is the amount of steps recorded in a single Gauss. The possible options are:
======================= ========== =============
Recommended Gauss range Resolution Gauss per bit
======================= ========== =============
... | 3.37882 | 2.82533 | 1.195903 |
raw = self.raw()
factors = {
1370: 0.73,
1090: 0.92,
820: 1.22,
660: 1.52,
440: 2.27,
390: 2.56,
330: 3.03,
230: 4.35
}
factor = factors[self.resolution] / 100
return raw[0] *... | def gauss(self) | Get the magnetometer values as gauss for each axis as a tuple (x,y,z)
:example:
>>> sensor = HMC5883L(gw)
>>> sensor.gauss()
(16.56, 21.2888, 26.017599999999998) | 3.444807 | 3.705996 | 0.929523 |
result = self.i2c_read(2)
value = struct.unpack('>H', result)[0]
if value < 32768:
return value / 256.0
else:
return (value - 65536) / 256.0 | def temperature(self) | Get the temperature in degree celcius | 2.781649 | 2.498193 | 1.113464 |
char = str(char).lower()
self.segments.write(self.font[char]) | def write(self, char) | Display a single character on the display
:type char: str or int
:param char: Character to display | 11.470818 | 19.775875 | 0.580041 |
return os.path.abspath(os.path.dirname(os.path.dirname(__file__))) | def get_html_theme_path() | Get the absolute path of the directory containing the theme files. | 2.392463 | 2.259224 | 1.058975 |
return FEEDBACK_FORM_FMT.format(pageid=quote("{}: {}".format(project, page))) | def feedback_form_url(project, page) | Create a URL for feedback on a particular page in a project. | 14.560326 | 13.189222 | 1.103956 |
def update_context(app, pagename, templatename, context, doctree): # pylint: disable=unused-argument
context['feedback_form_url'] = feedback_form_url(app.config.project, pagename) | Update the page rendering context to include ``feedback_form_url``. | null | null | null | |
event = 'html-page-context' if six.PY3 else b'html-page-context'
app.connect(event, update_context)
return {
'parallel_read_safe': True,
'parallel_write_safe': True,
'version': __version__,
} | def setup(app) | Sphinx extension to update the rendering context with the feedback form URL.
Arguments:
app (Sphinx): Application object for the Sphinx process
Returns:
a dictionary of metadata (http://www.sphinx-doc.org/en/stable/extdev/#extension-metadata) | 2.906523 | 3.596445 | 0.808166 |
certificates = []
keys = []
blobs = [b""]
for line in pemdata.split(b"\n"):
if line.startswith(b'-----BEGIN'):
if b'CERTIFICATE' in line:
blobs = certificates
else:
blobs = keys
blobs.append(b'')
blobs[-1] += line
... | def objectsFromPEM(pemdata) | Load some objects from a PEM. | 3.203979 | 3.176081 | 1.008784 |
if key.timestamp is not None:
key.timestamp -= 1
elif key.colVisibility is not None:
key.colVisibility = following_array(key.colVisibility)
elif key.colQualifier is not None:
key.colQualifier = following_array(key.colQualifier)
elif key.colFamily is not None:
key.col... | def following_key(key) | Returns the key immediately following the input key - based on the Java implementation found in
org.apache.accumulo.core.data.Key, function followingKey(PartialKey part)
:param key: the key to be followed
:return: a key that immediately follows the input key | 2.271479 | 2.146502 | 1.058223 |
prefixBytes = array('B', prefix)
changeIndex = len(prefixBytes) - 1
while (changeIndex >= 0 and prefixBytes[changeIndex] == 0xff ):
changeIndex = changeIndex - 1;
if(changeIndex < 0):
return None
newBytes = array('B', prefix[0:changeIndex + 1])
... | def followingPrefix(prefix) | Returns a String that sorts just after all Strings beginning with a prefix | 3.123895 | 3.321634 | 0.940469 |
fp = Range.followingPrefix(rowPrefix)
return Range(srow=rowPrefix, sinclude=True, erow=fp, einclude=False) | def prefix(rowPrefix) | Returns a Range that covers all rows beginning with a prefix | 10.908049 | 8.935356 | 1.220774 |
if not isinstance(muts, list) and not isinstance(muts, tuple):
muts = [muts]
cells = {}
for mut in muts:
cells.setdefault(mut.row, []).extend(mut.updates)
self.client.updateAndFlush(self.login, table, cells) | def add_mutations_and_flush(self, table, muts) | Add mutations to a table without the need to create and manage a batch writer. | 4.18461 | 3.801333 | 1.100827 |
self.client.removeConstraint(self.login, table, constraint) | def remove_constraint(self, table, constraint) | :param table: table name
:param constraint: the constraint number as returned by list_constraints | 10.299532 | 10.923945 | 0.94284 |
ctx = self._obj.get_context()
return _ContextProxy(ctx, self._factory) | def get_context(self) | A basic override of get_context to ensure that the appropriate proxy
object is returned. | 13.815911 | 8.072603 | 1.711457 |
self.send_login(principal, loginProperties)
return self.recv_login() | def login(self, principal, loginProperties) | Parameters:
- principal
- loginProperties | 3.148016 | 3.5926 | 0.87625 |
self.send_addConstraint(login, tableName, constraintClassName)
return self.recv_addConstraint() | def addConstraint(self, login, tableName, constraintClassName) | Parameters:
- login
- tableName
- constraintClassName | 2.809633 | 2.732343 | 1.028287 |
self.send_addSplits(login, tableName, splits)
self.recv_addSplits() | def addSplits(self, login, tableName, splits) | Parameters:
- login
- tableName
- splits | 2.966939 | 2.950531 | 1.005561 |
self.send_attachIterator(login, tableName, setting, scopes)
self.recv_attachIterator() | def attachIterator(self, login, tableName, setting, scopes) | Parameters:
- login
- tableName
- setting
- scopes | 2.626204 | 2.804304 | 0.93649 |
self.send_checkIteratorConflicts(login, tableName, setting, scopes)
self.recv_checkIteratorConflicts() | def checkIteratorConflicts(self, login, tableName, setting, scopes) | Parameters:
- login
- tableName
- setting
- scopes | 2.701329 | 2.562494 | 1.05418 |
self.send_clearLocatorCache(login, tableName)
self.recv_clearLocatorCache() | def clearLocatorCache(self, login, tableName) | Parameters:
- login
- tableName | 2.984045 | 3.176691 | 0.939356 |
self.send_cloneTable(login, tableName, newTableName, flush, propertiesToSet, propertiesToExclude)
self.recv_cloneTable() | def cloneTable(self, login, tableName, newTableName, flush, propertiesToSet, propertiesToExclude) | Parameters:
- login
- tableName
- newTableName
- flush
- propertiesToSet
- propertiesToExclude | 1.851207 | 1.988107 | 0.931141 |
self.send_compactTable(login, tableName, startRow, endRow, iterators, flush, wait)
self.recv_compactTable() | def compactTable(self, login, tableName, startRow, endRow, iterators, flush, wait) | Parameters:
- login
- tableName
- startRow
- endRow
- iterators
- flush
- wait | 2.113267 | 2.066656 | 1.022554 |
self.send_cancelCompaction(login, tableName)
self.recv_cancelCompaction() | def cancelCompaction(self, login, tableName) | Parameters:
- login
- tableName | 2.931957 | 2.898281 | 1.011619 |
self.send_createTable(login, tableName, versioningIter, type)
self.recv_createTable() | def createTable(self, login, tableName, versioningIter, type) | Parameters:
- login
- tableName
- versioningIter
- type | 2.70879 | 2.403362 | 1.127084 |
self.send_deleteTable(login, tableName)
self.recv_deleteTable() | def deleteTable(self, login, tableName) | Parameters:
- login
- tableName | 3.585465 | 3.077616 | 1.165014 |
self.send_deleteRows(login, tableName, startRow, endRow)
self.recv_deleteRows() | def deleteRows(self, login, tableName, startRow, endRow) | Parameters:
- login
- tableName
- startRow
- endRow | 2.521654 | 2.361094 | 1.068002 |
self.send_exportTable(login, tableName, exportDir)
self.recv_exportTable() | def exportTable(self, login, tableName, exportDir) | Parameters:
- login
- tableName
- exportDir | 3.258506 | 2.663713 | 1.223295 |
self.send_flushTable(login, tableName, startRow, endRow, wait)
self.recv_flushTable() | def flushTable(self, login, tableName, startRow, endRow, wait) | Parameters:
- login
- tableName
- startRow
- endRow
- wait | 2.352213 | 2.129347 | 1.104664 |
self.send_getLocalityGroups(login, tableName)
return self.recv_getLocalityGroups() | def getLocalityGroups(self, login, tableName) | Parameters:
- login
- tableName | 3.678285 | 2.846347 | 1.292283 |
self.send_getIteratorSetting(login, tableName, iteratorName, scope)
return self.recv_getIteratorSetting() | def getIteratorSetting(self, login, tableName, iteratorName, scope) | Parameters:
- login
- tableName
- iteratorName
- scope | 2.218162 | 2.17103 | 1.02171 |
self.send_getMaxRow(login, tableName, auths, startRow, startInclusive, endRow, endInclusive)
return self.recv_getMaxRow() | def getMaxRow(self, login, tableName, auths, startRow, startInclusive, endRow, endInclusive) | Parameters:
- login
- tableName
- auths
- startRow
- startInclusive
- endRow
- endInclusive | 1.776207 | 1.784028 | 0.995616 |
self.send_getTableProperties(login, tableName)
return self.recv_getTableProperties() | def getTableProperties(self, login, tableName) | Parameters:
- login
- tableName | 3.211948 | 3.076224 | 1.04412 |
self.send_getSplits(login, tableName, maxSplits)
return self.recv_getSplits() | def getSplits(self, login, tableName, maxSplits) | Parameters:
- login
- tableName
- maxSplits | 2.576467 | 2.230256 | 1.155234 |
self.send_importDirectory(login, tableName, importDir, failureDir, setTime)
self.recv_importDirectory() | def importDirectory(self, login, tableName, importDir, failureDir, setTime) | Parameters:
- login
- tableName
- importDir
- failureDir
- setTime | 2.379098 | 2.061888 | 1.153844 |
self.send_importTable(login, tableName, importDir)
self.recv_importTable() | def importTable(self, login, tableName, importDir) | Parameters:
- login
- tableName
- importDir | 3.197377 | 2.415191 | 1.323861 |
self.send_listIterators(login, tableName)
return self.recv_listIterators() | def listIterators(self, login, tableName) | Parameters:
- login
- tableName | 2.635703 | 2.686989 | 0.980913 |
self.send_listConstraints(login, tableName)
return self.recv_listConstraints() | def listConstraints(self, login, tableName) | Parameters:
- login
- tableName | 2.991812 | 2.747257 | 1.089018 |
self.send_mergeTablets(login, tableName, startRow, endRow)
self.recv_mergeTablets() | def mergeTablets(self, login, tableName, startRow, endRow) | Parameters:
- login
- tableName
- startRow
- endRow | 2.504989 | 2.308394 | 1.085165 |
self.send_offlineTable(login, tableName)
self.recv_offlineTable() | def offlineTable(self, login, tableName) | Parameters:
- login
- tableName | 3.862352 | 3.240609 | 1.19186 |
self.send_onlineTable(login, tableName)
self.recv_onlineTable() | def onlineTable(self, login, tableName) | Parameters:
- login
- tableName | 5.216174 | 2.993532 | 1.742482 |
self.send_removeConstraint(login, tableName, constraint)
self.recv_removeConstraint() | def removeConstraint(self, login, tableName, constraint) | Parameters:
- login
- tableName
- constraint | 3.142834 | 3.312833 | 0.948685 |
self.send_removeIterator(login, tableName, iterName, scopes)
self.recv_removeIterator() | def removeIterator(self, login, tableName, iterName, scopes) | Parameters:
- login
- tableName
- iterName
- scopes | 2.535617 | 2.407755 | 1.053104 |
self.send_removeTableProperty(login, tableName, property)
self.recv_removeTableProperty() | def removeTableProperty(self, login, tableName, property) | Parameters:
- login
- tableName
- property | 2.579778 | 3.068627 | 0.840695 |
self.send_renameTable(login, oldTableName, newTableName)
self.recv_renameTable() | def renameTable(self, login, oldTableName, newTableName) | Parameters:
- login
- oldTableName
- newTableName | 2.865213 | 2.468673 | 1.160629 |
self.send_setLocalityGroups(login, tableName, groups)
self.recv_setLocalityGroups() | def setLocalityGroups(self, login, tableName, groups) | Parameters:
- login
- tableName
- groups | 2.845974 | 2.790888 | 1.019738 |
self.send_setTableProperty(login, tableName, property, value)
self.recv_setTableProperty() | def setTableProperty(self, login, tableName, property, value) | Parameters:
- login
- tableName
- property
- value | 2.405437 | 2.671117 | 0.900536 |
self.send_splitRangeByTablets(login, tableName, range, maxSplits)
return self.recv_splitRangeByTablets() | def splitRangeByTablets(self, login, tableName, range, maxSplits) | Parameters:
- login
- tableName
- range
- maxSplits | 2.123483 | 2.151357 | 0.987044 |
self.send_tableExists(login, tableName)
return self.recv_tableExists() | def tableExists(self, login, tableName) | Parameters:
- login
- tableName | 3.378594 | 3.188135 | 1.05974 |
self.send_pingTabletServer(login, tserver)
self.recv_pingTabletServer() | def pingTabletServer(self, login, tserver) | Parameters:
- login
- tserver | 2.723739 | 2.531075 | 1.076119 |
self.send_getActiveScans(login, tserver)
return self.recv_getActiveScans() | def getActiveScans(self, login, tserver) | Parameters:
- login
- tserver | 3.160337 | 2.380781 | 1.327437 |
self.send_getActiveCompactions(login, tserver)
return self.recv_getActiveCompactions() | def getActiveCompactions(self, login, tserver) | Parameters:
- login
- tserver | 2.968721 | 2.423116 | 1.225167 |
self.send_removeProperty(login, property)
self.recv_removeProperty() | def removeProperty(self, login, property) | Parameters:
- login
- property | 3.52362 | 4.053997 | 0.869172 |
self.send_setProperty(login, property, value)
self.recv_setProperty() | def setProperty(self, login, property, value) | Parameters:
- login
- property
- value | 3.345748 | 3.886004 | 0.860974 |
self.send_authenticateUser(login, user, properties)
return self.recv_authenticateUser() | def authenticateUser(self, login, user, properties) | Parameters:
- login
- user
- properties | 2.564622 | 3.613103 | 0.709812 |
self.send_changeUserAuthorizations(login, user, authorizations)
self.recv_changeUserAuthorizations() | def changeUserAuthorizations(self, login, user, authorizations) | Parameters:
- login
- user
- authorizations | 3.35219 | 3.030797 | 1.106042 |
self.send_changeLocalUserPassword(login, user, password)
self.recv_changeLocalUserPassword() | def changeLocalUserPassword(self, login, user, password) | Parameters:
- login
- user
- password | 2.737265 | 3.106087 | 0.881258 |
self.send_createLocalUser(login, user, password)
self.recv_createLocalUser() | def createLocalUser(self, login, user, password) | Parameters:
- login
- user
- password | 3.245315 | 3.159314 | 1.027221 |
self.send_dropLocalUser(login, user)
self.recv_dropLocalUser() | def dropLocalUser(self, login, user) | Parameters:
- login
- user | 3.567462 | 3.556181 | 1.003172 |
self.send_getUserAuthorizations(login, user)
return self.recv_getUserAuthorizations() | def getUserAuthorizations(self, login, user) | Parameters:
- login
- user | 4.204716 | 2.956151 | 1.422362 |
self.send_grantSystemPermission(login, user, perm)
self.recv_grantSystemPermission() | def grantSystemPermission(self, login, user, perm) | Parameters:
- login
- user
- perm | 3.031161 | 3.129255 | 0.968653 |
self.send_grantTablePermission(login, user, table, perm)
self.recv_grantTablePermission() | def grantTablePermission(self, login, user, table, perm) | Parameters:
- login
- user
- table
- perm | 2.747924 | 2.603991 | 1.055274 |
self.send_hasSystemPermission(login, user, perm)
return self.recv_hasSystemPermission() | def hasSystemPermission(self, login, user, perm) | Parameters:
- login
- user
- perm | 4.321914 | 3.177584 | 1.360126 |
self.send_hasTablePermission(login, user, table, perm)
return self.recv_hasTablePermission() | def hasTablePermission(self, login, user, table, perm) | Parameters:
- login
- user
- table
- perm | 3.025125 | 2.612804 | 1.157808 |
self.send_revokeSystemPermission(login, user, perm)
self.recv_revokeSystemPermission() | def revokeSystemPermission(self, login, user, perm) | Parameters:
- login
- user
- perm | 3.123354 | 3.25602 | 0.959255 |
self.send_revokeTablePermission(login, user, table, perm)
self.recv_revokeTablePermission() | def revokeTablePermission(self, login, user, table, perm) | Parameters:
- login
- user
- table
- perm | 2.742034 | 2.571836 | 1.066178 |
self.send_createBatchScanner(login, tableName, options)
return self.recv_createBatchScanner() | def createBatchScanner(self, login, tableName, options) | Parameters:
- login
- tableName
- options | 2.365122 | 2.772354 | 0.85311 |
self.send_createScanner(login, tableName, options)
return self.recv_createScanner() | def createScanner(self, login, tableName, options) | Parameters:
- login
- tableName
- options | 2.505814 | 2.962535 | 0.845834 |
self.send_nextK(scanner, k)
return self.recv_nextK() | def nextK(self, scanner, k) | Parameters:
- scanner
- k | 3.54313 | 3.040066 | 1.165478 |
self.send_updateAndFlush(login, tableName, cells)
self.recv_updateAndFlush() | def updateAndFlush(self, login, tableName, cells) | Parameters:
- login
- tableName
- cells | 3.802615 | 3.263846 | 1.165072 |
self.send_createWriter(login, tableName, opts)
return self.recv_createWriter() | def createWriter(self, login, tableName, opts) | Parameters:
- login
- tableName
- opts | 2.950453 | 2.766866 | 1.066352 |
self.send_getFollowing(key, part)
return self.recv_getFollowing() | def getFollowing(self, key, part) | Parameters:
- key
- part | 4.022974 | 3.138127 | 1.281967 |
if not self.get_relay_state():
try:
request = requests.get(
'{}/relay'.format(self.resource), params={'state': '1'},
timeout=self.timeout)
if request.status_code == 200:
self.data['relay'] = True
... | def set_relay_on(self) | Turn the relay on. | 3.943359 | 3.839034 | 1.027175 |
if self.get_relay_state():
try:
request = requests.get(
'{}/relay'.format(self.resource), params={'state': '0'},
timeout=self.timeout)
if request.status_code == 200:
self.data['relay'] = False
... | def set_relay_off(self) | Turn the relay off. | 4.108723 | 4.020946 | 1.02183 |
self.get_status()
try:
self.state = self.data['relay']
except TypeError:
self.state = False
return bool(self.state) | def get_relay_state(self) | Get the relay state. | 5.438779 | 4.418878 | 1.230806 |
self.get_status()
try:
self.consumption = self.data['power']
except TypeError:
self.consumption = 0
return self.consumption | def get_consumption(self) | Get current power consumption in mWh. | 4.38038 | 3.532108 | 1.24016 |
try:
request = requests.get(
'{}/temp'.format(self.resource), timeout=self.timeout, allow_redirects=False)
self.temperature = request.json()['compensated']
return self.temperature
except requests.exceptions.ConnectionError:
raise e... | def get_temperature(self) | Get current temperature in celsius. | 5.946625 | 5.75184 | 1.033865 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.