def get_file(file_or_path, mode="r"):
    """Open a file for reading, or simply return the file object.
    """
    if hasattr(file_or_path, "read"):
        return file_or_path
    return open(file_or_path, mode)