


"""simple docstring"""

from __future__ import annotations

from dataclasses import dataclass





@dataclass
class    lowerCamelCase__						:
      a :     float
      a :     TreeNode | None											=		None
      a :     TreeNode | None											=		None






def lowerCAmelCase_      (				UpperCamelCase__	: TreeNode | None ):






 """simple docstring"""







 def is_valid_tree(UpperCamelCase__	: TreeNode | None ) -> bool:
  if node is None:
   return True

  if not isinstance(UpperCamelCase__				,   UpperCamelCase__ ):
   return False

  try:
   float(node.data )
  except (TypeError, ValueError):
   return False

  return is_valid_tree(node.left ) and is_valid_tree(node.right )

 if not is_valid_tree(UpperCamelCase__ ):
  raise ValueError(
      """Each node should be type of TreeNode and data should be float.""" )

 def is_binary_search_tree_recursive_check(
     UpperCamelCase__	: TreeNode | None				,   UpperCamelCase__	: float				,   UpperCamelCase__	: float ) -> bool:

  if node is None:
   return True

  return (
      left_bound < node.data < right_bound
      and is_binary_search_tree_recursive_check(node.left				,   UpperCamelCase__				,   node.data )
      and is_binary_search_tree_recursive_check(
          node.right				,   node.data				,   UpperCamelCase__ )
  )

 return is_binary_search_tree_recursive_check(UpperCamelCase__				,   -float("""inf""" )				,   float("""inf""" ) )


if __name__ == "__main__":
       import doctest

       doctest.testmod()




"""simple docstring"""

from collections.abc import Callable

import numpy as np


def lowerCAmelCase_      (				UpperCamelCase__	: Callable				,   UpperCamelCase__	: float				,   UpperCamelCase__	: float				,   UpperCamelCase__	: float				,   UpperCamelCase__	: float ):






 """simple docstring"""







 __lowercase									=	int(np.ceil((x_end - xa) / step_size ) )
 __lowercase									=	np.zeros((n + 1,) )
 __lowercase									=	ya
 __lowercase									=	xa

 for k in range(UpperCamelCase__ ):
  __lowercase									=	y[k] + step_size * ode_func(UpperCamelCase__				,   y[k] )
  x += step_size

 return y


if __name__ == "__main__":
       import doctest

       doctest.testmod()
