<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def clean_code(self, name, forbidden):
 """ Remove lines containing items in 'forbidden' from the code. Helpful for executing converted notebooks that still retain IPython magic commands. """


        code = self.read_code(name)
        code = code.split('\n')
        new_code = []
        for line in code:
            if [bad for bad in forbidden if bad in line]:
                pass
            else:
                allowed = ['time','timeit'] # Magics where we want to keep the command
                line = self.strip_line_magic(line, allowed)
                if isinstance(line,list):
                    line = ' '.join(line)
                new_code.append(line)
        new_code = '\n'.join(new_code)
        self.write_code(name, new_code)
        return new_code