class_docstr: class to contain filename, fileobj and file position
class_docstr_tok: ["class","to","contain","filename",",","fileobj","and","file","position"]
docstr: Return fileobj if present, or return fileobj from filename
  
  Set position to that given in self.pos
  
  Parameters
  ----------
  *args : tuple
     positional arguments to file open.  Ignored if there is a
     defined ``self.fileobj``.  These might include the mode, such
     as 'rb'
  **kwargs : dict
     named arguments to file open.  Ignored if there is a
     defined ``self.fileobj``
  
  Returns
  -------
  fileobj : file-like object
     object has position set (via ``fileobj.seek()``) to
     ``self.pos``
docstr_tok: ["Return","fileobj","if","present",",","or","return","fileobj","from","filename","Set","position","to","that","given","in","self.pos","Parameters","--","--","--","--","--","*","args",":","tuple","positional","arguments","to","file","open",".","Ignored","if","there","is","a","defined","``","self.fileobj","``",".","These","might","include","the","mode",",","such","as","'rb'","*","*","kwargs",":","dict","named","arguments","to","file","open",".","Ignored","if","there","is","a","defined","``","self.fileobj","``","Returns","--","--","--","-","fileobj",":","file-like","object","object","has","position","set","(","via","``","fileobj.seek","(",")","``",")","to","``","self.pos","``"]
code: def get_prepare_fileobj(self, *args, **kwargs) -> ImageOpener:
      """Return fileobj if present, or return fileobj from filename
  
      Set position to that given in self.pos
  
      Parameters
      ----------
      *args : tuple
         positional arguments to file open.  Ignored if there is a
         defined ``self.fileobj``.  These might include the mode, such
         as 'rb'
      **kwargs : dict
         named arguments to file open.  Ignored if there is a
         defined ``self.fileobj``
  
      Returns
      -------
      fileobj : file-like object
         object has position set (via ``fileobj.seek()``) to
         ``self.pos``
      """
      if self.fileobj is not None:
          obj = ImageOpener(self.fileobj)  # for context manager
          obj.seek(self.pos)
      elif self.filename is not None:
          obj = ImageOpener(self.filename, *args, **kwargs)
          if self.pos != 0:
              obj.seek(self.pos)
      else:
          raise FileHolderError("No filename or fileobj present")
      return obj
  
file_path: nibabel/nibabel/fileholders.py
imports: from __future__ import annotations
  import io
  import typing
  from copy import copy
  from .openers import ImageOpener
label_desc: Use image node_id 2 for calling the FileHolder obj's underlying member method code with example usage: obj.get_prepare_fileobj() and returns: obj