parameters: (result, blocks=None)
return_statement: return blocks
docstring: return a new extended blocks, givin the result
docstring_summary: return a new extended blocks, givin the result
docstring_tokens: return a new extended blocks givin the result
function: def _extend_blocks(result, blocks=None):
      """ return a new extended blocks, givin the result """
      from pandas.core.internals import BlockManager
      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
function_tokens: def _extend_blocks ( result , blocks = None ) : from pandas . core . internals import BlockManager 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