def extract_year_month_from_key(key):
    """
    Given an AWS S3 `key` (str) for a file,
    extract and return the year (int) and
    month (int) specified in the key after
    'ano=' and 'mes='.
    """
    
    a_pos = key.find('ano=')
    year  = int(key[a_pos + 4:a_pos + 8])
    m_pos = key.find('mes=')
    month = int(key[m_pos + 4:m_pos + 5])
    
    return year, month