
from manim import *




class        _SCREAMING_SNAKE_CASE	(   __UpperCamelCase			):
      def A_      (      self			):
          snake_case__    =					Rectangle(height=0.5		,						width=0.5			)
          snake_case__    =					Rectangle(height=0.2_5		,						width=0.2_5			)
          snake_case__    =					Rectangle(height=0.4_6		,						width=0.4_6			).set_stroke(width=0			)

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

          snake_case__    =					[mem.copy() for i in range(4			)]
          snake_case__    =					VGroup(*lowerCamelCase			).arrange(lowerCamelCase		,						buff=0			)
          snake_case__    =					Text("GPU"		,						font_size=24			)
          snake_case__    =					Group(lowerCamelCase		,						lowerCamelCase			).arrange(lowerCamelCase		,						buff=0.5		,						aligned_edge=lowerCamelCase			)
          gpu.move_to([-1, -1, 0]			)
          self.add(lowerCamelCase			)

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

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

          snake_case__    =					[]
          snake_case__    =					[]
          snake_case__    =					[]

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

              snake_case__    =					Rectangle(height=0.4_6 / 4		,						width=0.4_6 / 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.0_2		,						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			)

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

          snake_case__    =					Text("Loaded Checkpoint"		,						font_size=24			)
          snake_case__    =					Group(lowerCamelCase		,						lowerCamelCase			).arrange(lowerCamelCase		,						buff=0.5		,						aligned_edge=lowerCamelCase			)
          checkpoint.move_to([3, 0.5, 0]			)

          self.add(lowerCamelCase			)

          snake_case__    =					[]
          snake_case__    =					[]

          for i, rect in enumerate(lowerCamelCase			):
              snake_case__    =					fill.copy().set_fill(lowerCamelCase		,						opacity=0.7			)
              target.move_to(lowerCamelCase			)
              ckpt_arr.append(lowerCamelCase			)

              snake_case__    =					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			)

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

          snake_case__    =					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			)

          snake_case__    =					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			)

          snake_case__    =					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]			)

          snake_case__    =					[meta_mem.copy() for i in range(6			)]
          snake_case__    =					[meta_mem.copy() for i in range(6			)]
          snake_case__    =					VGroup(*lowerCamelCase			).arrange(lowerCamelCase		,						buff=0			)
          snake_case__    =					VGroup(*lowerCamelCase			).arrange(lowerCamelCase		,						buff=0			)
          snake_case__    =					VGroup(lowerCamelCase		,						lowerCamelCase			).arrange(lowerCamelCase		,						buff=0			)
          snake_case__    =					Text("Disk"		,						font_size=24			)
          snake_case__    =					Group(lowerCamelCase		,						lowerCamelCase			).arrange(lowerCamelCase		,						buff=0.5		,						aligned_edge=lowerCamelCase			)
          disk.move_to([-4.0, -1.2_5, 0]			)
          self.play(Write(lowerCamelCase		,						run_time=3			)		,						Write(lowerCamelCase		,						run_time=1			)		,						Create(lowerCamelCase		,						run_time=1			)			)

          snake_case__    =					[]
          for i, rect in enumerate(lowerCamelCase			):
              snake_case__    =					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			)			)

          snake_case__    =					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()



