import re


def get_years_from_fname(fname):
    """
    find the YYYY-YYYY pattern in the file name. Y0 and Y1 are Returned as integers
    """
    match = re.findall('[12][90][789012][0-9]-[12][90][789012][0-9]', fname)
    if len(match) >= 1:
        t0, t1 = [int(x) for x in match[0].split('-')]
        return t0, t1
    else:
        return None