<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def run_marionette_script(script, chrome=False, async=False, host='localhost', port=2828):
 """Create a Marionette instance and run the provided script"""

    m = DeviceHelper.getMarionette(host, port)
    m.start_session()
    if chrome:
        m.set_context(marionette.Marionette.CONTEXT_CHROME)
    if not async:
        result = m.execute_script(script)
    else:
        result = m.execute_async_script(script)
    m.delete_session()
    return result