




from collections.abc import Sequence

def      _SCREAMING_SNAKE_CASE     (				lowercase      :			Sequence[float]      ,				lowercase      :			float	):


      '''simple docstring'''



      return sum(c * (x**i) for i, c in enumerate(lowercase	)	)

def      _SCREAMING_SNAKE_CASE     (				lowercase      :			Sequence[float]      ,				lowercase      :			float	):


      '''simple docstring'''



      lowerCamelCase_							=       0.0
      for coeff in reversed(lowercase	):
            lowerCamelCase_							=       result * x + coeff
      return result


if __name__ == "__main__":
 lowerCamelCase							:						Union[str, Any]					       =  (0.0, 0.0, 5.0, 9.3, 7.0)
 lowerCamelCase							:						Union[str, Any]					       =  10.0
 print(evaluate_poly(poly, x))
 print(horner(poly, x))






'''simple docstring'''



import operator


def       snake_case   (	snake_case      : list					,		snake_case      : bool = False					,		snake_case      : list | None = None			) ->  list:


    """simple docstring"""


    lowerCAmelCase 						=							operator.lt if reverse else operator.gt
    lowerCAmelCase 						=							solution or []

    if not arr:
        return solution

    lowerCAmelCase 						=							[arr.pop(0			)]
    for i, item in enumerate(snake_case			):
        if _operator(snake_case					,		sublist[-1]			):
            sublist.append(snake_case			)
            arr.pop(snake_case			)

    #  merging sublist into solution list
    if not solution:
        solution.extend(snake_case			)
    else:
        while sublist:
            lowerCAmelCase 						=							sublist.pop(0			)
            for i, xx in enumerate(snake_case			):
                if not _operator(snake_case					,		snake_case			):
                    solution.insert(snake_case					,		snake_case			)
                    break
            else:
                solution.append(snake_case			)

    strand_sort(snake_case					,		snake_case					,		snake_case			)
    return solution


if __name__ == "__main__":
     assert strand_sort([4, 3, 5, 1, 2]) == [1, 2, 3, 4, 5]
     assert strand_sort([4, 3, 5, 1, 2], reverse=True) == [5, 4, 3, 2, 1]





