def get_from_list(x, ys: list, remove=False):
    """ Returns value from list. Optionally removes.
    Args:
        x: item value
        ys: list
        remove: removes item from list

    Returns:
     item
    """
    res = None
    if x in ys:
        res = x
    if remove:
        ys.remove(x)
    return res