parameters: (trajfn, mode)
return_statement: return of
docstring: Helper function for input/output LAMMPS traj files.
      Trajectories may be plain text, .gz or .bz2 compressed.
  
      :param trajfn: name of LAMMPS traj
  
      :param mode: "r" ("w") and "rb" ("wb") depending on read or write
  
      Returns: file pointer
docstring_summary: Helper function for input/output LAMMPS traj files.
      Trajectories may be plain text, .gz or .bz2 compressed.
docstring_tokens: Helper function for input / output LAMMPS traj files . Trajectories may be plain text . gz or . bz2 compressed .
function: def readwrite(trajfn, mode):
      """
      Helper function for input/output LAMMPS traj files.
      Trajectories may be plain text, .gz or .bz2 compressed.
  
      :param trajfn: name of LAMMPS traj
  
      :param mode: "r" ("w") and "rb" ("wb") depending on read or write
  
      Returns: file pointer
      """
  
      if trajfn.endswith(".gz"):
          of = gzip.open(trajfn, mode)
          #return gzip.GzipFile(trajfn, mode)
      elif trajfn.endswith(".bz2"):
          of = bz2.open(trajfn, mode)
          #return bz2.BZ2File(trajfn, mode)
      else:
          of = open(trajfn, mode)
      return of
function_tokens: def readwrite ( trajfn , mode ) : if trajfn . endswith ( ".gz" ) : of = gzip . open ( trajfn , mode ) #return gzip.GzipFile(trajfn, mode) elif trajfn . endswith ( ".bz2" ) : of = bz2 . open ( trajfn , mode ) #return bz2.BZ2File(trajfn, mode) else : of = open ( trajfn , mode ) return of