import operator


def check_operator(dropdown):
    """
    Converts the string value of the DropDown element in operator object

    Args:
        | *dropdown* : DropDown object from the algorithm class

    Returns:
        | *op_object*: operator object converted
    """
    op_object = None

    if dropdown.value == "strictly smaller":
        op_object = operator.lt
    if dropdown.value == "smaller or equal":
        op_object = operator.le
    if dropdown.value == "equal":
        op_object = operator.eq
    if dropdown.value == "greater or equal":
        op_object = operator.ge
    if dropdown.value == "strictly greater":
        op_object = operator.gt
    return op_object