class User:
    """
    Contains information about a user on the Hub.

    Attributes:
        username (`str`):
            Name of the user on the Hub (unique).
        fullname (`str`):
            User's full name.
        avatar_url (`str`):
            URL of the user's avatar.
        details (`str`, *optional*):
            User's details.
        is_following (`bool`, *optional*):
            Whether the authenticated user is following this user.
        is_pro (`bool`, *optional*):
            Whether the user is a pro user.
        num_models (`int`, *optional*):
            Number of models created by the user.
        num_datasets (`int`, *optional*):
            Number of datasets created by the user.
        num_spaces (`int`, *optional*):
            Number of spaces created by the user.
        num_discussions (`int`, *optional*):
            Number of discussions initiated by the user.
        num_papers (`int`, *optional*):
            Number of papers authored by the user.
        num_upvotes (`int`, *optional*):
            Number of upvotes received by the user.
        num_likes (`int`, *optional*):
            Number of likes given by the user.
        num_following (`int`, *optional*):
            Number of users this user is following.
        num_followers (`int`, *optional*):
            Number of users following this user.
        orgs (list of [`Organization`]):
            List of organizations the user is part of.
    """

    # Metadata
    username: str
    fullname: str
    avatar_url: str
    details: Optional[str] = None
    is_following: Optional[bool] = None
    is_pro: Optional[bool] = None
    num_models: Optional[int] = None
    num_datasets: Optional[int] = None
    num_spaces: Optional[int] = None
    num_discussions: Optional[int] = None
    num_papers: Optional[int] = None
    num_upvotes: Optional[int] = None
    num_likes: Optional[int] = None
    num_following: Optional[int] = None
    num_followers: Optional[int] = None
    orgs: List[Organization] = field(default_factory=list)

    def __init__(self, **kwargs) -> None:
        self.username = kwargs.pop("user", "")
        self.fullname = kwargs.pop("fullname", "")
        self.avatar_url = kwargs.pop("avatarUrl", "")
        self.is_following = kwargs.pop("isFollowing", None)
        self.is_pro = kwargs.pop("isPro", None)
        self.details = kwargs.pop("details", None)
        self.num_models = kwargs.pop("numModels", None)
        self.num_datasets = kwargs.pop("numDatasets", None)
        self.num_spaces = kwargs.pop("numSpaces", None)
        self.num_discussions = kwargs.pop("numDiscussions", None)
        self.num_papers = kwargs.pop("numPapers", None)
        self.num_upvotes = kwargs.pop("numUpvotes", None)
        self.num_likes = kwargs.pop("numLikes", None)
        self.num_following = kwargs.pop("numFollowing", None)
        self.num_followers = kwargs.pop("numFollowers", None)
        self.user_type = kwargs.pop("type", None)
        self.orgs = [Organization(**org) for org in kwargs.pop("orgs", [])]

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