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 applicationfrom_block_uid (
int
) – The uid of the block to duplicateblock_config (
Dict
[str
,Any
]) – The block config for the block to be createdinput_node_uid (
int
, default:-1
) – The input node uid for the newly created block- defaults to the inputassets_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>, ...]
}