def _preprocess_record(self, record: MutableMapping[(str, Any)]) -> Optional[MutableMapping[(str, Any)]]:
    if ('type' in record):
        del record['type']
    record = {'id': record['id'], **record['attributes']}
    doi = record.get('doi')
    if (doi is None):
        url = record['url']
        if (not url.startswith('https://fairsharing.org/fairsharing_records/')):
            tqdm.write(f"{record['id']} has no DOI: {record['url']}")
        return None
    elif doi.startswith('10.25504/'):
        record['prefix'] = record.pop('doi')[len('10.25504/'):]
    else:
        tqdm.write(f"DOI has unexpected prefix: {record['doi']}")
    record['description'] = _removeprefix(record.get('description'), 'This FAIRsharing record describes: ')
    record['name'] = _removeprefix(record.get('name'), 'FAIRsharing record for: ')
    for key in REDUNDANT_FIELDS:
        if (key in record):
            del record[key]
    return record
def _preprocess_record(self, record: MutableMapping[(str, Any)]) -> Optional[MutableMapping[(str, Any)]]:
    if ('type' in record):
        del record['type']
    record = {'id': record['id'], **record['attributes']}
    doi = record.get('doi')
    if (doi is None):
        url = record['url']
        if (not url.startswith('https://fairsharing.org/fairsharing_records/')):
            tqdm.write(f"{record['id']} has no DOI: {record['url']}")
        return None
    elif doi.startswith('10.25504/'):
        record['prefix'] = record.pop('doi')[len('10.25504/'):]
    else:
        tqdm.write(f"DOI has unexpected prefix: {record['doi']}")
    record['description'] = _removeprefix(record.get('description'), 'This FAIRsharing record describes: ')
    record['name'] = _removeprefix(record.get('name'), 'FAIRsharing record for: ')
    for key in REDUNDANT_FIELDS:
        if (key in record):
            del record[key]
    return record