def dump(data, hdfs_path, **kwargs):
kwargs["<STR_LIT>"] = "<STR_LIT:w>" if isinstance(data, bintype) else "<STR_LIT>"<EOL>with open(hdfs_path, **kwargs) as fo:<EOL><INDENT>i = <NUM_LIT:0><EOL>bufsize = common.BUFSIZE<EOL>while i < len(data):<EOL><INDENT>fo.write(data[i: i + bufsize])<EOL>i += bufsize<EOL><DEDENT><DEDENT>fo.fs.close()<EOL>
\
    Write ``data`` to ``hdfs_path``.

    Keyword arguments are passed to :func:`open`, except for ``mode``,
    which is forced to ``"w"`` (or ``"wt"`` for text data).