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

NameTypeDefaultInfo
applicationUnion[str, int]The name or UID of the application.
from_block_uidintThe uid of the block to duplicate.
block_configDict[str, Any]The block config for the block to be created.
input_node_uidint-1The input node uid for the newly created block- defaults to the input.
assets_to_importOptional[Dict[str, Any]]NoneAn 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>, ...]
}