docstr: Initialize a RepoCard from string content. The content should be a
  Markdown file with a YAML block at the beginning and a Markdown body.
  
  Args:
      content (`str`): The content of the Markdown file.
  
  Example:
      ```python
      >>> from huggingface_hub.repocard import RepoCard
      >>> text = '''
      ... ---
      ... language: en
      ... license: mit
      ... ---
      ...
      ... # My repo
      ... '''
      >>> card = RepoCard(text)
      >>> card.data.to_dict()
      {'language': 'en', 'license': 'mit'}
      >>> card.text
      '\n# My repo\n'
  
      ```
  <Tip>
  Raises the following error:
  
      - [`ValueError`](https://docs.python.org/3/library/exceptions.html#ValueError)
        when the content of the repo card metadata is not a dictionary.
  
  </Tip>
docstr_tok: ["Initialize","a","RepoCard","from","string","content",".","The","content","should","be","a","Markdown","file","with","a","YAML","block","at","the","beginning","and","a","Markdown","body",".","Args",":","content","(","`","str","`",")",":","The","content","of","the","Markdown","file",".","Example",":","``","`","python",">",">",">","from","huggingface_hub.repocard","import","RepoCard",">",">",">","text","=","``","'","...","--","-","...","language",":","en","...","license",":","mit","...","--","-","...","...","#","My","repo","...","``","'",">",">",">","card","=","RepoCard","(","text",")",">",">",">","card.data.to_dict","(",")","{","'language","'",":","'en","'",",","'license","'",":","'mit","'","}",">",">",">","card.text","'\\n","#","My","repo\\n'","``","`","<","Tip",">","Raises","the","following","error",":","-","[","`","ValueError","`","]","(","https",":","\/\/docs.python.org\/3\/library\/exceptions.html","#","ValueError",")","when","the","content","of","the","repo","card","metadata","is","not","a","dictionary",".","<","\/Tip",">"]
code: def __init__(
      self, content: str, ignore_metadata_errors: bool = False
  ):
      """Initialize a RepoCard from string content. The content should be a
      Markdown file with a YAML block at the beginning and a Markdown body.
  
      Args:
          content (`str`): The content of the Markdown file.
  
      Example:
          ```python
          >>> from huggingface_hub.repocard import RepoCard
          >>> text = '''
          ... ---
          ... language: en
          ... license: mit
          ... ---
          ...
          ... # My repo
          ... '''
          >>> card = RepoCard(text)
          >>> card.data.to_dict()
          {'language': 'en', 'license': 'mit'}
          >>> card.text
          '\\n# My repo\\n'
  
          ```
      <Tip>
      Raises the following error:
  
          - [`ValueError`](https://docs.python.org/3/library/exceptions.html#ValueError)
            when the content of the repo card metadata is not a dictionary.
  
      </Tip>
      """
  
      # Set the content of the RepoCard, as well as underlying .data and .text attributes.
      # See the `content` property setter for more details.
      self.ignore_metadata_errors = ignore_metadata_errors
      self.content = content
  
imports: import os
  import re
  from pathlib import Path
  from typing import Any, Dict, Literal, Optional, Type, Union
  import requests
  import yaml
  from huggingface_hub.file_download import hf_hub_download
  from huggingface_hub.hf_api import upload_file
  from huggingface_hub.repocard_data import CardData, DatasetCardData, EvalResult, ModelCardData, SpaceCardData, eval_results_to_model_index, model_index_to_eval_results
  from huggingface_hub.utils import get_session, is_jinja_available, yaml_dump
  from .constants import REPOCARD_NAME
  from .utils import EntryNotFoundError, SoftTemporaryDirectory, logging, validate_hf_hub_args
label_desc: Use image node_id 1 to create a new RepoCard object  with example: obj = RepoCard(content, ignore_metadata_errors)