def to_netjson(self, remove_block=True):
result = OrderedDict()<EOL>intermediate_data = list(self.intermediate_data[self.intermediate_key])<EOL>for index, block in enumerate(intermediate_data):<EOL><INDENT>if self.should_skip_block(block):<EOL><INDENT>continue<EOL><DEDENT>if remove_block:<EOL><INDENT>self.intermediate_data[self.intermediate_key].remove(block)<EOL><DEDENT>result = self.to_netjson_loop(block, result, index + <NUM_LIT:1>)<EOL><DEDENT>return result<EOL>
Converts the intermediate data structure (``self.intermediate_datra``)
to a NetJSON configuration dictionary (``self.config``)