def write(self, arg, **kwargs):
if hasattr(arg, '<STR_LIT>'):<EOL><INDENT>self._tofile(arg, **kwargs)<EOL><DEDENT>else:<EOL><INDENT>with open(arg, '<STR_LIT:wb>') as fid:<EOL><INDENT>self._tofile(fid, **kwargs)<EOL><DEDENT><DEDENT>
Write instance to file.