code: def transform_record(self, pid, record, links_factory=None, **kwargs):
          
          context = kwargs.get('marshmallow_context', {})
          context.setdefault('pid', pid)
          return self.dump(self.preprocess_record(pid, record,
                           links_factory=links_factory, **kwargs), context)
docs: Transform record into an intermediate representation.