def close(self):
if self.should_close:<EOL><INDENT>try:<EOL><INDENT>self.open_stream.close()<EOL><DEDENT>except (IOError, AttributeError):<EOL><INDENT>pass<EOL><DEDENT><DEDENT>
If we opened a stream earlier, in _get_data_from_filepath, we should
close it.

If an open stream or file was passed, we leave it open.