<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def external_system_identifiers(endpoint):
 """Populate the ``external_system_identifiers`` key. Also populates the ``new_record`` key through side effects. """

    @utils.flatten
    @utils.for_each_value
    def _external_system_identifiers(self, key, value):
        new_recid = maybe_int(value.get('d'))
        if new_recid:
            self['new_record'] = get_record_ref(new_recid, endpoint)

        return [
            {
                'schema': 'SPIRES',
                'value': ext_sys_id,
            } for ext_sys_id in force_list(value.get('a'))
        ]

    return _external_system_identifiers