<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def toggle_codecompletion(self, checked):

 """Toggle automatic code completion"""

        self.shell.set_codecompletion_auto(checked)
        self.set_option('codecompletion/auto', checked)