def METHOD_NAME(x, xmin, xmax):           # A simple constrain function, that can be called in constrain() and constrainFloat() to keep the similarity between the Arduino code
    if x <= xmin:                           # If input is smaller than minimum
        x = xmin                            # make input equal to minimum.
    elif x >= xmax:                         # If input is greater than maximum
        x = xmax                            # make it equal to maximum
    return x                                # Return the (modified) input