<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def get_ogr_driver(filepath):
 """ Get the OGR driver from the provided file extension. Args: file_extension (str):
 file extension Returns: osgeo.ogr.Driver Raises: ValueError: no driver is found """

    filename, file_extension = os.path.splitext(filepath)
    EXTENSION = file_extension[1:]

    ogr_driver_count = ogr.GetDriverCount()
    for idx in range(ogr_driver_count):
        driver = ogr.GetDriver(idx)
        driver_extension = driver.GetMetadataItem(str('DMD_EXTENSION')) or ''
        driver_extensions = driver.GetMetadataItem(str('DMD_EXTENSIONS')) or ''

        if EXTENSION == driver_extension or EXTENSION in driver_extensions:
            return driver

    else:
        msg = 'No driver found for the following file extension: {}'.format(
            EXTENSION)
        raise ValueError(msg)