def convert_to_int(value):
    """Attempts to convert a specified value to an integer

    :param value: Content to be converted into an integer
    :type value: string or int

    """
    if not value:
        return None

    # Apart from numbers also accept values that end with px
    value = value.strip(' px')
    try:
        return int(value)
    except (__HOLE__, ValueError):
        return None
dataset/ETHPy150Open michaelhelmick/lassie/lassie/utils.py/convert_to_int