'''simple docstring'''

from manim import *







class 				_lowercase     (				UpperCAmelCase__			):


 '''simple docstring'''






 def a					(      self   :	List[Any]							)  ->    Optional[Any]:
  __lowerCAmelCase											=						Rectangle(height=0.5      ,       width=0.5							)
  __lowerCAmelCase											=						Rectangle(height=0.4_6      ,       width=0.4_6							).set_stroke(width=0							)

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

  __lowerCAmelCase											=						[mem.copy() for i in range(1							)]
  __lowerCAmelCase											=						VGroup(*SCREAMING_SNAKE_CASE__							).arrange(SCREAMING_SNAKE_CASE__      ,       buff=0							)
  __lowerCAmelCase											=						Text("""GPU"""      ,       font_size=24							)
  __lowerCAmelCase											=						Group(SCREAMING_SNAKE_CASE__      ,       SCREAMING_SNAKE_CASE__							).arrange(SCREAMING_SNAKE_CASE__      ,       buff=0.5      ,       aligned_edge=SCREAMING_SNAKE_CASE__							)
  gpu.align_to(SCREAMING_SNAKE_CASE__      ,       SCREAMING_SNAKE_CASE__							)
  gpu.set_x(gpu.get_x() - 1							)

  self.add(SCREAMING_SNAKE_CASE__							)

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

  __lowerCAmelCase											=						Text("""Model"""      ,       font_size=24							)
  __lowerCAmelCase											=						Group(SCREAMING_SNAKE_CASE__      ,       SCREAMING_SNAKE_CASE__							).arrange(SCREAMING_SNAKE_CASE__      ,       buff=0.5      ,       aligned_edge=SCREAMING_SNAKE_CASE__							)
  model.move_to([3, -1.0, 0]							)

  self.play(
      Create(SCREAMING_SNAKE_CASE__      ,       run_time=1							)      ,       Create(SCREAMING_SNAKE_CASE__      ,       run_time=1							)      ,       Create(SCREAMING_SNAKE_CASE__      ,       run_time=1							)      ,       )

  __lowerCAmelCase											=						MarkupText(
      f"""First, an empty model skeleton is loaded\ninto <span fgcolor='{YELLOW}'>memory</span> without using much RAM."""      ,       font_size=24      ,       )

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

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

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

  step_a.move_to([2, 2, 0]							)
  self.play(Write(SCREAMING_SNAKE_CASE__      ,       run_time=2.5							)      ,       Write(SCREAMING_SNAKE_CASE__							)      ,       Write(SCREAMING_SNAKE_CASE__							)							)

  self.add(SCREAMING_SNAKE_CASE__							)

  __lowerCAmelCase											=						[]
  __lowerCAmelCase											=						[]
  __lowerCAmelCase											=						[]
  for i, rect in enumerate(SCREAMING_SNAKE_CASE__							):
   __lowerCAmelCase											=						Rectangle(height=0.4_6      ,       width=0.4_6							).set_stroke(width=0.0							).set_fill(SCREAMING_SNAKE_CASE__      ,       opacity=0.7							)
   cpu_target.move_to(SCREAMING_SNAKE_CASE__							)
   cpu_target.generate_target()
   __lowerCAmelCase											=						0.4_6 / 4
   __lowerCAmelCase											=						0.4_6 / 3

   if i == 0:
    cpu_target.target.next_to(cpu_left_col_base[0].get_corner(DOWN + LEFT							)      ,       buff=0.0_2      ,       direction=SCREAMING_SNAKE_CASE__							)
    cpu_target.target.set_x(cpu_target.target.get_x() + 0.1							)
   elif i == 3:
    cpu_target.target.next_to(cpu_targs[0].target      ,       direction=SCREAMING_SNAKE_CASE__      ,       buff=0.0							)
   else:
    cpu_target.target.next_to(cpu_targs[i - 1].target      ,       direction=SCREAMING_SNAKE_CASE__      ,       buff=0.0							)
   cpu_targs.append(SCREAMING_SNAKE_CASE__							)

   first_animations.append(rect.animate(run_time=0.5							).set_stroke(SCREAMING_SNAKE_CASE__							)							)
   second_animations.append(MoveToTarget(SCREAMING_SNAKE_CASE__      ,       run_time=1.5							)							)

  self.play(*SCREAMING_SNAKE_CASE__							)
  self.play(*SCREAMING_SNAKE_CASE__							)

  self.wait()







'''simple docstring'''

import itertools
from dataclasses import dataclass
from typing import Optional

import pandas as pd
import pyarrow as pa

import datasets
from datasets.table import table_cast







@dataclass
class 				_lowercase     (				datasets.BuilderConfig			):


 '''simple docstring'''






 _SCREAMING_SNAKE_CASE     :       Optional[datasets.Features]      	=					None







class 				_lowercase     (				datasets.ArrowBasedBuilder			):


 '''simple docstring'''






 _SCREAMING_SNAKE_CASE     :       Union[str, Any]      	=					PandasConfig
 def a					(      self   :	Union[str, Any]							)  ->    int:
  return datasets.DatasetInfo(features=self.config.features							)
 def a					(      self   :	Any      ,       SCREAMING_SNAKE_CASE__   :	Union[str, Any]							)  ->    str:
  if not self.config.data_files:
   raise ValueError(f"""At least one data file must be specified, but got data_files={self.config.data_files}"""							)
  __lowerCAmelCase											=						dl_manager.download_and_extract(self.config.data_files							)
  if isinstance(SCREAMING_SNAKE_CASE__      ,       (str, list, tuple)							):
   __lowerCAmelCase											=						data_files
   if isinstance(SCREAMING_SNAKE_CASE__      ,       SCREAMING_SNAKE_CASE__							):
    __lowerCAmelCase											=						[files]
   # Use `dl_manager.iter_files` to skip hidden files in an extracted archive
   __lowerCAmelCase											=						[dl_manager.iter_files(SCREAMING_SNAKE_CASE__							) for file in files]
   return [datasets.SplitGenerator(name=datasets.Split.TRAIN      ,       gen_kwargs={"""files""": files}							)]
  __lowerCAmelCase											=						[]
  for split_name, files in data_files.items():
   if isinstance(SCREAMING_SNAKE_CASE__      ,       SCREAMING_SNAKE_CASE__							):
    __lowerCAmelCase											=						[files]
   # Use `dl_manager.iter_files` to skip hidden files in an extracted archive
   __lowerCAmelCase											=						[dl_manager.iter_files(SCREAMING_SNAKE_CASE__							) for file in files]
   splits.append(datasets.SplitGenerator(name=SCREAMING_SNAKE_CASE__      ,       gen_kwargs={"""files""": files}							)							)
  return splits
 def a					(      self   :	Any      ,       SCREAMING_SNAKE_CASE__   :	pa.Table							)  ->    pa.Table:
  if self.config.features is not None:
   # more expensive cast to support nested features with keys in a different order
   # allows str <-> int/float or str to Audio for example
   __lowerCAmelCase											=						table_cast(SCREAMING_SNAKE_CASE__      ,       self.config.features.arrow_schema							)
  return pa_table





 def a					(      self   :	Any      ,       SCREAMING_SNAKE_CASE__   :	Optional[Any]							)  ->    List[Any]:
  for i, file in enumerate(itertools.chain.from_iterable(SCREAMING_SNAKE_CASE__							)							):
   with open(SCREAMING_SNAKE_CASE__      ,       """rb"""							) as f:
    __lowerCAmelCase											=						pa.Table.from_pandas(pd.read_pickle(SCREAMING_SNAKE_CASE__							)							)
    yield i, self._cast_table(SCREAMING_SNAKE_CASE__							)






