body stringlengths 26 98.2k | body_hash int64 -9,222,864,604,528,158,000 9,221,803,474B | docstring stringlengths 1 16.8k | path stringlengths 5 230 | name stringlengths 1 96 | repository_name stringlengths 7 89 | lang stringclasses 1
value | body_without_docstring stringlengths 20 98.2k |
|---|---|---|---|---|---|---|---|
@classmethod
def from_custom_template(cls, searchpath, name):
'\n Factory function for creating a subclass of ``Styler``\n with a custom template and Jinja environment.\n\n Parameters\n ----------\n searchpath : str or list\n Path or paths of directories containing the ... | 4,448,585,505,095,176,000 | Factory function for creating a subclass of ``Styler``
with a custom template and Jinja environment.
Parameters
----------
searchpath : str or list
Path or paths of directories containing the templates
name : str
Name of your custom template to use for rendering
Returns
-------
MyStyler : subclass of Styler
... | pandas/io/formats/style.py | from_custom_template | harunpehlivan/pandas | python | @classmethod
def from_custom_template(cls, searchpath, name):
'\n Factory function for creating a subclass of ``Styler``\n with a custom template and Jinja environment.\n\n Parameters\n ----------\n searchpath : str or list\n Path or paths of directories containing the ... |
def pipe(self, func, *args, **kwargs):
'\n Apply ``func(self, *args, **kwargs)``, and return the result.\n\n .. versionadded:: 0.24.0\n\n Parameters\n ----------\n func : function\n Function to apply to the Styler. Alternatively, a\n ``(callable, keyword)`` ... | 5,797,857,673,291,711,000 | Apply ``func(self, *args, **kwargs)``, and return the result.
.. versionadded:: 0.24.0
Parameters
----------
func : function
Function to apply to the Styler. Alternatively, a
``(callable, keyword)`` tuple where ``keyword`` is a string
indicating the keyword of ``callable`` that expects the Styler.
*args,... | pandas/io/formats/style.py | pipe | harunpehlivan/pandas | python | def pipe(self, func, *args, **kwargs):
'\n Apply ``func(self, *args, **kwargs)``, and return the result.\n\n .. versionadded:: 0.24.0\n\n Parameters\n ----------\n func : function\n Function to apply to the Styler. Alternatively, a\n ``(callable, keyword)`` ... |
def css_bar(start, end, color):
'\n Generate CSS code to draw a bar from start to end.\n '
css = 'width: 10em; height: 80%;'
if (end > start):
css += 'background: linear-gradient(90deg,'
if (start > 0):
css += ' transparent {s:.1f}%, {c} {s:.1f}%, '.format(s... | -5,143,326,183,301,107,000 | Generate CSS code to draw a bar from start to end. | pandas/io/formats/style.py | css_bar | harunpehlivan/pandas | python | def css_bar(start, end, color):
'\n \n '
css = 'width: 10em; height: 80%;'
if (end > start):
css += 'background: linear-gradient(90deg,'
if (start > 0):
css += ' transparent {s:.1f}%, {c} {s:.1f}%, '.format(s=start, c=color)
css += '{c} {e:.1f}%, tra... |
def relative_luminance(rgba):
'\n Calculate relative luminance of a color.\n\n The calculation adheres to the W3C standards\n (https://www.w3.org/WAI/GL/wiki/Relative_luminance)\n\n Parameters\n ----------\n color : rgb or rgb... | 2,695,997,616,953,070,600 | Calculate relative luminance of a color.
The calculation adheres to the W3C standards
(https://www.w3.org/WAI/GL/wiki/Relative_luminance)
Parameters
----------
color : rgb or rgba tuple
Returns
-------
float
The relative luminance as a value from 0 to 1 | pandas/io/formats/style.py | relative_luminance | harunpehlivan/pandas | python | def relative_luminance(rgba):
'\n Calculate relative luminance of a color.\n\n The calculation adheres to the W3C standards\n (https://www.w3.org/WAI/GL/wiki/Relative_luminance)\n\n Parameters\n ----------\n color : rgb or rgb... |
def get_message(msg):
'Get metric instance from dictionary or string'
if (not isinstance(msg, dict)):
try:
msg = json.loads(msg, encoding='utf-8')
except json.JSONDecodeError:
return None
typ = msg.pop('__type')
if (typ == 'metric'):
return Metric(**msg)
... | -1,440,209,607,654,485,200 | Get metric instance from dictionary or string | csm_test_utils/message.py | get_message | opentelekomcloud-infra/csm-test-utils | python | def get_message(msg):
if (not isinstance(msg, dict)):
try:
msg = json.loads(msg, encoding='utf-8')
except json.JSONDecodeError:
return None
typ = msg.pop('__type')
if (typ == 'metric'):
return Metric(**msg)
return None |
def push_metric(data: Metric, message_socket_address):
'push metrics to socket'
with socket.socket(socket.AF_UNIX, socket.SOCK_STREAM) as _socket:
try:
_socket.connect(message_socket_address)
msg = ('%s\n' % data.serialize())
_socket.sendall(msg.encode('utf8'))
... | -1,707,675,506,603,498,800 | push metrics to socket | csm_test_utils/message.py | push_metric | opentelekomcloud-infra/csm-test-utils | python | def push_metric(data: Metric, message_socket_address):
with socket.socket(socket.AF_UNIX, socket.SOCK_STREAM) as _socket:
try:
_socket.connect(message_socket_address)
msg = ('%s\n' % data.serialize())
_socket.sendall(msg.encode('utf8'))
return 'success'
... |
def serialize(self) -> str:
'Serialize data as json string'
try:
return json.dumps(self, separators=(',', ':'))
except json.JSONDecodeError as err:
return err.msg | 4,459,465,730,251,297,300 | Serialize data as json string | csm_test_utils/message.py | serialize | opentelekomcloud-infra/csm-test-utils | python | def serialize(self) -> str:
try:
return json.dumps(self, separators=(',', ':'))
except json.JSONDecodeError as err:
return err.msg |
def __bytes__(self) -> bytes:
'Returns bytes interpretation of data'
data = self.serialize()
return ('%s\n' % data).encode('utf8') | 6,820,283,154,981,992,000 | Returns bytes interpretation of data | csm_test_utils/message.py | __bytes__ | opentelekomcloud-infra/csm-test-utils | python | def __bytes__(self) -> bytes:
data = self.serialize()
return ('%s\n' % data).encode('utf8') |
def _verbose_message(message, *args, **kwargs):
'Print the message to stderr if -v/PYTHONVERBOSE is turned on.'
verbosity = kwargs.pop('verbosity', 1)
if (sys.flags.verbose >= verbosity):
if (not message.startswith(('#', 'import '))):
message = ('# ' + message)
print(message.form... | -9,013,888,047,320,691,000 | Print the message to stderr if -v/PYTHONVERBOSE is turned on. | palimport/_utils.py | _verbose_message | asmodehn/lark_import | python | def _verbose_message(message, *args, **kwargs):
verbosity = kwargs.pop('verbosity', 1)
if (sys.flags.verbose >= verbosity):
if (not message.startswith(('#', 'import '))):
message = ('# ' + message)
print(message.format(*args), file=sys.stderr) |
def validate_station(station):
'Check that the station ID is well-formed.'
if (station is None):
return
station = station.replace('.shtml', '')
if (not re.fullmatch('ID[A-Z]\\d\\d\\d\\d\\d\\.\\d\\d\\d\\d\\d', station)):
raise vol.error.Invalid('Malformed station ID')
return station | -1,019,518,209,456,315,800 | Check that the station ID is well-formed. | homeassistant/components/bom/sensor.py | validate_station | 5mauggy/home-assistant | python | def validate_station(station):
if (station is None):
return
station = station.replace('.shtml', )
if (not re.fullmatch('ID[A-Z]\\d\\d\\d\\d\\d\\.\\d\\d\\d\\d\\d', station)):
raise vol.error.Invalid('Malformed station ID')
return station |
def setup_platform(hass, config, add_entities, discovery_info=None):
'Set up the BOM sensor.'
station = config.get(CONF_STATION)
(zone_id, wmo_id) = (config.get(CONF_ZONE_ID), config.get(CONF_WMO_ID))
if (station is not None):
if (zone_id and wmo_id):
_LOGGER.warning('Using config %s... | 7,841,557,922,441,994,000 | Set up the BOM sensor. | homeassistant/components/bom/sensor.py | setup_platform | 5mauggy/home-assistant | python | def setup_platform(hass, config, add_entities, discovery_info=None):
station = config.get(CONF_STATION)
(zone_id, wmo_id) = (config.get(CONF_ZONE_ID), config.get(CONF_WMO_ID))
if (station is not None):
if (zone_id and wmo_id):
_LOGGER.warning('Using config %s, not %s and %s for BOM ... |
def _get_bom_stations():
'Return {CONF_STATION: (lat, lon)} for all stations, for auto-config.\n\n This function does several MB of internet requests, so please use the\n caching version to minimise latency and hit-count.\n '
latlon = {}
with io.BytesIO() as file_obj:
with ftplib.FTP('ftp.b... | 3,295,056,305,154,763,000 | Return {CONF_STATION: (lat, lon)} for all stations, for auto-config.
This function does several MB of internet requests, so please use the
caching version to minimise latency and hit-count. | homeassistant/components/bom/sensor.py | _get_bom_stations | 5mauggy/home-assistant | python | def _get_bom_stations():
'Return {CONF_STATION: (lat, lon)} for all stations, for auto-config.\n\n This function does several MB of internet requests, so please use the\n caching version to minimise latency and hit-count.\n '
latlon = {}
with io.BytesIO() as file_obj:
with ftplib.FTP('ftp.b... |
def bom_stations(cache_dir):
'Return {CONF_STATION: (lat, lon)} for all stations, for auto-config.\n\n Results from internet requests are cached as compressed JSON, making\n subsequent calls very much faster.\n '
cache_file = os.path.join(cache_dir, '.bom-stations.json.gz')
if (not os.path.isfile(c... | -3,257,003,656,173,373,400 | Return {CONF_STATION: (lat, lon)} for all stations, for auto-config.
Results from internet requests are cached as compressed JSON, making
subsequent calls very much faster. | homeassistant/components/bom/sensor.py | bom_stations | 5mauggy/home-assistant | python | def bom_stations(cache_dir):
'Return {CONF_STATION: (lat, lon)} for all stations, for auto-config.\n\n Results from internet requests are cached as compressed JSON, making\n subsequent calls very much faster.\n '
cache_file = os.path.join(cache_dir, '.bom-stations.json.gz')
if (not os.path.isfile(c... |
def closest_station(lat, lon, cache_dir):
'Return the ZONE_ID.WMO_ID of the closest station to our lat/lon.'
if ((lat is None) or (lon is None) or (not os.path.isdir(cache_dir))):
return
stations = bom_stations(cache_dir)
def comparable_dist(wmo_id):
'Create a psudeo-distance from latit... | 6,523,936,549,118,849,000 | Return the ZONE_ID.WMO_ID of the closest station to our lat/lon. | homeassistant/components/bom/sensor.py | closest_station | 5mauggy/home-assistant | python | def closest_station(lat, lon, cache_dir):
if ((lat is None) or (lon is None) or (not os.path.isdir(cache_dir))):
return
stations = bom_stations(cache_dir)
def comparable_dist(wmo_id):
'Create a psudeo-distance from latitude/longitude.'
(station_lat, station_lon) = stations[wmo_... |
def __init__(self, bom_data, condition, stationname):
'Initialize the sensor.'
self.bom_data = bom_data
self._condition = condition
self.stationname = stationname | 143,747,721,404,573,150 | Initialize the sensor. | homeassistant/components/bom/sensor.py | __init__ | 5mauggy/home-assistant | python | def __init__(self, bom_data, condition, stationname):
self.bom_data = bom_data
self._condition = condition
self.stationname = stationname |
@property
def name(self):
'Return the name of the sensor.'
if (self.stationname is None):
return 'BOM {}'.format(SENSOR_TYPES[self._condition][0])
return 'BOM {} {}'.format(self.stationname, SENSOR_TYPES[self._condition][0]) | -6,286,635,050,685,421,000 | Return the name of the sensor. | homeassistant/components/bom/sensor.py | name | 5mauggy/home-assistant | python | @property
def name(self):
if (self.stationname is None):
return 'BOM {}'.format(SENSOR_TYPES[self._condition][0])
return 'BOM {} {}'.format(self.stationname, SENSOR_TYPES[self._condition][0]) |
@property
def state(self):
'Return the state of the sensor.'
return self.bom_data.get_reading(self._condition) | -2,573,970,461,134,171,600 | Return the state of the sensor. | homeassistant/components/bom/sensor.py | state | 5mauggy/home-assistant | python | @property
def state(self):
return self.bom_data.get_reading(self._condition) |
@property
def device_state_attributes(self):
'Return the state attributes of the device.'
attr = {ATTR_ATTRIBUTION: ATTRIBUTION, ATTR_LAST_UPDATE: self.bom_data.last_updated, ATTR_SENSOR_ID: self._condition, ATTR_STATION_ID: self.bom_data.latest_data['wmo'], ATTR_STATION_NAME: self.bom_data.latest_data['name'],... | -5,342,490,108,203,357,000 | Return the state attributes of the device. | homeassistant/components/bom/sensor.py | device_state_attributes | 5mauggy/home-assistant | python | @property
def device_state_attributes(self):
attr = {ATTR_ATTRIBUTION: ATTRIBUTION, ATTR_LAST_UPDATE: self.bom_data.last_updated, ATTR_SENSOR_ID: self._condition, ATTR_STATION_ID: self.bom_data.latest_data['wmo'], ATTR_STATION_NAME: self.bom_data.latest_data['name'], ATTR_ZONE_ID: self.bom_data.latest_data['hi... |
@property
def unit_of_measurement(self):
'Return the units of measurement.'
return SENSOR_TYPES[self._condition][1] | -4,311,322,716,511,070,000 | Return the units of measurement. | homeassistant/components/bom/sensor.py | unit_of_measurement | 5mauggy/home-assistant | python | @property
def unit_of_measurement(self):
return SENSOR_TYPES[self._condition][1] |
def update(self):
'Update current conditions.'
self.bom_data.update() | 439,338,767,930,620,200 | Update current conditions. | homeassistant/components/bom/sensor.py | update | 5mauggy/home-assistant | python | def update(self):
self.bom_data.update() |
def __init__(self, station_id):
'Initialize the data object.'
(self._zone_id, self._wmo_id) = station_id.split('.')
self._data = None
self.last_updated = None | -3,496,315,959,322,159,600 | Initialize the data object. | homeassistant/components/bom/sensor.py | __init__ | 5mauggy/home-assistant | python | def __init__(self, station_id):
(self._zone_id, self._wmo_id) = station_id.split('.')
self._data = None
self.last_updated = None |
def _build_url(self):
'Build the URL for the requests.'
url = _RESOURCE.format(self._zone_id, self._zone_id, self._wmo_id)
_LOGGER.debug('BOM URL: %s', url)
return url | -6,698,946,057,005,399,000 | Build the URL for the requests. | homeassistant/components/bom/sensor.py | _build_url | 5mauggy/home-assistant | python | def _build_url(self):
url = _RESOURCE.format(self._zone_id, self._zone_id, self._wmo_id)
_LOGGER.debug('BOM URL: %s', url)
return url |
@property
def latest_data(self):
'Return the latest data object.'
if self._data:
return self._data[0]
return None | 6,897,681,113,500,615,000 | Return the latest data object. | homeassistant/components/bom/sensor.py | latest_data | 5mauggy/home-assistant | python | @property
def latest_data(self):
if self._data:
return self._data[0]
return None |
def get_reading(self, condition):
'Return the value for the given condition.\n\n BOM weather publishes condition readings for weather (and a few other\n conditions) at intervals throughout the day. To avoid a `-` value in\n the frontend for these conditions, we traverse the historical data\n ... | 7,540,319,837,574,102,000 | Return the value for the given condition.
BOM weather publishes condition readings for weather (and a few other
conditions) at intervals throughout the day. To avoid a `-` value in
the frontend for these conditions, we traverse the historical data
for the latest value that is not `-`.
Iterators are used in this metho... | homeassistant/components/bom/sensor.py | get_reading | 5mauggy/home-assistant | python | def get_reading(self, condition):
'Return the value for the given condition.\n\n BOM weather publishes condition readings for weather (and a few other\n conditions) at intervals throughout the day. To avoid a `-` value in\n the frontend for these conditions, we traverse the historical data\n ... |
def should_update(self):
'Determine whether an update should occur.\n\n BOM provides updated data every 30 minutes. We manually define\n refreshing logic here rather than a throttle to keep updates\n in lock-step with BOM.\n\n If 35 minutes has passed since the last BOM data update, then... | 742,864,539,779,868,200 | Determine whether an update should occur.
BOM provides updated data every 30 minutes. We manually define
refreshing logic here rather than a throttle to keep updates
in lock-step with BOM.
If 35 minutes has passed since the last BOM data update, then
an update should be done. | homeassistant/components/bom/sensor.py | should_update | 5mauggy/home-assistant | python | def should_update(self):
'Determine whether an update should occur.\n\n BOM provides updated data every 30 minutes. We manually define\n refreshing logic here rather than a throttle to keep updates\n in lock-step with BOM.\n\n If 35 minutes has passed since the last BOM data update, then... |
@Throttle(MIN_TIME_BETWEEN_UPDATES)
def update(self):
'Get the latest data from BOM.'
if (not self.should_update()):
_LOGGER.debug('BOM was updated %s minutes ago, skipping update as < 35 minutes, Now: %s, LastUpdate: %s', (datetime.datetime.now() - self.last_updated), datetime.datetime.now(), self.last... | 8,597,626,351,255,408,000 | Get the latest data from BOM. | homeassistant/components/bom/sensor.py | update | 5mauggy/home-assistant | python | @Throttle(MIN_TIME_BETWEEN_UPDATES)
def update(self):
if (not self.should_update()):
_LOGGER.debug('BOM was updated %s minutes ago, skipping update as < 35 minutes, Now: %s, LastUpdate: %s', (datetime.datetime.now() - self.last_updated), datetime.datetime.now(), self.last_updated)
return
tr... |
def comparable_dist(wmo_id):
'Create a psudeo-distance from latitude/longitude.'
(station_lat, station_lon) = stations[wmo_id]
return (((lat - station_lat) ** 2) + ((lon - station_lon) ** 2)) | -6,675,706,677,488,623,000 | Create a psudeo-distance from latitude/longitude. | homeassistant/components/bom/sensor.py | comparable_dist | 5mauggy/home-assistant | python | def comparable_dist(wmo_id):
(station_lat, station_lon) = stations[wmo_id]
return (((lat - station_lat) ** 2) + ((lon - station_lon) ** 2)) |
def reset_train_val_dataloaders(self, model) -> None:
'\n Resets train and val dataloaders if none are attached to the trainer.\n\n The val dataloader must be initialized before training loop starts, as the training loop\n inspects the val dataloader to determine whether to run the evaluation l... | -6,859,237,390,870,597,000 | Resets train and val dataloaders if none are attached to the trainer.
The val dataloader must be initialized before training loop starts, as the training loop
inspects the val dataloader to determine whether to run the evaluation loop. | pytorch_lightning/trainer/training_loop.py | reset_train_val_dataloaders | dcfidalgo/pytorch-lightning | python | def reset_train_val_dataloaders(self, model) -> None:
'\n Resets train and val dataloaders if none are attached to the trainer.\n\n The val dataloader must be initialized before training loop starts, as the training loop\n inspects the val dataloader to determine whether to run the evaluation l... |
def get_optimizers_iterable(self, batch_idx=None):
'\n Generates an iterable with (idx, optimizer) for each optimizer.\n '
if (not self.trainer.optimizer_frequencies):
return list(enumerate(self.trainer.optimizers))
if (batch_idx is None):
batch_idx = self.trainer.total_batch_i... | -5,717,690,482,004,592,000 | Generates an iterable with (idx, optimizer) for each optimizer. | pytorch_lightning/trainer/training_loop.py | get_optimizers_iterable | dcfidalgo/pytorch-lightning | python | def get_optimizers_iterable(self, batch_idx=None):
'\n \n '
if (not self.trainer.optimizer_frequencies):
return list(enumerate(self.trainer.optimizers))
if (batch_idx is None):
batch_idx = self.trainer.total_batch_idx
optimizers_loop_length = self.optimizer_freq_cumsum[(- 1... |
@staticmethod
def _prepare_outputs(outputs: List[List[List[Result]]], batch_mode: bool) -> Union[(List[List[List[Dict]]], List[List[Dict]], List[Dict], Dict)]:
'\n Extract required information from batch or epoch end results.\n\n Args:\n outputs: A 3-dimensional list of ``Result`` objects w... | -2,936,267,877,877,756,000 | Extract required information from batch or epoch end results.
Args:
outputs: A 3-dimensional list of ``Result`` objects with dimensions:
[optimizer outs][batch outs][tbptt steps].
batch_mode: If True, ignore the batch output dimension.
Returns:
The cleaned outputs with ``Result`` objects converte... | pytorch_lightning/trainer/training_loop.py | _prepare_outputs | dcfidalgo/pytorch-lightning | python | @staticmethod
def _prepare_outputs(outputs: List[List[List[Result]]], batch_mode: bool) -> Union[(List[List[List[Dict]]], List[List[Dict]], List[Dict], Dict)]:
'\n Extract required information from batch or epoch end results.\n\n Args:\n outputs: A 3-dimensional list of ``Result`` objects w... |
@contextmanager
def block_ddp_sync_behaviour(self, should_block_sync: bool=False):
'\n automatic_optimization = True\n Blocks ddp sync gradients behaviour on backwards pass.\n This is useful for skipping sync when accumulating gradients, reducing communication overhead\n\n automatic_opti... | 6,418,188,747,189,470,000 | automatic_optimization = True
Blocks ddp sync gradients behaviour on backwards pass.
This is useful for skipping sync when accumulating gradients, reducing communication overhead
automatic_optimization = False
do not block ddp gradient sync when using manual optimization
as gradients are needed within the training ste... | pytorch_lightning/trainer/training_loop.py | block_ddp_sync_behaviour | dcfidalgo/pytorch-lightning | python | @contextmanager
def block_ddp_sync_behaviour(self, should_block_sync: bool=False):
'\n automatic_optimization = True\n Blocks ddp sync gradients behaviour on backwards pass.\n This is useful for skipping sync when accumulating gradients, reducing communication overhead\n\n automatic_opti... |
def training_step_and_backward(self, split_batch, batch_idx, opt_idx, optimizer, hiddens):
'Wrap forward, zero_grad and backward in a closure so second order methods work'
with self.trainer.profiler.profile('training_step_and_backward'):
result = self.training_step(split_batch, batch_idx, opt_idx, hidde... | -7,326,739,331,186,369,000 | Wrap forward, zero_grad and backward in a closure so second order methods work | pytorch_lightning/trainer/training_loop.py | training_step_and_backward | dcfidalgo/pytorch-lightning | python | def training_step_and_backward(self, split_batch, batch_idx, opt_idx, optimizer, hiddens):
with self.trainer.profiler.profile('training_step_and_backward'):
result = self.training_step(split_batch, batch_idx, opt_idx, hiddens)
self._curr_step_result = result
if ((not self._skip_backward... |
def _should_check_val_fx(self, batch_idx: int, is_last_batch: bool, on_epoch: bool=False) -> bool:
' Decide if we should run validation. '
if (not self.trainer.enable_validation):
return False
if (((self.trainer.current_epoch + 1) % self.trainer.check_val_every_n_epoch) != 0):
return False
... | -6,102,987,013,807,913,000 | Decide if we should run validation. | pytorch_lightning/trainer/training_loop.py | _should_check_val_fx | dcfidalgo/pytorch-lightning | python | def _should_check_val_fx(self, batch_idx: int, is_last_batch: bool, on_epoch: bool=False) -> bool:
' '
if (not self.trainer.enable_validation):
return False
if (((self.trainer.current_epoch + 1) % self.trainer.check_val_every_n_epoch) != 0):
return False
is_val_check_batch = False
i... |
def _truncated_bptt_enabled(self) -> bool:
' Temporary tbptt utilities until this flag is fully migrated to the lightning module. '
return (self._truncated_bptt_steps() > 0) | -3,175,895,986,339,829,000 | Temporary tbptt utilities until this flag is fully migrated to the lightning module. | pytorch_lightning/trainer/training_loop.py | _truncated_bptt_enabled | dcfidalgo/pytorch-lightning | python | def _truncated_bptt_enabled(self) -> bool:
' '
return (self._truncated_bptt_steps() > 0) |
@parameterized.parameters((512, 64, 32, 64, np.float32, 0.0001), (512, 64, 32, 64, np.float64, 1e-08), (512, 64, 64, 64, np.float32, 0.0001), (512, 64, 64, 64, np.float64, 1e-08), (512, 72, 64, 64, np.float32, 0.0001), (512, 72, 64, 64, np.float64, 1e-08), (512, 64, 25, 64, np.float32, 0.0001), (512, 64, 25, 64, np.flo... | -4,160,313,818,380,276,700 | Test that spectral_ops.stft/inverse_stft match a NumPy implementation. | tensorflow/python/kernel_tests/signal/spectral_ops_test.py | test_stft_and_inverse_stft | 05259/tensorflow | python | @parameterized.parameters((512, 64, 32, 64, np.float32, 0.0001), (512, 64, 32, 64, np.float64, 1e-08), (512, 64, 64, 64, np.float32, 0.0001), (512, 64, 64, 64, np.float64, 1e-08), (512, 72, 64, 64, np.float32, 0.0001), (512, 72, 64, 64, np.float64, 1e-08), (512, 64, 25, 64, np.float32, 0.0001), (512, 64, 25, 64, np.flo... |
@parameterized.parameters((256, 32), (256, 64), (128, 25), (127, 32), (128, 64))
def test_inverse_stft_window_fn(self, frame_length, frame_step):
'Test that inverse_stft_window_fn has unit gain at each window phase.'
hann_window = window_ops.hann_window(frame_length, dtype=dtypes.float32)
inverse_window_fn ... | -6,633,481,258,799,354,000 | Test that inverse_stft_window_fn has unit gain at each window phase. | tensorflow/python/kernel_tests/signal/spectral_ops_test.py | test_inverse_stft_window_fn | 05259/tensorflow | python | @parameterized.parameters((256, 32), (256, 64), (128, 25), (127, 32), (128, 64))
def test_inverse_stft_window_fn(self, frame_length, frame_step):
hann_window = window_ops.hann_window(frame_length, dtype=dtypes.float32)
inverse_window_fn = spectral_ops.inverse_stft_window_fn(frame_step)
inverse_window =... |
@parameterized.parameters((256, 64), (128, 32))
def test_inverse_stft_window_fn_special_case(self, frame_length, frame_step):
'Test inverse_stft_window_fn in special overlap = 3/4 case.'
hann_window = window_ops.hann_window(frame_length, dtype=dtypes.float32)
inverse_window_fn = spectral_ops.inverse_stft_wi... | -8,461,162,554,945,300,000 | Test inverse_stft_window_fn in special overlap = 3/4 case. | tensorflow/python/kernel_tests/signal/spectral_ops_test.py | test_inverse_stft_window_fn_special_case | 05259/tensorflow | python | @parameterized.parameters((256, 64), (128, 32))
def test_inverse_stft_window_fn_special_case(self, frame_length, frame_step):
hann_window = window_ops.hann_window(frame_length, dtype=dtypes.float32)
inverse_window_fn = spectral_ops.inverse_stft_window_fn(frame_step)
inverse_window = inverse_window_fn(f... |
@staticmethod
def _compute_stft_gradient(signal, frame_length=32, frame_step=16, fft_length=32):
'Computes the gradient of the STFT with respect to `signal`.'
stft = spectral_ops.stft(signal, frame_length, frame_step, fft_length)
magnitude_stft = math_ops.abs(stft)
loss = math_ops.reduce_sum(magnitude_s... | 7,295,433,165,289,676,000 | Computes the gradient of the STFT with respect to `signal`. | tensorflow/python/kernel_tests/signal/spectral_ops_test.py | _compute_stft_gradient | 05259/tensorflow | python | @staticmethod
def _compute_stft_gradient(signal, frame_length=32, frame_step=16, fft_length=32):
stft = spectral_ops.stft(signal, frame_length, frame_step, fft_length)
magnitude_stft = math_ops.abs(stft)
loss = math_ops.reduce_sum(magnitude_stft)
return gradients_impl.gradients([loss], [signal])[0] |
def test_gradients(self):
'Test that spectral_ops.stft has a working gradient.'
if context.executing_eagerly():
return
with self.session() as sess:
signal_length = 512
empty_signal = array_ops.zeros([signal_length], dtype=dtypes.float32)
empty_signal_gradient = sess.run(self.... | 823,800,399,930,374,500 | Test that spectral_ops.stft has a working gradient. | tensorflow/python/kernel_tests/signal/spectral_ops_test.py | test_gradients | 05259/tensorflow | python | def test_gradients(self):
if context.executing_eagerly():
return
with self.session() as sess:
signal_length = 512
empty_signal = array_ops.zeros([signal_length], dtype=dtypes.float32)
empty_signal_gradient = sess.run(self._compute_stft_gradient(empty_signal))
self.as... |
def test_reuse_input(self):
'Objects should be reusable after write()'
original = b'original'
tests = [bytearray(original), memoryview(bytearray(original))]
for data in tests:
self.buffer.write(data)
data[:] = b'reused!!'
self.assertEqual(self.buffer.read(), original) | -2,576,115,287,122,548,000 | Objects should be reusable after write() | tests/test_buffer.py | test_reuse_input | 18928172992817182/streamlink | python | def test_reuse_input(self):
original = b'original'
tests = [bytearray(original), memoryview(bytearray(original))]
for data in tests:
self.buffer.write(data)
data[:] = b'reused!!'
self.assertEqual(self.buffer.read(), original) |
@property
def customdata(self):
'\n Assigns extra data each datum. This may be useful when\n listening to hover, click and selection events. Note that,\n "scatter" traces also appends customdata items in the markers\n DOM elements\n \n The \'customdata\' property is an array th... | 1,177,023,494,794,418,000 | Assigns extra data each datum. This may be useful when
listening to hover, click and selection events. Note that,
"scatter" traces also appends customdata items in the markers
DOM elements
The 'customdata' property is an array that may be specified as a tuple,
list, numpy array, or pandas Series
Returns
-------
numpy... | venv/lib/python3.7/site-packages/plotly/graph_objs/_splom.py | customdata | 180Studios/LoginApp | python | @property
def customdata(self):
'\n Assigns extra data each datum. This may be useful when\n listening to hover, click and selection events. Note that,\n "scatter" traces also appends customdata items in the markers\n DOM elements\n \n The \'customdata\' property is an array th... |
@property
def customdatasrc(self):
"\n Sets the source reference on plot.ly for customdata .\n \n The 'customdatasrc' property must be specified as a string or\n as a plotly.grid_objs.Column object\n\n Returns\n -------\n str\n "
return self['customdatasrc'] | -6,397,660,091,915,112,000 | Sets the source reference on plot.ly for customdata .
The 'customdatasrc' property must be specified as a string or
as a plotly.grid_objs.Column object
Returns
-------
str | venv/lib/python3.7/site-packages/plotly/graph_objs/_splom.py | customdatasrc | 180Studios/LoginApp | python | @property
def customdatasrc(self):
"\n Sets the source reference on plot.ly for customdata .\n \n The 'customdatasrc' property must be specified as a string or\n as a plotly.grid_objs.Column object\n\n Returns\n -------\n str\n "
return self['customdatasrc'] |
@property
def diagonal(self):
"\n The 'diagonal' property is an instance of Diagonal\n that may be specified as:\n - An instance of plotly.graph_objs.splom.Diagonal\n - A dict of string/value properties that will be passed\n to the Diagonal constructor\n \n S... | -5,254,479,112,447,050,000 | The 'diagonal' property is an instance of Diagonal
that may be specified as:
- An instance of plotly.graph_objs.splom.Diagonal
- A dict of string/value properties that will be passed
to the Diagonal constructor
Supported dict properties:
visible
Determines whether or not subplo... | venv/lib/python3.7/site-packages/plotly/graph_objs/_splom.py | diagonal | 180Studios/LoginApp | python | @property
def diagonal(self):
"\n The 'diagonal' property is an instance of Diagonal\n that may be specified as:\n - An instance of plotly.graph_objs.splom.Diagonal\n - A dict of string/value properties that will be passed\n to the Diagonal constructor\n \n S... |
@property
def dimensions(self):
"\n The 'dimensions' property is a tuple of instances of\n Dimension that may be specified as:\n - A list or tuple of instances of plotly.graph_objs.splom.Dimension\n - A list or tuple of dicts of string/value properties that\n will be passe... | 7,061,134,127,882,084,000 | The 'dimensions' property is a tuple of instances of
Dimension that may be specified as:
- A list or tuple of instances of plotly.graph_objs.splom.Dimension
- A list or tuple of dicts of string/value properties that
will be passed to the Dimension constructor
Supported dict properties:
axi... | venv/lib/python3.7/site-packages/plotly/graph_objs/_splom.py | dimensions | 180Studios/LoginApp | python | @property
def dimensions(self):
"\n The 'dimensions' property is a tuple of instances of\n Dimension that may be specified as:\n - A list or tuple of instances of plotly.graph_objs.splom.Dimension\n - A list or tuple of dicts of string/value properties that\n will be passe... |
@property
def dimensiondefaults(self):
"\n When used in a template (as\n layout.template.data.splom.dimensiondefaults), sets the default\n property values to use for elements of splom.dimensions\n \n The 'dimensiondefaults' property is an instance of Dimension\n that may be spe... | -3,862,303,385,040,442,400 | When used in a template (as
layout.template.data.splom.dimensiondefaults), sets the default
property values to use for elements of splom.dimensions
The 'dimensiondefaults' property is an instance of Dimension
that may be specified as:
- An instance of plotly.graph_objs.splom.Dimension
- A dict of string/value prop... | venv/lib/python3.7/site-packages/plotly/graph_objs/_splom.py | dimensiondefaults | 180Studios/LoginApp | python | @property
def dimensiondefaults(self):
"\n When used in a template (as\n layout.template.data.splom.dimensiondefaults), sets the default\n property values to use for elements of splom.dimensions\n \n The 'dimensiondefaults' property is an instance of Dimension\n that may be spe... |
@property
def hoverinfo(self):
"\n Determines which trace information appear on hover. If `none`\n or `skip` are set, no information is displayed upon hovering.\n But, if `none` is set, click and hover events are still fired.\n \n The 'hoverinfo' property is a flaglist and may be spec... | 1,056,236,944,801,603,700 | Determines which trace information appear on hover. If `none`
or `skip` are set, no information is displayed upon hovering.
But, if `none` is set, click and hover events are still fired.
The 'hoverinfo' property is a flaglist and may be specified
as a string containing:
- Any combination of ['x', 'y', 'z', 'text', '... | venv/lib/python3.7/site-packages/plotly/graph_objs/_splom.py | hoverinfo | 180Studios/LoginApp | python | @property
def hoverinfo(self):
"\n Determines which trace information appear on hover. If `none`\n or `skip` are set, no information is displayed upon hovering.\n But, if `none` is set, click and hover events are still fired.\n \n The 'hoverinfo' property is a flaglist and may be spec... |
@property
def hoverinfosrc(self):
"\n Sets the source reference on plot.ly for hoverinfo .\n \n The 'hoverinfosrc' property must be specified as a string or\n as a plotly.grid_objs.Column object\n\n Returns\n -------\n str\n "
return self['hoverinfosrc'] | 7,963,201,236,316,905,000 | Sets the source reference on plot.ly for hoverinfo .
The 'hoverinfosrc' property must be specified as a string or
as a plotly.grid_objs.Column object
Returns
-------
str | venv/lib/python3.7/site-packages/plotly/graph_objs/_splom.py | hoverinfosrc | 180Studios/LoginApp | python | @property
def hoverinfosrc(self):
"\n Sets the source reference on plot.ly for hoverinfo .\n \n The 'hoverinfosrc' property must be specified as a string or\n as a plotly.grid_objs.Column object\n\n Returns\n -------\n str\n "
return self['hoverinfosrc'] |
@property
def hoverlabel(self):
"\n The 'hoverlabel' property is an instance of Hoverlabel\n that may be specified as:\n - An instance of plotly.graph_objs.splom.Hoverlabel\n - A dict of string/value properties that will be passed\n to the Hoverlabel constructor\n \n ... | -3,727,103,481,074,180,600 | The 'hoverlabel' property is an instance of Hoverlabel
that may be specified as:
- An instance of plotly.graph_objs.splom.Hoverlabel
- A dict of string/value properties that will be passed
to the Hoverlabel constructor
Supported dict properties:
bgcolor
Sets the background colo... | venv/lib/python3.7/site-packages/plotly/graph_objs/_splom.py | hoverlabel | 180Studios/LoginApp | python | @property
def hoverlabel(self):
"\n The 'hoverlabel' property is an instance of Hoverlabel\n that may be specified as:\n - An instance of plotly.graph_objs.splom.Hoverlabel\n - A dict of string/value properties that will be passed\n to the Hoverlabel constructor\n \n ... |
@property
def hovertemplate(self):
'\n Template string used for rendering the information that appear\n on hover box. Note that this will override `hoverinfo`.\n Variables are inserted using %{variable}, for example "y:\n %{y}". Numbers are formatted using d3-format\'s syntax\n %{... | 7,679,512,898,802,646,000 | Template string used for rendering the information that appear
on hover box. Note that this will override `hoverinfo`.
Variables are inserted using %{variable}, for example "y:
%{y}". Numbers are formatted using d3-format's syntax
%{variable:d3-format}, for example "Price: %{y:$.2f}". See http
s://github.com/d3/d3-form... | venv/lib/python3.7/site-packages/plotly/graph_objs/_splom.py | hovertemplate | 180Studios/LoginApp | python | @property
def hovertemplate(self):
'\n Template string used for rendering the information that appear\n on hover box. Note that this will override `hoverinfo`.\n Variables are inserted using %{variable}, for example "y:\n %{y}". Numbers are formatted using d3-format\'s syntax\n %{... |
@property
def hovertemplatesrc(self):
"\n Sets the source reference on plot.ly for hovertemplate .\n \n The 'hovertemplatesrc' property must be specified as a string or\n as a plotly.grid_objs.Column object\n\n Returns\n -------\n str\n "
return self['hoverte... | -8,271,637,640,725,401,000 | Sets the source reference on plot.ly for hovertemplate .
The 'hovertemplatesrc' property must be specified as a string or
as a plotly.grid_objs.Column object
Returns
-------
str | venv/lib/python3.7/site-packages/plotly/graph_objs/_splom.py | hovertemplatesrc | 180Studios/LoginApp | python | @property
def hovertemplatesrc(self):
"\n Sets the source reference on plot.ly for hovertemplate .\n \n The 'hovertemplatesrc' property must be specified as a string or\n as a plotly.grid_objs.Column object\n\n Returns\n -------\n str\n "
return self['hoverte... |
@property
def hovertext(self):
"\n Same as `text`.\n \n The 'hovertext' property is a string and must be specified as:\n - A string\n - A number that will be converted to a string\n - A tuple, list, or one-dimensional numpy array of the above\n\n Returns\n -... | 7,117,407,928,880,878,000 | Same as `text`.
The 'hovertext' property is a string and must be specified as:
- A string
- A number that will be converted to a string
- A tuple, list, or one-dimensional numpy array of the above
Returns
-------
str|numpy.ndarray | venv/lib/python3.7/site-packages/plotly/graph_objs/_splom.py | hovertext | 180Studios/LoginApp | python | @property
def hovertext(self):
"\n Same as `text`.\n \n The 'hovertext' property is a string and must be specified as:\n - A string\n - A number that will be converted to a string\n - A tuple, list, or one-dimensional numpy array of the above\n\n Returns\n -... |
@property
def hovertextsrc(self):
"\n Sets the source reference on plot.ly for hovertext .\n \n The 'hovertextsrc' property must be specified as a string or\n as a plotly.grid_objs.Column object\n\n Returns\n -------\n str\n "
return self['hovertextsrc'] | -3,061,199,869,597,252,000 | Sets the source reference on plot.ly for hovertext .
The 'hovertextsrc' property must be specified as a string or
as a plotly.grid_objs.Column object
Returns
-------
str | venv/lib/python3.7/site-packages/plotly/graph_objs/_splom.py | hovertextsrc | 180Studios/LoginApp | python | @property
def hovertextsrc(self):
"\n Sets the source reference on plot.ly for hovertext .\n \n The 'hovertextsrc' property must be specified as a string or\n as a plotly.grid_objs.Column object\n\n Returns\n -------\n str\n "
return self['hovertextsrc'] |
@property
def ids(self):
"\n Assigns id labels to each datum. These ids for object constancy\n of data points during animation. Should be an array of strings,\n not numbers or any other type.\n \n The 'ids' property is an array that may be specified as a tuple,\n list, numpy ar... | -8,640,669,461,977,475,000 | Assigns id labels to each datum. These ids for object constancy
of data points during animation. Should be an array of strings,
not numbers or any other type.
The 'ids' property is an array that may be specified as a tuple,
list, numpy array, or pandas Series
Returns
-------
numpy.ndarray | venv/lib/python3.7/site-packages/plotly/graph_objs/_splom.py | ids | 180Studios/LoginApp | python | @property
def ids(self):
"\n Assigns id labels to each datum. These ids for object constancy\n of data points during animation. Should be an array of strings,\n not numbers or any other type.\n \n The 'ids' property is an array that may be specified as a tuple,\n list, numpy ar... |
@property
def idssrc(self):
"\n Sets the source reference on plot.ly for ids .\n \n The 'idssrc' property must be specified as a string or\n as a plotly.grid_objs.Column object\n\n Returns\n -------\n str\n "
return self['idssrc'] | -5,876,914,191,141,589,000 | Sets the source reference on plot.ly for ids .
The 'idssrc' property must be specified as a string or
as a plotly.grid_objs.Column object
Returns
-------
str | venv/lib/python3.7/site-packages/plotly/graph_objs/_splom.py | idssrc | 180Studios/LoginApp | python | @property
def idssrc(self):
"\n Sets the source reference on plot.ly for ids .\n \n The 'idssrc' property must be specified as a string or\n as a plotly.grid_objs.Column object\n\n Returns\n -------\n str\n "
return self['idssrc'] |
@property
def legendgroup(self):
"\n Sets the legend group for this trace. Traces part of the same\n legend group hide/show at the same time when toggling legend\n items.\n \n The 'legendgroup' property is a string and must be specified as:\n - A string\n - A number ... | -1,439,907,517,046,329,900 | Sets the legend group for this trace. Traces part of the same
legend group hide/show at the same time when toggling legend
items.
The 'legendgroup' property is a string and must be specified as:
- A string
- A number that will be converted to a string
Returns
-------
str | venv/lib/python3.7/site-packages/plotly/graph_objs/_splom.py | legendgroup | 180Studios/LoginApp | python | @property
def legendgroup(self):
"\n Sets the legend group for this trace. Traces part of the same\n legend group hide/show at the same time when toggling legend\n items.\n \n The 'legendgroup' property is a string and must be specified as:\n - A string\n - A number ... |
@property
def marker(self):
'\n The \'marker\' property is an instance of Marker\n that may be specified as:\n - An instance of plotly.graph_objs.splom.Marker\n - A dict of string/value properties that will be passed\n to the Marker constructor\n \n Supported... | 3,519,738,121,507,022,000 | The 'marker' property is an instance of Marker
that may be specified as:
- An instance of plotly.graph_objs.splom.Marker
- A dict of string/value properties that will be passed
to the Marker constructor
Supported dict properties:
autocolorscale
Determines whether the colorscale... | venv/lib/python3.7/site-packages/plotly/graph_objs/_splom.py | marker | 180Studios/LoginApp | python | @property
def marker(self):
'\n The \'marker\' property is an instance of Marker\n that may be specified as:\n - An instance of plotly.graph_objs.splom.Marker\n - A dict of string/value properties that will be passed\n to the Marker constructor\n \n Supported... |
@property
def name(self):
"\n Sets the trace name. The trace name appear as the legend item\n and on hover.\n \n The 'name' property is a string and must be specified as:\n - A string\n - A number that will be converted to a string\n\n Returns\n -------\n ... | -6,361,504,644,165,565,000 | Sets the trace name. The trace name appear as the legend item
and on hover.
The 'name' property is a string and must be specified as:
- A string
- A number that will be converted to a string
Returns
-------
str | venv/lib/python3.7/site-packages/plotly/graph_objs/_splom.py | name | 180Studios/LoginApp | python | @property
def name(self):
"\n Sets the trace name. The trace name appear as the legend item\n and on hover.\n \n The 'name' property is a string and must be specified as:\n - A string\n - A number that will be converted to a string\n\n Returns\n -------\n ... |
@property
def opacity(self):
"\n Sets the opacity of the trace.\n \n The 'opacity' property is a number and may be specified as:\n - An int or float in the interval [0, 1]\n\n Returns\n -------\n int|float\n "
return self['opacity'] | 3,079,945,175,595,132,400 | Sets the opacity of the trace.
The 'opacity' property is a number and may be specified as:
- An int or float in the interval [0, 1]
Returns
-------
int|float | venv/lib/python3.7/site-packages/plotly/graph_objs/_splom.py | opacity | 180Studios/LoginApp | python | @property
def opacity(self):
"\n Sets the opacity of the trace.\n \n The 'opacity' property is a number and may be specified as:\n - An int or float in the interval [0, 1]\n\n Returns\n -------\n int|float\n "
return self['opacity'] |
@property
def selected(self):
"\n The 'selected' property is an instance of Selected\n that may be specified as:\n - An instance of plotly.graph_objs.splom.Selected\n - A dict of string/value properties that will be passed\n to the Selected constructor\n \n S... | 1,050,611,856,426,197,100 | The 'selected' property is an instance of Selected
that may be specified as:
- An instance of plotly.graph_objs.splom.Selected
- A dict of string/value properties that will be passed
to the Selected constructor
Supported dict properties:
marker
plotly.graph_objs.splom.selected.... | venv/lib/python3.7/site-packages/plotly/graph_objs/_splom.py | selected | 180Studios/LoginApp | python | @property
def selected(self):
"\n The 'selected' property is an instance of Selected\n that may be specified as:\n - An instance of plotly.graph_objs.splom.Selected\n - A dict of string/value properties that will be passed\n to the Selected constructor\n \n S... |
@property
def selectedpoints(self):
"\n Array containing integer indices of selected points. Has an\n effect only for traces that support selections. Note that an\n empty array means an empty selection where the `unselected` are\n turned on for all points, whereas, any other non-array va... | -3,455,274,300,976,448,500 | Array containing integer indices of selected points. Has an
effect only for traces that support selections. Note that an
empty array means an empty selection where the `unselected` are
turned on for all points, whereas, any other non-array values
means no selection all where the `selected` and `unselected`
styles have ... | venv/lib/python3.7/site-packages/plotly/graph_objs/_splom.py | selectedpoints | 180Studios/LoginApp | python | @property
def selectedpoints(self):
"\n Array containing integer indices of selected points. Has an\n effect only for traces that support selections. Note that an\n empty array means an empty selection where the `unselected` are\n turned on for all points, whereas, any other non-array va... |
@property
def showlegend(self):
"\n Determines whether or not an item corresponding to this trace\n is shown in the legend.\n \n The 'showlegend' property must be specified as a bool\n (either True, or False)\n\n Returns\n -------\n bool\n "
return self... | -7,652,109,045,393,845,000 | Determines whether or not an item corresponding to this trace
is shown in the legend.
The 'showlegend' property must be specified as a bool
(either True, or False)
Returns
-------
bool | venv/lib/python3.7/site-packages/plotly/graph_objs/_splom.py | showlegend | 180Studios/LoginApp | python | @property
def showlegend(self):
"\n Determines whether or not an item corresponding to this trace\n is shown in the legend.\n \n The 'showlegend' property must be specified as a bool\n (either True, or False)\n\n Returns\n -------\n bool\n "
return self... |
@property
def showlowerhalf(self):
"\n Determines whether or not subplots on the lower half from the\n diagonal are displayed.\n \n The 'showlowerhalf' property must be specified as a bool\n (either True, or False)\n\n Returns\n -------\n bool\n "
retur... | 7,164,965,194,827,310,000 | Determines whether or not subplots on the lower half from the
diagonal are displayed.
The 'showlowerhalf' property must be specified as a bool
(either True, or False)
Returns
-------
bool | venv/lib/python3.7/site-packages/plotly/graph_objs/_splom.py | showlowerhalf | 180Studios/LoginApp | python | @property
def showlowerhalf(self):
"\n Determines whether or not subplots on the lower half from the\n diagonal are displayed.\n \n The 'showlowerhalf' property must be specified as a bool\n (either True, or False)\n\n Returns\n -------\n bool\n "
retur... |
@property
def showupperhalf(self):
"\n Determines whether or not subplots on the upper half from the\n diagonal are displayed.\n \n The 'showupperhalf' property must be specified as a bool\n (either True, or False)\n\n Returns\n -------\n bool\n "
retur... | -1,581,927,955,969,309,700 | Determines whether or not subplots on the upper half from the
diagonal are displayed.
The 'showupperhalf' property must be specified as a bool
(either True, or False)
Returns
-------
bool | venv/lib/python3.7/site-packages/plotly/graph_objs/_splom.py | showupperhalf | 180Studios/LoginApp | python | @property
def showupperhalf(self):
"\n Determines whether or not subplots on the upper half from the\n diagonal are displayed.\n \n The 'showupperhalf' property must be specified as a bool\n (either True, or False)\n\n Returns\n -------\n bool\n "
retur... |
@property
def stream(self):
"\n The 'stream' property is an instance of Stream\n that may be specified as:\n - An instance of plotly.graph_objs.splom.Stream\n - A dict of string/value properties that will be passed\n to the Stream constructor\n \n Supported d... | -661,828,426,000,341,100 | The 'stream' property is an instance of Stream
that may be specified as:
- An instance of plotly.graph_objs.splom.Stream
- A dict of string/value properties that will be passed
to the Stream constructor
Supported dict properties:
maxpoints
Sets the maximum number of points to k... | venv/lib/python3.7/site-packages/plotly/graph_objs/_splom.py | stream | 180Studios/LoginApp | python | @property
def stream(self):
"\n The 'stream' property is an instance of Stream\n that may be specified as:\n - An instance of plotly.graph_objs.splom.Stream\n - A dict of string/value properties that will be passed\n to the Stream constructor\n \n Supported d... |
@property
def text(self):
"\n Sets text elements associated with each (x,y) pair to appear on\n hover. If a single string, the same string appears over all the\n data points. If an array of string, the items are mapped in\n order to the this trace's (x,y) coordinates.\n \n The ... | 1,313,500,544,468,579,800 | Sets text elements associated with each (x,y) pair to appear on
hover. If a single string, the same string appears over all the
data points. If an array of string, the items are mapped in
order to the this trace's (x,y) coordinates.
The 'text' property is a string and must be specified as:
- A string
- A number th... | venv/lib/python3.7/site-packages/plotly/graph_objs/_splom.py | text | 180Studios/LoginApp | python | @property
def text(self):
"\n Sets text elements associated with each (x,y) pair to appear on\n hover. If a single string, the same string appears over all the\n data points. If an array of string, the items are mapped in\n order to the this trace's (x,y) coordinates.\n \n The ... |
@property
def textsrc(self):
"\n Sets the source reference on plot.ly for text .\n \n The 'textsrc' property must be specified as a string or\n as a plotly.grid_objs.Column object\n\n Returns\n -------\n str\n "
return self['textsrc'] | 6,589,185,397,491,211,000 | Sets the source reference on plot.ly for text .
The 'textsrc' property must be specified as a string or
as a plotly.grid_objs.Column object
Returns
-------
str | venv/lib/python3.7/site-packages/plotly/graph_objs/_splom.py | textsrc | 180Studios/LoginApp | python | @property
def textsrc(self):
"\n Sets the source reference on plot.ly for text .\n \n The 'textsrc' property must be specified as a string or\n as a plotly.grid_objs.Column object\n\n Returns\n -------\n str\n "
return self['textsrc'] |
@property
def uid(self):
"\n Assign an id to this trace, Use this to provide object\n constancy between traces during animations and transitions.\n \n The 'uid' property is a string and must be specified as:\n - A string\n - A number that will be converted to a string\n\n ... | 3,958,919,285,292,402,000 | Assign an id to this trace, Use this to provide object
constancy between traces during animations and transitions.
The 'uid' property is a string and must be specified as:
- A string
- A number that will be converted to a string
Returns
-------
str | venv/lib/python3.7/site-packages/plotly/graph_objs/_splom.py | uid | 180Studios/LoginApp | python | @property
def uid(self):
"\n Assign an id to this trace, Use this to provide object\n constancy between traces during animations and transitions.\n \n The 'uid' property is a string and must be specified as:\n - A string\n - A number that will be converted to a string\n\n ... |
@property
def uirevision(self):
"\n Controls persistence of some user-driven changes to the trace:\n `constraintrange` in `parcoords` traces, as well as some\n `editable: true` modifications such as `name` and\n `colorbar.title`. Defaults to `layout.uirevision`. Note that\n other ... | 6,291,104,720,439,785,000 | Controls persistence of some user-driven changes to the trace:
`constraintrange` in `parcoords` traces, as well as some
`editable: true` modifications such as `name` and
`colorbar.title`. Defaults to `layout.uirevision`. Note that
other user-driven trace attribute changes are controlled by
`layout` attributes: `trace.v... | venv/lib/python3.7/site-packages/plotly/graph_objs/_splom.py | uirevision | 180Studios/LoginApp | python | @property
def uirevision(self):
"\n Controls persistence of some user-driven changes to the trace:\n `constraintrange` in `parcoords` traces, as well as some\n `editable: true` modifications such as `name` and\n `colorbar.title`. Defaults to `layout.uirevision`. Note that\n other ... |
@property
def unselected(self):
"\n The 'unselected' property is an instance of Unselected\n that may be specified as:\n - An instance of plotly.graph_objs.splom.Unselected\n - A dict of string/value properties that will be passed\n to the Unselected constructor\n \n ... | 8,059,231,958,851,131,000 | The 'unselected' property is an instance of Unselected
that may be specified as:
- An instance of plotly.graph_objs.splom.Unselected
- A dict of string/value properties that will be passed
to the Unselected constructor
Supported dict properties:
marker
plotly.graph_objs.splom.u... | venv/lib/python3.7/site-packages/plotly/graph_objs/_splom.py | unselected | 180Studios/LoginApp | python | @property
def unselected(self):
"\n The 'unselected' property is an instance of Unselected\n that may be specified as:\n - An instance of plotly.graph_objs.splom.Unselected\n - A dict of string/value properties that will be passed\n to the Unselected constructor\n \n ... |
@property
def visible(self):
'\n Determines whether or not this trace is visible. If\n "legendonly", the trace is not drawn, but can appear as a\n legend item (provided that the legend itself is visible).\n \n The \'visible\' property is an enumeration that may be specified as:\n ... | -710,799,896,792,870,900 | Determines whether or not this trace is visible. If
"legendonly", the trace is not drawn, but can appear as a
legend item (provided that the legend itself is visible).
The 'visible' property is an enumeration that may be specified as:
- One of the following enumeration values:
[True, False, 'legendonly']
Re... | venv/lib/python3.7/site-packages/plotly/graph_objs/_splom.py | visible | 180Studios/LoginApp | python | @property
def visible(self):
'\n Determines whether or not this trace is visible. If\n "legendonly", the trace is not drawn, but can appear as a\n legend item (provided that the legend itself is visible).\n \n The \'visible\' property is an enumeration that may be specified as:\n ... |
@property
def xaxes(self):
"\n Sets the list of x axes corresponding to dimensions of this\n splom trace. By default, a splom will match the first N xaxes\n where N is the number of input dimensions. Note that, in case\n where `diagonal.visible` is false and `showupperhalf` or\n `... | -343,617,779,404,871,900 | Sets the list of x axes corresponding to dimensions of this
splom trace. By default, a splom will match the first N xaxes
where N is the number of input dimensions. Note that, in case
where `diagonal.visible` is false and `showupperhalf` or
`showlowerhalf` is false, this splom trace will generate one
less x-axis and on... | venv/lib/python3.7/site-packages/plotly/graph_objs/_splom.py | xaxes | 180Studios/LoginApp | python | @property
def xaxes(self):
"\n Sets the list of x axes corresponding to dimensions of this\n splom trace. By default, a splom will match the first N xaxes\n where N is the number of input dimensions. Note that, in case\n where `diagonal.visible` is false and `showupperhalf` or\n `... |
@property
def yaxes(self):
"\n Sets the list of y axes corresponding to dimensions of this\n splom trace. By default, a splom will match the first N yaxes\n where N is the number of input dimensions. Note that, in case\n where `diagonal.visible` is false and `showupperhalf` or\n `... | -7,748,419,616,988,008,000 | Sets the list of y axes corresponding to dimensions of this
splom trace. By default, a splom will match the first N yaxes
where N is the number of input dimensions. Note that, in case
where `diagonal.visible` is false and `showupperhalf` or
`showlowerhalf` is false, this splom trace will generate one
less x-axis and on... | venv/lib/python3.7/site-packages/plotly/graph_objs/_splom.py | yaxes | 180Studios/LoginApp | python | @property
def yaxes(self):
"\n Sets the list of y axes corresponding to dimensions of this\n splom trace. By default, a splom will match the first N yaxes\n where N is the number of input dimensions. Note that, in case\n where `diagonal.visible` is false and `showupperhalf` or\n `... |
def __init__(self, arg=None, customdata=None, customdatasrc=None, diagonal=None, dimensions=None, dimensiondefaults=None, hoverinfo=None, hoverinfosrc=None, hoverlabel=None, hovertemplate=None, hovertemplatesrc=None, hovertext=None, hovertextsrc=None, ids=None, idssrc=None, legendgroup=None, marker=None, name=None, opa... | 1,546,266,752,610,994,700 | Construct a new Splom object
Splom traces generate scatter plot matrix visualizations. Each
splom `dimensions` items correspond to a generated axis. Values
for each of those dimensions are set in `dimensions[i].values`.
Splom traces support all `scattergl` marker style attributes.
Specify `layout.grid` attributes and/... | venv/lib/python3.7/site-packages/plotly/graph_objs/_splom.py | __init__ | 180Studios/LoginApp | python | def __init__(self, arg=None, customdata=None, customdatasrc=None, diagonal=None, dimensions=None, dimensiondefaults=None, hoverinfo=None, hoverinfosrc=None, hoverlabel=None, hovertemplate=None, hovertemplatesrc=None, hovertext=None, hovertextsrc=None, ids=None, idssrc=None, legendgroup=None, marker=None, name=None, opa... |
def send_email(message: str) -> None:
"\n Sends an email to target email with given message.\n Args:\n message (str): message you're sending\n "
with open('../creds.json', 'r') as f:
creds = json.loads(f)
gmail_user = creds['user']
gmail_pass = creds['pass']
try:
serv... | -795,476,533,735,353,900 | Sends an email to target email with given message.
Args:
message (str): message you're sending | vaccines.py | send_email | Karalius/get-vaccine-vilnius | python | def send_email(message: str) -> None:
"\n Sends an email to target email with given message.\n Args:\n message (str): message you're sending\n "
with open('../creds.json', 'r') as f:
creds = json.loads(f)
gmail_user = creds['user']
gmail_pass = creds['pass']
try:
serv... |
def get_data() -> None:
'\n Infinite loop of every 10min requests to Vilnius vaccination center.\n Collects count of vaccines and adds to PostgreSQL database.\n Sends an email if Pfizer vaccine is available.\n '
while True:
sql_connection = psycopg2.connect(database=DATABASE, user=USER, pass... | 4,513,721,702,642,129,000 | Infinite loop of every 10min requests to Vilnius vaccination center.
Collects count of vaccines and adds to PostgreSQL database.
Sends an email if Pfizer vaccine is available. | vaccines.py | get_data | Karalius/get-vaccine-vilnius | python | def get_data() -> None:
'\n Infinite loop of every 10min requests to Vilnius vaccination center.\n Collects count of vaccines and adds to PostgreSQL database.\n Sends an email if Pfizer vaccine is available.\n '
while True:
sql_connection = psycopg2.connect(database=DATABASE, user=USER, pass... |
def _assert_tensorflow_version():
"Check that we're using a compatible TF version."
(major, minor, _) = tf.version.VERSION.split('.')
if ((int(major) not in (1, 2)) or ((int(major) == 1) and (int(minor) < 15))):
raise RuntimeError(('Tensorflow version >= 1.15, < 3 is required. Found (%s). Please ins... | 4,537,565,554,868,918,000 | Check that we're using a compatible TF version. | tensorflow_model_analysis/api/model_eval_lib.py | _assert_tensorflow_version | Bobgy/model-analysis | python | def _assert_tensorflow_version():
(major, minor, _) = tf.version.VERSION.split('.')
if ((int(major) not in (1, 2)) or ((int(major) == 1) and (int(minor) < 15))):
raise RuntimeError(('Tensorflow version >= 1.15, < 3 is required. Found (%s). Please install the latest 1.x or 2.x version from https://g... |
def _is_legacy_eval(eval_shared_model: Optional[types.EvalSharedModel], eval_config: Optional[config.EvalConfig]):
'Returns True if legacy evaluation is being used.'
return (eval_shared_model and (not isinstance(eval_shared_model, dict)) and (((not eval_shared_model.model_loader.tags) or (eval_constants.EVAL_TA... | 4,020,011,206,858,171,400 | Returns True if legacy evaluation is being used. | tensorflow_model_analysis/api/model_eval_lib.py | _is_legacy_eval | Bobgy/model-analysis | python | def _is_legacy_eval(eval_shared_model: Optional[types.EvalSharedModel], eval_config: Optional[config.EvalConfig]):
return (eval_shared_model and (not isinstance(eval_shared_model, dict)) and (((not eval_shared_model.model_loader.tags) or (eval_constants.EVAL_TAG in eval_shared_model.model_loader.tags)) and ((n... |
def _load_eval_run(output_path: Text) -> Tuple[(config.EvalConfig, Text, Text, Dict[(Text, Text)])]:
'Returns eval config, data location, file format, and model locations.'
path = os.path.join(output_path, _EVAL_CONFIG_FILE)
if tf.io.gfile.exists(path):
with tf.io.gfile.GFile(path, 'r') as f:
... | -3,223,791,447,349,410,300 | Returns eval config, data location, file format, and model locations. | tensorflow_model_analysis/api/model_eval_lib.py | _load_eval_run | Bobgy/model-analysis | python | def _load_eval_run(output_path: Text) -> Tuple[(config.EvalConfig, Text, Text, Dict[(Text, Text)])]:
path = os.path.join(output_path, _EVAL_CONFIG_FILE)
if tf.io.gfile.exists(path):
with tf.io.gfile.GFile(path, 'r') as f:
pb = json_format.Parse(f.read(), config_pb2.EvalRun())
... |
def load_validation_result(validations_file: Text) -> Optional[ValidationResult]:
'Read and deserialize the ValidationResult.'
validation_records = []
for record in tf.compat.v1.python_io.tf_record_iterator(validations_file):
validation_records.append(ValidationResult.FromString(record))
if vali... | 7,744,466,919,958,878,000 | Read and deserialize the ValidationResult. | tensorflow_model_analysis/api/model_eval_lib.py | load_validation_result | Bobgy/model-analysis | python | def load_validation_result(validations_file: Text) -> Optional[ValidationResult]:
validation_records = []
for record in tf.compat.v1.python_io.tf_record_iterator(validations_file):
validation_records.append(ValidationResult.FromString(record))
if validation_records:
assert (len(validati... |
def make_eval_results(results: List[EvalResult], mode: Text) -> EvalResults:
'Run model analysis for a single model on multiple data sets.\n\n Args:\n results: A list of TFMA evaluation results.\n mode: The mode of the evaluation. Currently, tfma.DATA_CENTRIC_MODE and\n tfma.MODEL_CENTRIC_MODE are suppo... | 1,152,483,092,745,140,900 | Run model analysis for a single model on multiple data sets.
Args:
results: A list of TFMA evaluation results.
mode: The mode of the evaluation. Currently, tfma.DATA_CENTRIC_MODE and
tfma.MODEL_CENTRIC_MODE are supported.
Returns:
An EvalResults containing all evaluation results. This can be used to
const... | tensorflow_model_analysis/api/model_eval_lib.py | make_eval_results | Bobgy/model-analysis | python | def make_eval_results(results: List[EvalResult], mode: Text) -> EvalResults:
'Run model analysis for a single model on multiple data sets.\n\n Args:\n results: A list of TFMA evaluation results.\n mode: The mode of the evaluation. Currently, tfma.DATA_CENTRIC_MODE and\n tfma.MODEL_CENTRIC_MODE are suppo... |
def load_eval_results(output_paths: List[Text], mode: Text, model_name: Optional[Text]=None) -> EvalResults:
'Run model analysis for a single model on multiple data sets.\n\n Args:\n output_paths: A list of output paths of completed tfma runs.\n mode: The mode of the evaluation. Currently, tfma.DATA_CENTRIC_... | 6,960,574,085,333,971,000 | Run model analysis for a single model on multiple data sets.
Args:
output_paths: A list of output paths of completed tfma runs.
mode: The mode of the evaluation. Currently, tfma.DATA_CENTRIC_MODE and
tfma.MODEL_CENTRIC_MODE are supported.
model_name: The name of the model if multiple models are evaluated tog... | tensorflow_model_analysis/api/model_eval_lib.py | load_eval_results | Bobgy/model-analysis | python | def load_eval_results(output_paths: List[Text], mode: Text, model_name: Optional[Text]=None) -> EvalResults:
'Run model analysis for a single model on multiple data sets.\n\n Args:\n output_paths: A list of output paths of completed tfma runs.\n mode: The mode of the evaluation. Currently, tfma.DATA_CENTRIC_... |
def load_eval_result(output_path: Text, model_name: Optional[Text]=None) -> EvalResult:
'Creates an EvalResult object for use with the visualization functions.'
(eval_config, data_location, file_format, model_locations) = _load_eval_run(output_path)
metrics_proto_list = metrics_and_plots_serialization.load_... | 2,867,715,658,580,579,300 | Creates an EvalResult object for use with the visualization functions. | tensorflow_model_analysis/api/model_eval_lib.py | load_eval_result | Bobgy/model-analysis | python | def load_eval_result(output_path: Text, model_name: Optional[Text]=None) -> EvalResult:
(eval_config, data_location, file_format, model_locations) = _load_eval_run(output_path)
metrics_proto_list = metrics_and_plots_serialization.load_and_deserialize_metrics(path=os.path.join(output_path, constants.METRICS... |
def default_eval_shared_model(eval_saved_model_path: Text, add_metrics_callbacks: Optional[List[types.AddMetricsCallbackType]]=None, include_default_metrics: Optional[bool]=True, example_weight_key: Optional[Union[(Text, Dict[(Text, Text)])]]=None, additional_fetches: Optional[List[Text]]=None, blacklist_feature_fetche... | 4,766,532,646,388,441,000 | Returns default EvalSharedModel.
Args:
eval_saved_model_path: Path to EvalSavedModel.
add_metrics_callbacks: Optional list of callbacks for adding additional
metrics to the graph (see EvalSharedModel for more information on how to
configure additional metrics). Metrics for example count and example
wei... | tensorflow_model_analysis/api/model_eval_lib.py | default_eval_shared_model | Bobgy/model-analysis | python | def default_eval_shared_model(eval_saved_model_path: Text, add_metrics_callbacks: Optional[List[types.AddMetricsCallbackType]]=None, include_default_metrics: Optional[bool]=True, example_weight_key: Optional[Union[(Text, Dict[(Text, Text)])]]=None, additional_fetches: Optional[List[Text]]=None, blacklist_feature_fetche... |
def default_extractors(eval_shared_model: Union[(types.EvalSharedModel, Dict[(Text, types.EvalSharedModel)])]=None, eval_config: config.EvalConfig=None, slice_spec: Optional[List[slicer.SingleSliceSpec]]=None, desired_batch_size: Optional[int]=None, materialize: Optional[bool]=True) -> List[extractor.Extractor]:
'R... | 5,195,463,914,530,202,000 | Returns the default extractors for use in ExtractAndEvaluate.
Args:
eval_shared_model: Shared model (single-model evaluation) or dict of shared
models keyed by model name (multi-model evaluation). Required unless the
predictions are provided alongside of the features (i.e. model-agnostic
evaluations).
... | tensorflow_model_analysis/api/model_eval_lib.py | default_extractors | Bobgy/model-analysis | python | def default_extractors(eval_shared_model: Union[(types.EvalSharedModel, Dict[(Text, types.EvalSharedModel)])]=None, eval_config: config.EvalConfig=None, slice_spec: Optional[List[slicer.SingleSliceSpec]]=None, desired_batch_size: Optional[int]=None, materialize: Optional[bool]=True) -> List[extractor.Extractor]:
'R... |
def default_evaluators(eval_shared_model: Optional[Union[(types.EvalSharedModel, Dict[(Text, types.EvalSharedModel)])]]=None, eval_config: config.EvalConfig=None, compute_confidence_intervals: Optional[bool]=False, k_anonymization_count: int=1, desired_batch_size: Optional[int]=None, serialize: bool=False, random_seed_... | 1,749,821,193,430,307,300 | Returns the default evaluators for use in ExtractAndEvaluate.
Args:
eval_shared_model: Optional shared model (single-model evaluation) or dict
of shared models keyed by model name (multi-model evaluation). Only
required if there are metrics to be computed in-graph using the model.
eval_config: Eval config.... | tensorflow_model_analysis/api/model_eval_lib.py | default_evaluators | Bobgy/model-analysis | python | def default_evaluators(eval_shared_model: Optional[Union[(types.EvalSharedModel, Dict[(Text, types.EvalSharedModel)])]]=None, eval_config: config.EvalConfig=None, compute_confidence_intervals: Optional[bool]=False, k_anonymization_count: int=1, desired_batch_size: Optional[int]=None, serialize: bool=False, random_seed_... |
def default_writers(output_path: Optional[Text], eval_shared_model: Optional[Union[(types.EvalSharedModel, Dict[(Text, types.EvalSharedModel)])]]=None) -> List[writer.Writer]:
'Returns the default writers for use in WriteResults.\n\n Args:\n output_path: Output path.\n eval_shared_model: Optional shared mode... | 6,589,016,826,840,738,000 | Returns the default writers for use in WriteResults.
Args:
output_path: Output path.
eval_shared_model: Optional shared model (single-model evaluation) or dict
of shared models keyed by model name (multi-model evaluation). Only
required if legacy add_metrics_callbacks are used. | tensorflow_model_analysis/api/model_eval_lib.py | default_writers | Bobgy/model-analysis | python | def default_writers(output_path: Optional[Text], eval_shared_model: Optional[Union[(types.EvalSharedModel, Dict[(Text, types.EvalSharedModel)])]]=None) -> List[writer.Writer]:
'Returns the default writers for use in WriteResults.\n\n Args:\n output_path: Output path.\n eval_shared_model: Optional shared mode... |
@beam.ptransform_fn
@beam.typehints.with_input_types(bytes)
@beam.typehints.with_output_types(types.Extracts)
def InputsToExtracts(inputs: beam.pvalue.PCollection):
'Converts serialized inputs (e.g. examples) to Extracts.'
return (inputs | beam.Map((lambda x: {constants.INPUT_KEY: x}))) | 1,328,535,458,801,781,500 | Converts serialized inputs (e.g. examples) to Extracts. | tensorflow_model_analysis/api/model_eval_lib.py | InputsToExtracts | Bobgy/model-analysis | python | @beam.ptransform_fn
@beam.typehints.with_input_types(bytes)
@beam.typehints.with_output_types(types.Extracts)
def InputsToExtracts(inputs: beam.pvalue.PCollection):
return (inputs | beam.Map((lambda x: {constants.INPUT_KEY: x}))) |
@beam.ptransform_fn
@beam.typehints.with_input_types(types.Extracts)
@beam.typehints.with_output_types(evaluator.Evaluation)
def ExtractAndEvaluate(extracts: beam.pvalue.PCollection, extractors: List[extractor.Extractor], evaluators: List[evaluator.Evaluator]):
'Performs Extractions and Evaluations in provided orde... | -2,748,688,428,476,792,000 | Performs Extractions and Evaluations in provided order. | tensorflow_model_analysis/api/model_eval_lib.py | ExtractAndEvaluate | Bobgy/model-analysis | python | @beam.ptransform_fn
@beam.typehints.with_input_types(types.Extracts)
@beam.typehints.with_output_types(evaluator.Evaluation)
def ExtractAndEvaluate(extracts: beam.pvalue.PCollection, extractors: List[extractor.Extractor], evaluators: List[evaluator.Evaluator]):
evaluation = {}
def update(evaluation: Dict[... |
@beam.ptransform_fn
@beam.typehints.with_input_types(Union[(evaluator.Evaluation, validator.Validation)])
@beam.typehints.with_output_types(beam.pvalue.PDone)
def WriteResults(evaluation_or_validation: Union[(evaluator.Evaluation, validator.Validation)], writers: List[writer.Writer]):
'Writes Evaluation or Validati... | 8,322,397,795,302,271,000 | Writes Evaluation or Validation results using given writers.
Args:
evaluation_or_validation: Evaluation or Validation output.
writers: Writes to use for writing out output.
Raises:
ValueError: If Evaluation or Validation is empty.
Returns:
beam.pvalue.PDone. | tensorflow_model_analysis/api/model_eval_lib.py | WriteResults | Bobgy/model-analysis | python | @beam.ptransform_fn
@beam.typehints.with_input_types(Union[(evaluator.Evaluation, validator.Validation)])
@beam.typehints.with_output_types(beam.pvalue.PDone)
def WriteResults(evaluation_or_validation: Union[(evaluator.Evaluation, validator.Validation)], writers: List[writer.Writer]):
'Writes Evaluation or Validati... |
@beam.ptransform_fn
@beam.typehints.with_input_types(beam.Pipeline)
@beam.typehints.with_output_types(beam.pvalue.PDone)
def WriteEvalConfig(pipeline: beam.Pipeline, eval_config: config.EvalConfig, output_path: Text, data_location: Optional[Text]='', file_format: Optional[Text]='', model_locations: Optional[Dict[(Text,... | -1,003,215,287,247,355,600 | Writes EvalConfig to file.
Args:
pipeline: Beam pipeline.
eval_config: EvalConfig.
output_path: Output path.
data_location: Optional location for data used with config.
file_format: Optional format for data used with config.
model_locations: Optional location(s) for model(s) used with config.
Returns:
b... | tensorflow_model_analysis/api/model_eval_lib.py | WriteEvalConfig | Bobgy/model-analysis | python | @beam.ptransform_fn
@beam.typehints.with_input_types(beam.Pipeline)
@beam.typehints.with_output_types(beam.pvalue.PDone)
def WriteEvalConfig(pipeline: beam.Pipeline, eval_config: config.EvalConfig, output_path: Text, data_location: Optional[Text]=, file_format: Optional[Text]=, model_locations: Optional[Dict[(Text, Tex... |
@beam.ptransform_fn
@beam.typehints.with_output_types(beam.pvalue.PDone)
def ExtractEvaluateAndWriteResults(examples: beam.pvalue.PCollection, eval_shared_model: Optional[Union[(types.EvalSharedModel, Dict[(Text, types.EvalSharedModel)])]]=None, eval_config: config.EvalConfig=None, extractors: Optional[List[extractor.E... | -1,977,251,296,438,576,400 | PTransform for performing extraction, evaluation, and writing results.
Users who want to construct their own Beam pipelines instead of using the
lightweight run_model_analysis functions should use this PTransform.
Example usage:
eval_config = tfma.EvalConfig(slicing_specs=[...], metrics_specs=[...])
eval_shared_m... | tensorflow_model_analysis/api/model_eval_lib.py | ExtractEvaluateAndWriteResults | Bobgy/model-analysis | python | @beam.ptransform_fn
@beam.typehints.with_output_types(beam.pvalue.PDone)
def ExtractEvaluateAndWriteResults(examples: beam.pvalue.PCollection, eval_shared_model: Optional[Union[(types.EvalSharedModel, Dict[(Text, types.EvalSharedModel)])]]=None, eval_config: config.EvalConfig=None, extractors: Optional[List[extractor.E... |
def run_model_analysis(eval_shared_model: Optional[Union[(types.EvalSharedModel, Dict[(Text, types.EvalSharedModel)])]]=None, eval_config: config.EvalConfig=None, data_location: Text='', file_format: Text='tfrecords', output_path: Optional[Text]=None, extractors: Optional[List[extractor.Extractor]]=None, evaluators: Op... | 277,492,606,528,607,420 | Runs TensorFlow model analysis.
It runs a Beam pipeline to compute the slicing metrics exported in TensorFlow
Eval SavedModel and returns the results.
This is a simplified API for users who want to quickly get something running
locally. Users who wish to create their own Beam pipelines can use the
Evaluate PTransform... | tensorflow_model_analysis/api/model_eval_lib.py | run_model_analysis | Bobgy/model-analysis | python | def run_model_analysis(eval_shared_model: Optional[Union[(types.EvalSharedModel, Dict[(Text, types.EvalSharedModel)])]]=None, eval_config: config.EvalConfig=None, data_location: Text=, file_format: Text='tfrecords', output_path: Optional[Text]=None, extractors: Optional[List[extractor.Extractor]]=None, evaluators: Opti... |
def single_model_analysis(model_location: Text, data_location: Text, output_path: Text=None, slice_spec: Optional[List[slicer.SingleSliceSpec]]=None) -> EvalResult:
'Run model analysis for a single model on a single data set.\n\n This is a convenience wrapper around run_model_analysis for a single model\n with a ... | -1,324,916,261,838,926,800 | Run model analysis for a single model on a single data set.
This is a convenience wrapper around run_model_analysis for a single model
with a single data set. For more complex use cases, use
tfma.run_model_analysis.
Args:
model_location: Path to the export eval saved model.
data_location: The location of the data... | tensorflow_model_analysis/api/model_eval_lib.py | single_model_analysis | Bobgy/model-analysis | python | def single_model_analysis(model_location: Text, data_location: Text, output_path: Text=None, slice_spec: Optional[List[slicer.SingleSliceSpec]]=None) -> EvalResult:
'Run model analysis for a single model on a single data set.\n\n This is a convenience wrapper around run_model_analysis for a single model\n with a ... |
def multiple_model_analysis(model_locations: List[Text], data_location: Text, **kwargs) -> EvalResults:
'Run model analysis for multiple models on the same data set.\n\n Args:\n model_locations: A list of paths to the export eval saved model.\n data_location: The location of the data files.\n **kwargs: Th... | -8,708,293,839,599,697,000 | Run model analysis for multiple models on the same data set.
Args:
model_locations: A list of paths to the export eval saved model.
data_location: The location of the data files.
**kwargs: The args used for evaluation. See tfma.single_model_analysis() for
details.
Returns:
A tfma.EvalResults containing al... | tensorflow_model_analysis/api/model_eval_lib.py | multiple_model_analysis | Bobgy/model-analysis | python | def multiple_model_analysis(model_locations: List[Text], data_location: Text, **kwargs) -> EvalResults:
'Run model analysis for multiple models on the same data set.\n\n Args:\n model_locations: A list of paths to the export eval saved model.\n data_location: The location of the data files.\n **kwargs: Th... |
def multiple_data_analysis(model_location: Text, data_locations: List[Text], **kwargs) -> EvalResults:
'Run model analysis for a single model on multiple data sets.\n\n Args:\n model_location: The location of the exported eval saved model.\n data_locations: A list of data set locations.\n **kwargs: The ar... | 8,351,321,221,426,479,000 | Run model analysis for a single model on multiple data sets.
Args:
model_location: The location of the exported eval saved model.
data_locations: A list of data set locations.
**kwargs: The args used for evaluation. See tfma.run_model_analysis() for
details.
Returns:
A tfma.EvalResults containing all the ... | tensorflow_model_analysis/api/model_eval_lib.py | multiple_data_analysis | Bobgy/model-analysis | python | def multiple_data_analysis(model_location: Text, data_locations: List[Text], **kwargs) -> EvalResults:
'Run model analysis for a single model on multiple data sets.\n\n Args:\n model_location: The location of the exported eval saved model.\n data_locations: A list of data set locations.\n **kwargs: The ar... |
def cross_channel_threshold_detector(multichannel, fs, **kwargs):
"\n Parameters\n ----------\n multichannel : np.array\n Msamples x Nchannels audio data\n fs : float >0\n detector_function : function, optional \n The function used to detect the start and end of a signal. \n Any ... | -593,467,887,461,798,300 | Parameters
----------
multichannel : np.array
Msamples x Nchannels audio data
fs : float >0
detector_function : function, optional
The function used to detect the start and end of a signal.
Any custom detector function can be given, the compulsory inputs
are audio np.array, sample rate and the functio... | batracker/signal_detection/detection.py | cross_channel_threshold_detector | thejasvibr/batracker | python | def cross_channel_threshold_detector(multichannel, fs, **kwargs):
"\n Parameters\n ----------\n multichannel : np.array\n Msamples x Nchannels audio data\n fs : float >0\n detector_function : function, optional \n The function used to detect the start and end of a signal. \n Any ... |
def dBrms_detector(one_channel, fs, **kwargs):
'\n Calculates the dB rms profile of the input audio and \n selects regions which arae above the profile. \n \n Parameters\n ----------\n one_channel\n fs\n dbrms_threshold: float, optional\n Defaults to -50 dB rms\n dbrms_window: fl... | 8,576,930,007,192,636,000 | Calculates the dB rms profile of the input audio and
selects regions which arae above the profile.
Parameters
----------
one_channel
fs
dbrms_threshold: float, optional
Defaults to -50 dB rms
dbrms_window: float, optional
The window which is used to calculate the dB rms profile
in seconds. Defaults to... | batracker/signal_detection/detection.py | dBrms_detector | thejasvibr/batracker | python | def dBrms_detector(one_channel, fs, **kwargs):
'\n Calculates the dB rms profile of the input audio and \n selects regions which arae above the profile. \n \n Parameters\n ----------\n one_channel\n fs\n dbrms_threshold: float, optional\n Defaults to -50 dB rms\n dbrms_window: fl... |
def envelope_detector(audio, fs, **kwargs):
'\n Generates the Hilbert envelope of the audio. Signals are detected\n wherever the envelope goes beyond a user-defined threshold value.\n \n Two main options are to segment loud signals with reference to dB peak or \n with reference dB above floor level. ... | -5,478,177,382,828,583,000 | Generates the Hilbert envelope of the audio. Signals are detected
wherever the envelope goes beyond a user-defined threshold value.
Two main options are to segment loud signals with reference to dB peak or
with reference dB above floor level.
Parameters
----------
audio
fs
Keyword Arguments
-----------------
thre... | batracker/signal_detection/detection.py | envelope_detector | thejasvibr/batracker | python | def envelope_detector(audio, fs, **kwargs):
'\n Generates the Hilbert envelope of the audio. Signals are detected\n wherever the envelope goes beyond a user-defined threshold value.\n \n Two main options are to segment loud signals with reference to dB peak or \n with reference dB above floor level. ... |
def moving_rms(X, **kwargs):
'Calculates moving rms of a signal with given window size. \n Outputs np.array of *same* size as X. The rms of the \n last few samples <= window_size away from the end are assigned\n to last full-window rms calculated\n Parameters\n ----------\n X : np.array\n ... | 4,701,221,638,837,301,000 | Calculates moving rms of a signal with given window size.
Outputs np.array of *same* size as X. The rms of the
last few samples <= window_size away from the end are assigned
to last full-window rms calculated
Parameters
----------
X : np.array
Signal of interest.
window_size : int, optional
Default... | batracker/signal_detection/detection.py | moving_rms | thejasvibr/batracker | python | def moving_rms(X, **kwargs):
'Calculates moving rms of a signal with given window size. \n Outputs np.array of *same* size as X. The rms of the \n last few samples <= window_size away from the end are assigned\n to last full-window rms calculated\n Parameters\n ----------\n X : np.array\n ... |
def parse_fn(line_words, line_tags):
'Encodes words into bytes for tensor\n\n :param line_words: one line with words (aka sentences) with space between each word/token\n :param line_tags: one line of tags (one tag per word in line_words)\n :return: (list of encoded words, len(words)), list of encoded tags\... | -6,792,739,573,695,873,000 | Encodes words into bytes for tensor
:param line_words: one line with words (aka sentences) with space between each word/token
:param line_tags: one line of tags (one tag per word in line_words)
:return: (list of encoded words, len(words)), list of encoded tags | src/model/lstm_crf/main.py | parse_fn | vikasbahirwani/SequenceTagging | python | def parse_fn(line_words, line_tags):
'Encodes words into bytes for tensor\n\n :param line_words: one line with words (aka sentences) with space between each word/token\n :param line_tags: one line of tags (one tag per word in line_words)\n :return: (list of encoded words, len(words)), list of encoded tags\... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.