docstr: Sets git user name and email (only in the current repo)
docstr_tok: ["Sets","git","user","name","and","email","(","only","in","the","current","repo",")"]
code: def git_config_username_and_email(
      self, git_user: str = None, git_email: str = None
  ):
      """
      Sets git user name and email (only in the current repo)
      """
      try:
          if git_user is not None:
              subprocess.run(
                  ["git", "config", "--global", "user.name", git_user],
                  stderr=subprocess.PIPE,
                  stdout=subprocess.PIPE,
                  check=True,
                  encoding="utf-8",
              )
          if git_email is not None:
              subprocess.run(
                  [
                      "git",
                      "config",
                      "--global",
                      "user.email",
                      git_email,
                  ],
                  stderr=subprocess.PIPE,
                  stdout=subprocess.PIPE,
                  check=True,
                  encoding="utf-8",
              )
      except subprocess.CalledProcessError as exc:
          raise EnvironmentError(exc.stderr)
  
imports: import logging
  import os
  import subprocess
  from abc import ABC, abstractmethod
  from pathlib import Path
  from typing import TYPE_CHECKING, Optional, Union
  from huggingface_hub import HfApi, HfFolder
  from transformers import AutoConfig, PretrainedConfig, add_start_docstrings
  from .exporters import TasksManager
  from .utils import CONFIG_NAME
label_desc: Use image node_id 8 for calling the OptimizedModel obj's underlying member method code with example usage: obj.git_config_username_and_email(git_user, git_email) without return types