def write(file, s, mode='w', **kwargs):
    """Read and return content of the file.

    Args:
        file: Path-like object giving the pathname of the file to be opened.
        s: Content to be written.
        mode: String giving the mode of the file to be opened. Default: 'w'.
        **kwargs: Optional arguments that ``open`` takes.

    Returns:
        The number of characters/bytes (according to mode) written.

    """
    with open(file, mode, **kwargs) as f:
        return f.write(s)