code: def _file_name(fname, base_dir):
          
  
          fname = fname.replace("\\", "\\\\")
  
          if base_dir != '' and fname[0] != ':' and not os.path.isabs(fname):
              fname = os.path.join(base_dir, fname)
  
          return fname
docs: Convert a relative filename if we have a base directory.