<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def get_foreign_keys(cls):
 """Get foreign keys and models they refer to, so we can pre-process the data for load_bulk """

        foreign_keys = {}
        for field in cls._meta.fields:
            if (
                field.get_internal_type() == 'ForeignKey' and
                field.name != 'parent'
            ):
                if django.VERSION >= (1, 9):
                    foreign_keys[field.name] = field.remote_field.model
                else:
                    foreign_keys[field.name] = field.rel.to
        return foreign_keys