



def      _A				(UpperCamelCase		:      Optional[Any] )  ->Any:



   '''simple docstring'''







   if not head:
      return True
   # split the list to two parts
   lowerCamelCase__ :      Union[str, Any]								=		head.next, head
   while fast and fast.next:
      lowerCamelCase__ :      Any								=		fast.next.next
      lowerCamelCase__ :      Tuple								=		slow.next
   lowerCamelCase__ :      Tuple								=		slow.next
   lowerCamelCase__ :      Optional[int]								=		None  # Don't forget here! But forget still works!
   # reverse the second part
   lowerCamelCase__ :      int								=		None
   while second:
      lowerCamelCase__ :      Dict								=		second.next
      lowerCamelCase__ :      int								=		node
      lowerCamelCase__ :      str								=		second
      lowerCamelCase__ :      str								=		nxt
   # compare two parts
   # second part has the same or one less node
   while node:
      if node.val != head.val:
         return False
      lowerCamelCase__ :      List[str]								=		node.next
      lowerCamelCase__ :      int								=		head.next
   return True






def      _A				(UpperCamelCase		:      List[str] )  ->Optional[Any]:



   '''simple docstring'''







   if not head or not head.next:
      return True

   # 1. Get the midpoint (slow)
   lowerCamelCase__ :      Tuple								=		head
   while fast and fast.next:
      lowerCamelCase__ :      Union[str, Any]								=		fast.next.next, slow.next

   # 2. Push the second half into the stack
   lowerCamelCase__ :      Dict								=		[slow.val]
   while slow.next:
      lowerCamelCase__ :      int								=		slow.next
      stack.append(slow.val )

   # 3. Comparison
   while stack:
      if stack.pop() != cur.val:
         return False
      lowerCamelCase__ :      Optional[Any]								=		cur.next

   return True






def      _A				(UpperCamelCase		:      str )  ->List[str]:



   '''simple docstring'''







   if not head or not head.next:
      return True
   lowerCamelCase__ :      str								=		{}
   lowerCamelCase__ :      Optional[int]								=		0
   while head:
      if head.val in d:
         d[head.val].append(UpperCamelCase )
      else:
         lowerCamelCase__ :      Tuple								=		[pos]
      lowerCamelCase__ :      int								=		head.next
      pos += 1
   lowerCamelCase__ :      Union[str, Any]								=		pos - 1
   lowerCamelCase__ :      List[Any]								=		0
   for v in d.values():
      if len(UpperCamelCase ) % 2 != 0:
         middle += 1
      else:
         lowerCamelCase__ :      int								=		0
         for i in range(0      ,			len(UpperCamelCase ) ):
            if v[i] + v[len(UpperCamelCase ) - 1 - step] != checksum:
               return False
            step += 1
      if middle > 1:
         return False
   return True








import copy
from dataclasses import dataclass, field
from typing import ClassVar, Dict

from ..features import Audio, Features, Value
from .base import TaskTemplate
@dataclass(frozen=A_      )
class 				__A					( A_      ):
			UpperCamelCase					:str     =			field(default='''automatic-speech-recognition'''					, metadata={'''include_in_asdict_even_if_is_default''': True}      )
			UpperCamelCase					:ClassVar[Features]     =			Features({'''audio''': Audio()}      )
			UpperCamelCase					:ClassVar[Features]     =			Features({'''transcription''': Value('''string'''      )}      )
			UpperCamelCase					:str     =			"audio"
			UpperCamelCase					:str     =			"transcription"





			def        _snake_case    (self							,    __magic_name__				):
						if self.audio_column not in features:
									raise ValueError(f"Column {self.audio_column} is not present in features."				)
						if not isinstance(features[self.audio_column]							,    __magic_name__				):
									raise ValueError(f"Column {self.audio_column} is not an Audio type."				)
						lowerCamelCase__ :      int								=		copy.deepcopy(self				)
						lowerCamelCase__ :      Tuple								=		self.input_schema.copy()
						lowerCamelCase__ :      Tuple								=		features[self.audio_column]
						lowerCamelCase__ :      List[str]								=		input_schema
						return task_template





			@property
			def        _snake_case    (self				):
						return {self.audio_column: "audio", self.transcription_column: "transcription"}



