






from __future__ import annotations

from typing import Generic, TypeVar

a 			=							TypeVar('T')
class 							__snake_case(       Generic[T]   ):



 def __init__(						self : Tuple			,		UpperCAmelCase__ : Union[str, Any]						):

    """simple docstring"""






    lowercase__    :						List[Any]       =			data  # Assign data
    lowercase__    :						Union[str, Any]       =			None  # Initialize next as null
    lowercase__    :						Optional[int]       =			None  # Initialize prev as null
class 							__snake_case(       Generic[T]   ):



 def __init__(						self : int						):

    """simple docstring"""






    lowercase__    :						Union[str, Any]       =			None



 def     UpperCAmelCase     (						self : Union[str, Any]			,		UpperCAmelCase__ : Tuple						):

    """simple docstring"""






    if self.head is None:
       lowercase__    :						Dict       =			Node(lowerCAmelCase_						)
    else:
       lowercase__    :						Optional[int]       =			Node(lowerCAmelCase_						)
       lowercase__    :						Optional[int]       =			new_node
       lowercase__    :						Optional[int]       =			self.head
       lowercase__    :						str       =			None
       lowercase__    :						Optional[int]       =			new_node



 def     UpperCAmelCase     (						self : Union[str, Any]						):

    """simple docstring"""






    if self.head is None:
       return None
    else:
       assert self.head is not None
       lowercase__    :						Optional[Any]       =			self.head.data
       lowercase__    :						Dict       =			self.head.next
       if self.head is not None:
          lowercase__    :						str       =			None
       return temp



 def     UpperCAmelCase     (						self : Optional[Any]						):

    """simple docstring"""






    return self.head.data if self.head is not None else None



 def __len__(						self : Tuple						):

    """simple docstring"""






    lowercase__    :						Optional[int]       =			self.head
    lowercase__    :						Dict       =			0
    while temp is not None:
       count += 1
       lowercase__    :						Union[str, Any]       =			temp.next
    return count



 def     UpperCAmelCase     (						self : List[str]						):

    """simple docstring"""






    return self.head is None







 def     UpperCAmelCase     (						self : int						):

    """simple docstring"""






    print("""stack elements are:"""						)
    lowercase__    :						Optional[Any]       =			self.head
    while temp is not None:
       print(temp.data			,		end="""->"""						)
       lowercase__    :						Optional[Any]       =			temp.next


# Code execution starts here
if __name__ == "__main__":
 # Start with the empty stack
 a 			=							Stack()

 # Insert 4 at the beginning. So stack becomes 4->None
 print('Stack operations using Doubly LinkedList')
 stack.push(4)

 # Insert 5 at the beginning. So stack becomes 4->5->None
 stack.push(5)

 # Insert 6 at the beginning. So stack becomes 4->5->6->None
 stack.push(6)

 # Insert 7 at the beginning. So stack becomes 4->5->6->7->None
 stack.push(7)

 # Print the stack
 stack.print_stack()

 # Print the top element
 print('\nTop element is ', stack.top())

 # Print the stack size
 print('Size of the stack is ', len(stack))

 # pop the top element
 stack.pop()

 # pop the top element
 stack.pop()

 # two elements have now been popped off
 stack.print_stack()

 # Print True if the stack is empty else False
 print('\nstack is empty:', stack.is_empty())







'''simple docstring'''


from dataclasses import dataclass
from typing import Callable, Optional

import datasets







@dataclass
class 						UpperCAmelCase						(		datasets.BuilderConfig):


 '''simple docstring'''




 __magic_name__       :			Optional[Callable]	=   None
 __magic_name__       :			Optional[dict]	=   None
 __magic_name__       :			Optional[datasets.Features]	=   None




 def    lowercase_	( self)			->   List[Any]:



      """simple docstring"""







      assert self.generator is not None, "generator must be specified"

      if self.gen_kwargs is None:
           a_									={}







class 						UpperCAmelCase						(		datasets.GeneratorBasedBuilder):


 '''simple docstring'''




 __magic_name__       :			Tuple	=   GeneratorConfig




 def    lowercase_	( self)			->   Tuple:



      """simple docstring"""







      return datasets.DatasetInfo(features=self.config.features)




 def    lowercase_	( self				,	lowerCAmelCase_)			->   int:



      """simple docstring"""







      return [datasets.SplitGenerator(name=datasets.Split.TRAIN				,	gen_kwargs=self.config.gen_kwargs)]




 def    lowercase_	( self				,	**lowerCAmelCase_)			->   List[Any]:



      """simple docstring"""







      for idx, ex in enumerate(self.config.generator(**lowerCAmelCase_)):
           yield idx, ex


