



"""simple docstring"""
import os
from datetime import datetime as dt

from github import Github


_UpperCAmelCase     :   Tuple     =			[
    """good first issue""",
    """feature request""",
    """wip""",
]





def      __magic_name__				(							):
   SCREAMING_SNAKE_CASE_: List[Any]     			=Github(os.environ["""GITHUB_TOKEN"""] )
   SCREAMING_SNAKE_CASE_: List[str]     			=g.get_repo("""huggingface/accelerate""" )
   SCREAMING_SNAKE_CASE_: Tuple     			=repo.get_issues(state="""open""" )

   for issue in open_issues:
      SCREAMING_SNAKE_CASE_: int     			=sorted([comment for comment in issue.get_comments()]							,			key=lambda lowercase : i.created_at							,			reverse=lowercase )
      SCREAMING_SNAKE_CASE_: int     			=comments[0] if len(lowercase ) > 0 else None
      SCREAMING_SNAKE_CASE_: Optional[int]     			=dt.utcnow()
      SCREAMING_SNAKE_CASE_: Optional[Any]     			=(current_time - issue.updated_at).days
      SCREAMING_SNAKE_CASE_: Tuple     			=(current_time - issue.created_at).days
      if (
          last_comment is not None
          and last_comment.user.login == "github-actions[bot]"
          and days_since_updated > 7
          and days_since_creation >= 30
          and not any(label.name.lower() in LABELS_TO_EXEMPT for label in issue.get_labels() )
      ):
         # Close issue since it has been 7 days of inactivity since bot mention.
         issue.edit(state="""closed""" )
      elif (
          days_since_updated > 23
          and days_since_creation >= 30
          and not any(label.name.lower() in LABELS_TO_EXEMPT for label in issue.get_labels() )
      ):
         # Add stale comment
         issue.create_comment(
             """This issue has been automatically marked as stale because it has not had """
             """recent activity. If you think this still needs to be addressed """
             """please comment on this thread.\n\nPlease note that issues that do not follow the """
             """[contributing guidelines](https://github.com/huggingface/accelerate/blob/main/CONTRIBUTING.md) """
             """are likely to be ignored.""" )


if __name__ == "__main__":
   main()








"""simple docstring"""
import numpy as np
from matplotlib import pyplot as plt
from sklearn.datasets import load_iris
from sklearn.metrics import ConfusionMatrixDisplay
from sklearn.model_selection import train_test_split
from xgboost import XGBClassifier





def      __magic_name__				(							lowercase ):
   return (data["data"], data["target"])





def      __magic_name__				(							lowercase							,			lowercase ):
   SCREAMING_SNAKE_CASE_: Dict     			=XGBClassifier()
   classifier.fit(lowercase							,			lowercase )
   return classifier





def      __magic_name__				(							):
   SCREAMING_SNAKE_CASE_: Optional[Any]     			=load_iris()
   SCREAMING_SNAKE_CASE_			,		SCREAMING_SNAKE_CASE_: Tuple     			=data_handling(lowercase )
   SCREAMING_SNAKE_CASE_			,		SCREAMING_SNAKE_CASE_			,		SCREAMING_SNAKE_CASE_			,		SCREAMING_SNAKE_CASE_: List[Any]     			=train_test_split(
       lowercase							,			lowercase							,			test_size=0.25 )

   SCREAMING_SNAKE_CASE_: Tuple     			=iris["""target_names"""]

   # Create an XGBoost Classifier from the training data
   SCREAMING_SNAKE_CASE_: Optional[int]     			=xgboost(lowercase							,			lowercase )

   # Display the confusion matrix of the classifier with both training and test sets
   ConfusionMatrixDisplay.from_estimator(
       lowercase							,			lowercase							,			lowercase							,			display_labels=lowercase							,			cmap="""Blues"""							,			normalize="""true"""							,			)
   plt.title("""Normalized Confusion Matrix - IRIS Dataset""" )
   plt.show()


if __name__ == "__main__":
   import doctest

   doctest.testmod(verbose=True)
   main()



