code: def RunValidationOutputToFile(feed, options, output_file):
    
    accumulator = HTMLCountingProblemAccumulator(options.limit_per_type,
                                                 options.error_types_ignore_list)
    problems = transitfeed.ProblemReporter(accumulator)
    schedule, exit_code = RunValidation(feed, options, problems)
    if isinstance(feed, basestring):
      feed_location = feed
    else:
      feed_location = getattr(feed, 'name', repr(feed))
    accumulator.WriteOutput(feed_location, output_file, schedule, options.extension)
    return exit_code
docs: Validate feed, write HTML to output_file and return an exit code.