class PaperInfo:
    """
    Contains information about a paper on the Hub.

    Attributes:
        id (`str`):
            arXiv paper ID.
        authors (`List[str]`, **optional**):
            Names of paper authors
        published_at (`datetime`, **optional**):
            Date paper published.
        title (`str`, **optional**):
            Title of the paper.
        summary (`str`, **optional**):
            Summary of the paper.
        upvotes (`int`, **optional**):
            Number of upvotes for the paper on the Hub.
        discussion_id (`str`, **optional**):
            Discussion ID for the paper on the Hub.
        source (`str`, **optional**):
            Source of the paper.
        comments (`int`, **optional**):
            Number of comments for the paper on the Hub.
        submitted_at (`datetime`, **optional**):
            Date paper appeared in daily papers on the Hub.
        submitted_by (`User`, **optional**):
            Information about who submitted the daily paper.
    """

    id: str
    authors: Optional[List[str]]
    published_at: Optional[datetime]
    title: Optional[str]
    summary: Optional[str]
    upvotes: Optional[int]
    discussion_id: Optional[str]
    source: Optional[str]
    comments: Optional[int]
    submitted_at: Optional[datetime]
    submitted_by: Optional[User]

    def __init__(self, **kwargs) -> None:
        paper = kwargs.pop("paper", {})
        self.id = kwargs.pop("id", None) or paper.pop("id", None)
        authors = paper.pop("authors", None) or kwargs.pop("authors", None)
        self.authors = [author.pop("name", None) for author in authors] if authors else None
        published_at = paper.pop("publishedAt", None) or kwargs.pop("publishedAt", None)
        self.published_at = parse_datetime(published_at) if published_at else None
        self.title = kwargs.pop("title", None)
        self.source = kwargs.pop("source", None)
        self.summary = paper.pop("summary", None) or kwargs.pop("summary", None)
        self.upvotes = paper.pop("upvotes", None) or kwargs.pop("upvotes", None)
        self.discussion_id = paper.pop("discussionId", None) or kwargs.pop("discussionId", None)
        self.comments = kwargs.pop("numComments", 0)
        submitted_at = kwargs.pop("publishedAt", None) or kwargs.pop("submittedOnDailyAt", None)
        self.submitted_at = parse_datetime(submitted_at) if submitted_at else None
        submitted_by = kwargs.pop("submittedBy", None) or kwargs.pop("submittedOnDailyBy", None)
        self.submitted_by = User(**submitted_by) if submitted_by else None

        # forward compatibility
        self.__dict__.update(**kwargs)
/Users/nielsrogge/Documents/python_projecten/huggingface_hub/src/huggingface_hub/hf_api.py