def _stringify_path(filepath_or_buffer):
 if (_PATHLIB_INSTALLED and isinstance(filepath_or_buffer, pathlib.Path)):
  return text_type(filepath_or_buffer)
 if (_PY_PATH_INSTALLED and isinstance(filepath_or_buffer, LocalPath)):
  return filepath_or_buffer.strpath
 return filepath_or_buffer

def _stringify_path ( filepath_or_buffer ) : if ( _PATHLIB_INSTALLED and isinstance ( filepath_or_buffer , pathlib . Path ) ) : return text_type ( filepath_or_buffer ) if ( _PY_PATH_INSTALLED and isinstance ( filepath_or_buffer , LocalPath ) ) : return filepath_or_buffer . strpath return filepath_or_buffer
return the argument coerced to a string if it was a pathlib .