def _extend_blocks(result, blocks=None):
 if (blocks is None):
  blocks = []
 if isinstance(result, list):
  for r in result:
   if isinstance(r, list):
    blocks.extend(r)
   else:
    blocks.append(r)
 elif isinstance(result, BlockManager):
  blocks.extend(result.blocks)
 else:
  blocks.append(result)
 return blocks

def _extend_blocks ( result , blocks = None ) : if ( blocks is None ) : blocks = [ ] if isinstance ( result , list ) : for r in result : if isinstance ( r , list ) : blocks . extend ( r ) else : blocks . append ( r ) elif isinstance ( result , BlockManager ) : blocks . extend ( result . blocks ) else : blocks . append ( result ) return blocks
extends the dictionary blocks with *new* blocks in the parent node .