'This function only closes the file if it was opened by the lazy
file wrapper.  For instance this will never close stdin.'

def close_intelligently(self):

    if self.should_close:
        self.close()
