<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def import_setting(file_path, qsettings=None):
 """Import InaSAFE's setting from a file. :param file_path: The file to read the imported setting. :type file_path: basestring :param qsettings: A custom QSettings to use. If it's not defined, it will use the default one. :type qsettings: qgis.PyQt.QtCore.QSettings :returns: A dictionary of the imported settings. :rtype: dict """

    with open(file_path, 'r') as f:
        inasafe_settings = json.load(f)

    if not qsettings:
        qsettings = QSettings()

    # Clear the previous setting
    qsettings.beginGroup('inasafe')
    qsettings.remove('')
    qsettings.endGroup()

    for key, value in list(inasafe_settings.items()):
        set_setting(key, value, qsettings=qsettings)

    return inasafe_settings