parameters: (fn, mode, encoding, newline)
return_statement: return bz2.BZ2File(fn, mode)
docstring: Wrapper to open bz2 in text mode.
  
      Parameters
      ----------
      fn : str
          File name
      mode : {'r', 'w'}
          File mode. Note that bz2 Text files are not supported.
      encoding : str
          Ignored, text bz2 files not supported in Python2.
      newline : str
          Ignored, text bz2 files not supported in Python2.
docstring_summary: Wrapper to open bz2 in text mode.
docstring_tokens: Wrapper to open bz2 in text mode .
function: def _python2_bz2open(fn, mode, encoding, newline):
      """Wrapper to open bz2 in text mode.
  
      Parameters
      ----------
      fn : str
          File name
      mode : {'r', 'w'}
          File mode. Note that bz2 Text files are not supported.
      encoding : str
          Ignored, text bz2 files not supported in Python2.
      newline : str
          Ignored, text bz2 files not supported in Python2.
      """
      import bz2
  
      _check_mode(mode, encoding, newline)
  
      if "t" in mode:
          # BZ2File is missing necessary functions for TextIOWrapper
          warnings.warn("Assuming latin1 encoding for bz2 text file in Python2",
                        RuntimeWarning, stacklevel=5)
          mode = mode.replace("t", "")
      return bz2.BZ2File(fn, mode)
function_tokens: def _python2_bz2open ( fn , mode , encoding , newline ) : import bz2 _check_mode ( mode , encoding , newline ) if "t" in mode : # BZ2File is missing necessary functions for TextIOWrapper warnings . warn ( "Assuming latin1 encoding for bz2 text file in Python2" , RuntimeWarning , stacklevel = 5 ) mode = mode . replace ( "t" , "" ) return bz2 . BZ2File ( fn , mode )