def driver_for_path(path, drivers=None):
ext = (os.path.splitext(path)[<NUM_LIT:1>][<NUM_LIT:1>:] or path).lower()<EOL>drivers = drivers or ImageDriver.registry if ext else {}<EOL>for name, meta in drivers.items():<EOL><INDENT>if ext == meta.get('<STR_LIT>', '<STR_LIT>').lower():<EOL><INDENT>return ImageDriver(name)<EOL><DEDENT><DEDENT>return None<EOL>
Returns the gdal.Driver for a path or None based on the file extension.

    Arguments:
    path -- file path as str with a GDAL supported file extension