"""simple docstring"""
from abc import ABC, abstractmethod
from typing import List, Optional



class 					lowerCAmelCase_      (     lowerCAmelCase   ):



    """simple docstring"""

    def __init__(			self      ):






          """simple docstring"""

          self.test()

    def 						snake_case	(			self      ):






          """simple docstring"""

          snake_case        =     0
          snake_case        =     False
          while not completed:
                if counter == 1:
                      self.reset()
                snake_case        =     self.advance()
                if not self.does_advance(lowerCAmelCase      ):
                      raise Exception(
                          'Custom Constraint is not defined correctly. self.does_advance(self.advance()) must be true.'      )

                snake_case   ,snake_case   ,snake_case        =     self.update(lowerCAmelCase      )
                counter += 1

                if counter > 1_00_00:
                      raise Exception('update() does not fulfill the constraint.'      )

          if self.remaining() != 0:
                raise Exception('Custom Constraint is not defined correctly.'      )

    @abstractmethod
    def 						snake_case	(			self      ):






          """simple docstring"""

          raise NotImplementedError(
              F"""{self.__class__} is an abstract class. Only classes inheriting this class can be called."""      )

    @abstractmethod
    def 						snake_case	(			self						,      lowerCAmelCase      ):






          """simple docstring"""

          raise NotImplementedError(
              F"""{self.__class__} is an abstract class. Only classes inheriting this class can be called."""      )

    @abstractmethod
    def 						snake_case	(			self						,      lowerCAmelCase      ):






          """simple docstring"""

          raise NotImplementedError(
              F"""{self.__class__} is an abstract class. Only classes inheriting this class can be called."""      )

    @abstractmethod
    def 						snake_case	(			self      ):






          """simple docstring"""

          raise NotImplementedError(
              F"""{self.__class__} is an abstract class. Only classes inheriting this class can be called."""      )

    @abstractmethod
    def 						snake_case	(			self      ):






          """simple docstring"""

          raise NotImplementedError(
              F"""{self.__class__} is an abstract class. Only classes inheriting this class can be called."""      )

    @abstractmethod
    def 						snake_case	(			self						,      lowerCAmelCase=False      ):






          """simple docstring"""

          raise NotImplementedError(
              F"""{self.__class__} is an abstract class. Only classes inheriting this class can be called."""      )





class 					lowerCAmelCase_      (     lowerCAmelCase   ):



    """simple docstring"""

    def __init__(			self						,      lowerCAmelCase      ):






          """simple docstring"""

          super(lowerCAmelCase						,      self      ).__init__()

          if not isinstance(lowerCAmelCase						,      lowerCAmelCase      ) or len(lowerCAmelCase      ) == 0:
                raise ValueError(F"""`token_ids` has to be a non-empty list, but is {token_ids}."""      )
          if any((not isinstance(lowerCAmelCase						,      lowerCAmelCase      ) or token_id < 0) for token_id in token_ids      ):
                raise ValueError(F"""Each list in `token_ids` has to be a list of positive integers, but is {token_ids}."""      )

          snake_case        =     token_ids

          snake_case        =     len(self.token_ids      )
          snake_case        =     -1  # the index of the currently fulfilled step
          snake_case        =     False

    def 						snake_case	(			self      ):






          """simple docstring"""

          if self.completed:
                return None
          return self.token_ids[self.fulfilled_idx + 1]

    def 						snake_case	(			self						,      lowerCAmelCase      ):






          """simple docstring"""

          if not isinstance(lowerCAmelCase						,      lowerCAmelCase      ):
                raise ValueError(F"""`token_id` has to be an `int`, but is {token_id} of type {type(lowerCAmelCase      )}"""      )

          if self.completed:
                return False

          return token_id == self.token_ids[self.fulfilled_idx + 1]

    def 						snake_case	(			self						,      lowerCAmelCase      ):






          """simple docstring"""

          if not isinstance(lowerCAmelCase						,      lowerCAmelCase      ):
                raise ValueError(F"""`token_id` has to be an `int`, but is {token_id} of type {type(lowerCAmelCase      )}"""      )

          snake_case        =     False
          snake_case        =     False
          snake_case        =     False

          if self.does_advance(lowerCAmelCase      ):
                self.fulfilled_idx += 1
                snake_case        =     True
                if self.fulfilled_idx == (self.seqlen - 1):
                      snake_case        =     True
                snake_case        =     completed
          else:
                # failed to make progress.
                snake_case        =     True
                self.reset()
          return stepped, completed, reset

    def 						snake_case	(			self      ):






          """simple docstring"""

          snake_case        =     False
          snake_case        =     0

    def 						snake_case	(			self      ):






          """simple docstring"""

          return self.seqlen - (self.fulfilled_idx + 1)

    def 						snake_case	(			self						,      lowerCAmelCase=False      ):






          """simple docstring"""

          snake_case        =     PhrasalConstraint(self.token_ids      )

          if stateful:
                snake_case        =     self.seqlen
                snake_case        =     self.fulfilled_idx
                snake_case        =     self.completed

          return new_constraint





class 					lowerCAmelCase_      :



    """simple docstring"""

    def __init__(			self						,      lowerCAmelCase						,      lowerCAmelCase=True      ):






          """simple docstring"""

          snake_case        =     max([len(lowerCAmelCase      ) for one in nested_token_ids]      )

          snake_case        =     {}
          for token_ids in nested_token_ids:
                snake_case        =     root
                for tidx, token_id in enumerate(lowerCAmelCase      ):
                      if token_id not in level:
                            snake_case        =     {}

                      snake_case        =     level[token_id]

          if no_subsets and self.has_subsets(lowerCAmelCase						,      lowerCAmelCase      ):
                raise ValueError(
                    'Each list in `nested_token_ids` can\'t be a complete subset of another list, but is'
                    F""" {nested_token_ids}."""      )

          snake_case        =     root

    def 						snake_case	(			self						,      lowerCAmelCase      ):






          """simple docstring"""

          snake_case        =     self.trie

          for current_token in current_seq:
                snake_case        =     start[current_token]

          snake_case        =     list(start.keys()      )

          return next_tokens

    def 						snake_case	(			self						,      lowerCAmelCase      ):






          """simple docstring"""

          snake_case        =     self.next_tokens(lowerCAmelCase      )

          return len(lowerCAmelCase      ) == 0

    def 						snake_case	(			self						,      lowerCAmelCase      ):






          """simple docstring"""

          snake_case        =     list(root.values()      )
          if len(lowerCAmelCase      ) == 0:
                return 1
          else:
                return sum([self.count_leaves(lowerCAmelCase      ) for nn in next_nodes]      )

    def 						snake_case	(			self						,      lowerCAmelCase						,      lowerCAmelCase      ):






          """simple docstring"""

          snake_case        =     self.count_leaves(lowerCAmelCase      )
          return len(lowerCAmelCase      ) != leaf_count





class 					lowerCAmelCase_      (     lowerCAmelCase   ):



    """simple docstring"""

    def __init__(			self						,      lowerCAmelCase      ):






          """simple docstring"""

          super(lowerCAmelCase						,      self      ).__init__()

          if not isinstance(lowerCAmelCase						,      lowerCAmelCase      ) or len(lowerCAmelCase      ) == 0:
                raise ValueError(F"""`nested_token_ids` has to be a non-empty list, but is {nested_token_ids}."""      )
          if any(not isinstance(lowerCAmelCase						,      lowerCAmelCase      ) for token_ids in nested_token_ids      ):
                raise ValueError(F"""`nested_token_ids` has to be a list of lists, but is {nested_token_ids}."""      )
          if any(
              any((not isinstance(lowerCAmelCase						,      lowerCAmelCase      ) or token_id < 0) for token_id in token_ids      )
              for token_ids in nested_token_ids      ):
                raise ValueError(
                    F"""Each list in `nested_token_ids` has to be a list of positive integers, but is {nested_token_ids}."""      )

          snake_case        =     DisjunctiveTrie(lowerCAmelCase      )
          snake_case        =     nested_token_ids

          snake_case        =     self.trie.max_height
          snake_case        =     []
          snake_case        =     False

    def 						snake_case	(			self      ):






          """simple docstring"""

          snake_case        =     self.trie.next_tokens(self.current_seq      )

          if len(lowerCAmelCase      ) == 0:
                return None
          else:
                return token_list

    def 						snake_case	(			self						,      lowerCAmelCase      ):






          """simple docstring"""

          if not isinstance(lowerCAmelCase						,      lowerCAmelCase      ):
                raise ValueError(F"""`token_id` is supposed to be type `int`, but is {token_id} of type {type(lowerCAmelCase      )}"""      )

          snake_case        =     self.trie.next_tokens(self.current_seq      )

          return token_id in next_tokens

    def 						snake_case	(			self						,      lowerCAmelCase      ):






          """simple docstring"""

          if not isinstance(lowerCAmelCase						,      lowerCAmelCase      ):
                raise ValueError(F"""`token_id` is supposed to be type `int`, but is {token_id} of type {type(lowerCAmelCase      )}"""      )

          snake_case        =     False
          snake_case        =     False
          snake_case        =     False

          if self.does_advance(lowerCAmelCase      ):
                self.current_seq.append(lowerCAmelCase      )
                snake_case        =     True
          else:
                snake_case        =     True
                self.reset()

          snake_case        =     self.trie.reached_leaf(self.current_seq      )
          snake_case        =     completed

          return stepped, completed, reset

    def 						snake_case	(			self      ):






          """simple docstring"""

          snake_case        =     False
          snake_case        =     []

    def 						snake_case	(			self      ):






          """simple docstring"""

          if self.completed:
                # since this can be completed without reaching max height
                return 0
          else:
                return self.seqlen - len(self.current_seq      )

    def 						snake_case	(			self						,      lowerCAmelCase=False      ):






          """simple docstring"""

          snake_case        =     DisjunctiveConstraint(self.token_ids      )

          if stateful:
                snake_case        =     self.seqlen
                snake_case        =     self.current_seq
                snake_case        =     self.completed

          return new_constraint





class 					lowerCAmelCase_      :



    """simple docstring"""

    def __init__(			self						,      lowerCAmelCase      ):






          """simple docstring"""

          snake_case        =     constraints

          # max # of steps required to fulfill a given constraint
          snake_case        =     max([c.seqlen for c in constraints]      )
          snake_case        =     len(lowerCAmelCase      )
          snake_case        =     False

          self.init_state()

    def 						snake_case	(			self      ):






          """simple docstring"""

          snake_case        =     []
          snake_case        =     None
          snake_case        =     [constraint.copy(stateful=lowerCAmelCase      ) for constraint in self.constraints]

    def 						snake_case	(			self      ):






          """simple docstring"""

          snake_case        =     0
          if self.inprogress_constraint:
                # extra points for having a constraint mid-fulfilled
                add += self.max_seqlen - self.inprogress_constraint.remaining()

          return (len(self.complete_constraints      ) * self.max_seqlen) + add

    def 						snake_case	(			self      ):






          """simple docstring"""

          snake_case        =     []
          if self.inprogress_constraint is None:
                for constraint in self.pending_constraints:  # "pending" == "unfulfilled yet"
                      snake_case        =     constraint.advance()
                      if isinstance(lowerCAmelCase						,      lowerCAmelCase      ):
                            token_list.append(lowerCAmelCase      )
                      elif isinstance(lowerCAmelCase						,      lowerCAmelCase      ):
                            token_list.extend(lowerCAmelCase      )
          else:
                snake_case        =     self.inprogress_constraint.advance()
                if isinstance(lowerCAmelCase						,      lowerCAmelCase      ):
                      token_list.append(lowerCAmelCase      )
                elif isinstance(lowerCAmelCase						,      lowerCAmelCase      ):
                      token_list.extend(lowerCAmelCase      )

          if len(lowerCAmelCase      ) == 0:
                return None
          else:
                return token_list

    def 						snake_case	(			self						,      lowerCAmelCase      ):






          """simple docstring"""

          self.init_state()

          if token_ids is not None:
                for token in token_ids:
                      # completes or steps **one** constraint
                      snake_case   ,snake_case        =     self.add(lowerCAmelCase      )

                      # the entire list of constraints are fulfilled
                      if self.completed:
                            break

    def 						snake_case	(			self						,      lowerCAmelCase      ):






          """simple docstring"""

          if not isinstance(lowerCAmelCase						,      lowerCAmelCase      ):
                raise ValueError(F"""`token_id` should be an `int`, but is `{token_id}`."""      )

          snake_case   ,snake_case        =     False, False

          if self.completed:
                snake_case        =     True
                snake_case        =     False
                return complete, stepped

          if self.inprogress_constraint is not None:
                # In the middle of fulfilling a constraint. If the `token_id` *does* makes an incremental progress to current
                # job, simply update the state

                snake_case   ,snake_case   ,snake_case        =     self.inprogress_constraint.update(lowerCAmelCase      )
                if reset:
                      # 1. If the next token breaks the progress, then we must restart.
                      #     e.g. constraint = "I love pies" and sequence so far is "I love" but `token_id` == "books".

                      #     But that doesn't mean we self.init_state(), since we only reset the state for this particular
                      #     constraint, not the full list of constraints.

                      self.pending_constraints.append(self.inprogress_constraint.copy(stateful=lowerCAmelCase      )      )
                      snake_case        =     None

                if complete:
                      # 2. If the next token completes the constraint, move it to completed list, set
                      #     inprogress to None. If there are no pending constraints either, then this full list of constraints
                      #     is complete.

                      self.complete_constraints.append(self.inprogress_constraint      )
                      snake_case        =     None

                      if len(self.pending_constraints      ) == 0:
                            # we're done!
                            snake_case        =     True

          else:
                # Not in the middle of fulfilling a constraint. So does this `token_id` helps us step towards any of our list
                # of constraints?

                for cidx, pending_constraint in enumerate(self.pending_constraints      ):
                      if pending_constraint.does_advance(lowerCAmelCase      ):
                            snake_case   ,snake_case   ,snake_case        =     pending_constraint.update(lowerCAmelCase      )

                            if not stepped:
                                  raise Exception(
                                      '`constraint.update(token_id)` is not yielding incremental progress, '
                                      'even though `constraint.does_advance(token_id)` is true.'      )

                            if complete:
                                  self.complete_constraints.append(lowerCAmelCase      )
                                  snake_case        =     None

                            if not complete and stepped:
                                  snake_case        =     pending_constraint

                            if complete or stepped:
                                  # If we made any progress at all, then it's at least not a "pending constraint".

                                  snake_case        =     (
                                      self.pending_constraints[:cidx] + self.pending_constraints[cidx + 1 :]
                                  )

                                  if len(self.pending_constraints      ) == 0 and self.inprogress_constraint is None:
                                        # If there's no longer any pending after this and no inprogress either, then we must be
                                        # complete.

                                        snake_case        =     True

                                  break  # prevent accidentally stepping through multiple constraints with just one token.

          return complete, stepped

    def 						snake_case	(			self						,      lowerCAmelCase=True      ):






          """simple docstring"""

          snake_case        =     ConstraintListState(self.constraints      )  # we actually never though self.constraints objects
          # throughout this process. So it's at initialization state.

          if stateful:
                snake_case        =     [
                    constraint.copy(stateful=lowerCAmelCase      ) for constraint in self.complete_constraints
                ]
                if self.inprogress_constraint is not None:
                      snake_case        =     self.inprogress_constraint.copy(stateful=lowerCAmelCase      )
                snake_case        =     [constraint.copy() for constraint in self.pending_constraints]

          return new_state



"""simple docstring"""
import requests
from bsa import BeautifulSoup





def 				lowerCAmelCase__      (     _UpperCamelCase    :			str = "https://www.worldometers.info/coronavirus"   )   ->			dict:





						"""simple docstring"""






						snake_case        =     BeautifulSoup(requests.get(_UpperCamelCase   ).text	,     'html.parser'   )
						snake_case        =     soup.findAll('h1'   )
						snake_case        =     soup.findAll('div'	,     {'class': 'maincounter-number'}   )
						keys += soup.findAll('span'	,     {'class': 'panel-title'}   )
						values += soup.findAll('div'	,     {'class': 'number-table-main'}   )
						return {key.text.strip(): value.text.strip() for key, value in zip(_UpperCamelCase	,     _UpperCamelCase   )}


if __name__ == "__main__":
					print("\033[1m" + "COVID-19 Status of the World" + "\033[0m\n")
					for key, value in world_covidaa_stats().items():
										print(f"""{key}\n{value}\n""")


