<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def find_resources_to_get(lecture, file_formats, resource_filter, ignored_formats=None):
 """ Select formats to download. """

    resources_to_get = []

    if ignored_formats is None:
        ignored_formats = []

    if len(ignored_formats):
        logging.info("The following file formats will be ignored: " + ",".join(ignored_formats))

    for fmt, resources in iteritems(lecture):
        fmt0 = fmt

        short_fmt = None
        if '.' in fmt:
            short_fmt = fmt.split('.')[1]

        if fmt in ignored_formats or (short_fmt != None and short_fmt in ignored_formats) :
            continue

        if fmt in file_formats or (short_fmt != None and short_fmt in file_formats) or 'all' in file_formats:
            for r in resources:
                if resource_filter and r[1] and not re.search(resource_filter, r[1]):
                    logging.debug('Skipping b/c of rf: %s %s',
                                  resource_filter, r[1])
                    continue
                resources_to_get.append((fmt0, r[0], r[1]))
        else:
            logging.debug(
                'Skipping b/c format %s not in %s', fmt, file_formats)

    return resources_to_get