code: def external_system_identifiers2marc(self, key, value):
      
      def _is_scheme_cernkey(id_, schema):
          return schema == 'CERNKEY'
  
      def _is_scheme_spires(id_, schema):
          return schema == 'SPIRES'
  
      result_035 = self.get('035', [])
      id_dict = self.get('id_dict', defaultdict(list))
      result_970 = self.get('970', [])
  
      values = force_list(value)
      for value in values:
          id_ = value.get('value')
          schema = value.get('schema')
  
          if _is_scheme_spires(id_, schema):
              result_970.append({
                  'a': id_,
              })
          elif _is_scheme_cernkey(id_, schema):
              result_035.append({
                  '9': 'CERNKEY',
                  'z': id_,
              })
          else:
              id_dict[schema].append(id_)
  
      self['970'] = result_970
      self['id_dict'] = id_dict
      return result_035
docs: Populate the ``035`` MARC field.
  
      Also populates the ``970`` MARC field through side effects and an extra
      ``id_dict`` dictionary that holds potentially duplicate IDs that are
      post-processed in a filter.