(paper: Dict[str, Any], metadata: Optional[Dict[str, Any]] = None)
| 235 | return match.group(1) if match else "" |
| 236 | |
| 237 | |
| 238 | def _paper_arxiv_id(paper: Dict[str, Any], metadata: Optional[Dict[str, Any]] = None) -> str: |
| 239 | metadata = metadata if metadata is not None else _paper_metadata(paper) |
| 240 | explicit = _first_text(paper, metadata, "arxiv_id") |
| 241 | if explicit: |
| 242 | return _extract_arxiv_id(explicit) or explicit |
| 243 | for key in ("paper_url", "url", "pdf_url", "source_url"): |
| 244 | arxiv_id = _extract_arxiv_id(paper.get(key) or metadata.get(key)) |
| 245 | if arxiv_id: |
| 246 | return arxiv_id |
| 247 | return "" |
| 248 | |
| 249 |
no test coverage detected