parameters: (self, mode=None)
docstring: Check if TarFile is still open, and if the operation's mode
             corresponds to TarFile's mode.
docstring_summary: Check if TarFile is still open, and if the operation's mode
             corresponds to TarFile's mode.
docstring_tokens: Check if TarFile is still open and if the operation s mode corresponds to TarFile s mode .
function: def _check(self, mode=None):
          """Check if TarFile is still open, and if the operation's mode
             corresponds to TarFile's mode.
          """
          if self.closed:
              raise IOError("%s is closed" % self.__class__.__name__)
          if mode is not None and self.mode not in mode:
              raise IOError("bad operation for mode %r" % self.mode)
function_tokens: def _check ( self , mode = None ) : if self . closed : raise IOError ( "%s is closed" % self . __class__ . __name__ ) if mode is not None and self . mode not in mode : raise IOError ( "bad operation for mode %r" % self . mode )