Decode a list of string notations to specify blocks inside the network. Args: string_list (list[str]): A list of strings, each string is a notation of block. Returns: blocks_args: A list of BlockArgs namedtuples of block args.
(string_list)
| 351 | |
| 352 | @staticmethod |
| 353 | def decode(string_list): |
| 354 | """Decode a list of string notations to specify blocks inside the network. |
| 355 | Args: |
| 356 | string_list (list[str]): A list of strings, each string is a notation of block. |
| 357 | Returns: |
| 358 | blocks_args: A list of BlockArgs namedtuples of block args. |
| 359 | """ |
| 360 | assert isinstance(string_list, list) |
| 361 | blocks_args = [] |
| 362 | for block_string in string_list: |
| 363 | blocks_args.append(BlockDecoder._decode_block_string(block_string)) |
| 364 | return blocks_args |
| 365 | |
| 366 | @staticmethod |
| 367 | def encode(blocks_args): |
no test coverage detected