code: 
  
  
  
  
  
  class 	UpperCamelCase_     :
  
  
  
  					def __init__(		self    :    int					,			lowerCamelCase    :    Dict	):
  							lowerCamelCase_  :    Any   	=			data
  							lowerCamelCase_  :    Union[str, Any]   	=			None
  							lowerCamelCase_  :    Optional[int]   	=			None
  
  
  
  
  
  					def __str__(		self    :    Dict	):
  							return F"{self.data}"
  
  
  
  
  
  
  class 	UpperCamelCase_     :
  
  
  
  					def __init__(		self    :    str	):
  							lowerCamelCase_  :    List[Any]   	=			None
  							lowerCamelCase_  :    int   	=			None
  
  
  
  					def __iter__(		self    :    Optional[int]	):
  							lowerCamelCase_  :    Union[str, Any]   	=			self.head
  							while node:
  									yield node.data
  									lowerCamelCase_  :    Tuple   	=			node.next
  
  
  
  					def __str__(		self    :    Optional[int]	):
  							return "->".join([str(lowerCamelCase	) for item in self]	)
  
  
  
  					def __len__(		self    :    Optional[int]	):
  							return sum(1 for _ in self	)
  
  
  
  					def      __a    (		self    :    List[Any]					,			lowerCamelCase    :    Tuple	):
  							self.insert_at_nth(0					,			lowerCamelCase	)
  
  
  
  					def      __a    (		self    :    Dict					,			lowerCamelCase    :    List[str]	):
  							self.insert_at_nth(len(self	)					,			lowerCamelCase	)
  
  
  
  					def      __a    (		self    :    Union[str, Any]					,			lowerCamelCase    :    int					,			lowerCamelCase    :    Optional[int]	):
  							lowerCamelCase_  :    str   	=			len(self	)
  
  							if not 0 <= index <= length:
  									raise IndexError('list index out of range'	)
  							lowerCamelCase_  :    str   	=			Node(lowerCamelCase	)
  							if self.head is None:
  									lowerCamelCase_  :    Tuple   	=			new_node
  							elif index == 0:
  									lowerCamelCase_  :    Union[str, Any]   	=			new_node
  									lowerCamelCase_  :    List[str]   	=			self.head
  									lowerCamelCase_  :    Dict   	=			new_node
  							elif index == length:
  									lowerCamelCase_  :    Optional[Any]   	=			new_node
  									lowerCamelCase_  :    Any   	=			self.tail
  									lowerCamelCase_  :    Optional[Any]   	=			new_node
  							else:
  									lowerCamelCase_  :    str   	=			self.head
  									for _ in range(0					,			lowerCamelCase	):
  											lowerCamelCase_  :    Optional[Any]   	=			temp.next
  									lowerCamelCase_  :    Dict   	=			new_node
  									lowerCamelCase_  :    str   	=			temp.previous
  									lowerCamelCase_  :    str   	=			temp
  									lowerCamelCase_  :    int   	=			new_node
  
  
  
  					def      __a    (		self    :    Tuple	):
  							return self.delete_at_nth(0	)
  
  
  
  					def      __a    (		self    :    Dict	):
  							return self.delete_at_nth(len(self	) - 1	)
  
  
  
  					def      __a    (		self    :    Optional[int]					,			lowerCamelCase    :    int	):
  							lowerCamelCase_  :    List[Any]   	=			len(self	)
  
  							if not 0 <= index <= length - 1:
  									raise IndexError('list index out of range'	)
  							lowerCamelCase_  :    str   	=			self.head  # default first node
  							if length == 1:
  									lowerCamelCase_  :    Optional[Any]   	=			None
  							elif index == 0:
  									lowerCamelCase_  :    Dict   	=			self.head.next
  									lowerCamelCase_  :    int   	=			None
  							elif index == length - 1:
  									lowerCamelCase_  :    Any   	=			self.tail
  									lowerCamelCase_  :    List[Any]   	=			self.tail.previous
  									lowerCamelCase_  :    Optional[int]   	=			None
  							else:
  									lowerCamelCase_  :    List[str]   	=			self.head
  									for _ in range(0					,			lowerCamelCase	):
  											lowerCamelCase_  :    int   	=			temp.next
  									lowerCamelCase_  :    Dict   	=			temp
  									lowerCamelCase_  :    Dict   	=			temp.previous
  									lowerCamelCase_  :    str   	=			temp.next
  							return delete_node.data
  
  
  
  					def      __a    (		self    :    Any					,			lowerCamelCase    :    List[Any]	):
  							lowerCamelCase_  :    List[Any]   	=			self.head
  
  							while current.data != data:  # Find the position to delete
  									if current.next:
  											lowerCamelCase_  :    Tuple   	=			current.next
  									else:  # We have reached the end an no value matches
  											raise ValueError('No data matching given value'	)
  
  							if current == self.head:
  									self.delete_head()
  
  							elif current == self.tail:
  									self.delete_tail()
  
  							else:  # Before: 1 <--> 2(current) <--> 3
  									lowerCamelCase_  :    Dict   	=			current.next  # 1 --> 3
  									lowerCamelCase_  :    str   	=			current.previous  # 1 <--> 3
  							return data
  
  
  
  
  
  					def      __a    (		self    :    str	):
  							return len(self	) == 0
  
  
  def 		_SCREAMING_SNAKE_CASE    (   ):
  		lowerCamelCase_  :    List[Any]   	=			DoublyLinkedList()
  		assert linked_list.is_empty() is True
  		assert str(lowerCAmelCase__	) == ""
  
  		try:
  				linked_list.delete_head()
  				raise AssertionError  # This should not happen.
  		except IndexError:
  				assert True  # This should happen.
  
  		try:
  				linked_list.delete_tail()
  				raise AssertionError  # This should not happen.
  		except IndexError:
  				assert True  # This should happen.
  
  		for i in range(10	):
  				assert len(lowerCAmelCase__	) == i
  				linked_list.insert_at_nth(lowerCAmelCase__       ,i + 1	)
  		assert str(lowerCAmelCase__	) == "->".join(str(lowerCAmelCase__	) for i in range(1       ,11	)	)
  
  		linked_list.insert_at_head(0	)
  		linked_list.insert_at_tail(11	)
  		assert str(lowerCAmelCase__	) == "->".join(str(lowerCAmelCase__	) for i in range(0       ,12	)	)
  
  		assert linked_list.delete_head() == 0
  		assert linked_list.delete_at_nth(9	) == 10
  		assert linked_list.delete_tail() == 11
  		assert len(lowerCAmelCase__	) == 9
  		assert str(lowerCAmelCase__	) == "->".join(str(lowerCAmelCase__	) for i in range(1       ,10	)	)
  
  
  if __name__ == "__main__":
  		from doctest import testmod
  
  		testmod()
  
style_context: 
  
  
  
  
  
  from __future__ import annotations
  
  
  def 		_SCREAMING_SNAKE_CASE    (   lowerCAmelCase__	):
  		lowerCamelCase_  :    int
  		lowerCamelCase_  :    list[str]   	=			list(lowerCAmelCase__	)
  		lowerCamelCase_	,			lowerCamelCase_  :    List[str]   	=			_vector[:-1], int(_vector[-1]	)
  		lowerCamelCase_  :    list[int]   	=			[int(lowerCAmelCase__	) for digit in __vector]
  
  		vector.reverse()
  		for i, digit in enumerate(lowerCAmelCase__	):
  				if i & 1 == 0:
  						lowerCamelCase_  :    int   	=			digit * 2
  						if doubled > 9:
  								doubled -= 9
  						check_digit += doubled
  				else:
  						check_digit += digit
  
  		return check_digit % 10 == 0
  
  
  if __name__ == "__main__":
  		import doctest
  
  		doctest.testmod()
  		assert is_luhn("""79927398713""")
  		assert not is_luhn("""79927398714""")
  