<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def show_toast(self, msg, long=True):
 """ Show a toast message for the given duration. This is an android specific api. Parameters msg: str Text to display in the toast message long: bool Display for a long or short (system defined) duration """

        from .android_toast import Toast

        def on_toast(ref):
            t = Toast(__id__=ref)
            t.show()

        Toast.makeText(self, msg, 1 if long else 0).then(on_toast)