def write(self, process_tile, data):
if isinstance(process_tile, tuple):<EOL><INDENT>process_tile = self.config.process_pyramid.tile(*process_tile)<EOL><DEDENT>elif not isinstance(process_tile, BufferedTile):<EOL><INDENT>raise ValueError("<STR_LIT>" % type(process_tile))<EOL><DEDENT>if self.config.mode not in ["<STR_LIT>", "<STR_LIT>"]:<EOL><INDENT>raise ValueError("<STR_LIT>")<EOL><DEDENT>if self.config.mode == "<STR_LIT>" and (<EOL>self.config.output.tiles_exist(process_tile)<EOL>):<EOL><INDENT>message = "<STR_LIT>"<EOL>logger.debug((process_tile.id, message))<EOL>return ProcessInfo(<EOL>tile=process_tile,<EOL>processed=False,<EOL>process_msg=None,<EOL>written=False,<EOL>write_msg=message<EOL>)<EOL><DEDENT>elif data is None:<EOL><INDENT>message = "<STR_LIT>"<EOL>logger.debug((process_tile.id, message))<EOL>return ProcessInfo(<EOL>tile=process_tile,<EOL>processed=False,<EOL>process_msg=None,<EOL>written=False,<EOL>write_msg=message<EOL>)<EOL><DEDENT>else:<EOL><INDENT>with Timer() as t:<EOL><INDENT>self.config.output.write(process_tile=process_tile, data=data)<EOL><DEDENT>message = "<STR_LIT>" % t<EOL>logger.debug((process_tile.id, message))<EOL>return ProcessInfo(<EOL>tile=process_tile,<EOL>processed=False,<EOL>process_msg=None,<EOL>written=True,<EOL>write_msg=message<EOL>)<EOL><DEDENT>
Write data into output format.

Parameters
----------
process_tile : BufferedTile or tile index tuple
    process tile
data : NumPy array or features
    data to be written