pathorcontents was solely used by the gcs backend. I moved the function into the backend package so it could still be used by other backends for good measure.