<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def merge(self, other):
 """Add requirements from 'other' Berksfile into this one."""

        if not isinstance(other, Berksfile):
            raise TypeError("Berksfile to merge should be a 'Berksfile' "
                            "instance, not %s.", type(other))
        current = self.to_dict()
        new = other.to_dict()

        # compare and gather cookbook dependencies
        berks_writelines = ['%s\n' % self.cookbook_statement(cbn, meta)
                            for cbn, meta in new.get('cookbook', {}).items()
                            if cbn not in current.get('cookbook', {})]

        # compare and gather 'source' requirements
        berks_writelines.extend(["source '%s'\n" % src for src
                                 in new.get('source', [])
                                 if src not in current.get('source', [])])

        self.write_statements(berks_writelines)
        return self.to_dict()