


'''simple docstring'''






from manim import *






class   __snake_case			(  __UpperCamelCase):







    """simple docstring"""



    def __lowercase  (  self       :    Tuple						)  ->    Any:
      lowerCAmelCase_     : Union[str, Any]     =  Rectangle(height=0.5       ,		width=0.5						)
      lowerCAmelCase_     : List[str]     =  Rectangle(height=0.25       ,		width=0.25						)
      lowerCAmelCase_     : Dict     =  Rectangle(height=0.46       ,		width=0.46						).set_stroke(width=0						)

      lowerCAmelCase_     : str     =  [mem.copy() for i in range(6						)]
      lowerCAmelCase_     : Optional[int]     =  [mem.copy() for i in range(6						)]
      lowerCAmelCase_     : Optional[int]     =  VGroup(*lowerCamelCase						).arrange(lowerCamelCase       ,		buff=0						)
      lowerCAmelCase_     : List[str]     =  VGroup(*lowerCamelCase						).arrange(lowerCamelCase       ,		buff=0						)
      lowerCAmelCase_     : Optional[Any]     =  VGroup(lowerCamelCase       ,		lowerCamelCase						).arrange(lowerCamelCase       ,		buff=0						)
      lowerCAmelCase_     : str     =  Text("""CPU"""       ,		font_size=24						)
      lowerCAmelCase_     : int     =  Group(lowerCamelCase       ,		lowerCamelCase						).arrange(lowerCamelCase       ,		buff=0.5       ,		aligned_edge=lowerCamelCase						)
      cpu.move_to([-2.5, -0.5, 0]						)
      self.add(lowerCamelCase						)

      lowerCAmelCase_     : Union[str, Any]     =  [mem.copy() for i in range(4						)]
      lowerCAmelCase_     : Optional[int]     =  VGroup(*lowerCamelCase						).arrange(lowerCamelCase       ,		buff=0						)
      lowerCAmelCase_     : Optional[int]     =  Text("""GPU"""       ,		font_size=24						)
      lowerCAmelCase_     : List[str]     =  Group(lowerCamelCase       ,		lowerCamelCase						).arrange(lowerCamelCase       ,		buff=0.5       ,		aligned_edge=lowerCamelCase						)
      gpu.move_to([-1, -1, 0]						)
      self.add(lowerCamelCase						)

      lowerCAmelCase_     : Any     =  [mem.copy() for i in range(6						)]
      lowerCAmelCase_     : Union[str, Any]     =  VGroup(*lowerCamelCase						).arrange(lowerCamelCase       ,		buff=0						)

      lowerCAmelCase_     : int     =  Text("""Model"""       ,		font_size=24						)
      lowerCAmelCase_     : Dict     =  Group(lowerCamelCase       ,		lowerCamelCase						).arrange(lowerCamelCase       ,		buff=0.5       ,		aligned_edge=lowerCamelCase						)
      model.move_to([3, -1.0, 0]						)
      self.add(lowerCamelCase						)

      lowerCAmelCase_     : Optional[Any]     =  []
      lowerCAmelCase_     : str     =  []
      lowerCAmelCase_     : List[str]     =  []

      for i, rect in enumerate(lowerCamelCase						):
        rect.set_stroke(lowerCamelCase						)

        lowerCAmelCase_     : int     =  Rectangle(height=0.46 / 4       ,		width=0.46 / 3						).set_stroke(width=0.0						).set_fill(lowerCamelCase       ,		opacity=0.7						)

        if i == 0:
          cpu_target.next_to(cpu_left_col_base[0].get_corner(DOWN + LEFT						)       ,		buff=0.02       ,		direction=lowerCamelCase						)
          cpu_target.set_x(cpu_target.get_x() + 0.1						)
        elif i == 3:
          cpu_target.next_to(model_cpu_arr[0]       ,		direction=lowerCamelCase       ,		buff=0.0						)
        else:
          cpu_target.next_to(model_cpu_arr[i - 1]       ,		direction=lowerCamelCase       ,		buff=0.0						)
        self.add(lowerCamelCase						)
        model_cpu_arr.append(lowerCamelCase						)

      self.add(*lowerCamelCase       ,		*lowerCamelCase       ,		*lowerCamelCase						)

      lowerCAmelCase_     : Dict     =  [mem.copy() for i in range(6						)]
      lowerCAmelCase_     : Any     =  VGroup(*lowerCamelCase						).arrange(lowerCamelCase       ,		buff=0						)

      lowerCAmelCase_     : Optional[int]     =  Text("""Loaded Checkpoint"""       ,		font_size=24						)
      lowerCAmelCase_     : str     =  Group(lowerCamelCase       ,		lowerCamelCase						).arrange(lowerCamelCase       ,		buff=0.5       ,		aligned_edge=lowerCamelCase						)
      checkpoint.move_to([3, 0.5, 0]						)

      self.add(lowerCamelCase						)

      lowerCAmelCase_     : Optional[int]     =  []
      lowerCAmelCase_     : Tuple     =  []

      for i, rect in enumerate(lowerCamelCase						):
        lowerCAmelCase_     : List[str]     =  fill.copy().set_fill(lowerCamelCase       ,		opacity=0.7						)
        target.move_to(lowerCamelCase						)
        ckpt_arr.append(lowerCamelCase						)

        lowerCAmelCase_     : Optional[Any]     =  target.copy()
        if i < 5:
          cpu_target.move_to(cpu_left_col_base[i + 1]						)
        else:
          cpu_target.move_to(cpu_right_col_base[i - 5]						)
        ckpt_cpu_arr.append(lowerCamelCase						)
      self.add(*lowerCamelCase       ,		*lowerCamelCase						)

      lowerCAmelCase_     : str     =  Square(side_length=2.2						)
      key.move_to([-5, 2, 0]						)

      lowerCAmelCase_     : str     =  MarkupText(
          F'<b>Key:</b>\n\n<span fgcolor=\'{YELLOW}\'>●</span> Empty Model'       ,		font_size=18       ,		)

      key_text.move_to([-5, 2.4, 0]						)

      self.add(lowerCamelCase       ,		lowerCamelCase						)

      lowerCAmelCase_     : List[Any]     =  MarkupText(
          F'<span fgcolor=\'{BLUE}\'>●</span> Checkpoint'       ,		font_size=18       ,		)

      blue_text.next_to(lowerCamelCase       ,		DOWN * 2.4       ,		aligned_edge=key_text.get_left()						)
      self.add(lowerCamelCase						)

      lowerCAmelCase_     : Tuple     =  MarkupText(
          F'Based on the passed in configuration, weights are stored in\na variety of np.memmaps on disk or to a particular device.'       ,		font_size=24       ,		)
      step_a.move_to([2, 2, 0]						)

      lowerCAmelCase_     : str     =  [meta_mem.copy() for i in range(6						)]
      lowerCAmelCase_     : List[str]     =  [meta_mem.copy() for i in range(6						)]
      lowerCAmelCase_     : Any     =  VGroup(*lowerCamelCase						).arrange(lowerCamelCase       ,		buff=0						)
      lowerCAmelCase_     : Union[str, Any]     =  VGroup(*lowerCamelCase						).arrange(lowerCamelCase       ,		buff=0						)
      lowerCAmelCase_     : str     =  VGroup(lowerCamelCase       ,		lowerCamelCase						).arrange(lowerCamelCase       ,		buff=0						)
      lowerCAmelCase_     : Any     =  Text("""Disk"""       ,		font_size=24						)
      lowerCAmelCase_     : Optional[int]     =  Group(lowerCamelCase       ,		lowerCamelCase						).arrange(lowerCamelCase       ,		buff=0.5       ,		aligned_edge=lowerCamelCase						)
      disk.move_to([-4.0, -1.25, 0]						)
      self.play(Write(lowerCamelCase       ,		run_time=3						)       ,		Write(lowerCamelCase       ,		run_time=1						)       ,		Create(lowerCamelCase       ,		run_time=1						)						)

      lowerCAmelCase_     : Optional[int]     =  []
      for i, rect in enumerate(lowerCamelCase						):
        lowerCAmelCase_     : Dict     =  rect.copy()
        target.generate_target()
        target.target.move_to(disk_left_col_base[i]						).scale(0.5						)
        animations.append(MoveToTarget(lowerCamelCase       ,		run_time=1.5						)						)
      self.play(*lowerCamelCase						)

      self.play(FadeOut(lowerCamelCase						)						)

      lowerCAmelCase_     : Union[str, Any]     =  MarkupText(F'Then, the checkpoint is removed from memory\nthrough garbage collection.'       ,		font_size=24						)
      step_a.move_to([2, 2, 0]						)

      self.play(Write(lowerCamelCase       ,		run_time=3						)						)

      self.play(
          FadeOut(lowerCamelCase       ,		lowerCamelCase       ,		*lowerCamelCase       ,		*lowerCamelCase						)       ,		)

      self.wait()





import os
from datetime import datetime as dt

from github import Github


__magic_name__  							=	[
    '''good first issue''',
    '''feature request''',
    '''wip''',
]





def 						SCREAMING_SNAKE_CASE__     (   ):
    snake_case__    =					Github(os.environ["GITHUB_TOKEN"]				)
    snake_case__    =					g.get_repo("huggingface/accelerate"				)
    snake_case__    =					repo.get_issues(state="open"				)

    for issue in open_issues:
        snake_case__    =					sorted([comment for comment in issue.get_comments()]     ,		key=lambda __lowerCAmelCase				: i.created_at     ,		reverse=__lowerCAmelCase				)
        snake_case__    =					comments[0] if len(__lowerCAmelCase				) > 0 else None
        snake_case__    =					dt.utcnow()
        snake_case__    =					(current_time - issue.updated_at).days
        snake_case__    =					(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()



