class_docstr: To normalize the repo.
  
  Args:
      uri (`str`):
          The uri of the repo.
class_docstr_tok: ["To","normalize","the","repo",".","Args",":","uri","(","`","str","`",")",":","The","uri","of","the","repo","."]
docstr: Mapping the path(endswith']'), like repo[framework] to repo-framework.
  
  Args:
      path (`str`):
          The path to the uri.
  
  Returns:
      (`str`)
          Check if passed.
  
  Raises:
      (`ValueError`)
          Raise error when the path does not match the format.
docstr_tok: ["Mapping","the","path","(","endswith","'","]","'",")",",","like","repo","[","framework","]","to","repo-framework",".","Args",":","path","(","`","str","`",")",":","The","path","to","the","uri",".","Returns",":","(","`","str","`",")","Check","if","passed",".","Raises",":","(","`","ValueError","`",")","Raise","error","when","the","path","does","not","match","the","format","."]
code: def mapping(path: str) -> str:
      """
      Mapping the path(endswith']'), like repo[framework] to repo-framework.
  
      Args:
          path (`str`):
              The path to the uri.
  
      Returns:
          (`str`)
              Check if passed.
  
      Raises:
          (`ValueError`)
              Raise error when the path does not match the format.
      """
      try:
          if not path.endswith("]"):
              raise ValueError
          repo, framework = path.strip("]").split("[")
          path = f"{repo}-{framework}"
          return path
      except ValueError:
          raise ValueError(
              f"{path} does not match the '[/author/]repo-name[framework]' format!"
          ) from ValueError
  
file_path: towhee/towhee/utils/repo_normalize.py
imports: import re
  from urllib.parse import urlparse, parse_qsl, urlsplit
  from typing import NamedTuple
label_desc: Use image node_id 7 for calling the RepoNormalize obj's underlying member method code with example usage: obj.mapping(path) and returns: path