parameters: (file_like, block_size)
docstring: Yield file contents by block then close the file.
docstring_summary: Yield file contents by block then close the file.
docstring_tokens: Yield file contents by block then close the file .
function: def iter_and_close(file_like, block_size):
      """Yield file contents by block then close the file."""
      while 1:
          try:
              block = file_like.read(block_size)
              if block: yield block
              else: raise StopIteration
          except StopIteration, si:
              file_like.close()
              return
function_tokens: def iter_and_close ( file_like , block_size ) : while 1 : try : block = file_like . read ( block_size ) if block : yield block else : raise StopIteration except StopIteration , si : file_like . close ( ) return