Skip to main content
Version: 0.96

snorkelflow.client.blocks.duplicate_block

snorkelflow.client.blocks.duplicate_block(application, from_block_uid, block_config, input_node_uid=-1, assets_to_import=None)

Duplicates a block in an application

Parameters:
  • application (Union[str, int]) – The name or UID of the application

  • from_block_uid (int) – The uid of the block to duplicate

  • block_config (Dict[str, Any]) – The block config for the block to be created

  • input_node_uid (int, default: -1) – The input node uid for the newly created block- defaults to the input

  • assets_to_import (Optional[Dict[str, Any]], default: None) – An optional dictionary specifying duplication options

Returns:

Details on the duplicated block

Return type:

Dict[str, any]

Example

>>> sf.duplicate_block(
>>> APP_NAME,
>>> BLOCK_UID,
>>> block_config=dict(
>>> label_map=dict(POS=1, NEG=0, UNKNOWN=-1)
>>> ),
>>> )
{
'block_uid': <block_uid>,
'node_uids': [<node_uid>, ...],
'job_ids': [<job_uid>, ...]
}